forked from quickfixgo/quickfix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
NewOrderSingle.go
350 lines (343 loc) · 19.8 KB
/
NewOrderSingle.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
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
//Package newordersingle msg type = D.
package newordersingle
import (
"github.com/quickfixgo/quickfix"
"github.com/quickfixgo/quickfix/enum"
"github.com/quickfixgo/quickfix/fix50/commissiondata"
"github.com/quickfixgo/quickfix/fix50/discretioninstructions"
"github.com/quickfixgo/quickfix/fix50/displayinstruction"
"github.com/quickfixgo/quickfix/fix50/financingdetails"
"github.com/quickfixgo/quickfix/fix50/instrument"
"github.com/quickfixgo/quickfix/fix50/orderqtydata"
"github.com/quickfixgo/quickfix/fix50/parties"
"github.com/quickfixgo/quickfix/fix50/peginstructions"
"github.com/quickfixgo/quickfix/fix50/preallocgrp"
"github.com/quickfixgo/quickfix/fix50/spreadorbenchmarkcurvedata"
"github.com/quickfixgo/quickfix/fix50/stipulations"
"github.com/quickfixgo/quickfix/fix50/strategyparametersgrp"
"github.com/quickfixgo/quickfix/fix50/trdgsesgrp"
"github.com/quickfixgo/quickfix/fix50/trdregtimestamps"
"github.com/quickfixgo/quickfix/fix50/triggeringinstruction"
"github.com/quickfixgo/quickfix/fix50/undinstrmtgrp"
"github.com/quickfixgo/quickfix/fix50/yielddata"
"github.com/quickfixgo/quickfix/fixt11"
"time"
)
//Message is a NewOrderSingle FIX Message
type Message struct {
FIXMsgType string `fix:"D"`
fixt11.Header
//ClOrdID is a required field for NewOrderSingle.
ClOrdID string `fix:"11"`
//SecondaryClOrdID is a non-required field for NewOrderSingle.
SecondaryClOrdID *string `fix:"526"`
//ClOrdLinkID is a non-required field for NewOrderSingle.
ClOrdLinkID *string `fix:"583"`
//Parties is a non-required component for NewOrderSingle.
Parties *parties.Parties
//TradeOriginationDate is a non-required field for NewOrderSingle.
TradeOriginationDate *string `fix:"229"`
//TradeDate is a non-required field for NewOrderSingle.
TradeDate *string `fix:"75"`
//Account is a non-required field for NewOrderSingle.
Account *string `fix:"1"`
//AcctIDSource is a non-required field for NewOrderSingle.
AcctIDSource *int `fix:"660"`
//AccountType is a non-required field for NewOrderSingle.
AccountType *int `fix:"581"`
//DayBookingInst is a non-required field for NewOrderSingle.
DayBookingInst *string `fix:"589"`
//BookingUnit is a non-required field for NewOrderSingle.
BookingUnit *string `fix:"590"`
//PreallocMethod is a non-required field for NewOrderSingle.
PreallocMethod *string `fix:"591"`
//AllocID is a non-required field for NewOrderSingle.
AllocID *string `fix:"70"`
//PreAllocGrp is a non-required component for NewOrderSingle.
PreAllocGrp *preallocgrp.PreAllocGrp
//SettlType is a non-required field for NewOrderSingle.
SettlType *string `fix:"63"`
//SettlDate is a non-required field for NewOrderSingle.
SettlDate *string `fix:"64"`
//CashMargin is a non-required field for NewOrderSingle.
CashMargin *string `fix:"544"`
//ClearingFeeIndicator is a non-required field for NewOrderSingle.
ClearingFeeIndicator *string `fix:"635"`
//HandlInst is a non-required field for NewOrderSingle.
HandlInst *string `fix:"21"`
//ExecInst is a non-required field for NewOrderSingle.
ExecInst *string `fix:"18"`
//MinQty is a non-required field for NewOrderSingle.
MinQty *float64 `fix:"110"`
//MaxFloor is a non-required field for NewOrderSingle.
MaxFloor *float64 `fix:"111"`
//ExDestination is a non-required field for NewOrderSingle.
ExDestination *string `fix:"100"`
//TrdgSesGrp is a non-required component for NewOrderSingle.
TrdgSesGrp *trdgsesgrp.TrdgSesGrp
//ProcessCode is a non-required field for NewOrderSingle.
ProcessCode *string `fix:"81"`
//Instrument is a required component for NewOrderSingle.
instrument.Instrument
//FinancingDetails is a non-required component for NewOrderSingle.
FinancingDetails *financingdetails.FinancingDetails
//UndInstrmtGrp is a non-required component for NewOrderSingle.
UndInstrmtGrp *undinstrmtgrp.UndInstrmtGrp
//PrevClosePx is a non-required field for NewOrderSingle.
PrevClosePx *float64 `fix:"140"`
//Side is a required field for NewOrderSingle.
Side string `fix:"54"`
//LocateReqd is a non-required field for NewOrderSingle.
LocateReqd *bool `fix:"114"`
//TransactTime is a required field for NewOrderSingle.
TransactTime time.Time `fix:"60"`
//Stipulations is a non-required component for NewOrderSingle.
Stipulations *stipulations.Stipulations
//QtyType is a non-required field for NewOrderSingle.
QtyType *int `fix:"854"`
//OrderQtyData is a required component for NewOrderSingle.
orderqtydata.OrderQtyData
//OrdType is a required field for NewOrderSingle.
OrdType string `fix:"40"`
//PriceType is a non-required field for NewOrderSingle.
PriceType *int `fix:"423"`
//Price is a non-required field for NewOrderSingle.
Price *float64 `fix:"44"`
//StopPx is a non-required field for NewOrderSingle.
StopPx *float64 `fix:"99"`
//SpreadOrBenchmarkCurveData is a non-required component for NewOrderSingle.
SpreadOrBenchmarkCurveData *spreadorbenchmarkcurvedata.SpreadOrBenchmarkCurveData
//YieldData is a non-required component for NewOrderSingle.
YieldData *yielddata.YieldData
//Currency is a non-required field for NewOrderSingle.
Currency *string `fix:"15"`
//ComplianceID is a non-required field for NewOrderSingle.
ComplianceID *string `fix:"376"`
//SolicitedFlag is a non-required field for NewOrderSingle.
SolicitedFlag *bool `fix:"377"`
//IOIID is a non-required field for NewOrderSingle.
IOIID *string `fix:"23"`
//QuoteID is a non-required field for NewOrderSingle.
QuoteID *string `fix:"117"`
//TimeInForce is a non-required field for NewOrderSingle.
TimeInForce *string `fix:"59"`
//EffectiveTime is a non-required field for NewOrderSingle.
EffectiveTime *time.Time `fix:"168"`
//ExpireDate is a non-required field for NewOrderSingle.
ExpireDate *string `fix:"432"`
//ExpireTime is a non-required field for NewOrderSingle.
ExpireTime *time.Time `fix:"126"`
//GTBookingInst is a non-required field for NewOrderSingle.
GTBookingInst *int `fix:"427"`
//CommissionData is a non-required component for NewOrderSingle.
CommissionData *commissiondata.CommissionData
//OrderCapacity is a non-required field for NewOrderSingle.
OrderCapacity *string `fix:"528"`
//OrderRestrictions is a non-required field for NewOrderSingle.
OrderRestrictions *string `fix:"529"`
//CustOrderCapacity is a non-required field for NewOrderSingle.
CustOrderCapacity *int `fix:"582"`
//ForexReq is a non-required field for NewOrderSingle.
ForexReq *bool `fix:"121"`
//SettlCurrency is a non-required field for NewOrderSingle.
SettlCurrency *string `fix:"120"`
//BookingType is a non-required field for NewOrderSingle.
BookingType *int `fix:"775"`
//Text is a non-required field for NewOrderSingle.
Text *string `fix:"58"`
//EncodedTextLen is a non-required field for NewOrderSingle.
EncodedTextLen *int `fix:"354"`
//EncodedText is a non-required field for NewOrderSingle.
EncodedText *string `fix:"355"`
//SettlDate2 is a non-required field for NewOrderSingle.
SettlDate2 *string `fix:"193"`
//OrderQty2 is a non-required field for NewOrderSingle.
OrderQty2 *float64 `fix:"192"`
//Price2 is a non-required field for NewOrderSingle.
Price2 *float64 `fix:"640"`
//PositionEffect is a non-required field for NewOrderSingle.
PositionEffect *string `fix:"77"`
//CoveredOrUncovered is a non-required field for NewOrderSingle.
CoveredOrUncovered *int `fix:"203"`
//MaxShow is a non-required field for NewOrderSingle.
MaxShow *float64 `fix:"210"`
//PegInstructions is a non-required component for NewOrderSingle.
PegInstructions *peginstructions.PegInstructions
//DiscretionInstructions is a non-required component for NewOrderSingle.
DiscretionInstructions *discretioninstructions.DiscretionInstructions
//TargetStrategy is a non-required field for NewOrderSingle.
TargetStrategy *int `fix:"847"`
//TargetStrategyParameters is a non-required field for NewOrderSingle.
TargetStrategyParameters *string `fix:"848"`
//ParticipationRate is a non-required field for NewOrderSingle.
ParticipationRate *float64 `fix:"849"`
//CancellationRights is a non-required field for NewOrderSingle.
CancellationRights *string `fix:"480"`
//MoneyLaunderingStatus is a non-required field for NewOrderSingle.
MoneyLaunderingStatus *string `fix:"481"`
//RegistID is a non-required field for NewOrderSingle.
RegistID *string `fix:"513"`
//Designation is a non-required field for NewOrderSingle.
Designation *string `fix:"494"`
//StrategyParametersGrp is a non-required component for NewOrderSingle.
StrategyParametersGrp *strategyparametersgrp.StrategyParametersGrp
//ManualOrderIndicator is a non-required field for NewOrderSingle.
ManualOrderIndicator *bool `fix:"1028"`
//CustDirectedOrder is a non-required field for NewOrderSingle.
CustDirectedOrder *bool `fix:"1029"`
//ReceivedDeptID is a non-required field for NewOrderSingle.
ReceivedDeptID *string `fix:"1030"`
//CustOrderHandlingInst is a non-required field for NewOrderSingle.
CustOrderHandlingInst *string `fix:"1031"`
//OrderHandlingInstSource is a non-required field for NewOrderSingle.
OrderHandlingInstSource *int `fix:"1032"`
//TrdRegTimestamps is a non-required component for NewOrderSingle.
TrdRegTimestamps *trdregtimestamps.TrdRegTimestamps
//MatchIncrement is a non-required field for NewOrderSingle.
MatchIncrement *float64 `fix:"1089"`
//MaxPriceLevels is a non-required field for NewOrderSingle.
MaxPriceLevels *int `fix:"1090"`
//DisplayInstruction is a non-required component for NewOrderSingle.
DisplayInstruction *displayinstruction.DisplayInstruction
//PriceProtectionScope is a non-required field for NewOrderSingle.
PriceProtectionScope *string `fix:"1092"`
//TriggeringInstruction is a non-required component for NewOrderSingle.
TriggeringInstruction *triggeringinstruction.TriggeringInstruction
//PreTradeAnonymity is a non-required field for NewOrderSingle.
PreTradeAnonymity *bool `fix:"1091"`
//RefOrderID is a non-required field for NewOrderSingle.
RefOrderID *string `fix:"1080"`
//RefOrderIDSource is a non-required field for NewOrderSingle.
RefOrderIDSource *string `fix:"1081"`
//ExDestinationIDSource is a non-required field for NewOrderSingle.
ExDestinationIDSource *string `fix:"1133"`
fixt11.Trailer
}
//Marshal converts Message to a quickfix.Message instance
func (m Message) Marshal() quickfix.Message { return quickfix.Marshal(m) }
//New returns an initialized NewOrderSingle instance
func New(clordid string, instrument instrument.Instrument, side string, transacttime time.Time, orderqtydata orderqtydata.OrderQtyData, ordtype string) *Message {
var m Message
m.SetClOrdID(clordid)
m.SetInstrument(instrument)
m.SetSide(side)
m.SetTransactTime(transacttime)
m.SetOrderQtyData(orderqtydata)
m.SetOrdType(ordtype)
return &m
}
func (m *Message) SetClOrdID(v string) { m.ClOrdID = v }
func (m *Message) SetSecondaryClOrdID(v string) { m.SecondaryClOrdID = &v }
func (m *Message) SetClOrdLinkID(v string) { m.ClOrdLinkID = &v }
func (m *Message) SetParties(v parties.Parties) { m.Parties = &v }
func (m *Message) SetTradeOriginationDate(v string) { m.TradeOriginationDate = &v }
func (m *Message) SetTradeDate(v string) { m.TradeDate = &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) SetDayBookingInst(v string) { m.DayBookingInst = &v }
func (m *Message) SetBookingUnit(v string) { m.BookingUnit = &v }
func (m *Message) SetPreallocMethod(v string) { m.PreallocMethod = &v }
func (m *Message) SetAllocID(v string) { m.AllocID = &v }
func (m *Message) SetPreAllocGrp(v preallocgrp.PreAllocGrp) { m.PreAllocGrp = &v }
func (m *Message) SetSettlType(v string) { m.SettlType = &v }
func (m *Message) SetSettlDate(v string) { m.SettlDate = &v }
func (m *Message) SetCashMargin(v string) { m.CashMargin = &v }
func (m *Message) SetClearingFeeIndicator(v string) { m.ClearingFeeIndicator = &v }
func (m *Message) SetHandlInst(v string) { m.HandlInst = &v }
func (m *Message) SetExecInst(v string) { m.ExecInst = &v }
func (m *Message) SetMinQty(v float64) { m.MinQty = &v }
func (m *Message) SetMaxFloor(v float64) { m.MaxFloor = &v }
func (m *Message) SetExDestination(v string) { m.ExDestination = &v }
func (m *Message) SetTrdgSesGrp(v trdgsesgrp.TrdgSesGrp) { m.TrdgSesGrp = &v }
func (m *Message) SetProcessCode(v string) { m.ProcessCode = &v }
func (m *Message) SetInstrument(v instrument.Instrument) { m.Instrument = v }
func (m *Message) SetFinancingDetails(v financingdetails.FinancingDetails) { m.FinancingDetails = &v }
func (m *Message) SetUndInstrmtGrp(v undinstrmtgrp.UndInstrmtGrp) { m.UndInstrmtGrp = &v }
func (m *Message) SetPrevClosePx(v float64) { m.PrevClosePx = &v }
func (m *Message) SetSide(v string) { m.Side = v }
func (m *Message) SetLocateReqd(v bool) { m.LocateReqd = &v }
func (m *Message) SetTransactTime(v time.Time) { m.TransactTime = v }
func (m *Message) SetStipulations(v stipulations.Stipulations) { m.Stipulations = &v }
func (m *Message) SetQtyType(v int) { m.QtyType = &v }
func (m *Message) SetOrderQtyData(v orderqtydata.OrderQtyData) { m.OrderQtyData = v }
func (m *Message) SetOrdType(v string) { m.OrdType = v }
func (m *Message) SetPriceType(v int) { m.PriceType = &v }
func (m *Message) SetPrice(v float64) { m.Price = &v }
func (m *Message) SetStopPx(v float64) { m.StopPx = &v }
func (m *Message) SetSpreadOrBenchmarkCurveData(v spreadorbenchmarkcurvedata.SpreadOrBenchmarkCurveData) {
m.SpreadOrBenchmarkCurveData = &v
}
func (m *Message) SetYieldData(v yielddata.YieldData) { m.YieldData = &v }
func (m *Message) SetCurrency(v string) { m.Currency = &v }
func (m *Message) SetComplianceID(v string) { m.ComplianceID = &v }
func (m *Message) SetSolicitedFlag(v bool) { m.SolicitedFlag = &v }
func (m *Message) SetIOIID(v string) { m.IOIID = &v }
func (m *Message) SetQuoteID(v string) { m.QuoteID = &v }
func (m *Message) SetTimeInForce(v string) { m.TimeInForce = &v }
func (m *Message) SetEffectiveTime(v time.Time) { m.EffectiveTime = &v }
func (m *Message) SetExpireDate(v string) { m.ExpireDate = &v }
func (m *Message) SetExpireTime(v time.Time) { m.ExpireTime = &v }
func (m *Message) SetGTBookingInst(v int) { m.GTBookingInst = &v }
func (m *Message) SetCommissionData(v commissiondata.CommissionData) { m.CommissionData = &v }
func (m *Message) SetOrderCapacity(v string) { m.OrderCapacity = &v }
func (m *Message) SetOrderRestrictions(v string) { m.OrderRestrictions = &v }
func (m *Message) SetCustOrderCapacity(v int) { m.CustOrderCapacity = &v }
func (m *Message) SetForexReq(v bool) { m.ForexReq = &v }
func (m *Message) SetSettlCurrency(v string) { m.SettlCurrency = &v }
func (m *Message) SetBookingType(v int) { m.BookingType = &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 }
func (m *Message) SetSettlDate2(v string) { m.SettlDate2 = &v }
func (m *Message) SetOrderQty2(v float64) { m.OrderQty2 = &v }
func (m *Message) SetPrice2(v float64) { m.Price2 = &v }
func (m *Message) SetPositionEffect(v string) { m.PositionEffect = &v }
func (m *Message) SetCoveredOrUncovered(v int) { m.CoveredOrUncovered = &v }
func (m *Message) SetMaxShow(v float64) { m.MaxShow = &v }
func (m *Message) SetPegInstructions(v peginstructions.PegInstructions) { m.PegInstructions = &v }
func (m *Message) SetDiscretionInstructions(v discretioninstructions.DiscretionInstructions) {
m.DiscretionInstructions = &v
}
func (m *Message) SetTargetStrategy(v int) { m.TargetStrategy = &v }
func (m *Message) SetTargetStrategyParameters(v string) { m.TargetStrategyParameters = &v }
func (m *Message) SetParticipationRate(v float64) { m.ParticipationRate = &v }
func (m *Message) SetCancellationRights(v string) { m.CancellationRights = &v }
func (m *Message) SetMoneyLaunderingStatus(v string) { m.MoneyLaunderingStatus = &v }
func (m *Message) SetRegistID(v string) { m.RegistID = &v }
func (m *Message) SetDesignation(v string) { m.Designation = &v }
func (m *Message) SetStrategyParametersGrp(v strategyparametersgrp.StrategyParametersGrp) {
m.StrategyParametersGrp = &v
}
func (m *Message) SetManualOrderIndicator(v bool) { m.ManualOrderIndicator = &v }
func (m *Message) SetCustDirectedOrder(v bool) { m.CustDirectedOrder = &v }
func (m *Message) SetReceivedDeptID(v string) { m.ReceivedDeptID = &v }
func (m *Message) SetCustOrderHandlingInst(v string) { m.CustOrderHandlingInst = &v }
func (m *Message) SetOrderHandlingInstSource(v int) { m.OrderHandlingInstSource = &v }
func (m *Message) SetTrdRegTimestamps(v trdregtimestamps.TrdRegTimestamps) { m.TrdRegTimestamps = &v }
func (m *Message) SetMatchIncrement(v float64) { m.MatchIncrement = &v }
func (m *Message) SetMaxPriceLevels(v int) { m.MaxPriceLevels = &v }
func (m *Message) SetDisplayInstruction(v displayinstruction.DisplayInstruction) {
m.DisplayInstruction = &v
}
func (m *Message) SetPriceProtectionScope(v string) { m.PriceProtectionScope = &v }
func (m *Message) SetTriggeringInstruction(v triggeringinstruction.TriggeringInstruction) {
m.TriggeringInstruction = &v
}
func (m *Message) SetPreTradeAnonymity(v bool) { m.PreTradeAnonymity = &v }
func (m *Message) SetRefOrderID(v string) { m.RefOrderID = &v }
func (m *Message) SetRefOrderIDSource(v string) { m.RefOrderIDSource = &v }
func (m *Message) SetExDestinationIDSource(v string) { m.ExDestinationIDSource = &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.ApplVerID_FIX50, "D", r
}