CSV Format
Format your historical market price data for use with the Scratio risk calculation API.
File Structure
Your file must contain one date column and at least one asset price column.
date,AAPL,MSFT,GOOGL
2026-01-05,251.42,418.92,182.10
2026-01-06,249.91,421.18,181.77
2026-01-07,252.10,423.44,183.05Each asset column represents the historical price of one asset. You may include one or more assets in the same dataset.
Date Column
A date column is required. The column name is case-insensitive, so the following are all accepted:
date
Date
DATE
dAtEScratio normalizes the date column to a consistent internal representation before processing.
Each retained row must contain a valid date observation.
Date Formats
Scratio supports common date formats and normalizes accepted dates before processing the dataset.
The following formats can be used when their interpretation is unambiguous:
2026-01-05
2026/01/05
2026-1-5
05-01-2026
05/01/2026Recommended
Use YYYY-MM-DD whenever possible. This format avoids ambiguity between common day/month and month/day conventions.
Ambiguous or invalid date values are treated as invalid rows and removed during processing.
Asset Columns
Your dataset must contain at least one asset price column in addition to the date column.
date,AAPL
2026-01-05,251.42
2026-01-06,249.91
2026-01-07,252.10Multiple assets can be included in the same dataset.
date,AAPL,MSFT,BTC-USD
2026-01-05,251.42,418.92,91234.5678
2026-01-06,249.91,421.18,91821.4000
2026-01-07,252.10,423.44,92510.1250Price Values
Asset price values must be numeric and greater than zero.
Prices may contain up to four decimal places. Scratio normalizes accepted values to a consistent four-decimal precision.
date,AAPL,BTC-USD
2026-01-05,251.42,91234.5678
2026-01-06,249.9,91821.4
2026-01-07,252,92510.125Accepted values are normalized to a consistent precision before being used by the risk calculation engine.
Invalid Rows
Scratio removes invalid rows during processing rather than requiring every row in the uploaded file to be valid.
A row is removed when it contains an invalid date or an invalid asset price, including:
- Missing values.
- Non-numeric price values.
- Price values less than or equal to zero.
- Invalid date values.
- Duplicate dates.
date,AAPL,MSFT
2026-01-05,251.42,418.92
2026-01-06,,421.18
2026-01-07,0,423.44
2026-01-08,not-a-number,425.10
2026-01-09,252.10,426.32In this example, the rows for January 6, January 7, and January 8 are removed. The remaining valid rows continue through dataset validation.
Duplicate Dates
Each date should represent a single historical observation.
If the same date appears more than once, all rows for that date are removed. Scratio does not select or preserve the first or last occurrence.
date,AAPL
2026-01-05,251.42
2026-01-05,252.10
2026-01-05,249.91
2026-01-06,253.20All three rows for January 5 are removed, while the January 6 observation remains.
Minimum Observations
After invalid rows are removed, the dataset must contain at least 30 valid observations.
A dataset with fewer than 30 valid observations after processing cannot be accepted for risk calculations.
Example
The following example shows a dataset before and after normalization.
DATE,AAPL,MSFT
2026/01/05,251.42,418.92
2026-01-06,249.9,421.18
2026/01/07,252,423.44The date column is normalized and accepted price values are represented using a consistent four-decimal precision:
date,AAPL,MSFT
2026-01-05,251.4200,418.9200
2026-01-06,249.9000,421.1800
2026-01-07,252.0000,423.4400Input formatting may vary within the supported rules, but accepted data is normalized to a consistent representation before risk calculations.