I need some advice for the below code if you please,
Period_MA is external variable and I set it to 20; but when I am testing my code by changing
to
the moving average disappear from the chart
would someone help and tell me what is wrong with my code?
and when I modify the line of the code and = , I get the moving average to 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
Thank you
Period_MA is external variable and I set it to 20; but when I am testing my code by changing
Inserted Code
for(x=i; x<i+Period_MA; x++)
Inserted Code
for(x=i; [u]x<=i+Period_MA[/u]; x++)
would someone help and tell me what is wrong with my code?
Inserted Code
int Counted_Bars = IndicatorCounted(); int Uncounted_Bars = Bars - Counted_Bars; Uncounted_Bars++; for(int i=0; i<=Uncounted_Bars; i++) { double Total = 0; for(x=i; x<i+Period_MA; x++) { Total = Total + iClose(NULL,0,x); } Closing_Price_Array[i] = Total / Period_MA; }
and when I modify the line of the code and = , I get the moving average to 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
Inserted Code
for(x=i; x<=i+Period_MA; x++)