Skip to content

PendingOrderCancellationReason

Summary

The reason for the order cancellation.

Signature

1
public enum PendingOrderCancellationReason

Namespace

cAlgo.API

Fields

Name Description
Cancelled THe order was cancelled by trader.
Expired The order was cancelled due to expiration.
Rejected The order fill was rejected and the order was cancelled.

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


Last update: July 1, 2022

Comments