Incredibly slow backtest at every tick..
-
Hi,i made two EAs but i tested in the every tick and it is unbelievable slow..At open prices it is fast.Any reason why?
-
@fxmich78 Every tick = more data, CPU needs to do more work, like a 100 times more work.
I usually test with open prices when developing, and only confirm the final test on every tick method.
-
-
@fxmich78
Well, you can optimize your algorithm in a way that your CPU does minimal amount of useless work - if you have multiple conditions, put first the condition that passes the most rarely.Also, putting "once per bar" on top of your project naturally makes "every tick" faster, but it also limits the strategy.
If "open prices" and "every tick" differs a lot, you are probably making too small (short-time) trades. I would change my strategy - the backtest results are not very reliable in that case.
-
@roar Thank you.I ll give it a try.
-
In general any generated EA will be slower that the same strategy if you are able to carefully code it manually. This is because the generated EA is full with useless code. My EA builder is not so clever to only include the code that is needed and to optimize it in the best way, so you always end up with bloated slow code. But it should not be too slow... like waiting for hours to backtest one day. It is important what blocks are you running on every tick. Try to connect them in such a way, so the slowest block are running more rarely. Of course, you can't always say which blocks are slower than others... even I can't tell that without testing them. But maybe you are using some custom indicator - maybe this indicator is poorly written and it is too slow. Put that indicator in few blocks and the time stops
