In fact, the number of entries to OnCalculate is not regulated. Maybe one, maybe three :).
Here is an example when there are two entries and you still do not receive information, since the indicators are not ready:
2021.03.07 08:18:22.646 test-indi1 (XAUUSD,M5) prev_calculated = 0 k1 = 2 k2= -1 2021.03.07 08:18:22.646 test-indi1 (XAUUSD,M5) prev_calculated = 50000 k1 = 2 k2= -1
In fact, the number of entries to OnCalculate is not regulated. Maybe one, maybe three :).
Here is an example when there are two entries and you still do not receive information, since the indicators are not ready:
I have never seen three or more :).
You need? You cannot demand, so you simply cannot know anything in advance - for example, there was a swap of history. You will find out about this post factum - by the OnCalculate function (prev_calculated == 0).
You can always drop the indicator and then manually update the chart (through the right mouse click).
- 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
CopyBuffer function not work when prev_calculated =0 and Handle in other TimeFrame which different Current TimeFrame
First I creat Indicator with two Handle in two timeframe: one in Curent TF exp: H1 and one in Orther TF exp: H4
Then I use CopyBuffer in OnCaculator funtion
I Backtest this Indicator in timeframe = H1 and receive result :
CopyBuffer with handle TimeFrame= H4 not work when prev_calculated =0. It mean need at least 2 tick for it to work.
This makes it difficult for me , I add Indicator to chart at weekend (market close) , Oncaculator funtion only have 1 tick.
how to solve this problem? thank for help