FX31337 / FX-BT-Scripts

:page_facing_up: Useful scripts for backtesting.
MIT License
34 stars 39 forks source link

Mismatch in OLHC data when converting from CSV to HST #85

Closed kenorb closed 7 years ago

kenorb commented 7 years ago
  1. Clone this repo.

  2. Download CSV file into the repo folder, e.g.

    wget https://raw.githubusercontent.com/FX31337/FX-BT-Data-EURUSD-DS/EURUSD-2014/EURUSD/2014/01/2014-01-01--23h_ticks.csv
  3. Convert CSV file into HST format:

    ./convert_csv_to_mt.py -v -i 2014-01-01--22h_ticks.csv -f hst4 -t M1,M5,M15,M30,H1,H4,D1,W1,MN
  4. Verify data by convert_mt_to_csv.py, e.g.:

    $ ./convert_mt_to_csv.py -i EURUSD60.hst -f hst4
    2014.01.01 22:00:00,1.37553,1.37553,1.37552,1.37553,1,0,0
    $ ./convert_mt_to_csv.py -i EURUSD30.hst -f hst4
    2014.01.01 22:00:00,1.37553,1.37553,1.37552,1.37553,1,0,0
    2014.01.01 22:30:00,1.37499,1.37499,1.37499,1.37499,12,0,0

    The above data is not correct (only the first open price is correct). The high (2nd) should be the highest tick from the list, then the lowest value from the period, then the last closing value of the particular period. Same for all other HST formats.