You can access CLOSED candles. When you see a new price on the chart it’s because it’s CLOSE, which may change until the candle is closed, but you cannot access the previous value retained on the same forming candle.
Each candle is a single unit, be it 1 Day, 1 hour or 1 second. You cannot access its multiple values whenever you see it changing on the chart.
The solution is to use MTF (Multi Time Frame) support that allows to use several TF’s.
You could use, say 1h TF as your setup TF, then use a lower TF to access the 1h candle while it’s being built:
1
2
3
4
5
Timeframe(1h,UpdateOnClose)
CloseA=close
Timeframe(default)
CloseB=close
ReturnCloseAAS"Closed",CloseBAS"Forming Now",CloseB[1]AS"Forming Now previous"
What if the next value on your chart is -137 (i.e. CCI increased 1 up but is still <0). How do I colour the number in green to indicate that it increased up?
But what if the next value on your chart is -137 (i.e. CCI increased 1 up but is still <0). How do I colour the number in green to indicate that it increased up?
To help us continually offer you the best experience on ProRealCode, we use cookies. By clicking on "Continue" you are agreeing to our use of them. You can also check our "privacy policy" page for more information.Continue