how to trade according 3 last bar?

 

hello every body..

i want to make ea based of 3 last bar..

example if i choose 1 hour timeframe..

and now 12.40,so the trade will open on 13.00. he will check bar time 10, 11 and 12...

the if want open trade on time 14.00, he will check bar time 11,12,and 13..

and etc..

if i am choose time frame 30, and want open position on 12.00, so he will check bar time 10.30,11.00,11.30.

the 1 last bar will check based of ema, last bar 2 check based of stoch, last bar 3 check based of macd or other indicator..

of more simple like:

last bar 1: check open[1]>high[1]

last bar 2: check open[1]=high[1]

last bar 3:check close[1]>low[1]

but the important i want to know how to make can check 3 last bar..

is it can?

thx..

Reason: