armybender
Active member
I am looking at the box where you put the symbol, the SPX chart right now, the price in the box next to it is 4136.48. TastyWorks is showing the same price. Using the Bar style Chart Type. For the 20 days 1 day Heikin Ashi style chart the current price line is 4136.52. The Heikin Ashi is showing 4135.32 which is expected.
Right, so if you want the line to show up on the Heikin Ashi close, you need to add a variable to calculate the Heikin Ashi close, which is just the OHLC4.
Just replace this line (shown below). But, be aware that is not the true price at the close of the market - that is a calculated price to generate the Heikin Ashi bar. I'm sure you already know that part though.
REPLACE IN CODE:
def lastClose = if !IsNaN(close) and IsNaN(close[-1]) then OHLC4 else lastClose[1];