"USING THE HEIKIN-ASHI TECHNIQUE" by Dan Valcu
Here are the definitions for the modified OHLC values for the
heikin-ashi candlestick technique.haClose = (O+H+L+C)/4 haOpen = (haOpen (previous bar) + haClose (previous bar))/2 haHigh = Maximum(H, haOpen, haClose) haLow = Minimum(L, haOpen, haClose)__________________________________________________________________________ Here's how to calculate the modified OHCL values using a spreadsheet for the heikin-ashi candlestick technique. Heikin-Ashi OHLC values To illustrate the calculation of heikin-ashi OHCL values in a spreadsheet (sidebar Figure 1), I used daily data for the US Dollar Index (4/24/03-8/22/03). You can use intraday, weekly, or any other time frame for the data. To build the data table and the chart associated with it, follow these steps: In cell F2: =B2 In cell G2: =MAX(C2,F2,I2) In cell H2: =MIN(D2,F2,I2) In cell I2: =SUM(B2:E2)/4 Observe that cell F2 contains the value for the real open for day 1. You also have the option to enter zero in cell F2 and MIN(D2,I2) in cell H2. But in this case the range used to display the chart will be the date for the x axis, and haOpen, haHigh, haLow, and haClose for the y axis. In cell F3: =(F2+I2)/2 In cell G3: =MAX(C3,F3,I3) In cell H3: =MIN(D3,F3,I3) In cell I3: =SUM(B3:E3)/4 -DV __________________________________________________________________________ Here are MetaStock formulas for indicators based on heikin-ashi candlestick OHLC values. Defining simple indicators with MetaStock based on modified OHLC values
In MetaStock, choose Tools, Indicator Builder, and New to create these four new indicators: Name: haClose haclose:=(O+H+L+C)/4; haclose; Name: haOpen haopen:=(PREV+Ref(Fml("haClose"),-1))/2; haopen; Name: haDiffCO hadiffco:= Fml("haClose") - Fml("haOpen"); hadiffco; Name: Mov-haDiffCO Periods:=Input("Time periods",3,50,3); movhadiffco:= Mov(Fml("haDiffCO"),Periods,S); movhadiffco; -DV__________________________________________________________________________ Here are the formulas for the heikin-ashi candlesticks given on page 28 of Dan Valcu's article. Another interesting feature is the anticipation of a change in the strength of the next trading bar. Assume you are at the end of today's trading session. Based on the calculation of haOpen: haOpen (tomorrow) = (haOpen(today) + haClose(today))/2 (A) The position of haClose(tomorrow) versus haOpen(tomorrow) will determine the color of the candle body: If haClose(tomorrow) > haOpen(tomorrow) (B) Body (tomorrow) = white Else Body (tomorrow) = filled/red Endif |