Plot Values Inconsistent
How to view an attached .mq5 online? or download a code posted by code button as a .mq5? It is possible in codebase. Forum not support these features?
Don't use the iClose function. The event handler already provides the correct close prices in the proper sequence for the indicator.
sum += close[ii]; // sum += iClose(Symbol(),PERIOD_CURRENT,ii); This is because iClose behaves as a series, but the OnCalculate event handler data in MT5 behaves as a non-series.
I am new to MT5 and having some trouble creating a simple moving average indicator. Sometimes the plots look correct, but sometimes the plot just flattens out at 0. Can anyone see what I am doing wrong here?