Navigation: Importing Bar Data >

CSV Import

 

 

 

 

RealTest supports two ways to import CSV data:

1.By providing a disk folder containing multiple CSV files, one per symbol

2.By providing a single CSV file containing data for multiple dates and symbols

In either case, your CSV data files must meet the following criteria:

Each bar of data (fields for one symbol on one date) must be on its own line (row) within each file

The field delimiter must be a comma (unless CSVNumFmt: Comma is specified, in which case it is a semicolon)

The decimal point must be a period (US format, again unless CSVNumFmt: Comma is specified)

All rows must have the same field order

For multi-file CSV import, the following rules also apply:

There must be one file per symbol

The name of each file must be SYMBOL dot CSV (e.g. MSFT.CSV) [not case sensitive]

For single-file CSV import, the only extra rule is that the file must include a Symbol column.

The following potential anomalies are permitted and handled correctly in CSV import:

Fields with or without quotes around them (quotes are removed)

Quoted numeric fields with embedded commas (quotes and commas are removed)

Rows in any order (ascending or descending or even random – RealTest will sort them)

Columns in any order (but the order must be specified)

Presence or absence of a header row or other extra rows

Dates in any supported format (use CSVDateFmt to override current program setting for M/D/Y vs. D/M/Y if needed)

Split adjusted and/or un-adjusted data

Dividends can either be a column in the data, or can be specified in the EventList file as a special event type

Each row can include an extra column with whatever you want in it

Other considerations:

Each multi-file CSV import path must be specified in its own DataPath statement (there is no directory tree recursion)

Each single-file CSV import file must be specified in its own CSVFile statement

CSV import sections must also include a CSVFields statement to define the layout of the columns in the CSV files (header rows are always ignored)

See also import_csv.rts in the Examples folder for an example.

 

 

 

Copyright © 2020-2024 Systematic Solutions, LLC