multiple time frame afl- help needed

#1
PLEASE HELP TO FIND OUT WHAT IS WRONG WITH THE FOLLOWING CODE:

My logic is, i want a buy signal when price is crossing 10 MA and at the same time hourly candle is green. my trading TF is 15 min. When i scan with this code, buy signal is generated even when the hourly candle is red.

TimeFrameSet(inHourly);


upbar = IIf( Close > Open ,1,0);
downbar= IIf(Close < Open ,1,0);


b9 = upbar==1 ;
s9 = downbar ==1 ;

TimeFrameRestore();

BuyHourly = TimeFrameExpand(b9, inHourly);
SellHourly = TimeFrameExpand(s9, inHourly);


Buy= cross(close, MA(close,10) )And BuyHourly ;

Thanks IN ADVANCE
 

Similar threads

Trade in Rs 20, No more % brokerage

Name:Phone:
Email:City:
State:
Are you a day trader?