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?
Anyone???
Greg Burgess: 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?
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.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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?