Trading two timeframes

 

Hello,

Is it possible in an expert advisor, to have 2 different timeframes conditions, for example : buy if MACD (daily) is higher than previous and MACD (hourly) is higher than previous.

Thanks for help.

Jo

 

Multiple TF

Hi

The answer is yes. Some functions have parameter "timeframe". For example:

double iMA( string symbol, int TIMEFRAME, int period, int ma_shift, int ma_method, int applied_price, int shift)

MA1 = iMA(NULL,PERIOD_M30,FastMA,0,MODE_EMA,PRICE_MEDIAN,i)

MA2 = iMA(NULL,PERIOD_D1,SlowMA,0,MODE_EMA,PRICE_MEDIAN,i)

Here we have two moving averages: first from half hour chart, second from daily one. Painting them together is quite complicated, but for EA it does not really matter.

hope this helps

alx

 

Thanks alx.

It's really helpful.

Jo