The Heikin Ashi Formula consists of four calculations, which remap Open, Close, High, and Low:
Open = [Open (previous bar) + Close (previous bar)]/2.
Close = (Open+High+Low+Close)/4.
High = Max Price Reached.
Low = Max Low Price Reached.
The chart of the left is the system generated Heikin-Ashi colors.
The chart on the right is the code based Heikin-Ashi colors, derived from the standard formula, as described above.
Notice the difference, highlighted in gray.
This code will paint the Heikin-Ashi colors on any bar type, including Equivolume.
Which one is correct? Which one is better? Either my code is off, or TOS is using non-traditional inputs?
Open = [Open (previous bar) + Close (previous bar)]/2.
Close = (Open+High+Low+Close)/4.
High = Max Price Reached.
Low = Max Low Price Reached.
The chart of the left is the system generated Heikin-Ashi colors.
The chart on the right is the code based Heikin-Ashi colors, derived from the standard formula, as described above.
Notice the difference, highlighted in gray.
This code will paint the Heikin-Ashi colors on any bar type, including Equivolume.
Code:
def haOpen = (open[1] + close[1])/2;
def haClose = (open + close + high + low)/4;
assignpriceColor(if haOpen < haClose then color.green else
if haOpen > haClose then color.red else color.white);
Which one is correct? Which one is better? Either my code is off, or TOS is using non-traditional inputs?