本文整理汇总了Golang中github.com/quickfixgo/quickfix/field.NewSymbol函数的典型用法代码示例。如果您正苦于以下问题:Golang NewSymbol函数的具体用法?Golang NewSymbol怎么用?Golang NewSymbol使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了NewSymbol函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: updateOrder
func (a *Application) updateOrder(order internal.Order, status enum.OrdStatus) {
execReport := executionreport.New(
field.NewOrderID(order.ClOrdID),
field.NewExecID(a.genExecID()),
field.NewExecTransType(enum.ExecTransType_NEW),
field.NewExecType(enum.ExecType(status)),
field.NewOrdStatus(status),
field.NewSymbol(order.Symbol),
field.NewSide(order.Side),
field.NewLeavesQty(order.OpenQuantity(), 2),
field.NewCumQty(order.ExecutedQuantity, 2),
field.NewAvgPx(order.AvgPx, 2),
)
execReport.SetOrderQty(order.Quantity, 2)
execReport.SetClOrdID(order.ClOrdID)
switch status {
case enum.OrdStatus_FILLED, enum.OrdStatus_PARTIALLY_FILLED:
execReport.SetLastShares(order.LastExecutedQuantity, 2)
execReport.SetLastPx(order.LastExecutedPrice, 2)
}
execReport.Header.SetTargetCompID(order.SenderCompID)
execReport.Header.SetSenderCompID(order.TargetCompID)
quickfix.Send(execReport)
}
示例2: OnFIX41NewOrderSingle
func (e *executor) OnFIX41NewOrderSingle(msg fix41nos.NewOrderSingle, sessionID quickfix.SessionID) (err quickfix.MessageRejectError) {
ordType, err := msg.GetOrdType()
if err != nil {
return
}
if ordType != enum.OrdType_LIMIT {
return quickfix.ValueIsIncorrect(tag.OrdType)
}
symbol, err := msg.GetSymbol()
if err != nil {
return
}
side, err := msg.GetSide()
if err != nil {
return
}
orderQty, err := msg.GetOrderQty()
if err != nil {
return
}
price, err := msg.GetPrice()
if err != nil {
return
}
execReport := fix41er.New(
e.genOrderID(),
e.genExecID(),
field.NewExecTransType(enum.ExecTransType_NEW),
field.NewExecType(enum.ExecType_FILL),
field.NewOrdStatus(enum.OrdStatus_FILLED),
field.NewSymbol(symbol),
field.NewSide(side),
field.NewOrderQty(orderQty, 2),
field.NewLastShares(orderQty, 2),
field.NewLastPx(price, 2),
field.NewLeavesQty(decimal.Zero, 2),
field.NewCumQty(orderQty, 2),
field.NewAvgPx(price, 2),
)
clOrdID, err := msg.GetClOrdID()
if err != nil {
return
}
execReport.SetClOrdID(clOrdID)
quickfix.SendToTarget(execReport, sessionID)
return
}
示例3: updateOrder
func (a *Application) updateOrder(order Order, status string) {
execReport := executionreport.New(
field.NewOrderID(order.ClOrdID),
field.NewExecID(a.genExecID()),
field.NewExecTransType(enum.ExecTransType_NEW),
field.NewExecType(status),
field.NewOrdStatus(status),
field.NewSymbol(order.Symbol),
field.NewSide(order.Side),
field.NewLeavesQty(order.OpenQuantity()),
field.NewCumQty(order.ExecutedQuantity),
field.NewAvgPx(order.AvgPx),
)
execReport.SetOrderQty(order.Quantity)
execReport.SetClOrdID(order.ClOrdID)
execReport.Header.SetTargetCompID(order.SenderCompID)
execReport.Header.SetSenderCompID(order.TargetCompID)
quickfix.Send(execReport)
}
示例4: SetSymbol
//SetSymbol sets Symbol, Tag 55
func (m NoRelatedSym) SetSymbol(v string) {
m.Set(field.NewSymbol(v))
}
示例5: SetSymbol
//SetSymbol sets Symbol, Tag 55
func (m OrderMassCancelRequest) SetSymbol(v string) {
m.Set(field.NewSymbol(v))
}
示例6: SetSymbol
//SetSymbol sets Symbol, Tag 55
func (m DontKnowTrade) SetSymbol(v string) {
m.Set(field.NewSymbol(v))
}
示例7: SetSymbol
//SetSymbol sets Symbol, Tag 55
func (m IOI) SetSymbol(v string) {
m.Set(field.NewSymbol(v))
}
示例8: SetSymbol
//SetSymbol sets Symbol, Tag 55
func (m OrderCancelReplaceRequest) SetSymbol(v string) {
m.Set(field.NewSymbol(v))
}
示例9: SetSymbol
//SetSymbol sets Symbol, Tag 55
func (m QuoteStatusRequest) SetSymbol(v string) {
m.Set(field.NewSymbol(v))
}
示例10: SetSymbol
//SetSymbol sets Symbol, Tag 55
func (m SecurityDefinitionRequest) SetSymbol(v string) {
m.Set(field.NewSymbol(v))
}
示例11: SetSymbol
//SetSymbol sets Symbol, Tag 55
func (m NoOrders) SetSymbol(v string) {
m.Set(field.NewSymbol(v))
}
示例12: SetSymbol
//SetSymbol sets Symbol, Tag 55
func (m SecurityListRequest) SetSymbol(v string) {
m.Set(field.NewSymbol(v))
}
示例13: SetSymbol
//SetSymbol sets Symbol, Tag 55
func (m MarketDataSnapshotFullRefresh) SetSymbol(v string) {
m.Set(field.NewSymbol(v))
}
示例14: SetSymbol
//SetSymbol sets Symbol, Tag 55
func (m TradeCaptureReportRequest) SetSymbol(v string) {
m.Set(field.NewSymbol(v))
}
示例15: SetSymbol
//SetSymbol sets Symbol, Tag 55
func (m NewOrderList) SetSymbol(v string) {
m.Set(field.NewSymbol(v))
}