cBot Error Behaviour

Created at 30 Oct 2021, 19:55
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!
EY

eynt

Joined 08.05.2020

cBot Error Behaviour
30 Oct 2021, 19:55


Is there a way to control what happens on an exception on my cBot. For example, choose if I want to close all positions or do nothing, etc.

 

Thanks


@eynt
Replies

amusleh
01 Nov 2021, 08:20

Hi,

You can use try/catch to catch an exception and then do anything you want to.


@amusleh

eynt
02 Nov 2021, 10:42

RE:

Is there any way to determine it using some sort of a parameter or via the app's GUI?

 

Thanks

 


@eynt

amusleh
03 Nov 2021, 08:19

RE: RE:

yuval.ein said:

Is there any way to determine it using some sort of a parameter or via the app's GUI?

 

Thanks

 

Hi,

No, its not possible, you have to use try/catch block inside your indicator/cBot code.


@amusleh

eynt
03 Nov 2021, 10:14 ( Updated at: 03 Nov 2021, 10:31 )

RE: RE: RE:

A. What does the Stop method does?

B. If I have several instances of the same cBot and one of them calls the Stop, does it effect the other instances?

 

 

Thanks

 


@eynt

amusleh
04 Nov 2021, 07:58

RE: RE: RE: RE:

yuval.ein said:

A. What does the Stop method does?

B. If I have several instances of the same cBot and one of them calls the Stop, does it effect the other instances?

 

 

Thanks

 

Hi,

No, it doesn't effect other instances, if you call Stop on a cBot it will only stop the instance that called the method not the other ones.


@amusleh