limit is given a value according to the number of bars on the H1 chart, but used in the loop as an index for the MN1 chart.
If there are more bars on the H1 chart than on the MN1 chart, then you will get the array out of range error
limit is given a value according to the number of bars on the H1 chart, but used in the loop as an index for the MN1 chart.
If there are more bars on the H1 chart than on the MN1 chart, then you will get the array out of range error
Sorry for my bad advice.
I just noticed that the iMA call on the monthly chart is always bar 0
Sorry for my bad advice.
I just noticed that the iMA call on the monthly chart is always bar 0
Ah,no problem sir. No advice is bad though.
Till now still no solution, if you come up with something please tell me sir.
Thanks sir
Unlikely, but if the earliest bar on the H1 chart is earlier than the earliest bar on the MN1 chart
will likely give the error
check that mn2 is at least 1 less than iBars on MN1
Thanks sir, I have found the problem. It is because of the IndicatorBuffer name, haha
Now it works, but it only show the line for 1 month in H1 timeframes (yeah, another problem).
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hey, I am making a MTF indicator to show static moving avarage from D1,W1, and MN1 timeframes in H1. Somehow I got it works for D1 and W1 periods, but I always get "array out of range" for MN1 period. Can somebody help me to find the solution for this problem?
Thanks