Optimization and Backtesting
-
Not sure if this is an issue or just how things are, but I'm noticing it takes an extended amount of time to backtest (45 mins or more) and optimize (3-4 hours) simple strategies in MT5. Maybe I'm doing something wrong in my block structure. I would love some guidance if possible. I am using a VPS (2.6ghz, 4 processors, 8gb ram). Here is a link to a simple RSI strategy that took 4 hours to optimize. https://fxdreema.com/shared/Jls3zg58b
-
Do you use tick data or rough data?
-
tick data
-
Tick data can be expected to take 10x more time...
Fxdreema projects are inherently slower, but there are some performance optimization you can do:- move the "once per bar" to the top of your flow
- dont use the yellow (false) output of the "once per bar" I think its just a mistake in your project
- "close positions" block is known to cause infinite loops, see here: https://fxdreema.com/forum/topic/16494/close-positions-when-market-is-closed
-
Thank you!
-
If anyone was wondering, i changed the modeling to '1 minute ohlc' and it works like a charm. Optimizations take about 6 mins and backtesting takes about 2 minutes. I appreciate the feedback roar!
-
Results are a few dollars off, but nothing major
-
@Progress337 you can certainly do a quick optimization, just to get a general overview, but after that, if you want a 100% reliable backtest you have to run the one "every tick based on real ticks", you can see the difference.
-
Yup that's what I do.
1 minute olhc (Optimization in sample, backtest out of sample)
Every tick (Backtest in sample and out of sample to confirm) -
A question if I may, I have been running tests on MT5 for my strategy using 'every tick'. I was getting amazing results on a 1m 'trend following' strategy in the NY session, with my test showing circa $50K profit in a year (on $100k). I then switched to 'every tick based on real ticks' and got a $90k loss. Can it really be that different?
I understand that the affect depends on the type of strategy. I was originally trying to snipe entries and would need tick data, but I've changed it so that all of my conditions are at candle close. But I still get -$90k using 'real ticks', whereas OHLC is +$25k. Can anyone give me any more insight? Is the MT5 tester totally useless for testing scalping strategies therefore?
-
Trailing stop or just very small fixed stops will cause that issue.