How to use/implement events OnBarClose/Open in cBot

Created at 26 Jul 2023, 13:08
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!
V.

v.fiodorov83

Joined 24.07.2019

How to use/implement events OnBarClose/Open in cBot
26 Jul 2023, 13:08


Hello! 

I tried to write like this:

protected override void OnStart()
        {  
            Bars.BarClosed += BarsBarClosed;
        }
        
        private void BarsBarClosed(BarClosedEventArgs obj)
        {
            Print("Bar closed");
        }      

But I get the following error in the cTrader log: 01/02/2023 03:00:00.230 | Crashed in OnStart with TypeLoadException: Could not load type 'cAlgo.API.BarClosedEventArgs' from assembly 'cAlgo.API, Version=1.0.0.0, Culture=neutral, PublicKeyToken=3499da3018340880'.


@v.fiodorov83
Replies

PanagiotisChar
26 Jul 2023, 13:12

Hi there,

Are you using 4.8.15?

Aieden Technologies

Need help? Join us on Telegram


 


@PanagiotisChar

v.fiodorov83
26 Jul 2023, 14:04 ( Updated at: 21 Dec 2023, 09:23 )

RE: How to use/implement events OnBarClose/Open in cBot

PanagiotisChar said: 

Hi there,

Are you using 4.8.15?

Aieden Technologies

Need help? Join us on Telegram


 

 


@v.fiodorov83

PanagiotisChar
27 Jul 2023, 05:12

Hi,

This became available in 4.8

Aieden Technologies

Need help? Join us on Telegram


 


@PanagiotisChar