Import prices (ticks) from histdata.com for backtesting. They offer data for forex, gold, and SP500.
Full list of supported instruments.
Change period and instrument in histdata.rb:
for i_date in 2020..2021 # change dateand
fxpair = 'SPXUSD' # change your instrumentThen run the script. CSV files should be downloading now.
./cmd/import-histdata/histdata.rbmv HISTDATA* data/
find ./data/ -name 'HISTDATA*zip' -exec unzip {} \;Now run the importer which generates 1min candles and stores them to local sqlite DB:
INSTRUMENT="SPXUSD" IMPORT_HISTDATA_CSV_FILES=`ls *.csv | tr "\n" ","` go run cmd/import-histdata/main.goThen you can run the backtesting tool to use the data with the .db file in ./data.
- Remove ruby script and support downloading CSV files in the Go program.