Smoothed Heikin Ashi for Amibroker?

#11
Dear Sir,

It is possible that your revised formula is similar to the Smoothed Heiken Ashi as the trend looks similar. Am posting the formula for Smothening as found in another site.

Step 1

First calculate the moving average (MA) based in n periods of openings, minimum, maximum and closures which must be replaced by the openings, minimum, maximum and closures that appear in the formulas discussed earlier so that we get the following :
Close
Modified = (MA (Open, n ) MAMximo, n) MovAvg (minimum, n ) MA (Close, n ))/ 4
Open Modified = (MA (Open Modified from the previous bar, n) MA (Close Modified from the bar below, n ))/ 2
Max Modified = Max (MA (Maximum, n ), MA (Open Modified n ), MA (Close Modified n ))
Minimum Modified = Min (MA (Minimum, n ), MA (Open Modified n ), MA (Close Modified n ))

Step 2

It then proceeds to apply a second moving average p periods to openings, closures, minimum and maximum modified so that each of the parts of the candle Heikin Ashi its smoothed version, are as follows :
Opening Softened = MA (Open Modified p )
Close Smooth = MA (Close Modified p )
Max Smooth = MA (Maximum Modified p )
Minimum Smooth = MA (Minimum Modified p )


Hope this helps. Thanks
 
#12
In the image given by you, price is given as candle chart and smoothed heikin ashi is given based on ma.

I enclose another image similar to yours on 5mt chart with heikin ashi based on 30ma( this you can change in parameters). Further, candle chart can also be converted into heikin ashi in parameters

Hope this helps you.

Afl used is as follows







_SECTION_BEGIN("Price");
HAswitch = ParamToggle("Heikin Ashi","Off,On");
PriceUpCol = ParamColor("Price UP Color",colorGreen);
PriceDnCol = ParamColor("Price DN Color",colorRed);
PriceSty = ParamStyle("Price Style",styleCandle,maskDefault | styleCandle | styleBar);

HaClose = ( O+H+L+C ) / 4;
HaOpen = AMA( Ref(HaClose, -1), 0.5);
HaHigh = Max(H, Max(HaClose, HaOpen));
HaLow = Min(L, Min(HaClose, HaOpen));

if(HAswitch)
PlotOHLC(HaOpen,HaHigh,HaLow,HaClose,"Heikin Ashi",IIf(HaClose > HaOpen,PriceUpCol,PriceDnCol),PriceSty);
else
Plot(C,"Price",IIf(C > Ref(C,-1), PriceUpCol, PriceDnCol), PriceSty);
_SECTION_END();






_SECTION_BEGIN("Price");
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();

_SECTION_BEGIN("Heiken Ashi Smoothed");
SetChartBkGradientFill( ParamColor("BgTop", colorBlack),ParamColor("BgBottom", colorBlack),ParamColor("Titleblock",colorLightGrey ));
SetChartOptions(0,chartShowArrows|chartShowDates);
GraphXSpace=5;
p=Param("Period",6,2,30,1);
Om=MA(O,p);
hm=MA(H,p);
lm=MA(L,p);
Cm=MA(C,p);
HACLOSE=(Om+Hm+Lm+Cm)/4;
HaOpen = AMA( Ref( HaClose, -1 ), 0.5 );
HaHigh = Max( Hm, Max( HaClose, HaOpen ) );
HaLow = Min( Lm, Min( HaClose, HaOpen ) );
PlotOHLC( HaOpen, HaHigh, HaLow, HaClose, "" + Name(), colorWhite, styleCandle | styleNoLabel );
_SECTION_END();
Line=ParamToggle("Show Line chart also","Hide|Show",0);
if(Line==1) {
Plot(C,"Close",colorWhite,styleLine);
}



_SECTION_BEGIN("Magnified Market Price");
//by Vidyasagar, [email protected]//
FS=Param("Font Size",30,30,100,1);
GfxSelectFont("Arial", FS, 900, italic = False, underline = False, True );
GfxSetBkMode( colorWhite );
GfxSetTextColor( ParamColor("Color",colorYellow) );
//Hor=Param("Horizontal Position",800,800,800,800);

Hor=Param("Horizontal Position",20,20,500,20);




Ver=Param("Vertical Position",50,50,250,50);
GfxTextOut(""+C,Hor , Ver );
YC=TimeFrameGetPrice("C",inDaily,-1);
DD=Prec(C-YC,2);
xx=Prec((DD/YC)*100,2);
GfxSelectFont("Arial", 12, 700, italic = False, underline = False, True );
GfxSetBkMode( colorWhite );
GfxSetTextColor(ParamColor("Color",colorYellow) );
GfxTextOut(""+DD+" ("+xx+"%)", Hor+5, Ver+45 );
_SECTION_END();




_SECTION_BEGIN("Price Line");

PriceLineColor=ParamColor("PriceLineColor",ColorRGB(82,82,82));
PriceLevel = ParamField("PriceField", field = 3 );

Daysback = Param("Bars Back",100,10,500,1);
FirstBar = BarCount - DaysBack;
YY = IIf(BarIndex() >= Firstbar,EndValue(PriceLevel),Null);

Plot(YY,"Current Price",PriceLineColor,ParamStyle("LineStyle",styleLine|styleDashed|styleNoTitle|styleNoLabel|styleThick,maskAll));


side = Param("side",1,0,1000,1);

dist = 0;

for( i = 0; i < BarCount; i++ )
{
if(i+side== BarCount) PlotText( "\n " + PriceLevel[ i ], i, YY[ i ]-dist, colorLightBlue );
}


_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();




 
#14
Dear Sir,

It is more for positional calls than for intraday - you will get whipsaws but just ignore them and follow the trend as given by the Heiken Ashi and sell ideally only when the trend changes as per the modified HA (or whenever you are comfortable with your profits). Please back test atleast 25 - 30 trades and you will see more than 80% success - with your capturing a majority of the overall trend
 
#15
Hi ...can anybody plot the buy/sell signal in this smoothed heikin ashi AFL?? ..meaning that it takes a long position when the candle turns green and short position when the candle turns red.....so that it can be used for automated trading....here is the afl:

_SECTION_BEGIN("Heiken Ashi Smoothed");
SetChartBkGradientFill( ParamColor("BgTop", colorBlack),ParamColor("BgBottom", colorBlack),ParamColor("Titleblock",colorLightGrey ));
SetChartOptions(0,chartShowArrows|chartShowDates);
GraphXSpace=5;
p=Param("Period",6,2,30,1);
Om=MA(O,p);
hm=MA(H,p);
lm=MA(L,p);
Cm=MA(C,p);
HACLOSE=(Om+Hm+Lm+Cm)/4;
HaOpen = AMA( Ref( HaClose, -1 ), 0.5 );
HaHigh = Max( Hm, Max( HaClose, HaOpen ) );
HaLow = Min( Lm, Min( HaClose, HaOpen ) );
PlotOHLC( HaOpen, HaHigh, HaLow, HaClose, "" + Name(), colorWhite, styleCandle | styleNoLabel );
 

Similar threads