Fave This

Saturday 18 December 2010

[Komunitas AmiBroker] afl - buy sell with angle

coba kutak katik angka-angka 30,15,45,1

_SECTION_BEGIN("");

a = Param("Angle",30,15,45,1);
pd = Param("Period",5,4,6,1);
P = ParamField("Price field",3);

a= (22/7)*(a/180);
Num = 0;
Den = 0;

for(i=1; i<=pd; i++)
{
if(pd%2==0 AND i > pd/2) X = sin((i-1)*a);
else X = sin(i*a);

Num = Num + X*Ref(P,1-i);
Den = Den + X;
}

if (den!=0) j1 = Num / Den;

Plot(j1,"j1",IIf(j1 > Ref(j1,-1),colorGreen,colorRed),styleThick);

Buy = Close > j1;
Sell = Close < j1;
Buy=ExRem(Buy,Sell); Sell=ExRem(Sell,Buy);
PlotShapes( shapeHollowUpArrow* Buy , colorGreen ,0);
PlotShapes( shapeHollowDownArrow* Sell, colorRed ,0);
//Plot(0,"",colorDarkBlue,styleLine);

Filter = Buy OR Sell;
Buy=ExRem(Buy,Sell); Sell=ExRem(Sell,Buy);
AddTextColumn(FullName(),"Name");
AddColumn( Buy, "BUY" );
AddColumn( Sell, "SELL" );


_SECTION_END();

_SECTION_BEGIN("Price1");
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();
SetChartBkGradientFill( ParamColor("BgTop", ColorRGB( 172,172,172 )),

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

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