# How to code multi timeframe analysis

#### ezraluandre

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

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

Replies
4
Views
4K
Replies
2
Views
746
Replies
4
Views
2K
Replies
0
Views
789
Replies
2
Views
3K