Previous Bar and OnBar

Created at 17 Oct 2020, 00:51
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!
JE

JeanPaul

Joined 17.10.2020

Previous Bar and OnBar
17 Oct 2020, 00:51


I want to double check my assumptions:

When OnBar is executed:

1 - Bars.LastValue.Open = Bars.LastValue.High = Bars.LastValue.Low = Bars.LastValue.Close

The reason is that OnBar is executed on the new bar and the OHLC should be Bars.LastValue.Open

2 - To get immediately the bar that has just finished Bars.Last(1) will do.

Please confirm.

 


@JeanPaul
Replies

PanagiotisCharalampous
19 Oct 2020, 07:58

Hi JeanPaul,

Your assumption is correct.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous