iMA (moving average) use with a "non Standard" Time Frame

To add comments, please log in or register
rod178
276
rod178  

It seems that iMA will only return a non zero value using the "standard" time frames. Is there a way of returning a moving average price using time frames such as m10 etc.

Additionally, what is the purpose of the maShift input?

int MAperiods1 = 9;     
int timeFrame  = 10;
int iShift     = 0;
int maShift    = 8; // what is the purpose of this input?

double maPrice = iMA(Symbol(), timeFrame, MAperiods1, maShift, MODE_EMA,PRICE_CLOSE, iShift);
return(maPrice); // returns 0 except when timeFrame is a standard period eg 5 15 30 etc
qjol
3196
qjol  
in case you want to use non standard TF you have to create the TF first using offline chart

maShft in your code is shifting the MA what's the purpose ? You tell me why did you shift it !

rod178
276
rod178  
qjol:
in case you want to use non standard TF you have to create the TF first using offline chart

maShft in your code is shifting the MA what's the purpose ? You tell me why did you shift it !

OK, did not realise that the non standard TF were only available in offline charts

As for the maShift, I simply used what was in the documentation example. As I stated, I do not understand the purpose of this input, or at least a reson for its possible use.

qjol
3196
qjol  
you saw the alligator indicator ?
Keith Watford
Moderator
22015
Keith Watford  
rod178:

OK, did not realise that the non standard TF were only available in offline charts

As for the maShift, I simply used what was in the documentation example. As I stated, I do not understand the purpose of this input, or at least a reson for its possible use.


MA Shift 8 will shift the whole MA forward by 8 bars. Some find it useful.
To add comments, please log in or register