-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmarket-data_types.go
261 lines (249 loc) · 7.52 KB
/
market-data_types.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
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
package trader
type Candle struct {
Time int `json:"datetime"`
Volume int
Open float64
Close float64
Hi float64 `json:"high"`
Lo float64 `json:"low"`
}
type Quote struct {
AssetMainType string
AssetSubType string
QuoteType string
RealTime bool
SSID int `json:"ssid"`
Symbol string
Hi52 float64 `json:"52WeekHigh"`
Lo52 float64 `json:"52WeekLow"`
AskMICId string
AskPrice float64
AskSize int
AskTime int
BidMICId string
BidPrice float64
BidSize int
BidTime int
Close float64 `json:"closePrice"`
HiPrice float64 `json:"highPrice"`
LastMICId string
LastPrice float64
LastSize int
LoPrice float64 `json:"lowPrice"`
Mark float64 `json:"mark"`
MarkChange float64
MarkPercentChange float64
NetChange float64
NetPercentChange float64
Open float64
PostMarketChange float64
PostMarketPercentChange float64
QuoteTime int
SecurityStatus string
TotalVolume int
TradeTime int
}
type SimpleInstrument struct {
Cusip string
Symbol string
Description string
Exchange string
AssetType string
}
// Change this to reflect ordering of schwab return
type FundamentalInstrument struct {
Symbol string
Cusip string
Description string
Exchange string
AssetType string
Hi52 float64 `json:"high52"`
Lo52 float64 `json:"low52"`
DividendYield float64
DividendAmount float64
DividendDate string
PE float64 `json:"peRatio"`
PEG float64 `json:"pegRatio"`
PB float64 `json:"pbRatio"`
PR float64 `json:"prRatio"`
PCF float64 `json:"pcfRatio"`
GrossMarginTTM float64
NetMarginTTM float64
OperatingMarginTTM float64
GrossMarginMRQ float64
NetProfitMarginMRQ float64
OperatingMarginMRQ float64
ROE float64 `json:"returnOnEquity"`
ROA float64 `json:"returnOnAssets"`
ROI float64 `json:"returnOnInvestment"`
QuickRatio float64
CurrentRatio float64
InterestCoverage float64
TotalDebtToCapital float64
LtDebtToEquity float64
TotalDebtToEquity float64
EpsTTM float64
EpsChangePercentTTM float64
EpsChangeYear float64
EpsChange float64
RevChangeYear float64
RevChangeTTM float64
RevChangeIn float64
SharesOutstanding float64
MarketCapFloat float64
MarketCap float64
BookValuePerShare float64
ShortIntToFloat float64
ShortIntDayToCover float64
DividendGrowthRate3Year float64
DividendPayAmount float64
DividendPayDate string
Beta float64
Vol1DayAvg float64
Vol10DayAvg float64
Vol3MonthAvg float64
Avg1DayVolume int
Avg10DaysVolume int
Avg3MonthVolume int
DeclarationDate string
DividendFreq int
Eps float64
DtnVolume int
NextDividendPayDate string
NextDividendDate string
FundLeverageFactor float64
}
type Screener struct {
Symbol string
Description string
Volume int
LastPrice float64
NetChange float64
MarketShare float64
TotalVolume int
Trades int
NetPercentChange float64
}
/*
Legacy:
STRIKE float64
EXCHANGE string
EXPIRATION float64
DAYS2EXPIRATION float64
BID float64
ASK float64
LAST float64
MARK float64
BIDASK_SIZE string
VOLATILITY float64
DELTA float64
GAMMA float64
THETA float64
VEGA float64
RHO float64
OPEN_INTEREST float64
TIME_VALUE float64
THEORETICAL_VALUE float64
THEORETICAL_VOLATILITY float64
PERCENT_CHANGE float64
MARK_CHANGE float64
MARK_PERCENT_CHANGE float64
INTRINSIC_VALUE float64
IN_THE_MONEY bool
*/
type Chain struct {
Symbol string
Status string
Underlying Underlying
Strategy string
Interval float64
IsDelayed bool
IsIndex bool
DaysToExpiration float64
InterestRate float64
UnderlyingPrice float64
Volatility float64
CallExpDateMap map[string]map[string][]OptionContract
PutExpDateMap map[string]map[string][]OptionContract
}
type Underlying struct {
Ask float64
AskSize float64
Bid float64
BidSize float64
Change float64
Close float64
Delayed bool
Description string
ExchangeName string
Hi52 float64 `json:"fiftyTwoWeekHigh"fiftyTwoWeekHigh"`
Lo52 float64 `json:"fiftyTwoWeekHigh"fiftyTwoWeekLow"`
HiPrice float64 `json:"highPrice"`
LoPrice float64 `json:"lowPrice"`
Mark float64
MarkPercentChange float64
OpenPrice float64
PercentChange float64
QuoteTime int64
Symbol string
TotalVolume int64
TradeTime int64
}
type OptionContract struct {
PutCall string
Symbol string
Description string
ExchangeName string
Bid float64
Ask float64
Last float64
Mark float64
BidSize int64
AskSize int64
LastSize int64
HighPrice float64
LowPrice float64
OpenPrice float64
ClosePrice float64
TotalVolume int64
QuoteTimeInLong int64
TradeTimeInLong int64
NetChange float64
Volatility float64
Delta float64
Gamma float64
Theta float64
Vega float64
RHO float64
OpenInterest float64
TimeValue float64
InTheMoney bool
TheoreticalOptionValue float64
TheoreticalVolatility float64
Mini bool
NonStandard bool
OptionDeliverablesList []OptionDeliverables
StrikePrice float64
ExpirationDate string
DaysToExpiration int64
ExpirationType string
LastTradingDay int64
Multiplier float64
SettlementType string
DeliverableNote string
PercentChange float64
MarkChange float64
MarkPercentChange float64
PennyPilot bool
IntrinsicValue float64
ExtrinsicValue float64
OptionRoot string
ExerciseType string
Hi52 float64 `json:"high52Week"`
Lo52 float64 `json:"low52Week"`
}
type OptionDeliverables struct {
Symbol string
AssetType string
DeliverableUnits float64
}