Afl

#2
wanted a average of 15min and 60min 34ema on 5min chart.
Code:
_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); 
_SECTION_END();

_SECTION_BEGIN("Multiple Time Frame EMA");
Plot( EMA( C, 5 ), "",colorYellow, styleLine ); 

TimeFrameSet(in15Minute);
C15 = EMA(C,5)  ;
TimeFrameRestore();

C15e = TimeFrameExpand(C15,in15Minute,expandLast);

Plot(C15E,"15min Ema",colorWhite,styleNoLabel|styleLine);

TimeFrameSet(4*in15Minute);

C60 = EMA(C,5)  ;
TimeFrameRestore();

C60E = TimeFrameExpand(C60,4*in15Minute,expandLast);

Plot(C60E,"60min Ema",colorRed,styleNoLabel|styleLine);

TimeFrameSet(34*in1Minute);
C34 = EMA(C,5) ;
TimeFrameRestore();

C34e = TimeFrameExpand(C34,34*in1Minute,expandLast);
Plot(C34e,"34min Ema",colorGreen,styleLine);


_SECTION_END();
 
#3
Hi,

Not sure why I am not able to post a new topic. Sorry for jumping in here.
I want to write an explorer where RSI for 5 min>70 and RSI for 30 min>70.
I wrote a code. It is returning all scripts which meet the criteria for the range given. But I want the exploration to give those scripts which currently meeting these criteria.
Code:
======================
TimeFrameSet( in5Minute );
rs5=RSI(14);
TimeFrameSet( in30Minute );
rs30=RSI(14);
Filter=rs5>70 AND rs30>60;
======================
Your help will be appreciated.
Thanks,
Satyendra
 
#4
Hi,

Not sure why I am not able to post a new topic. Sorry for jumping in here.
I want to write an explorer where RSI for 5 min>70 and RSI for 30 min>70.
I wrote a code. It is returning all scripts which meet the criteria for the range given. But I want the exploration to give those scripts which currently meeting these criteria.
Code:
======================
TimeFrameSet( in5Minute );
rs5=RSI(14);
TimeFrameSet( in30Minute );
rs30=RSI(14);
Filter=rs5>70 AND rs30>60;
======================
Your help will be appreciated.
Thanks,
Satyendra
 

Romeo1998

Well-Known Member
#5
Dear friend Satyendra,
for scripts currently fulfilling the given criteria, in analysis window, in range, select 1 recent bar or 1 recent day :happy:
In the following code, i have used OR in filter instead of AND
bcoz when i used AND , there were no scripts fulfilling those 2 conditions at the same time ( maybe bcoz i dont have enough data :D )
have a look at this code
here it is :happy:
Code:
TimeFrameSet( in5Minute );
rs5=RSI(14);
TimeFrameRestore();
TimeFrameSet( in5Minute*6 );
rs30=RSI(14);
TimeFrameRestore();
Filter =rs5>70 OR rs30>70;
AddColumn(IIf(rs5>70,1,Null),"Rsi_in_5_mins>70",1,colorBlack,IIf(rs5>70,colorLightBlue,Null));
AddColumn(IIf(rs30>70,1,Null),"Rsi_in_30_mins>70",1,colorBlack,IIf(rs30>70,colorLime,Null));


// this isnt showing any results in exploration :)
/*
cond = rs5>70 AND rs30>70;
Filter = cond;
AddColumn(IIf(cond,1,Null),"cond",1,colorBlack,IIf(cond,colorLightBlue,Null));
*/
:happy:
 
Last edited:

trash

Well-Known Member
#6
Dear friend Satyendra,
for scripts currently fulfilling the given criteria, in analysis window, in range, select 1 recent bar or 1 recent day :happy:
In the following code, i have used OR in filter instead of AND
bcoz when i used AND , there were no scripts fulfilling those 2 conditions at the same time ( maybe bcoz i dont have enough data :D )
have a look at this code
here it is :happy:
Code:
TimeFrameSet( in5Minute );
rs5=RSI(14);
TimeFrameRestore();
TimeFrameSet( in5Minute*6 );
rs30=RSI(14);
TimeFrameRestore();
Filter =rs5>70 OR rs30>70;
AddColumn(IIf(rs5>70,1,Null),"Rsi_in_5_mins>70",1,colorBlack,IIf(rs5>70,colorLightBlue,Null));
AddColumn(IIf(rs30>70,1,Null),"Rsi_in_30_mins>70",1,colorBlack,IIf(rs30>70,colorLime,Null));


// this isnt showing any results in exploration :)
/*
cond = rs5>70 AND rs30>70;
Filter = cond;
AddColumn(IIf(cond,1,Null),"cond",1,colorBlack,IIf(cond,colorLightBlue,Null));
*/
:happy:
Wrong wrong, wrong once again.

How about reading the manual properly
https://www.amibroker.com/guide/h_timeframe.html
and testing/debugging code before posting nonsense that gets spread around wrong again because other people thinking "That's the way it is done properly" because of someone acting as if he would know what to do (while just the opposite is the actual fact).

It makes no senses to post bullshit code just for the sake of posting some code.

And a script is a code/program but not a symbol/ticker.
Seriously the kind of nonsense that gets spread around on the Internet is just nothing short but amazing.

The correct code has been posted at official AmiBroker forum already.
 

Romeo1998

Well-Known Member
#7
Wrong wrong, wrong once again.

How about reading the manual properly
https://www.amibroker.com/guide/h_timeframe.html
and testing/debugging code before posting nonsense that gets spread around wrong again because other people thinking "That's the way it is done properly" because of someone acting as if he would know what to do (while just the opposite is the actual fact).

It makes no senses to post bullshit code just for the sake of posting some code.

And a script is a code/program but not a symbol/ticker.
Seriously the kind of nonsense that gets spread around on the Internet is just nothing short but amazing.

The correct code has been posted at official AmiBroker forum already.
Dear friend trash,
I had made silly mistakes as usual :D
thank u for guiding me again :happy:
after searching for many hrs, i found out my mistakes :D
here is the modified code :D
Code:
TimeFrameSet( in5Minute );
rs5 = RSI();
TimeFrameRestore();
rs5 = TimeFrameExpand( rs5, in5Minute );
 
TimeFrameSet( in5Minute*6 );
rs30 = RSI();
TimeFrameRestore();
rs30 = TimeFrameExpand( rs30, in5Minute*6 );

Filter = rs5>70 AND rs30>70;
AddColumn(IIf(rs5>70,1,Null),"Rsi_in_5_mins>70",1,colorBlack,IIf(rs5>70,colorLightBlue,Null));
AddColumn(IIf(rs30>70,1,Null),"Rsi_in_30_mins>70",1,colorBlack,IIf(rs30>70,colorLime,Null));
:happy:
 
Last edited:
#8
AFL REQUIRED WITH FOLLOWING SPECIFICATION

TREND IS UP
LIQUID SCRIP
SCRIP BOUNCED FROM ITS SMA20-SIMPLE MOVING AVEARAGE IN LAST 3 DAYS.
DOWN->DOWN-> SMA20=CLOSE(OR CLOSE VERY NEAR TO SMA20 BY LESS THAN RS 5/-) ->UP->UP


PLEASE HELP

REFER: D R BARTON'S HOOKE PATTERN
 

Similar threads