本文整理汇总了Golang中github.com/quickfixgo/quickfix/field.PriceField类的典型用法代码示例。如果您正苦于以下问题:Golang PriceField类的具体用法?Golang PriceField怎么用?Golang PriceField使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PriceField类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: GetPrice
//GetPrice gets Price, Tag 44
func (m NewOrderSingle) GetPrice() (v decimal.Decimal, err quickfix.MessageRejectError) {
var f field.PriceField
if err = m.Get(&f); err == nil {
v = f.Value()
}
return
}
示例2: GetPrice
//GetPrice gets Price, Tag 44
func (m ExecutionReport) GetPrice() (v decimal.Decimal, err quickfix.MessageRejectError) {
var f field.PriceField
if err = m.Get(&f); err == nil {
v = f.Value()
}
return
}
示例3: GetPrice
//GetPrice gets Price, Tag 44
func (m IndicationofInterest) GetPrice() (v decimal.Decimal, err quickfix.MessageRejectError) {
var f field.PriceField
if err = m.Get(&f); err == nil {
v = f.Value()
}
return
}
示例4: GetPrice
//GetPrice gets Price, Tag 44
func (m Advertisement) GetPrice() (v decimal.Decimal, err quickfix.MessageRejectError) {
var f field.PriceField
if err = m.Get(&f); err == nil {
v = f.Value()
}
return
}
示例5: GetPrice
//GetPrice gets Price, Tag 44
func (m OrderCancelReplaceRequest) GetPrice() (v decimal.Decimal, err quickfix.MessageRejectError) {
var f field.PriceField
if err = m.Get(&f); err == nil {
v = f.Value()
}
return
}
示例6: GetPrice
//GetPrice gets Price, Tag 44
func (m NoBidComponents) GetPrice() (v decimal.Decimal, err quickfix.MessageRejectError) {
var f field.PriceField
if err = m.Get(&f); err == nil {
v = f.Value()
}
return
}
示例7: OnFIX41NewOrderSingle
func (e *executor) OnFIX41NewOrderSingle(msg fix41nos.NewOrderSingle, sessionID quickfix.SessionID) (err quickfix.MessageRejectError) {
var ordType field.OrdTypeField
if ordType, err = msg.GetOrdType(); err != nil {
return err
}
if ordType.String() != enum.OrdType_LIMIT {
return quickfix.ValueIsIncorrect(tag.OrdType)
}
var symbol field.SymbolField
if symbol, err = msg.GetSymbol(); err != nil {
return
}
var side field.SideField
if side, err = msg.GetSide(); err != nil {
return
}
var orderQty field.OrderQtyField
if orderQty, err = msg.GetOrderQty(); err != nil {
return
}
var price field.PriceField
if price, err = msg.GetPrice(); 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),
symbol,
side,
orderQty,
field.NewLastShares(orderQty.Float64()),
field.NewLastPx(price.Float64()),
field.NewLeavesQty(0),
field.NewCumQty(orderQty.Float64()),
field.NewAvgPx(price.Float64()),
)
quickfix.SendToTarget(execReport, sessionID)
return
}
示例8: OnFIX50NewOrderSingle
func (e *executor) OnFIX50NewOrderSingle(msg fix50nos.NewOrderSingle, sessionID quickfix.SessionID) (err quickfix.MessageRejectError) {
var ordType field.OrdTypeField
if ordType, err = msg.GetOrdType(); err != nil {
return err
}
if ordType.String() != enum.OrdType_LIMIT {
return quickfix.ValueIsIncorrect(tag.OrdType)
}
var symbol field.SymbolField
if symbol, err = msg.GetSymbol(); err != nil {
return
}
var side field.SideField
if side, err = msg.GetSide(); err != nil {
return
}
var orderQty field.OrderQtyField
if orderQty, err = msg.GetOrderQty(); err != nil {
return
}
var price field.PriceField
if price, err = msg.GetPrice(); err != nil {
return
}
var clOrdID field.ClOrdIDField
if clOrdID, err = msg.GetClOrdID(); err != nil {
return
}
execReport := fix50er.New(
e.genOrderID(),
e.genExecID(),
field.NewExecType(enum.ExecType_FILL),
field.NewOrdStatus(enum.OrdStatus_FILLED),
side,
field.NewLeavesQty(0),
field.NewCumQty(orderQty.Float64()),
)
execReport.Set(clOrdID)
execReport.Set(symbol)
execReport.Set(orderQty)
execReport.SetLastQty(orderQty.Float64())
execReport.SetLastPx(price.Float64())
execReport.SetAvgPx(price.Float64())
if msg.HasAccount() {
var acct field.AccountField
if acct, err = msg.GetAccount(); err != nil {
return err
}
execReport.Set(acct)
}
quickfix.SendToTarget(execReport, sessionID)
return
}