How to Scan diff time frames in One AFL

singhboy

Active Member
#1
Hi guys, i wanted to knw if its possible to scan diffrent time frames simultaneosly with single AFL. For example i want to scan for stocks in which 5ema cross 13 ema on 5 mint, and stoch is up on 5-15n 30 mint. Now this is afl n i can scan stoch condition on 5 mint only , not on 15 n 30.

x = EMA(Close,13);
y = EMA (Close,5);

Buy=Cross(y,x)

AND (
( StochK( 5, 3)>StochD( 5, 3, 3 ))
AND StochK( 5, 3 ) < 80
);
Sell= Cross(x,y)
AND (
( StochK( 5,3) < StochD(5,3,3))
AND StochK (5,3) > 20
);
Filter=(Volume>50000) AND (Buy OR Sell) AND (Close>200);
AddColumn(Close,"Close",1.4);
AddColumn(Buy,"buy",1.2);
AddColumn(Sell,"sell",1.2);

Now in automatic analysis- setting-general-periodicity, i can choose time frames , but i want all these conditions met from single afl so that i dont hav to change periodicity for every scan. Can sum1 help me pls :down:
 

singhboy

Active Member
#3
thnx for the link but i couldnt make afl reading that bcz i dont knw much abt afl language, will u pls make the afl if u know how to do it. Thnx alot
 

singhboy

Active Member
#4
Sum1 at least pls post any similar afl, means any afl which would scan diff time frames, i will try to make required afl myself, thnx
 

murthymsr

Well-Known Member
#6
@singhboy : Have a look at this: (As example only. Not for trading)

TimeFrameSet(inWeekly);
RSIw = RSI(14);
TimeFrameRestore();

TimeFrameSet(inDaily);
RSI1d = RSI(14);
TimeFrameRestore();

Buy = RSIW>30 .and. RSId>30;
Sell = RSIW<70 .and. RSId<70;
 
#8
@singhboy : Have a look at this: (As example only. Not for trading)

TimeFrameSet(inWeekly);
RSIw = RSI(14);
TimeFrameRestore();

TimeFrameSet(inDaily);
RSI1d = RSI(14);
TimeFrameRestore();

Buy = RSIW>30 .and. RSId>30;
Sell = RSIW<70 .and. RSId<70;
sir require attched code in multitime frame exploratation
 

Attachments

Similar threads