# How to Scan diff time frames in One AFL

#### singhboy

##### Active Member
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);

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);

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

#### singhboy

##### Active Member
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
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

#### NORBE_1958

##### Member
In amibroker scan can it be done bases on date time wise order instead of ticker order ABC sorting

#### murthymsr

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

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

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

Sell = RSIW<70 .and. RSId<70;

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

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

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

Sell = RSIW<70 .and. RSId<70;
good example and easy to understand

#### Hiren Vyas

##### New Member
@singhboy : Have a look at this: (As example only. Not for trading)

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

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