How To Write Simple Amibroker Buy Sell Indicators

Amibroker Buy Sell Indicators

Lets Write Easy Amibroker Buy Sell Indicators In This Post
AmiBroker offers us automated technical analysis instruments. AmiBroker can check for person given buy/sell stipulations supplying you with an idea concerning the present state of affairs on the market. It will possibly additionally do a system take a look at (simulation) telling us in regards to the efficiency of our trading system. AmiBroker software additionally has Amibroker system language (AFL) permitting you to jot down no longer best system assessments but in addition customized Amibroker buy sell symptoms and guru guide commentaries.

To be able to do that you need to outline buy and sell principles, Amibroker buy sell indicators formulation or commentaries the usage of a different AmiBroker Formula Language (AFL), which is described beneath.

AFL is used for outlining your trading ideas and explorations in Automated Analysis window, customized commentaries within the Guru Commentary window and Amibroker buy sell indications formulation in Formula Editor window.

Now lets attempt to construct our personal Amibroker buy sell indications that buys or shorts in three duration-MA and eighty duration-MA crossover.

amibroker buy sell indicators

Copy the following code to your Amibroker’s formula editor:

// Start Amibroker buy sell indicators
/*PositionSize = MarginDeposit = 1; */
/*i = Optimize (“best volume”, 5, 1, 50, 1); */

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”, colorDefault ), styleNoTitle | ParamStyle(“Style”) | GetPriceStyle() );

Buy = MA( Close , 3 ) > MA( Close , 80 ) AND Volume > Ref( Volume , -5 ) AND Close > SAR( 0.02, 0.2 );
/* AND Volume > Ref (Volume, Optimize (“best volume”, 5, 1, 30, 3)) AND Close > SAR( 0.02, 0.2 );*/
/* ApplyStop(stopTypeLoss, stopModePercent, Optimize( “max. loss stop level”, 10, 2, 30, 1 ), True ); */
/*BuyStop = ApplyStop(stopTypeLoss, stopModePoint, Optimize( “MK max. loss stop level”, 10, 2, 30, 1 ), True );*/
Sell = MA( Close , 3 ) < MA( Close , 80 ) AND Volume > Ref( Volume , -5 )AND SAR( 0.02, 0.2 ) > Close;
/*Sell = SAR( 0.02, 0.2 ) > Close;*/
/*AND Volume > Ref (Volume, Optimize (“best volume”, -5, -1, -30, -3)) AND SAR( 0.02, 0.2 ) > Close;*/
/* Sell= (( Ref( Close , -1 )- Close) < -2); */ Short = MA( Close , 3 ) < MA( Close , 80 ) AND Volume > Ref( Volume , -5 ) AND SAR( 0.02, 0.2 ) > Close;
/*AND Volume > Ref (Volume, Optimize (“best volume”, -5, -1, -30, -3)) AND SAR( 0.02, 0.2 ) > Close;*/
Cover = MA( Close , 3 ) > MA( Close , 80 ) AND Volume > Ref( Volume , -5 )AND Close > SAR( 0.02, 0.2 );
/*AND Volume > Ref (Volume, Optimize (“best volume”, -5, -1, -30, -3)) AND Close > SAR( 0.02, 0.2 );*/

Buy=ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy);
Short=ExRem(Short,Cover);
Cover=ExRem(Cover,Short);

PlotShapes(IIf(Buy==1, shapeUpArrow , shapeNone), colorGreen, 0,Low, Offset=-20);
PlotShapes(IIf(Sell==1, shapeHollowDownArrow, shapeNone), colorRed, 0,High, Offset=-20);
PlotShapes(IIf(Short==1, shapeDownArrow , shapeNone), colorRed, 0,High, Offset=-20);
PlotShapes(IIf(Cover==1, shapeHollowUpArrow, shapeNone), colorGreen, 0,Low, Offset=-20);

// End Amibroker buy sell indicators

Wish to take a look at some more professional trading systems on Amibroker platform. Click on here for Trend Blaster. Your comments in this regard will be appreciated.

Author Bio

Indrajit Mukherjee

Indrajit is a professional blogger and Trading System developer, Amibroker expert, Wordpress expert, SEO expert and Stock market analyst. Trading since 2000, he has started the journey of StockManiacs.net on 2008. He follows Indian and world stock markets closely.

error: Content is protected !!