Thursday, September 3, 2015

Modified SAR technique

This is an Amibroker formula which I use with my trading everyday. Many people use the normal SAR formula or the EMA of past five days. But the accuracy is greater with the formula that I provide here.

_SECTION_BEGIN("Modified Sar formula");
_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() );

feb =(LLV(Low,5)*0.764)+(Ref(Low,-1)*0.236);
feb2 =(feb*0.764)+(Low*0.236);
feb1 = MA(feb2,5);
feb10 =MA(feb2,10);
Hig = EMA(High,5);
Lo  = EMA(Low,5);

Plot(feb1,"",colorBlue,512 +styleThick );

//Plot(Hig,"",colorBlue,512 +styleThick + styleDashed);
//Plot(Lo,"",colorRed,512 +styleThick + styleDashed);
Buy = Cross(High,feb1) AND MA(V,20)>500000;
Sell =Cross(feb1,Low)AND MA(V,20)>500000;
ExB =Buy;
ExS = Sell;
ExB_status = WriteIf( ExB, "Buy", " " );
ExS_status = WriteIf( ExS, "Sell", " " );
ExB_Color = IIf( ExB, colorDarkGreen , colorWhite );
ExS_Color = IIf( ExS, colorRed, colorWhite );
Filter = ExB OR ExS;
AddColumn( C, "close,", 1.2, IIf( C > Ref( C, -1 ), colorDarkGreen, colorRed ) );
AddTextColumn( ExB_status, "Buy", 1, colorWhite, ExB_color );
AddTextColumn( ExS_status, "Sell", 1, colorWhite, ExS_color );
GfxSetOverlayMode( mode = 0 );
GfxSelectPen( colorOrange, 2 );
GfxSelectSolidBrush( colorBlack );
GfxRoundRect(5,20, 250,63, 16, 20 );
GfxSelectFont( "Arial",12, 700, False );
GfxSetTextColor( colorPaleGreen );

GfxSetTextColor( colorBlue );
GfxTextOut(WriteIf(feb1, "MY-SAR:  "+(feb1),""), 8 ,25 );

GfxSetTextColor( colorRed );


How to calculate in excel:

Step1 : calculate the lowest value of value for past 5 days  and multiply with 0.764Step2 : Multiply the previous low price with 0.236 Step3: add the both numbers

when the close price is lesser than modified sar value , it is bearish and its time to sell your positions. when the close price is above the modified sar value , it is bullish and its time to buy. Do only when the cross-over occurs and not at other times.

No comments:

Post a Comment

What you should know about Crypto Investing ? - Press Release

The eBook chapter can be downloaded on and sent to any kindle eReader smartphone or device with a free kindle application. The ...