Possible Bug with ExecuteMarketOrder v3.3

Created at 15 Oct 2018, 17:32
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!
ClickAlgo's avatar

ClickAlgo

Joined 05.02.2015

Possible Bug with ExecuteMarketOrder v3.3
15 Oct 2018, 17:32


If you run the line of code below:

ExecuteMarketOrder(TradeType.Buy, _robot.Symbol, size, "RR-Tool", sl, tp);

and you do not have the event function below declared

private void OnPositionOpened(PositionOpenedEventArgs args)

The cBot crashes with the following error message

15/10/2018 17:31:42.102 | Crashed in Positions.Opened with NullReferenceException: Object reference not set to an instance of an object.


@ClickAlgo
Replies

ClickAlgo
15 Oct 2018, 18:08

Sorry, I posted on the wrong forum, it is an intermittent fault also.


@ClickAlgo

ClickAlgo
17 Oct 2018, 14:01

This bug was probably caused by the architecture of my project, it has been resolved using an async call instead, you can ignore or close this ticket.


@ClickAlgo