Help get this topic noticed by sharing it on Twitter, Facebook, or email.

Referencing current price in past indicator calculations

I'm pretty sure this is not doable in pine script, but I thought I would give it a shot here and ask.

I am trying to make de-gapped candles, which requires the most recent close in order to adjust past, de-gapped opens, high, lows, and closes in order to retain real time data's accuracy to the real security. In another language I would just use something like "close[-1]", but this syntax is not allowed in pine script, with good reason, as to not allow forward looking backtests/indicators.

The goal is to have it so in real time you can still see the current price on the current bar, and as new real time data comes in previous bars are being shifted up or down to remove gaps and maintain real time accuracy.

If anyone knows of any workarounds it would be greatly appreciated, and if not thanks for reading and confirming the infeasibility of this script.
1 person has
this question
+1
Reply