Skip to content

PendingOrders

Summary

Provides access to methods of the Pending Orders collection

Signature

1
public abstract interface PendingOrders

Namespace

cAlgo.API

See Also

Properties

Item

Signature

1
public abstract PendingOrder Item {get;}

Return Value

PendingOrder

Count

Summary

Total number of pending orders

Signature

1
public abstract int Count {get;}

Return Value

int

Examples

1
 var totalOrders = PendingOrders.Count;

Events

Created

Summary

Occurs when pending order is created

Signature

1
public abstract event Action<PendingOrderCreatedEventArgs> Created;

Examples

1
2
3
4
5
6
7
8
9
 protected override void OnStart()
 {
     PendingOrders.Created += PendingOrdersOnCreated;
     PlaceStopOrder(TradeType.Buy, Symbol, 10000, Symbol.Ask + 10 * Symbol.PipSize);
 }
 private void PendingOrdersOnCreated(PendingOrderCreatedEventArgs args)
 {
     Print("Pending order with id {0} was created", args.PendingOrder.Id);
 }

Modified

Summary

Occurs when pending order is modified

Signature

1
public abstract event Action<PendingOrderModifiedEventArgs> Modified;

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
 protected override void OnStart()
 {
     PendingOrders.Modified += PendingOrdersOnModified;
     var result = PlaceStopOrder(TradeType.Buy, Symbol, 10000, Symbol.Ask + 10 * Symbol.PipSize);
     ModifyPendingOrder(result.PendingOrder, Symbol.Ask + 20 * Symbol.PipSize ,null, null, null);
 }
 private void PendingOrdersOnModified(PendingOrderModifiedEventArgs args)
 {
     Print("Pending order with id {0} was modifed", args.PendingOrder.Id);
 }

Cancelled

Summary

Occurs when pending order is cancelled

Signature

1
public abstract event Action<PendingOrderCancelledEventArgs> Cancelled;

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
 protected override void OnStart()
 {
     PendingOrders.Cancelled += PendingOrdersOnCancelled;
     var result = PlaceStopOrder(TradeType.Buy, Symbol, 10000, Symbol.Ask + 10 * Symbol.PipSize);
     CancelPendingOrder(result.PendingOrder);
 }
 private void PendingOrdersOnCancelled(PendingOrderCancelledEventArgs args)
 {
    Print("Pending order with id {0} was cancelled. Reason: {1}", args.PendingOrder.Id, args.Reason);
 }

Filled

Summary

Occurs when pending order is filled

Signature

1
public abstract event Action<PendingOrderFilledEventArgs> Filled;

Examples

1
2
3
4
5
6
7
8
9
 protected override void OnStart()
 {
     PendingOrders.Filled += PendingOrdersOnFilled;
     PlaceStopOrder(TradeType.Buy, Symbol, 10000, Symbol.Ask);
 }
 private void PendingOrdersOnFilled(PendingOrderFilledEventArgs args)
 {
     Print("Pending order with id {0} was filled, position id  is {1}", args.PendingOrder.Id, args.Position.Id);
 }