Hi! A maybe simple question: How do I define the last formed candle on a chart with the value of for example 1?
Best regards, Andy
The current candle being formed is referred to as [0] or nothing. [1 ] is the first previous, [2] the second previous,….
So HIGH[2] is the HIGH price of the second previous candle.
This is true for ProBuilder and ProScreener which both access candles live, while ProOrder deals only with closed candles, so [0] or nothing refers to the last closed candle, whch is considered the current candle.
Not sure I fully understand the question but here goes…
The currently forming candle (the last one on the chart) is always [0]. The candle before it is [1] and the one before that is [2] and so on.
So if you want to know any of the values or indicator values of the currently forming candle then you want to look at high[0], low[0], average[12](close[0]) etc. You can omit the [0] in your code as if there is no value then PRT code just assumes that it is zero.
EDIT: I think we were typing at the same time Roberto!
Ok, thank’s to both of you:)
Stop me if I’m wrong, but I think that Andy is looking for a code to know if the last visible candle on the bar is the last one?