Hello Folks,
I'm new to MQL5 , I have been trying to code the HMA of the monthly timeframe but no success, I coded it to be calculated on the current timeframe then changed the interval to PERIOD_MN1 but no success
here's my code, I'd really appreciate it if someone told me what I could be doing wrong I've been stuck on it forever
You need to use "iBarShift" to align the bar time of the current chart with the bar time of the monthly chart.
In this case, "ArraySetAsSeries" must be set to "true" for this to work.
You need to use "iBarShift" to align the bar time of the current chart with the bar time of the monthly chart.
In this case, "ArraySetAsSeries" must be set to "true" for this to work.
I don't quite understand where or how to use the iBarShift function? would you please elaborate more?
I don't quite understand where or how to use the iBarShift function? would you please elaborate more?
LinearWeightedMAOnBuffer(rates_total, prev_calculated, 0, sqrt_p, HMASumBuffer_MN, Temp_Buffer, weightsum); if (prev_calculated > 0) start += int(PERIOD_MN1) / _Period; for (iBar = start; iBar >= 0 && !IsStopped(); iBar--) { int y = iBarShift(_Symbol, PERIOD_MN1, time[iBar]); HMAFinalBuffer_MN[iBar] = Temp_Buffer[y]; }and also you should fix about "ArraySetAsSeries".
- 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 Folks,
I'm new to MQL5 , I have been trying to code the HMA of the monthly timeframe but no success, I coded it to be calculated on the current timeframe then changed the interval to PERIOD_MN1 but no success
here's my code, I'd really appreciate it if someone told me what I could be doing wrong I've been stuck on it forever