Skip to content

PendingOrderCreatedEventArgs

Summary

Provides data for the pending order creation events.

Signature

1
public class PendingOrderCreatedEventArgs

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.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);
     }
 }
 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.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")

See Also

Properties

PendingOrder

Summary

Gets the pending order that was created.

Signature

1
public PendingOrder PendingOrder {get;}

Return Value

PendingOrder