-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtick_type.go
230 lines (225 loc) · 6.88 KB
/
tick_type.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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
package ibapi
// TickType is the type of ticks.
type TickType = int64
const (
BID_SIZE TickType = iota
BID
ASK
ASK_SIZE
LAST
LAST_SIZE
HIGH
LOW
VOLUME
CLOSE
BID_OPTION_COMPUTATION
ASK_OPTION_COMPUTATION
LAST_OPTION_COMPUTATION
MODEL_OPTION
OPEN
LOW_13_WEEK
HIGH_13_WEEK
LOW_26_WEEK
HIGH_26_WEEK
LOW_52_WEEK
HIGH_52_WEEK
AVG_VOLUME
OPEN_INTEREST
OPTION_HISTORICAL_VOL
OPTION_IMPLIED_VOL
OPTION_BID_EXCH
OPTION_ASK_EXCH
OPTION_CALL_OPEN_INTEREST
OPTION_PUT_OPEN_INTEREST
OPTION_CALL_VOLUME
OPTION_PUT_VOLUME
INDEX_FUTURE_PREMIUM
BID_EXCH
ASK_EXCH
AUCTION_VOLUME
AUCTION_PRICE
AUCTION_IMBALANCE
MARK_PRICE
BID_EFP_COMPUTATION
ASK_EFP_COMPUTATION
LAST_EFP_COMPUTATION
OPEN_EFP_COMPUTATION
HIGH_EFP_COMPUTATION
LOW_EFP_COMPUTATION
CLOSE_EFP_COMPUTATION
LAST_TIMESTAMP
SHORTABLE
FUNDAMENTAL_RATIOS
RT_VOLUME
HALTED
BID_YIELD
ASK_YIELD
LAST_YIELD
CUST_OPTION_COMPUTATION
TRADE_COUNT
TRADE_RATE
VOLUME_RATE
LAST_RTH_TRADE
RT_HISTORICAL_VOL
IB_DIVIDENDS
BOND_FACTOR_MULTIPLIER
REGULATORY_IMBALANCE
NEWS_TICK
SHORT_TERM_VOLUME_3_MIN
SHORT_TERM_VOLUME_5_MIN
SHORT_TERM_VOLUME_10_MIN
DELAYED_BID
DELAYED_ASK
DELAYED_LAST
DELAYED_BID_SIZE
DELAYED_ASK_SIZE
DELAYED_LAST_SIZE
DELAYED_HIGH
DELAYED_LOW
DELAYED_VOLUME
DELAYED_CLOSE
DELAYED_OPEN
RT_TRD_VOLUME
CREDITMAN_MARK_PRICE
CREDITMAN_SLOW_MARK_PRICE
DELAYED_BID_OPTION
DELAYED_ASK_OPTION
DELAYED_LAST_OPTION
DELAYED_MODEL_OPTION
LAST_EXCH
LAST_REG_TIME
FUTURES_OPEN_INTEREST
AVG_OPT_VOLUME
DELAYED_LAST_TIMESTAMP
SHORTABLE_SHARES
DELAYED_HALTED
REUTERS_2_MUTUAL_FUNDS
ETF_NAV_CLOSE
ETF_NAV_PRIOR_CLOSE
ETF_NAV_BID
ETF_NAV_ASK
ETF_NAV_LAST
ETF_FROZEN_NAV_LAST
ETF_NAV_HIGH
ETF_NAV_LOW
SOCIAL_MARKET_ANALYTICS
ESTIMATED_IPO_MIDPOINT
FINAL_IPO_LAST
DELAYED_YIELD_BID
DELAYED_YIELD_ASK
NOT_SET
)
func TickName(t TickType) string {
return tickTypeMap[t]
}
var tickTypeMap = map[TickType]string{
BID_SIZE: "BID_SIZE",
BID: "BID",
ASK: "ASK",
ASK_SIZE: "ASK_SIZE",
LAST: "LAST",
LAST_SIZE: "LAST_SIZE",
HIGH: "HIGH",
LOW: "LOW",
VOLUME: "VOLUME",
CLOSE: "CLOSE",
BID_OPTION_COMPUTATION: "BID_OPTION_COMPUTATION",
ASK_OPTION_COMPUTATION: "ASK_OPTION_COMPUTATION",
LAST_OPTION_COMPUTATION: "LAST_OPTION_COMPUTATION",
MODEL_OPTION: "MODEL_OPTION",
OPEN: "OPEN",
LOW_13_WEEK: "LOW_13_WEEK",
HIGH_13_WEEK: "HIGH_13_WEEK",
LOW_26_WEEK: "LOW_26_WEEK",
HIGH_26_WEEK: "HIGH_26_WEEK",
LOW_52_WEEK: "LOW_52_WEEK",
HIGH_52_WEEK: "HIGH_52_WEEK",
AVG_VOLUME: "AVG_VOLUME",
OPEN_INTEREST: "OPEN_INTEREST",
OPTION_HISTORICAL_VOL: "OPTION_HISTORICAL_VOL",
OPTION_IMPLIED_VOL: "OPTION_IMPLIED_VOL",
OPTION_BID_EXCH: "OPTION_BID_EXCH",
OPTION_ASK_EXCH: "OPTION_ASK_EXCH",
OPTION_CALL_OPEN_INTEREST: "OPTION_CALL_OPEN_INTEREST",
OPTION_PUT_OPEN_INTEREST: "OPTION_PUT_OPEN_INTEREST",
OPTION_CALL_VOLUME: "OPTION_CALL_VOLUME",
OPTION_PUT_VOLUME: "OPTION_PUT_VOLUME",
INDEX_FUTURE_PREMIUM: "INDEX_FUTURE_PREMIUM",
BID_EXCH: "BID_EXCH",
ASK_EXCH: "ASK_EXCH",
AUCTION_VOLUME: "AUCTION_VOLUME",
AUCTION_PRICE: "AUCTION_PRICE",
AUCTION_IMBALANCE: "AUCTION_IMBALANCE",
MARK_PRICE: "MARK_PRICE",
BID_EFP_COMPUTATION: "BID_EFP_COMPUTATION",
ASK_EFP_COMPUTATION: "ASK_EFP_COMPUTATION",
LAST_EFP_COMPUTATION: "LAST_EFP_COMPUTATION",
OPEN_EFP_COMPUTATION: "OPEN_EFP_COMPUTATION",
HIGH_EFP_COMPUTATION: "HIGH_EFP_COMPUTATION",
LOW_EFP_COMPUTATION: "LOW_EFP_COMPUTATION",
CLOSE_EFP_COMPUTATION: "CLOSE_EFP_COMPUTATION",
LAST_TIMESTAMP: "LAST_TIMESTAMP",
SHORTABLE: "SHORTABLE",
FUNDAMENTAL_RATIOS: "FUNDAMENTAL_RATIOS",
RT_VOLUME: "RT_VOLUME",
HALTED: "HALTED",
BID_YIELD: "BID_YIELD",
ASK_YIELD: "ASK_YIELD",
LAST_YIELD: "LAST_YIELD",
CUST_OPTION_COMPUTATION: "CUST_OPTION_COMPUTATION",
TRADE_COUNT: "TRADE_COUNT",
TRADE_RATE: "TRADE_RATE",
VOLUME_RATE: "VOLUME_RATE",
LAST_RTH_TRADE: "LAST_RTH_TRADE",
RT_HISTORICAL_VOL: "RT_HISTORICAL_VOL",
IB_DIVIDENDS: "IB_DIVIDENDS",
BOND_FACTOR_MULTIPLIER: "BOND_FACTOR_MULTIPLIER",
REGULATORY_IMBALANCE: "REGULATORY_IMBALANCE",
NEWS_TICK: "NEWS_TICK",
SHORT_TERM_VOLUME_3_MIN: "SHORT_TERM_VOLUME_3_MIN",
SHORT_TERM_VOLUME_5_MIN: "SHORT_TERM_VOLUME_5_MIN",
SHORT_TERM_VOLUME_10_MIN: "SHORT_TERM_VOLUME_10_MIN",
DELAYED_BID: "DELAYED_BID",
DELAYED_ASK: "DELAYED_ASK",
DELAYED_LAST: "DELAYED_LAST",
DELAYED_BID_SIZE: "DELAYED_BID_SIZE",
DELAYED_ASK_SIZE: "DELAYED_ASK_SIZE",
DELAYED_LAST_SIZE: "DELAYED_LAST_SIZE",
DELAYED_HIGH: "DELAYED_HIGH",
DELAYED_LOW: "DELAYED_LOW",
DELAYED_VOLUME: "DELAYED_VOLUME",
DELAYED_CLOSE: "DELAYED_CLOSE",
DELAYED_OPEN: "DELAYED_OPEN",
RT_TRD_VOLUME: "RT_TRD_VOLUME",
CREDITMAN_MARK_PRICE: "CREDITMAN_MARK_PRICE",
CREDITMAN_SLOW_MARK_PRICE: "CREDITMAN_SLOW_MARK_PRICE",
DELAYED_BID_OPTION: "DELAYED_BID_OPTION",
DELAYED_ASK_OPTION: "DELAYED_ASK_OPTION",
DELAYED_LAST_OPTION: "DELAYED_LAST_OPTION",
DELAYED_MODEL_OPTION: "DELAYED_MODEL_OPTION",
LAST_EXCH: "LAST_EXCH",
LAST_REG_TIME: "LAST_REG_TIME",
FUTURES_OPEN_INTEREST: "FUTURES_OPEN_INTEREST",
AVG_OPT_VOLUME: "AVG_OPT_VOLUME",
DELAYED_LAST_TIMESTAMP: "DELAYED_LAST_TIMESTAMP",
SHORTABLE_SHARES: "SHORTABLE_SHARES",
DELAYED_HALTED: "DELAYED_HALTED",
REUTERS_2_MUTUAL_FUNDS: "REUTERS_2_MUTUAL_FUNDS",
ETF_NAV_CLOSE: "ETF_NAV_CLOSE",
ETF_NAV_PRIOR_CLOSE: "ETF_NAV_PRIOR_CLOSE",
ETF_NAV_BID: "ETF_NAV_BID",
ETF_NAV_ASK: "ETF_NAV_ASK",
ETF_NAV_LAST: "ETF_NAV_LAST",
ETF_FROZEN_NAV_LAST: "ETF_FROZEN_NAV_LAST",
ETF_NAV_HIGH: "ETF_NAV_HIGH",
ETF_NAV_LOW: "ETF_NAV_LOW",
SOCIAL_MARKET_ANALYTICS: "SOCIAL_MARKET_ANALYTICS",
ESTIMATED_IPO_MIDPOINT: "ESTIMATED_IPO_MIDPOINT",
FINAL_IPO_LAST: "FINAL_IPO_LAST",
DELAYED_YIELD_BID: "DELAYED_YIELD_BID",
DELAYED_YIELD_ASK: "DELAYED_YIELD_ASK",
NOT_SET: "NOT_SET",
}
func IsPrice(tickType TickType) bool {
return tickType == BID || tickType == ASK || tickType == LAST || tickType == DELAYED_BID || tickType == DELAYED_ASK || tickType == DELAYED_LAST
}