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?

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