Heiken-Ashi Doji Finder

16:41 Roundturn: I would like to identify a doji candle on a Heiken-Ashi bar…

16:41 Roundturn: The definition: the body of the Heiken-Ashi candle is <= 10 percent of the candle's range…
16:42 Roundturn: I welcome your suggestions

16:55 Ensign Howard: so you want the spread between Open and Close to be less than 10% of the bar's range
16:56 Roundturn: Yes.
16:58 Roundturn: if (abs((close[i]-open[i]))/(high[i]-low[i])) >= dojiM
16:58 Roundturn: dojiM is user input for perentage (decimal)
16:59 Roundturn: Okay. Thank you.


17:05 Ensign Howard: this chart shows just HA bars... actual bars have been hidden with B keys


17:06 Ensign Howard: on the HA study note the assignment of the 4 parts of the HA bar to GVs H=1, L=2, C=3, Open=4
17:07 Ensign Howard: these GV values are then used by the following DYO to detect the doji, which is close-open spread is less than 10% of the bar's range.


17:07 Ensign Howard: Line A computes the bar's range using H in [1] and L in [2]
17:07 Ensign Howard: Line B computes the candle range using C in [3] and O in [4]
17:08 Ensign Howard: Line C makes sure this is a positive value
17:08 Ensign Howard: Line D computes the ratio of 100 * ABS(C-O)/(H-L)
17:09 Ensign Howard: Line E is the boolean flag that is True when the percent is less than 10%

17:09 Ensign Howard: any questions?

17:11 saroj: Howard, why do you multiply by 100 in line D?
17:11 Ensign Howard: the *100 is not necessary if you want to compare the ratio with 0.10
17:12 Ensign Howard: easier for me to think of percent and multiply by 100 and then compare with 10
17:12 Ensign Howard: just a matter of style

17:17 Roundturn: That was really fast! Thank you very much!

Last updated 02/16/2009