Skip to main content

Heikin Ashi HaDiffCO for Amibroker (AFL)

kaiji over 16 years ago Amibroker (AFL)

  • Rating:
    4 / 5 (Votes 5)
  • Tags:
    trading system, amibroker, bands

This is a modified version of the “Heikin-Ashi HaDiffCO,” which is a “leading signal” oscillator. May be used with Bollinger or other bands to determine buy/cover or sell/short areas. I did not find much value in using the HaDiffCO with the Heikin-Ashi candlesticks. The HaDiffCO works well in any timeframe.

By: Brian

Indicator / Formula

Copy & Paste Friendly
_SECTION_BEGIN("D_Opt HaDiffCO");
/* HaDiffCo for use with Heikin-Ashi Modified Candlestick Chart */
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));
HaDiffCO = HaClose-HaOpen;
Per = Param("MA Periods",8,3,50,1);
Plot(HaDiffCO,"HaDiffCO",colorWhite);
Plot(WMA(HaDiffCO,5),"HaDiffCO",colorRed, styleDots);
Plot(MA(HaDiffCO,per),"MA("+per+")",colorBlue,styleDots);
// Plot Arrows
Buy = Cross(WMA(HaDiffCO,5),MA(HaDiffCO,per));
Short = Cross(MA(HaDiffCO,per),WMA(HaDiffCO,5));
Title = "HaDiffCO";
_SECTION_END();

_SECTION_BEGIN("Bollinger Bands");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15, 2, 100, 1 );
Width = Param("Width", 2, 0, 10, 0.05 );
Color = ParamColor("Color", colorCycle );
Style = ParamStyle("Style");
Plot( BBandTop( P, Periods, Width ), "BBTop" + _PARAM_VALUES(), Color, Style ); 
Plot( BBandBot( P, Periods, Width ), "BBBot" + _PARAM_VALUES(), Color, Style ); 
_SECTION_END();

2 comments

over 15 years ago

Administrator can you add Buy and sell signal to the above formula. I have used this formula but it doesn’t give buy/sell indicators. please help

Leave Comment

Please login here to leave a comment.