|
NFA Accounts: Pending to Filled
#468807
10/21/17 03:23
10/21/17 03:23
|
Joined: Feb 2017
Posts: 1,725 Chicago
AndrewAMD
OP
Serious User
|
OP
Serious User
Joined: Feb 2017
Posts: 1,725
Chicago
|
jcl, I have a broker plugin question regarding NFA accounts.
Zorro distinguishes between “orders” and “trades”. On NFA accounts, there technically are no trades, only orders and positions.
In the plugin, I get a BrokerBuy call. If the order is placed (instantly in pending mode), I return a trade ID from a counter. And normally, the order will eventually get filled, but not exactly at the most recently quoted price. As in: it might be a series of partial fills at different prices whose average will be close to but not equal to the most recently quoted price.
Is there a way to designate the order as: “pending, please confirm actual transaction later”? If not, I’d be interested in a new function such as “BrokerFill”, to verify fill status.
|
|
|
Re: NFA Accounts: Pending to Filled
[Re: jcl]
#468815
10/21/17 12:30
10/21/17 12:30
|
Joined: Feb 2017
Posts: 1,725 Chicago
AndrewAMD
OP
Serious User
|
OP
Serious User
Joined: Feb 2017
Posts: 1,725
Chicago
|
Good! For context, I will note the different fill cases that are enumerated. In FIXML:
enum FixmlOrdStatus_enum_t
{
os_New = '0',
os_PartiallyFilled = '1',
os_Filled = '2',
os_DoneForDay = '3',
os_Canceled = '4',
os_PendingCancel = '6',
os_Stopped = '7',
os_Rejected = '8',
os_Suspended = '9',
os_PendingNew = 'A',
os_Calculated = 'B',
os_Expired = 'C',
os_AcceptedForBidding = 'D',
os_PendingReplace = 'E',
};
In Sierra Chart's DTC protocol:
enum OrderStatusEnum : int32_t
{ ORDER_STATUS_UNSPECIFIED = 0
, ORDER_STATUS_ORDER_SENT = 1
, ORDER_STATUS_PENDING_OPEN = 2
, ORDER_STATUS_PENDING_CHILD = 3
, ORDER_STATUS_OPEN = 4
, ORDER_STATUS_PENDING_CANCEL_REPLACE = 5
, ORDER_STATUS_PENDING_CANCEL = 6
, ORDER_STATUS_FILLED = 7
, ORDER_STATUS_CANCELED = 8
, ORDER_STATUS_REJECTED = 9
, ORDER_STATUS_PARTIALLY_FILLED = 10
};
I do not think **all** of these should be accounted for, just enough of them. Thanks! Andrew
|
|
|
Re: NFA Accounts: Pending to Filled
[Re: jcl]
#468825
10/22/17 13:01
10/22/17 13:01
|
Joined: Feb 2017
Posts: 1,725 Chicago
AndrewAMD
OP
Serious User
|
OP
Serious User
Joined: Feb 2017
Posts: 1,725
Chicago
|
It normally would be the BrokerTrade function. You can use it for returning the fill price. But for some reason it currently works for non-NFA accounts only. I've noted to make it work also for NFA accounts in the next version. jcl, this solution would appear to confirm fill status for orders to open a position. Does it also confirm fill status for orders to close a position? This would also be useful.
|
|
|
Re: NFA Accounts: Pending to Filled
[Re: AndrewAMD]
#468844
10/23/17 14:29
10/23/17 14:29
|
Joined: Jul 2017
Posts: 784
Zheka
User
|
User
Joined: Jul 2017
Posts: 784
|
Hi, Andrew, In the plugin, I get a BrokerBuy call. If the order is placed (instantly in pending mode), I return a trade ID from a counter. And normally, the order will eventually get filled, but not exactly at the most recently quoted price. As in: it might be a series of partial fills at different prices whose average will be close to but not equal to the most recently quoted price. It would be useful to get the actual OrderId at the broker, rather then an artificial internal trade counter. Same for actual order fill prices (rather then the quoted ask/bid at the time of placing an order).
|
|
|
Re: NFA Accounts: Pending to Filled
[Re: AndrewAMD]
#468853
10/23/17 16:58
10/23/17 16:58
|
Joined: Jul 2017
Posts: 784
Zheka
User
|
User
Joined: Jul 2017
Posts: 784
|
Sadly, this is not always the case. Ally Invest gives me an order ID - it’s a string with two letters, a dash, and then a series of numbers. In case of SierraChart, it is quite safe to assume that OrderIDs reported via DTC would conform to the same convention. Most SC broker integrations are based on FIX.
|
|
|
|