Skip to main content

Heikin Ashi Easy System for Amibroker (AFL)

felippemiranda over 12 years ago Amibroker (AFL)

  • Rating:
    4 / 5 (Votes 2)
  • Tags:
    oscillator, amibroker, heikin

Based on the System by Mark Douglas.
The System comprises heikin ashi price bars, a price – action channel, and two indicators :
HaRSI – Indicates overbought and oversold conditios and
Dynamic Traders Index -Used as entry and exit points, as HaRSI crosses the signal line (red) or Market Base Line (yellow)

Screenshots

Indicator / Formula

Copy & Paste Friendly
//---------- Heikin Ashi Easy System
//Based on the System by Mark Douglas
//AFL by Felippe Miranda


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


_SECTION_BEGIN("Heikin Ashi ");

HaClose = (O+H+L+C)/4; 
HaOpen = AMA( Ref( HaClose, -1 ), .30); 
HaHigh = Max( H, Max( HaClose, HaOpen ) ); 
HaLow = Min( L, Min( HaClose, HaOpen ) ); 
barcolor = IIf(HaClose >= HaOpen,colorGreen,colorRed);
PlotOHLC( HaOpen, HaHigh, HaLow, HaClose, "", barcolor, styleCandle );
// Plot PAC 
PacUP=(MA(HaHigh,5));
PacDW=(MA(HaLow,5));
Plot(PacUP, "",colorOrange, styleLine | styleThick);
Plot(PacDW, "",colorOrange, styleLine | styleThick);
_SECTION_END();
// -- Plot basic candle chart
PlotOHLC(Open, High, Low, Close,"C ", colorYellow, styleLine | styleThick);
GraphXSpace = 7;
_SECTION_END();

_SECTION_BEGIN("SAR");
acc = Param("Acceleration", 0.02, 0, 1, 0.001 );
accm = Param("Max. acceleration", 0.2, 0, 1, 0.001 );
Plot( SAR( acc, accm ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style", styleDots | styleNoLine, maskDefault | styleDots | styleNoLine ) );
_SECTION_END();

	
//Plot the following formula on the second pane

_SECTION_BEGIN("HaRSI");
Plot(32," ", colorRed,styleLine|styleThick);
Plot(50," ", colorGreen,styleLine|styleThick);
Plot(68," ", colorRed,styleLine|styleThick);
a = DEMA(RSI(13),2);
Plot(a, "HaRSIPL - RSI Price Line", colorGreen, styleThick); 
_SECTION_END();


//Plot the following formula on the third pane 
_SECTION_BEGIN("Dynamic Traders Index");
a = DEMA(RSI(13),2);
b = MA(a,7);
bh = DEMA(a,34)+2*(StDev(a,34));
bl = DEMA(a,34)-2*(StDev(a,34));
bm = (bh+bl)/2;

Plot(a, "TDI - Traders Dynamic Index ", colorGreen, styleThick); 
Plot(b,"TSL", colorRed, styleThick);

Plot( bh , "", colorBlue, styleThick);
Plot( bl , "", colorBlue, styleThick);
Plot( bm , "", colorYellow, styleThick);
_SECTION_END()
//The rules are described on the Mark Douglas work “Why The Easy System ?” 

5 comments

1. Nahid
over 12 years ago

Dear felippemiranda,
Its a nice AFL. But it is not working. I am using Amibroker 5.60 version. Would you please rectify it for me?
Nahid

over 11 years ago

Dear Nahid,
Use the AFL syntax check, the AFL has worked with versions 5.4,5.7,5.8 and 5.9

3. Mehmudd
over 10 years ago

Hi Felippemiranda,

Can you please rectify and post the code or can you please let me know what exactly has to be done as I have no idea about programming as I’m from completely other field?

over 10 years ago

> rules are described on the Mark Douglas work “Why The Easy System ?”

May I ask, can you please elaborate on the source. I checked Mark Douglas’ Web page, and did not find any reference to “Why The Easy System”. Thanks

Leave Comment

Please login here to leave a comment.