Skip to content

PendingOrderCancellationReason

Summary

The reason for the order cancellation.

Signature

1
public enum PendingOrderCancellationReason

Namespace

cAlgo.API

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
 using cAlgo.API;
 namespace cAlgo.Robots
 {
     // This sample shows how to use PendingOrderCancellationReason
     [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
     public class PendingOrderCancellationReasonSample : Robot
     {
         protected override void OnStart()
         {
             PendingOrders.Cancelled += PendingOrders_Cancelled;
         }
         private void PendingOrders_Cancelled(PendingOrderCancelledEventArgs obj)
         {
             Print(obj.Reason);
             switch (obj.Reason)
             {
                 case PendingOrderCancellationReason.Cancelled:
                     // Do something if order cancelled
                     break;
                 case PendingOrderCancellationReason.Expired:
                     // Do something if order expired
                     break;
                 case PendingOrderCancellationReason.Rejected:
                     // Do something if order rejected
                     break;
             }
         }
     }
 }

See Also

Fields

Cancelled

Summary

THe order was cancelled by trader.

Signature

1
public static PendingOrderCancellationReason Cancelled;

Return Value

PendingOrderCancellationReason

Expired

Summary

The order was cancelled due to expiration.

Signature

1
public static PendingOrderCancellationReason Expired;

Return Value

PendingOrderCancellationReason

Rejected

Summary

The order fill was rejected and the order was cancelled.

Signature

1
public static PendingOrderCancellationReason Rejected;

Return Value

PendingOrderCancellationReason