Bug with OnPendingOrderCreated event?

Created at 11 Oct 2013, 14:34
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!
ER

ERP1

Joined 11.10.2013

Bug with OnPendingOrderCreated event?
11 Oct 2013, 14:34


Hi,

 

I've been trying to a bot to help take some of the manual effort out of my trading strategies and found that the  OnPendingOrderCreated event wasn't behaving as expected:

 

Running a bot with the following code:

using System;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
using cAlgo.API.Requests;
using cAlgo.Indicators;

namespace cAlgo.Robots
{
    [Robot(TimeZone = TimeZones.UTC)]
    public class NewRobot : Robot
    {
        protected override void OnPendingOrderCreated(PendingOrder newOrder)
        {
            Print("Pending order is now created");
            //It will be triggered when a pending order is created
        }
    }
}

I was expecting that when I manually create a pending order, it would trigger the event and print the message to the log....but nothing happens.

 

To test it the behavior from another angle, I tried out the OnPositionOpened event and it responded to manually created -market- orders.

 

I'm trying to have a piece of code ran upon entry of a pending order......am I missing something? is the event not working as expected? is there another way to achieve this?


@ERP1
Replies

Spotware
11 Oct 2013, 16:54

Right now the events are raised when positions/orders are created by the robot. But we plan to introduce new events that can be used for all positions/orders.
 


@Spotware

ERP1
16 Oct 2013, 11:52

Thanks! I'll look forward to it!


@ERP1