OnBar() if Bar is secondary

Created at 06 Jul 2018, 12:21
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!
alexander.n.fedorov's avatar

alexander.n.fedorov

Joined 02.01.2018

OnBar() if Bar is secondary
06 Jul 2018, 12:21


Dear Panagiotis,

How do I do 

"

protected override void OnBar()

"

if I want to do it on a secondar TimeFrame?

 

Regards, Alexander


@alexander.n.fedorov
Replies

PanagiotisCharalampous
06 Jul 2018, 12:36

Hi Alexander,

This is not possible. OnBar is called only the cBot's timeframe. If you want to handle the OnBar() on another timeframe, you will need to run a cBot on that timeframe as well.

An alternative is to run your code in OnTick() and check each time if a new bar has been added each timeframe series.

Best Regards,

Panagiotis


@PanagiotisCharalampous

alexander.n.fedorov
06 Jul 2018, 12:38

Thank you

 


@alexander.n.fedorov