I have been struggling to plot "TWO days ago" OHLC on my charts on NinjaTrader 8. I came across this post, downloaded the file provided by Chris L, and changed the indexing as follows per his update:
if(BarsInProgress != 0) return; if(CurrentBars[0] < 2 || CurrentBars[1] < 2) return; if (ShowOpen) PriorOpen[0] = Opens[1][1]; if (ShowHigh) PriorHigh[0] = Highs[1][1]; if (ShowLow) PriorLow[0] = Lows[1][1]; if (ShowClose) PriorClose[0] = Closes[1][1]; }
Bizarrely, the two days ago "CLOSE" does not line up with the previous day's close! This is odd because the highs and lows match perfectly, as you can see below:
I also tried to modify the original "Prior Day OHLC" file but could not make things work! Would highly appreciate any advice on how to fix this!
Thank you!

Comment