[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] please help to create a scan from this code



PureBytes Links

Trading Reference Links

Can some one modify this code to run as a scan giving results as follows:

Highest percentage difference between r1 and close and also r2 and close- arranged higest difference first.

Thanks in advance


/*Tushar Chande's Range Projection */

 

/* AFL Code by Prakash Shenoi */

//

 

//

Av=MA(abs(C-Ref(C,-1)),10);

r1=(C+Av);

r2=(C+(2*Av));

s1=(C-Av);

s2=(C-(2*Av));

Plot (Close,"",45,128);

Plot (r1,"",36,16+8);

Plot (r2,"",15,16+8);

Plot (s1,"",0,16+8);

Plot (s2,"",34,16+8);

GraphXSpace=5;

Title=Name ()+ " "+"\n"+ "RES =" + WriteVal  (r1,1.2) + ", "+ WriteVal  (r2,1.2) + "

 "+

"SUPP= "+ WriteVal (s1,1.2)+ ", " + WriteVal(s2,1.2) ;

// Paste the code below to your price chart somewhere and green ribbon means both

// both MACD and ADX trending up so if the red ribbon shows up the MACD and the ADX

// are both trending down.

 

_SECTION_BEGIN("trending ribbon");

uptrend=PDI()>MDI()AND Signal()<MACD();

downtrend=MDI()>PDI()AND Signal()>MACD();

 

 

Plot( 5, /* defines the height of the ribbon in percent of pane width */"ribbon",

IIf( uptrend, colorBrightGreen    , IIf( downtrend, colorBlue, 0 )), /* choose color */

styleOwnScale|styleArea|styleNoLabel, -0.1, 150 );

 

_SECTION_END();

_SECTION_BEGIN("Price");

SetChartOptions(0,chartShowDates);

_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} O- %g, Hi %g, Lo %g, C- %g (%.1f%%) Vol " +WriteVal( V, 1.0 ) +" {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 )) ));


__._,_.___

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html




Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___