Order Cancel Reject Event
Called whenever an order cancellation is rejected for any reason. A cancellation may be rejected if the order has already been filled, or if the exchange does not allow the cancellation.
Interface: def on_cancel_reject(self,
event,
md,
order,
service,
account):
pass
Name | Type | Information |
---|---|---|
account_id | integer | The account id of the order event. Will be the same as account id of the script. |
clordid | string | Client Order Id in FIX. Is generated when the order is sent. Will be the same on executions. |
instruction_id | string | Unique GUID for the instance of the script that generated the initial order. Will be None if the initial order wasn't started from same machine (e.g. from trading client) |
intent | string | The intent attribute you set in the order that generated this event. |
kind | integer | Event enum (7) representing the kind of event. *LIVE AND FORWARD ONLY*, represents the type of event (trade, quote, news, imbalance etc) |
line_number | string | line_number is the line in your strategy script where the order was placed that generated this event. Can be used to help debug order behavior |
order_algorithm | string | The order_algorithm GUID you set in the order that generated this event. This can be useful in debugging order behavior. |
order_id | string | Unique GUID of order having its cancel rejected (very similar clordid). Will be None if the initial order wasn't started from same machine (e.g. from trading client) |
price | float | Price of the order/cancel reject. |
reason | string | Reason the cancel was rejected (if passed thru). |
script_class_name | string | script_class_name represents the name of your Strategy class that placed the order that generated this event. Can be used to help debug order behavior |
script_id | string | GUID of the script. Will be None if the initial order wasn't started from same machine (e.g. from trading client) |
shares | integer | Shares being rejected for canceled. May differ from order shares if partially filled |
state | string | Order Message's States |
symbol | string | Event Symbol. In most cases symbol is obvious (self.symbol, md.symbol). If the script has subscribed to multiple symbols events, then event.symbol should be used to identify the symbol. |
timestamp | muts | Timestamp of the event. |
user_key | string | user_key set on the order. Can be used to identify trades that go together (pairs/batch/strategy). account object can be filtered on user_key |
Console