Skip to content

PendingOrderFilledEventArgs

Summary

Provides data for the pending order fill event.

Signature

1
public class PendingOrderFilledEventArgs

Namespace

cAlgo.API

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
 using cAlgo.API;
 using cAlgo.API.Internals;
 namespace cAlgo.Robots;
 [Robot(AccessRights = AccessRights.None, AddIndicators = true)]
 public 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}");
     }
 }
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
 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}")

See Also

Properties

PendingOrder

Summary

Gets the pending order that was filled.

Signature

1
public PendingOrder PendingOrder {get;}

Return Value

PendingOrder

Position

Summary

Gets the position that was filled from the pending order.

Signature

1
public Position Position {get;}

Return Value

Position