Skip to content

PendingOrderFilledEventArgs

class cAlgo.API

DesktopCLICloud

Provides data for the pending order fill event.

Definition

public class PendingOrderFilledEventArgs

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.Filled += PendingOrdersOnFilled;
        PlaceStopOrder(TradeType.Buy, Symbol.Name, 10000, Symbol.Ask);
    }

    private void PendingOrdersOnFilled(PendingOrderFilledEventArgs args)
    {
        Print($"Pending order with id {args.PendingOrder.Id} was filled, position id  is {args.Position.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.Filled += self.on_pending_orders_filled
        api.PlaceStopOrder(TradeType.Buy, api.Symbol.Name, 10000, api.Symbol.Ask)

    def on_pending_orders_filled(self, args):
        print(f"Pending order with id {args.PendingOrder.Id} was filled, position id  is {args.Position.Id}")
{
  "AccessRights": "None",
  "AddIndicators": true
}

Properties

Name Description
PendingOrderDesktopCLICloudPendingOrder Gets the pending order that was filled.
PositionDesktopCLICloudPosition Gets the position that was filled from the pending order.

See also