OnTimer() x backtesting x Visual Mode
OnTimer() x backtesting x Visual Mode
31 Jul 2018, 16:01
For more than one year I thought (because I swear I have read on some help place) the OnTimer() event would not be triggered when using backtest or optimization at all.
Ok... I use the OnTimer only to write some stuff on the chart.
Then, because of a OnTimer crash error related to API.Color (version 3.01) x Colors (version 3.0) when backtesting, I added a get away code: if(IsBacktesting) return; in the beginning of the event.
And the backtesting speed (as optimization as well) increased a lot.
I think it should be noticed CLEARLY in some place in the Help information that the OnTimer event is always triggered and only the chart drawing is not displayed because of obvious reasons.
-------> Now, I think it should exist a IsVisualMode similar to the IsBacktesting property because if the code does something relevant to the robot you want it to run, but if there is also something being written in the chart, you do not want it to run.
Lavio
PanagiotisCharalampous
01 Aug 2018, 09:59
Hi Lavio,
"(because I swear I have read on some help place)". If you can locate where you have read that, please let us know to update the documentation. Whatever is not explicitly stated that is not working on backtesting or optimization, then it should work.
Best Regards,
Panagiotis
@PanagiotisCharalampous