PendingOrders
Summary
Provides access to methods of the Pending Orders collection
Signature
| public abstract interface PendingOrders
|
Namespace
cAlgo.API
See Also
Properties
Item
Signature
| public abstract PendingOrder Item {get;}
|
Return Value
PendingOrder
Count
Summary
Total number of pending orders
Signature
| public abstract int Count {get;}
|
Return Value
int
Examples
| var totalOrders = PendingOrders.Count;
|
Events
Created
Summary
Occurs when pending order is created
Signature
| public abstract event Action<PendingOrderCreatedEventArgs> Created;
|
Examples
| 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
| public abstract event Action<PendingOrderModifiedEventArgs> Modified;
|
Examples
| 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
| public abstract event Action<PendingOrderCancelledEventArgs> Cancelled;
|
Examples
| 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
| public abstract event Action<PendingOrderFilledEventArgs> Filled;
|
Examples
| 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);
}
|