forked from quickfixgo/quickfix
/
Quote.go
310 lines (294 loc) · 15.5 KB
/
Quote.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
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
//Package quote msg type = S.
package quote
import (
"github.com/quickfixgo/quickfix"
"github.com/quickfixgo/quickfix/enum"
"github.com/quickfixgo/quickfix/fix44"
"github.com/quickfixgo/quickfix/fix44/financingdetails"
"github.com/quickfixgo/quickfix/fix44/instrument"
"github.com/quickfixgo/quickfix/fix44/instrumentleg"
"github.com/quickfixgo/quickfix/fix44/legbenchmarkcurvedata"
"github.com/quickfixgo/quickfix/fix44/legstipulations"
"github.com/quickfixgo/quickfix/fix44/nestedparties"
"github.com/quickfixgo/quickfix/fix44/orderqtydata"
"github.com/quickfixgo/quickfix/fix44/parties"
"github.com/quickfixgo/quickfix/fix44/spreadorbenchmarkcurvedata"
"github.com/quickfixgo/quickfix/fix44/stipulations"
"github.com/quickfixgo/quickfix/fix44/underlyinginstrument"
"github.com/quickfixgo/quickfix/fix44/yielddata"
"time"
)
//NoQuoteQualifiers is a repeating group in Quote
type NoQuoteQualifiers struct {
//QuoteQualifier is a non-required field for NoQuoteQualifiers.
QuoteQualifier *string `fix:"695"`
}
//NewNoQuoteQualifiers returns an initialized NoQuoteQualifiers instance
func NewNoQuoteQualifiers() *NoQuoteQualifiers {
var m NoQuoteQualifiers
return &m
}
func (m *NoQuoteQualifiers) SetQuoteQualifier(v string) { m.QuoteQualifier = &v }
//NoUnderlyings is a repeating group in Quote
type NoUnderlyings struct {
//UnderlyingInstrument is a non-required component for NoUnderlyings.
UnderlyingInstrument *underlyinginstrument.UnderlyingInstrument
}
//NewNoUnderlyings returns an initialized NoUnderlyings instance
func NewNoUnderlyings() *NoUnderlyings {
var m NoUnderlyings
return &m
}
func (m *NoUnderlyings) SetUnderlyingInstrument(v underlyinginstrument.UnderlyingInstrument) {
m.UnderlyingInstrument = &v
}
//NoLegs is a repeating group in Quote
type NoLegs struct {
//InstrumentLeg is a non-required component for NoLegs.
InstrumentLeg *instrumentleg.InstrumentLeg
//LegQty is a non-required field for NoLegs.
LegQty *float64 `fix:"687"`
//LegSwapType is a non-required field for NoLegs.
LegSwapType *int `fix:"690"`
//LegSettlType is a non-required field for NoLegs.
LegSettlType *string `fix:"587"`
//LegSettlDate is a non-required field for NoLegs.
LegSettlDate *string `fix:"588"`
//LegStipulations is a non-required component for NoLegs.
LegStipulations *legstipulations.LegStipulations
//NestedParties is a non-required component for NoLegs.
NestedParties *nestedparties.NestedParties
//LegPriceType is a non-required field for NoLegs.
LegPriceType *int `fix:"686"`
//LegBidPx is a non-required field for NoLegs.
LegBidPx *float64 `fix:"681"`
//LegOfferPx is a non-required field for NoLegs.
LegOfferPx *float64 `fix:"684"`
//LegBenchmarkCurveData is a non-required component for NoLegs.
LegBenchmarkCurveData *legbenchmarkcurvedata.LegBenchmarkCurveData
}
//NewNoLegs returns an initialized NoLegs instance
func NewNoLegs() *NoLegs {
var m NoLegs
return &m
}
func (m *NoLegs) SetInstrumentLeg(v instrumentleg.InstrumentLeg) { m.InstrumentLeg = &v }
func (m *NoLegs) SetLegQty(v float64) { m.LegQty = &v }
func (m *NoLegs) SetLegSwapType(v int) { m.LegSwapType = &v }
func (m *NoLegs) SetLegSettlType(v string) { m.LegSettlType = &v }
func (m *NoLegs) SetLegSettlDate(v string) { m.LegSettlDate = &v }
func (m *NoLegs) SetLegStipulations(v legstipulations.LegStipulations) { m.LegStipulations = &v }
func (m *NoLegs) SetNestedParties(v nestedparties.NestedParties) { m.NestedParties = &v }
func (m *NoLegs) SetLegPriceType(v int) { m.LegPriceType = &v }
func (m *NoLegs) SetLegBidPx(v float64) { m.LegBidPx = &v }
func (m *NoLegs) SetLegOfferPx(v float64) { m.LegOfferPx = &v }
func (m *NoLegs) SetLegBenchmarkCurveData(v legbenchmarkcurvedata.LegBenchmarkCurveData) {
m.LegBenchmarkCurveData = &v
}
//Message is a Quote FIX Message
type Message struct {
FIXMsgType string `fix:"S"`
fix44.Header
//QuoteReqID is a non-required field for Quote.
QuoteReqID *string `fix:"131"`
//QuoteID is a required field for Quote.
QuoteID string `fix:"117"`
//QuoteRespID is a non-required field for Quote.
QuoteRespID *string `fix:"693"`
//QuoteType is a non-required field for Quote.
QuoteType *int `fix:"537"`
//NoQuoteQualifiers is a non-required field for Quote.
NoQuoteQualifiers []NoQuoteQualifiers `fix:"735,omitempty"`
//QuoteResponseLevel is a non-required field for Quote.
QuoteResponseLevel *int `fix:"301"`
//Parties is a non-required component for Quote.
Parties *parties.Parties
//TradingSessionID is a non-required field for Quote.
TradingSessionID *string `fix:"336"`
//TradingSessionSubID is a non-required field for Quote.
TradingSessionSubID *string `fix:"625"`
//Instrument is a required component for Quote.
instrument.Instrument
//FinancingDetails is a non-required component for Quote.
FinancingDetails *financingdetails.FinancingDetails
//NoUnderlyings is a non-required field for Quote.
NoUnderlyings []NoUnderlyings `fix:"711,omitempty"`
//Side is a non-required field for Quote.
Side *string `fix:"54"`
//OrderQtyData is a non-required component for Quote.
OrderQtyData *orderqtydata.OrderQtyData
//SettlType is a non-required field for Quote.
SettlType *string `fix:"63"`
//SettlDate is a non-required field for Quote.
SettlDate *string `fix:"64"`
//SettlDate2 is a non-required field for Quote.
SettlDate2 *string `fix:"193"`
//OrderQty2 is a non-required field for Quote.
OrderQty2 *float64 `fix:"192"`
//Currency is a non-required field for Quote.
Currency *string `fix:"15"`
//Stipulations is a non-required component for Quote.
Stipulations *stipulations.Stipulations
//Account is a non-required field for Quote.
Account *string `fix:"1"`
//AcctIDSource is a non-required field for Quote.
AcctIDSource *int `fix:"660"`
//AccountType is a non-required field for Quote.
AccountType *int `fix:"581"`
//NoLegs is a non-required field for Quote.
NoLegs []NoLegs `fix:"555,omitempty"`
//BidPx is a non-required field for Quote.
BidPx *float64 `fix:"132"`
//OfferPx is a non-required field for Quote.
OfferPx *float64 `fix:"133"`
//MktBidPx is a non-required field for Quote.
MktBidPx *float64 `fix:"645"`
//MktOfferPx is a non-required field for Quote.
MktOfferPx *float64 `fix:"646"`
//MinBidSize is a non-required field for Quote.
MinBidSize *float64 `fix:"647"`
//BidSize is a non-required field for Quote.
BidSize *float64 `fix:"134"`
//MinOfferSize is a non-required field for Quote.
MinOfferSize *float64 `fix:"648"`
//OfferSize is a non-required field for Quote.
OfferSize *float64 `fix:"135"`
//ValidUntilTime is a non-required field for Quote.
ValidUntilTime *time.Time `fix:"62"`
//BidSpotRate is a non-required field for Quote.
BidSpotRate *float64 `fix:"188"`
//OfferSpotRate is a non-required field for Quote.
OfferSpotRate *float64 `fix:"190"`
//BidForwardPoints is a non-required field for Quote.
BidForwardPoints *float64 `fix:"189"`
//OfferForwardPoints is a non-required field for Quote.
OfferForwardPoints *float64 `fix:"191"`
//MidPx is a non-required field for Quote.
MidPx *float64 `fix:"631"`
//BidYield is a non-required field for Quote.
BidYield *float64 `fix:"632"`
//MidYield is a non-required field for Quote.
MidYield *float64 `fix:"633"`
//OfferYield is a non-required field for Quote.
OfferYield *float64 `fix:"634"`
//TransactTime is a non-required field for Quote.
TransactTime *time.Time `fix:"60"`
//OrdType is a non-required field for Quote.
OrdType *string `fix:"40"`
//BidForwardPoints2 is a non-required field for Quote.
BidForwardPoints2 *float64 `fix:"642"`
//OfferForwardPoints2 is a non-required field for Quote.
OfferForwardPoints2 *float64 `fix:"643"`
//SettlCurrBidFxRate is a non-required field for Quote.
SettlCurrBidFxRate *float64 `fix:"656"`
//SettlCurrOfferFxRate is a non-required field for Quote.
SettlCurrOfferFxRate *float64 `fix:"657"`
//SettlCurrFxRateCalc is a non-required field for Quote.
SettlCurrFxRateCalc *string `fix:"156"`
//CommType is a non-required field for Quote.
CommType *string `fix:"13"`
//Commission is a non-required field for Quote.
Commission *float64 `fix:"12"`
//CustOrderCapacity is a non-required field for Quote.
CustOrderCapacity *int `fix:"582"`
//ExDestination is a non-required field for Quote.
ExDestination *string `fix:"100"`
//OrderCapacity is a non-required field for Quote.
OrderCapacity *string `fix:"528"`
//PriceType is a non-required field for Quote.
PriceType *int `fix:"423"`
//SpreadOrBenchmarkCurveData is a non-required component for Quote.
SpreadOrBenchmarkCurveData *spreadorbenchmarkcurvedata.SpreadOrBenchmarkCurveData
//YieldData is a non-required component for Quote.
YieldData *yielddata.YieldData
//Text is a non-required field for Quote.
Text *string `fix:"58"`
//EncodedTextLen is a non-required field for Quote.
EncodedTextLen *int `fix:"354"`
//EncodedText is a non-required field for Quote.
EncodedText *string `fix:"355"`
fix44.Trailer
}
//Marshal converts Message to a quickfix.Message instance
func (m Message) Marshal() quickfix.Message { return quickfix.Marshal(m) }
//New returns an initialized Quote instance
func New(quoteid string, instrument instrument.Instrument) *Message {
var m Message
m.SetQuoteID(quoteid)
m.SetInstrument(instrument)
return &m
}
func (m *Message) SetQuoteReqID(v string) { m.QuoteReqID = &v }
func (m *Message) SetQuoteID(v string) { m.QuoteID = v }
func (m *Message) SetQuoteRespID(v string) { m.QuoteRespID = &v }
func (m *Message) SetQuoteType(v int) { m.QuoteType = &v }
func (m *Message) SetNoQuoteQualifiers(v []NoQuoteQualifiers) { m.NoQuoteQualifiers = v }
func (m *Message) SetQuoteResponseLevel(v int) { m.QuoteResponseLevel = &v }
func (m *Message) SetParties(v parties.Parties) { m.Parties = &v }
func (m *Message) SetTradingSessionID(v string) { m.TradingSessionID = &v }
func (m *Message) SetTradingSessionSubID(v string) { m.TradingSessionSubID = &v }
func (m *Message) SetInstrument(v instrument.Instrument) { m.Instrument = v }
func (m *Message) SetFinancingDetails(v financingdetails.FinancingDetails) { m.FinancingDetails = &v }
func (m *Message) SetNoUnderlyings(v []NoUnderlyings) { m.NoUnderlyings = v }
func (m *Message) SetSide(v string) { m.Side = &v }
func (m *Message) SetOrderQtyData(v orderqtydata.OrderQtyData) { m.OrderQtyData = &v }
func (m *Message) SetSettlType(v string) { m.SettlType = &v }
func (m *Message) SetSettlDate(v string) { m.SettlDate = &v }
func (m *Message) SetSettlDate2(v string) { m.SettlDate2 = &v }
func (m *Message) SetOrderQty2(v float64) { m.OrderQty2 = &v }
func (m *Message) SetCurrency(v string) { m.Currency = &v }
func (m *Message) SetStipulations(v stipulations.Stipulations) { m.Stipulations = &v }
func (m *Message) SetAccount(v string) { m.Account = &v }
func (m *Message) SetAcctIDSource(v int) { m.AcctIDSource = &v }
func (m *Message) SetAccountType(v int) { m.AccountType = &v }
func (m *Message) SetNoLegs(v []NoLegs) { m.NoLegs = v }
func (m *Message) SetBidPx(v float64) { m.BidPx = &v }
func (m *Message) SetOfferPx(v float64) { m.OfferPx = &v }
func (m *Message) SetMktBidPx(v float64) { m.MktBidPx = &v }
func (m *Message) SetMktOfferPx(v float64) { m.MktOfferPx = &v }
func (m *Message) SetMinBidSize(v float64) { m.MinBidSize = &v }
func (m *Message) SetBidSize(v float64) { m.BidSize = &v }
func (m *Message) SetMinOfferSize(v float64) { m.MinOfferSize = &v }
func (m *Message) SetOfferSize(v float64) { m.OfferSize = &v }
func (m *Message) SetValidUntilTime(v time.Time) { m.ValidUntilTime = &v }
func (m *Message) SetBidSpotRate(v float64) { m.BidSpotRate = &v }
func (m *Message) SetOfferSpotRate(v float64) { m.OfferSpotRate = &v }
func (m *Message) SetBidForwardPoints(v float64) { m.BidForwardPoints = &v }
func (m *Message) SetOfferForwardPoints(v float64) { m.OfferForwardPoints = &v }
func (m *Message) SetMidPx(v float64) { m.MidPx = &v }
func (m *Message) SetBidYield(v float64) { m.BidYield = &v }
func (m *Message) SetMidYield(v float64) { m.MidYield = &v }
func (m *Message) SetOfferYield(v float64) { m.OfferYield = &v }
func (m *Message) SetTransactTime(v time.Time) { m.TransactTime = &v }
func (m *Message) SetOrdType(v string) { m.OrdType = &v }
func (m *Message) SetBidForwardPoints2(v float64) { m.BidForwardPoints2 = &v }
func (m *Message) SetOfferForwardPoints2(v float64) { m.OfferForwardPoints2 = &v }
func (m *Message) SetSettlCurrBidFxRate(v float64) { m.SettlCurrBidFxRate = &v }
func (m *Message) SetSettlCurrOfferFxRate(v float64) { m.SettlCurrOfferFxRate = &v }
func (m *Message) SetSettlCurrFxRateCalc(v string) { m.SettlCurrFxRateCalc = &v }
func (m *Message) SetCommType(v string) { m.CommType = &v }
func (m *Message) SetCommission(v float64) { m.Commission = &v }
func (m *Message) SetCustOrderCapacity(v int) { m.CustOrderCapacity = &v }
func (m *Message) SetExDestination(v string) { m.ExDestination = &v }
func (m *Message) SetOrderCapacity(v string) { m.OrderCapacity = &v }
func (m *Message) SetPriceType(v int) { m.PriceType = &v }
func (m *Message) SetSpreadOrBenchmarkCurveData(v spreadorbenchmarkcurvedata.SpreadOrBenchmarkCurveData) {
m.SpreadOrBenchmarkCurveData = &v
}
func (m *Message) SetYieldData(v yielddata.YieldData) { m.YieldData = &v }
func (m *Message) SetText(v string) { m.Text = &v }
func (m *Message) SetEncodedTextLen(v int) { m.EncodedTextLen = &v }
func (m *Message) SetEncodedText(v string) { m.EncodedText = &v }
//A RouteOut is the callback type that should be implemented for routing Message
type RouteOut func(msg Message, sessionID quickfix.SessionID) quickfix.MessageRejectError
//Route returns the beginstring, message type, and MessageRoute for this Message type
func Route(router RouteOut) (string, string, quickfix.MessageRoute) {
r := func(msg quickfix.Message, sessionID quickfix.SessionID) quickfix.MessageRejectError {
m := new(Message)
if err := quickfix.Unmarshal(msg, m); err != nil {
return err
}
return router(*m, sessionID)
}
return enum.BeginStringFIX44, "S", r
}