Shin Joo Young: But I reduced it, this light indicator only calculates needed
candles. Any Suggestion ?
-
You should stop using the old event handlers and IndicatorCounted and
start using the new ones.
Event Handling Functions - Functions - Language Basics - MQL4 Reference
How to do your lookbacks correctly. - You have not "reduced it." You need to change it to "only calculates needed candles."
How to do your lookbacks correctly.
William Roeder:
- You should stop using the old event handlers and IndicatorCounted and start using the new ones.
Event Handling Functions - Functions - Language Basics - MQL4 Reference
How to do your lookbacks correctly. - You have not "reduced it." You need to change it to "only calculates needed candles."
How to do your lookbacks correctly.
1. I edited some lines only
2. I think this correction has not helped. No more explanation needed. You understanded it already with my words.
Overcorrection. Take it easy and no concern about micro things. Thank You.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
This Indicator is very slow if you use backtest many candles.
But I reduced it, this light indicator only calculates needed candles.
Any Suggestion ?
In the code, startbars is the main fix.
Backtest time comparison :
2019.08.05 21:33:27.939 2019.08.05 15:59:59 EURUSD,H1: 1097 tick events (1096 bars, 3193 bar states) processed in 0:00:09.297 (total time 0:00:09.422)
2019.08.05 21:33:51.950 2019.08.05 15:59:59 EURUSD,H1: 1097 tick events (1096 bars, 3193 bar states) processed in 0:00:01.250 (total time 0:00:01.359)