Bars.ClosePrices.Last(0) in OnBarClosed()

Created at 27 Feb 2024, 08:43
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
IG

iggys77

Joined 20.02.2024

Bars.ClosePrices.Last(0) in OnBarClosed()
27 Feb 2024, 08:43


In the docs it says that

“When accessed in this event handler, the Bars collection does not contain the current live bar, whereas other collections (e.g., Positions, Symbols, etc.) contain actual data.”

 

Does this mean that

Bars.ClosePrices.Last(0)

inside the OnBarClosed() event handler returns the previous bar's close price (whereas Last(0) would typically return the current one)?

 


@iggys77