confusing in backtest - page 2

 
Stanislav Korotky #:

Please, start to read from the beginning and the quoted fragments will appear among first 10 paragraphs.

I see it. Thanks
 
Chi Hong Au Yeung #:

there's a button you can drag left and right to speedup the backtest process mate, rather thn that generally nothing else can help you speedup the time.

OHLC modelling will speed up the time, and I found that when the indicator itself is based on bars, the result will often times be nearly identical than if you ran the Every Tick modelling.

Another thing that will really speed up testing is if you use a predefined amount of bars in the indicator (the ind that the EA is using), rather than using all bars available on the symbol.
 
Conor Mcnamara #:

Another thing that will really speed up testing is if you use a predefined amount of bars in the indicator (the ind that the EA is using), rather than using all bars available on the symbol.

For the sake of efficiency, correctly coded indicators do normaly recalculate themselves on several most recent bars only (2 bars is sufficient for most of algorithms), so the bar limit in indicator (if such input variable exists) is used only for the very 1-st calculation on history, and does not affect testing speed.

 
Stanislav Korotky #:

There is a problem with formatting of inline link in that post (I don't know why) - unfortunately I can't edit posts - ask moderators.

But the same link with proper formatting is provided in a dedicated box at the bottom of that same post, like this - https://www.mql5.com/en/book/applications/indicators_make/indicators_test

|

|

V

thanks a lot ,  as you said i add this line code "#property tester_everytick_calculate into indicator source
" and run again backtest in visual and unvisual and they are the same (the results)   :))

the indicator that i used is zigzag in example folder
 
Stanislav Korotky #:

For the sake of efficiency, correctly coded indicators do normaly recalculate themselves on several most recent bars only (2 bars is sufficient for most of algorithms), so the bar limit in indicator (if such input variable exists) is used only for the very 1-st calculation on history, and does not affect testing speed.

Got it, but when you say "correctly coded", do you partly mean by this that the main calculation loop is iterating with "prev_calculated"?

I built an indicator which is not iterating with prev_calculated in the calculation loop and is quite slow when testing with all bars available, an old project, and arguably I should go back and change it

 
Conor Mcnamara #:

Got it, but when you say "correctly coded", do you partly mean by this that the main calculation loop is iterating with "prev_calculated"?

I built an indicator which is not iterating with prev_calculated in the calculation loop and is quite slow when testing with all bars available, an old project, and arguably I should go back and change it

Exactly. Only new bars starting from prev_calculated needs to be updated normally. You can find examples in the docs and in the algotrading book.