How to code multi timeframe analysis

ezraluandre

Trader
Jun 17, 2020
33
1
24
30
Hi I try to build EA that using multi timeframe analysis. Let's say I want to use MA as trend and stochastic as entry.

Let's say I want to use MA in higher timeframe, to do that I will code like this,
Code:
If(iClose(Symbol(),PERIOD_H1,0) >iMA(Symbol(),PERIOD_H1,200,0,MODE_EMA,PRICE_CLOSE,0)

for entry the code would be like this,
Code:
If(iStochastic(Symbol(),PERIOD_CURRENT,5,3,3,MODE_EMA,0,MODE_MAIN,2)<20 && iStochastic(Symbol(),PERIOD_CURRENT,5,3,3,MODE_EMA,0,MODE_MAIN,1)>20

Is this how you code multi timeframe analysis?
 

hayseed

Master Trader
Jul 27, 2010
1,065
265
149
usa
Hi I try to build EA that using multi timeframe analysis. Let's say I want to use MA as trend and stochastic as entry.

Let's say I want to use MA in higher timeframe, to do that I will code like this,
Code:
If(iClose(Symbol(),PERIOD_H1,0) >iMA(Symbol(),PERIOD_H1,200,0,MODE_EMA,PRICE_CLOSE,0)

for entry the code would be like this,
Code:
If(iStochastic(Symbol(),PERIOD_CURRENT,5,3,3,MODE_EMA,0,MODE_MAIN,2)<20 && iStochastic(Symbol(),PERIOD_CURRENT,5,3,3,MODE_EMA,0,MODE_MAIN,1)>20

Is this how you code multi timeframe analysis?
//----

hey ezra..... yes.....

when you use iClose(Symbol(),PERIOD_H1, 0 ), that is effectively saying the BID is greater than the moving average.....

so your terms are saying ,

the (hourly close) is greater than the (hour 200 ema ) ...

and

the stochastic crossed above the 20 last bar....

....h