Hello,
After I added this code my backtest got REALLY slow to the point where it crashes after a few months...
Any ideas on how to fix this.
Thanks to everyone
I'm not a coding master yet but I can say that the ticket value must be of "uint" type rather than "int";
also if "Latest_Close_Price" takes the value of candle close 0, on an every tick modeling, it will be different from candle close 1 almost every tick, and then execute the functions every time. You can use this condition instead :
static int LastBarsCount=0; if(iBars(_Symbol,PERIOD_CURRENT)>LastBarsCount) { LastBarsCount=iBars(_Symbol,PERIOD_CURRENT); NewCandle(); }
I'm not a coding master yet but I can say that the ticket value must be of "uint" type rather than "int";
also if "Latest_Close_Price" takes the value of candle close 0, on an every tick modeling, it will be different from candle close 1 almost every tick, and then execute the functions every time. You can use this condition instead :
I changed it but it didn't work...
But still thanks
https://www.metatrader5.com/en/metaeditor/help/development/profiling
https://www.mql5.com/en/articles/2661
https://www.mql5.com/en/articles/654
Search (Ctrl+f) for Profil.
- www.mql5.com
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello,
After I added this code my backtest got REALLY slow to the point where it crashes after a few months...
Any ideas on how to fix this.
Thanks to everyone