
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
so if you want to use the average range of the last 1000 bars of the current chart:
sum(high-low)/n, how would you code this to use as a variable in your code?
This would need to be adapted somehow.. I guess I would have to use iMAOnArray, but how set it the right way?
This doesn't give any errors in the MetaEditor, but in MT4 it gives:
"2009.07.25 17:41:44 range USDJPY,H1: first parameter for iMAOnArray indicator must be an array"
CurrentHigh = iHigh(NULL,0,i);
CurrentLow = iLow(NULL,0,i+RPeriod);
range=CurrentHigh-CurrentLow;
range = ArraySetAsSeries(range,true);
double avgrange=iMAOnArray(range,0,1000,0,MODE_SMA,0);
Range[i] = avgrange;
//Range[i] = range;
little help pls