maxcalcroft96:
pmarpSum += ( pmarArr[s] > pmarArr[1] ? 0 : 1 );
pmarpSum += ( pmarArr[s] > pmarArr[1] ? 0 : 1 );
pmarpSum += ( pmarArr[s] > pmarArr[1] ? 0 : 1 );
replace with
pmarArr[i]
You copy values of VWMA as far as pmarLookback.
CopyBuffer(VWMAHandle,0,0,pmarpLookback,VWMAArr);
But you try reading values even further in the main loop:
for(int i=1;i<rates_total;i++) { pmarArr[i]=MathAbs(close[i]/VWMAArr[i]); ...
There are more to be discussed regarding your selective usage of ArraySetAsSeries. All in all there are many logical errors.
Man thank you so much! that solved it, I can make a start from here, now its actually showing what I want more or less. Yes there are a lot of errors, I need to learn more and optimise the code better. Thank you for the guidance, much appreciated :)

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 want to create a version of an indicator in TradingView in MQL5. I have tried my best to code it in MQL5 but all I get in the indicator window is a horizontal line that displays the last bars value for that indicator (which ive verified is correct) and it updates with each tick. Ive attached both my code and the code for the indicator in tradingview as well as what my indicator window shows. Any help would be much appreciated as I'm relatively new to MQL5. (NB: I'm only using the VWMA option for the moving average, hence the code)