Fave This

Saturday 12 March 2011

[Komunitas AmiBroker] darvas explorer.afl

SetChartOptions( 0, chartShowArrows|chartShowDates );

_SECTION_BEGIN("Price Chart");

_N(Title = StrFormat("{{NAME}} - O= %g, H= %g, L= %g, C= %g (%.1f%%) V= " +WriteVal( V, 1.0 ) +"\n{{VALUES}}", O, H, L, C, SelectedValue(
ROC( C, 1 )) ));
PriceStyle = GetPriceStyle();
PriceStyleOpt = ParamStyle("Price Style")|PriceStyle;

if (PriceStyle==styleCandle)
Plot( C, "", colorBlack, PriceStyleOpt);
else
Plot( C, "", IIf( Close >= Ref(C, -1), colorBlue, colorRed ),
PriceStyleOpt);

_SECTION_END();

_SECTION_BEGIN("Darvas Box");

Periods= Param("Darvas Periods",5,5,260);

boxHigh = Ref(H,-3)>=Ref(HHV(H,Periods),-4) AND
Ref(H,-3)>Ref(H,-2) AND Ref(H,-3)>Ref(H,-1) AND Ref(H,-3)>H;

Topbox=ValueWhen(boxHigh, Ref(H,-3));
Botbox=ValueWhen(boxHigh,LLV(L,4));

/*=========================
- Allow color change
- Style change
==========================*/
Plot(TopBox, "Top", ParamColor("Box Top Color", colorRed), ParamStyle("Box
Top Style"));
Plot(Botbox, "Bot", ParamColor("Box Bottom Color",colorBlue), ParamStyle("Box
Bottom Style"));

_SECTION_END();

_SECTION_BEGIN("Exploration");

//== Price Increment Value - depend on different country
Inc = 0.1;


//== Set the Price Range for stock to scan
PriceFrom = Param("Price From:", 5, 0.1, 200, Inc);
PriceTo = Param("Price To:", 100, 0.1, 200, Inc);

/*
MAV - Moving Average of Volume
Buy - Default 20 days
Sell - default 10 days

Filter:
Buy: Today Buy Volume must be > N time of Buy MAV.
(Buy Up required Huge push force)
The previous Day High must be below the Darvas Top and Today must
close above Darvas Top

Sell: Today Sell Volume must be > N time of Sell MAV
(Sell Down required small pull force)
The previous Day Low must be above the Darvas bottom and Today must
close below Darvas Low

*/
Buy_MAPds = Param("Buy: MAV. Periods", 20, 1, 260);
Buy_VxMAV = Param("Buy: V > NxMAV", 2, 0, 20, 0.1);
Sell_MAPds = Param("Sell: MAV. Periods", 10, 1, 260);
Sell_VxMAV = Param("Sell: V > NxMAV", 1, 0, 20, 0.1);

BuyMAV = MA(V, Buy_MAPds);
SellMAV = MA(V, Sell_MAPds);

/* Rule to Filter
-
- The previous Day High must be inside the Darvas Top and Today must close
above Darvas Top

*/
Buy = Ref(H, -1) <=TopBox AND C>TopBox AND (V>Buy_VxMAV*BuyMAV);
Sell = Ref(L, -1) >=Botbox AND C<Botbox AND (V>Sell_VxMAV*SellMAV);


Filter = (Buy OR Sell) AND (C>=PriceFrom AND C<=PriceTo);

AddTextColumn(FullName(), "Security", 1.0, colorDefault, colorDefault, 200);
AddTextColumn(WriteIf(Buy, "Buy", WriteIf(Sell, "Sell", "-")), "Trade", 1.0,colorYellow,IIf(Buy, colorGreen, IIf(Sell, colorRed, colorDefault)),50);
AddColumn(C, "Price", 0.3, colorDefault, colorDefault, 60);
AddColumn(V, "Volume", 1.0, colorDefault, colorDefault,80);

_SECTION_END();

------------------------------------

Apabila membutuhkan software AmiBroker, Realtime Intraday Data & Pelatihan silahkan kontak : Dendo Valentino | Cell : 08159304868 | e-mail: amibrokerfreak{at}yahoo.co.id | YM id : dendov | http://www.facebook.com/dendo.amibrokerfreak | http://www.amibroker-4-bei.org

Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/amibroker-4-bei/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/amibroker-4-bei/join
(Yahoo! ID required)

<*> To change settings via email:
amibroker-4-bei-digest@yahoogroups.com
amibroker-4-bei-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
amibroker-4-bei-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/

No comments:

Post a Comment