Hi, can someone please clarify the name convention for bars in an array of type Open, Close, High, Low. If bar is the current open bar on the chart, then how can it have a close price, since it’s not closed yet? Or is bar the last closed bar before the current open bar?
Close is the current price
I know it says that in the array definition. But if it’s the current price, how can the bar be closed? Isn’t the current bar an open bar? Sorry if this is obvious to everyone else. Or to put another way, if I want to reference the most recent closed bar, is that Close or Close?
watch out for what type of array you are analyzing - Did you use ArraySetAsSeries() to true? - if so, your bar is your current bar, and so, the close price is the last traded price. You will only have the real bar close price when a new bar is open, obviously, so you canl access bar to have that real closing price…
Close == current price of the current filling bar; can change
Close == the close price of the first fully filled bar; does not change
Close == the close price of the second fully filled bar; does not change
Close . . .
Thanks all, that’s cleared it up. So essentially, Close is the current bid price in the open candle, and Close is the close price of the most recent candle. Got it!
You are close, but look here:
I would treat that value as undefined since it has no logical meaning as you well understood before. Since it makes no sense to have a closing value in a bar that is still not closed, just do not use that value at all. Anything may be stored there, and it will be a wrong value whatever it is.