cBot onError method

Created at 18 Jun 2019, 14:48
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!
EO

eofe

Joined 18.06.2019

cBot onError method
18 Jun 2019, 14:48


Could you elaborate a little on this method please? On the website, it says Called if there is an error executing a trade operation.

 

Can you provide some trade operation errors that may trigger this method? Order rejection? Or the “technical error” message I often see in cBot logs.

https://ctrader.com/api/reference/robot/onerror

 

Or does it only gets triggered when TradeResult has an error?

https://ctrader.com/api/reference/traderesult/error


@eofe
Replies

PanagiotisCharalampous
19 Jun 2019, 17:38

Hi efxps,

Thanks for positng in our forum. OnError is called when TradeResult.IsSuccessful = false. Which means positions not opened or pending order not placed You can find the errors that can trigger OnError here

Best Regards,

Panagiotis


@PanagiotisCharalampous

eofe
19 Jun 2019, 18:18

The page you shared is very helpful. Thanks.


@eofe