FX31337 / FX-BT-Scripts

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

convert_csv_to_mt: unmatched data error (volume limit exceeded) #70

Closed kenorb closed 8 years ago

kenorb commented 8 years ago

When backtesting using higher timeframes, the following errors appear in the terminal log files:

TestGenerator: unmatched data error (volume limit 584 at 2014.01.02 23:00 exceeded)
TestGenerator: unmatched data error (volume limit 852 at 2014.01.02 23:30 exceeded)
TestGenerator: unmatched data error (volume limit 426 at 2014.01.02 23:45 exceeded)
TestGenerator: unmatched data error (volume limit 822 at 2014.01.03 00:00 exceeded)
TestGenerator: unmatched data error (volume limit 933 at 2014.01.03 00:15 exceeded)
TestGenerator: unmatched data error (volume limit 884 at 2014.01.03 00:30 exceeded)

CI fails: #142088830, #142088831, #142088832

It's the same as all 'unmatched data errors', only in this case the volume is unmatched (usually O/C/H/L are unmatched). It means the tester is using data from a lower timeframe to test the EA on a larger timeframe, but the volume in the larger timeframe is not the sum of volumes of the lower timeframes... Hence - unmatched data error - this is literally the problem.

To solve this problem, build all larger timeframes from M1 data using the standard period_converter script. Please search for more info (this error and it's solution have been discussed many times).

Source: forum.mql4.com/32463

Testing:

  1. Clone repo.
  2. Clone/download some CSV files.
  3. Run: ./convert_csv_to_mt.py -v -i all.csv -s EURUSD -p 20 -S default -t M1,M5,M15,M30,H1,H4,D1,W1,MN -f fxt4
  4. Copy HST files into platform dir at: history/default/
  5. Copy FXT files into platform dir at: tester/history/
  6. Run the test using M15 or M30 period, e.g.

    ./_VM/scripts/run_backtest.sh -v -t -e TestSpread -D5 -m1 -s0 -P M15

To read FXT format, use: convert_mt_to_csv.py instead.

Est. 4-8h

kenorb commented 8 years ago

Fixed in 87f0063f04ff3ab21a98db13058950b77a56061e