I got curious about Heiken Ashi, and one thing led to another. In the end, I was reading the code and found a surprise. Here's the code where they calculate the actual values:
HAClose.Set((Open[0] + High[0] + Low[0] + Close[0]) * 0.25); // Calculate the close HAOpen.Set((HAOpen[1] + HAClose[1]) * 0.5); // Calculate the open HAHigh.Set(Math.Max(High[0], HAOpen[0])); // Calculate the high HALow.Set(Math.Min(Low[0], HAOpen[0])); // Calculate the low
- HAHigh should be the maximum of High[0], HAOpen[0], and HAClose[0]
- HALow should be the minimum of Low[0], HAOpen[0], and HAClose[0]
Every place I have found on the net, including the original TASC article, agrees on including HAClose[0] in those last two calculations.
OK -- do we have a bug here? Is there newer wisdom that makes the given calculation correct? Am I just plain missing something?
--EV
Comment