Skip to content

PendingOrderCreatedEventArgs

class cAlgo.API

DesktopCLICloud

Provides data for the pending order creation events.

Definition

public class PendingOrderCreatedEventArgs

Namespace: cAlgo.API · Group: EventArgs

Examples

using cAlgo.API;
using cAlgo.API.Internals;

namespace cAlgo.Robots;

public partial class Test : Robot
{
    protected override void OnStart()
    {
        PendingOrders.Created += PendingOrdersOnCreated;
        PlaceStopOrder(TradeType.Buy, Symbol.Name, 10000, Symbol.Ask + 10 * Symbol.PipSize);
    }

    private void PendingOrdersOnCreated(PendingOrderCreatedEventArgs args)
    {
        Print("Pending order with id {0} was created", args.PendingOrder.Id);
    }
}
import clr

clr.AddReference("cAlgo.API")

# Import cAlgo API types
from cAlgo.API import *
# Import trading wrapper functions
from robot_wrapper import *

class Test():
    def on_start(self):
        api.PendingOrders.Created += self.on_pending_orders_created
        api.PlaceStopOrder(TradeType.Buy, api.Symbol.Name, 10000, api.Symbol.Ask + 10 * api.Symbol.PipSize)

    def on_pending_orders_created(self, args):
        print(f"Pending order with id {args.PendingOrder.Id} was created")
{
  "AccessRights": "None",
  "AddIndicators": true
}

Properties

Name Description
PendingOrderDesktopCLICloudPendingOrder Gets the pending order that was created.

See also