/
order_schema.go
156 lines (142 loc) · 7.09 KB
/
order_schema.go
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
package tdam
type Order struct {
Session string `json:"session"` // 'NORMAL' or 'AM' or 'PM' or 'SEAMLESS'
Duration string `json:"duration"` //: "'DAY' or 'GOOD_TILL_CANCEL' or 'FILL_OR_KILL'",
OrderType string `json:"orderType"` //: "'MARKET' or 'LIMIT' or 'STOP' or 'STOP_LIMIT' or 'TRAILING_STOP' or 'MARKET_ON_CLOSE' or 'EXERCISE' or 'TRAILING_STOP_LIMIT' or 'NET_DEBIT' or 'NET_CREDIT' or 'NET_ZERO'",
CancelTime interface{} `json:"cancelTime"`
ComplexOrderStrategyType string `json:"complexOrderStrategyType"` // 'NONE' or 'COVERED' or 'VERTICAL' or 'BACK_RATIO' or 'CALENDAR' or 'DIAGONAL' or 'STRADDLE' or 'STRANGLE' or 'COLLAR_SYNTHETIC' or 'BUTTERFLY' or 'CONDOR' or 'IRON_CONDOR' or 'VERTICAL_ROLL' or 'COLLAR_WITH_STOCK' or 'DOUBLE_DIAGONAL' or 'UNBALANCED_BUTTERFLY' or 'UNBALANCED_CONDOR' or 'UNBALANCED_IRON_CONDOR' or 'UNBALANCED_VERTICAL_ROLL' or 'CUSTOM'
Quantity int `json:"quantity"`
FilledQuantity int `json:"filledQuantity"`
RemainingQuantity int `json:"remainingQuantity"`
RequestedDestination string `json:"requestedDestination"` // 'INET' or 'ECN_ARCA' or 'CBOE' or 'AMEX' or 'PHLX' or 'ISE' or 'BOX' or 'NYSE' or 'NASDAQ' or 'BATS' or 'C2' or 'AUTO'
DestinationLinkName string `json:"destinationLinkName"` // string
ReleaseTime string `json:"releaseTime"` // string
StopPrice int `json:"stopPrice"`
StopPriceLinkBasis string `json:"stopPriceLinkBasis"` // 'MANUAL' or 'BASE' or 'TRIGGER' or 'LAST' or 'BID' or 'ASK' or 'ASK_BID' or 'MARK' or 'AVERAGE'
StopPriceLinkType string `json:"stopPriceLinkType"` // 'VALUE' or 'PERCENT' or 'TICK'
StopPriceOffset int `json:"stopPriceOffset"`
StopType string `json:"stopType"` // 'STANDARD' or 'BID' or 'ASK' or 'LAST' or 'MARK'
PriceLinkBasis string `json:"priceLinkBasis"` // 'MANUAL' or 'BASE' or 'TRIGGER' or 'LAST' or 'BID' or 'ASK' or 'ASK_BID' or 'MARK' or 'AVERAGE'
PriceLinkType string `json:"priceLinkType"` // 'VALUE' or 'PERCENT' or 'TICK'
Price int `json:"price"`
TaxLotMethod string `json:"taxLotMethod"` // 'FIFO' or 'LIFO' or 'HIGH_COST' or 'LOW_COST' or 'AVERAGE_COST' or 'SPECIFIC_LOT'
OrderLegCollection []OrderLegCollection `json:"orderLegCollection"`
ActivationPrice int `json:"activationPrice"`
SpecialInstruction string `json:"specialInstruction"` // 'ALL_OR_NONE' or 'DO_NOT_REDUCE' or 'ALL_OR_NONE_DO_NOT_REDUCE'
OrderStrategyType string `json:"orderStrategyType"` // 'SINGLE' or 'OCO' or 'TRIGGER'
OrderId int `json:"orderId"`
Cancelable bool `json:"cancelable"`
Editable bool `json:"editable"`
Status string `json:"status"` // 'AWAITING_PARENT_ORDER' or 'AWAITING_CONDITION' or 'AWAITING_MANUAL_REVIEW' or 'ACCEPTED' or 'AWAITING_UR_OUT' or 'PENDING_ACTIVATION' or 'QUEUED' or 'WORKING' or 'REJECTED' or 'PENDING_CANCEL' or 'CANCELED' or 'PENDING_REPLACE' or 'REPLACED' or 'FILLED' or 'EXPIRED'
EnteredTime string `json:"enteredTime"` // string
CloseTime string `json:"closeTime"` // string
Tag string `json:"tag"` // string
AccountId int `json:"accountId"`
/*
"orderActivityCollection": [
"The type <OrderActivity> has the following subclasses [Execution] descriptions are listed below"
],
"replacingOrderCollection": [
{}
],
"childOrderStrategies": [
{}
],
*/
StatusDescription string `json:"statusDescription"` // string
}
type OrderLegCollection struct {
OrderLegType string `json:"orderLegType"` // 'EQUITY' or 'OPTION' or 'INDEX' or 'MUTUAL_FUND' or 'CASH_EQUIVALENT' or 'FIXED_INCOME' or 'CURRENCY'
LegId int `json:"legId"`
Instrument string `json:"instrument"` // The type <Instrument> has the following subclasses [Option, MutualFund, CashEquivalent, Equity, FixedIncome] descriptions are listed below\"
Instruction string `json:"instruction"` // 'BUY' or 'SELL' or 'BUY_TO_COVER' or 'SELL_SHORT' or 'BUY_TO_OPEN' or 'BUY_TO_CLOSE' or 'SELL_TO_OPEN' or 'SELL_TO_CLOSE' or 'EXCHANGE'
PositionEffect string `json:"positionEffect"` // 'OPENING' or 'CLOSING' or 'AUTOMATIC'
Quantity int `json:"quantity"`
QuantityType string `json:"quantityType"` // 'ALL_SHARES' or 'DOLLARS' or 'SHARES'
}
/*
//The class <Instrument> has the
//following subclasses:
//-Option
//-MutualFund
//-CashEquivalent
//-Equity
//-FixedIncome
//JSON for each are listed below:
//Option:
{
"assetType": "'EQUITY' or 'OPTION' or 'INDEX' or 'MUTUAL_FUND' or 'CASH_EQUIVALENT' or 'FIXED_INCOME' or 'CURRENCY'",
"cusip": "string",
"symbol": "string",
"description": "string",
"type": "'VANILLA' or 'BINARY' or 'BARRIER'",
"putCall": "'PUT' or 'CALL'",
"underlyingSymbol": "string",
"optionMultiplier": 0,
"optionDeliverables": [
{
"symbol": "string",
"deliverableUnits": 0,
"currencyType": "'USD' or 'CAD' or 'EUR' or 'JPY'",
"assetType": "'EQUITY' or 'OPTION' or 'INDEX' or 'MUTUAL_FUND' or 'CASH_EQUIVALENT' or 'FIXED_INCOME' or 'CURRENCY'"
}
]
}
//OR
//MutualFund:
{
"assetType": "'EQUITY' or 'OPTION' or 'INDEX' or 'MUTUAL_FUND' or 'CASH_EQUIVALENT' or 'FIXED_INCOME' or 'CURRENCY'",
"cusip": "string",
"symbol": "string",
"description": "string",
"type": "'NOT_APPLICABLE' or 'OPEN_END_NON_TAXABLE' or 'OPEN_END_TAXABLE' or 'NO_LOAD_NON_TAXABLE' or 'NO_LOAD_TAXABLE'"
}
//OR
//CashEquivalent:
{
"assetType": "'EQUITY' or 'OPTION' or 'INDEX' or 'MUTUAL_FUND' or 'CASH_EQUIVALENT' or 'FIXED_INCOME' or 'CURRENCY'",
"cusip": "string",
"symbol": "string",
"description": "string",
"type": "'SAVINGS' or 'MONEY_MARKET_FUND'"
}
//OR
//Equity:
{
"assetType": "'EQUITY' or 'OPTION' or 'INDEX' or 'MUTUAL_FUND' or 'CASH_EQUIVALENT' or 'FIXED_INCOME' or 'CURRENCY'",
"cusip": "string",
"symbol": "string",
"description": "string"
}
//OR
//FixedIncome:
{
"assetType": "'EQUITY' or 'OPTION' or 'INDEX' or 'MUTUAL_FUND' or 'CASH_EQUIVALENT' or 'FIXED_INCOME' or 'CURRENCY'",
"cusip": "string",
"symbol": "string",
"description": "string",
"maturityDate": "string",
"variableRate": 0,
"factor": 0
}
//The class <OrderActivity> has the
//following subclasses:
//-Execution
//JSON for each are listed below:
//Execution:
{
"activityType": "'EXECUTION' or 'ORDER_ACTION'",
"executionType": "'FILL'",
"quantity": 0,
"orderRemainingQuantity": 0,
"executionLegs": [
{
"legId": 0,
"quantity": 0,
"mismarkedQuantity": 0,
"price": 0,
"time": "string"
}
]
}
*/