Download MetaTrader 5
To add comments, please log in or register
Post web links to paid signals. Receive the partner's share!
rod178
276
rod178 2014.04.13 05:43 

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
3243
qjol 2014.04.13 09:32  
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 2014.04.13 09:45  
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
3243
qjol 2014.04.13 10:01  
you saw the alligator indicator ?
Keith Watford
Moderator
8026
Keith Watford 2014.04.13 10:05  
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