|
Category
Import Specification
Description
CSV field order (comma-separated list)
Choices
Symbol - symbol name -- only applicable when CSVFile (single-file / multi-symbol CSV) is used; with DataPath, each symbol comes from its data file's name
Date - bar date
Time - bar time
Open - open price
High - high price
Low - low price
Close - close price
Volume - volume
AdjClose - adjusted close price
RealClose - unadjusted (as-traded) close price
Split - split ratio (real close / adjusted close)
Dividend - dividend amount (should be 0 except on ex-dividend dates)
Extra - value that can be referenced as Extra
Notes
CSV field order does not need to be specified for CSV Import — if omitted, RealTest auto-detects the column layout from the header row (by names such as Date, Open, High, Low, Close, Volume). Specify CSVFields when the files have no header row or use non-standard column names.
A CSVFields statement applies to the DataPath and CSVFile statements that follow it, and carries forward to subsequent DataSources as well, until another CSVFields statement replaces it. Each CSVFields statement fully replaces the prior mapping rather than adding to it. Any DataSource that no CSVFields mapping applies to auto-detects its columns from its own file's header row.
CSVFields: Auto stops a prior mapping from carrying forward and restores header auto-detection for the current DataSource and the ones after it — useful when an earlier CSV source declared explicit fields but a later source (such as CSIFutures) should auto-detect from its own headers.
Here is a partial example of a CSV import specification showing how this looks:
.png)
Note that CSV field names (like all names in RealTest) are not case-sensitive.
To ignore a column in a CSV file, add an extra comma to the field order list, e.g. "date,,,open,high,low,close,,volume".
To ignore the first one or more columns, add extra comma(s) at the start of the list, e.g. ",,date,close".
Providing split adjustment data
RealTest needs a cumulative split factor for each bar in order to correctly perform on-the-fly split adjustment when calculating multi-bar functions and indicators.
There are three alternative ways to provide this information in a CSV file. Choose the one that matches your data source.
•AdjClose — Use when your OHLCV data is unadjusted (as-traded prices) and your data source provides a separate adjusted close column. RealTest derives the split factor as Close / AdjClose. This is the format used by Tiingo.
•RealClose — Use when your OHLCV data is split-adjusted and your data source provides a separate unadjusted close column. RealTest derives the split factor as RealClose / Close, then un-adjusts the OHLCV data back to as-traded prices. This is the format used by Norgate.
•AdjClose + RealClose — If your data source provides both an adjusted and an unadjusted close, you may specify both. RealTest derives the split factor as RealClose / AdjClose and un-adjusts the OHLCV data. The OHLCV columns are assumed to be split-adjusted in this case (same as RealClose alone).
•Split — Use when your data source provides the split ratio directly instead of a second close price. OHLCV data must be unadjusted. Two formats are supported and auto-detected:
1.Event-based ratio: The split ratio on ex-split dates (e.g. 2 for a 2:1 split, 0.5 for a 1:2 reverse split), with 1.0 on all other dates. Dates must be in descending order.
2.Cumulative factor: The cumulative split adjustment factor on every bar (e.g. 1.0 for recent bars, 2.0 for all bars before a 2:1 split). Dates may be in any order.
Split cannot be combined with AdjClose or RealClose — it is an alternative way to provide split information, not a supplement to those columns.
If none of these columns are specified, RealTest assumes the data is unadjusted with no split history, and all split factors default to 1.0.
|