I try to create a formula that calculate a modiefied Heikin Ashi described by
Avinash Khilnani in his book, but I don´t succeed.
I have an Excel-file that describes the calculation!
I tried to link this Excel-file to this topic, but can´t see that it´s possible.
I know that it is very much to ask for, but if someone could help me with this
formula I be very thankful.
@AsaLeffe I am not familiar with your book and you have not listed any formula's so I don't see how anyone can help code them with you.
There are many posts in this forum with users discussing Heikin-Ashi. Search the forum as that might help or at least you will find other users with familiarity with the technique.
If you want to learn about Heikin-Ashi I suggest reading the books by Dan Valcu, the brains behind the Heikin-Ashi technique (and he is an AmiBroker user)
AmiBroker afl based upon Dan Valcu original Technical Analysis of Stocks and Commodities article
More articles from TASC that incorporate H-A with afl's.
// Heikin Ashi described by Avinash Khilnani in book
// The Modified Heikin Ashi Fibonacci Trading System
HaClose = (Open+High+Low+2*Close) / 5;
HaOpen = (HaClose + Open) / 2;
HaHigh = Max( High, Max( HaClose, HaOpen ) );
HaLow = Min( Low, Min( HaClose, HaOpen ) );
for (i=5; i<BarCount; i++)
HaClose[i] = (Open[i]+High[i]+Low[i]+2*Close[i]) / 5;
Haopen[i] = (HaClose[i-1] + HaOpen[i-1]) / 2;
HaHigh[i] = (Haopen[i]+HaOpen[i-1]+HaOpen[i-2]+HaOpen[i-3]+HaOpen[i-4])/5 ;
Halow[i] = (HaClose[i]+HaClose[i-1]+HaClose[i-2]+HaClose[i-3]+HaClose[i-4])/5 ;
upBar = HaOpen < HaClose ;
downBar = HAOpen > HAClose ;
barColor = IIf( upBar, colorGreen, IIf( downBar, colorRed, colorBlack ));
PlotOHLC( HaOpen, HaHigh, HaLow, HaClose, "HA", barColor, styleCandle ); //colorBlack
Title = Name()+" "+" Mod Heikin Ashi - Open: "+NumToStr(HaOpen,1.2,True)+" High: "+NumToStr(HaHigh,1.2,True)+" Low: "+NumToStr(Halow,1.2,True)+" Close: "+NumToStr(Haclose,1.2, True);