It didn't happen because you changed the code, but because there was a mistake in your code from the beginning.
When the program starts, "Counted_Bars" is zero, so "Uncounted_Bars = Bars".
It didn't happen because you changed the code, but because there was a mistake in your code from the beginning.
When the program starts, "Counted_Bars" is zero, so "Uncounted_Bars = Bars".
How the Counted_Bars is zero and it is = IndicatorCounted () function which returns the amount of bars not changed after the indicator had been launched last?
and when I modify the line of the code and = , I get the moving average widen like below, so I just need to know how it was calculated just by adding an equal sign so that will be the outcome
for(x=i;
x<=i+Period_MA; x++)
Thank you
Counted_Bars = IndicatorCounted(); //---> Counted_Bars = 0 Uncounted_Bars = Bars - Counted_Bars; //---> Uncounted_Bars = Bars - 0 Uncounted_Bars++; //---> Uncounted_Bars = Bars + 1 // When "i = Uncounted_Bars" in the "for loop", Closing_Price_Array[i] = Total / Period_MA; //---> Closing_Price_Array[Bars + 1] ---> array out of range
when I remove the equal yes, it updates on M1 chart and work fine, I am just trying to understand what the variance that the equal sign did to get this, how it was calculated?
Well I managed to remove the out of array error by adding the below to the code but still when I add the equal in the below line of code
x<=i+Period_MAI get the same widen MA but when I remove it it works fine, I am trying to understand how the calculation took place to make this variance
int Counted_Bars = IndicatorCounted();
Counted_Bars--;
if(Counted_Bars<Period_MA)
{Counted_Bars = Period_MA;
}
int Uncounted_Bars = Bars - Counted_Bars;
for(int i=Uncounted_Bars; i>=0; i--)
{
double Total = 0;
for(x=i;
x<=i+Period_MA; x++)
{
Total = Total + iClose(Symbol(),0,x);
}
Closing_Price_Array[i] = Total / Period_MA;
}
Hello there, ive facing a problem kind of technical i don't know what it is. i cant access the mql5 website neither on mobile nor on desktop PC. Yet i am login now by using a VPN. I unchecked all of three options under the "Binding to IP address". It is still not working.
As we can see in the screenshot, same problem in mobile browser. . Can someone please help me about Thanks
Hello there, ive facing a problem kind of technical i don't know what it is. i cant access the mql5 website neither on mobile nor on desktop PC. Yet i am login now by using a VPN. I unchecked all of three options under the "Binding to IP address". It is still not working.
As we can see in the screenshot, same problem in mobile browser. . Can someone please help me about Thanks
This happens when you have some excessive activity, too many friend requests sent, too many market votes etc. or it may just be an automatic IP ban.
Wait for a few hours and it will be back to normal.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I need some advice for the below code if you please,
1- for some reason, I get a note of "array out of range " in Mt4 expert journal
2- although Period_MA is external variable and I set it to 20; but when I am testing my code by changing
for(x=i; x<i+Period_MA; x++)
to
for(x=i; x<=i+Period_MA; x++)
the moving average disappear from the chartwould someone help and tell me what is wrong with my code?