-
You must use proper English to be understood.
“current bar of the current currect” is nonsense.
-
Initially Indicator counted is zero so your loop start at Bars and arrays exceeded.
-
You should stop using the old event handlers (init, start, deinit) and IndicatorCounted() and start using new event handlers (OnInit, OnTick/OnCalculate, OnDeinit).
Event Handling Functions - MQL4 Reference
How to do your lookbacks correctly - MQL4 programming forum #9-14 & #19 (2016) -
MTFFieldPrice=iClose(NULL,MTF,i);
On MT4: Unless the current chart is that specific symbol(s)/TF(s) referenced, you must handle 4066/4073 errors before accessing candle/indicator values.
Download history in MQL4 EA - MQL4 programming forum - Page 3 #26.4 (2019) -
int Dev1counted_bars = IndicatorCounted();
You have IC in the main loop. Don't call it in any other function. It is for the current chart only. It does not apply to any other timeframe. Convert your chart bar index to other timeframe index.
Do not double post!!!
I have deleted your duplicated post.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
When the current bar of the current currect changed it affected on the previous bar not the current bar of the histogram
I know that happened the because the different of the time frames shifting but can't handle that issue,
there is any support to solve that issue