本文整理汇总了Golang中github.com/quickfixgo/quickfix/field.OrdTypeField类的典型用法代码示例。如果您正苦于以下问题:Golang OrdTypeField类的具体用法?Golang OrdTypeField怎么用?Golang OrdTypeField使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了OrdTypeField类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: GetOrdType
//GetOrdType gets OrdType, Tag 40
func (m ExecutionReport) GetOrdType() (v enum.OrdType, err quickfix.MessageRejectError) {
var f field.OrdTypeField
if err = m.Get(&f); err == nil {
v = f.Value()
}
return
}
开发者ID:quickfixgo,项目名称:examples,代码行数:8,代码来源:ExecutionReport.generated.go
示例2: GetOrdType
//GetOrdType gets OrdType, Tag 40
func (m NewOrderSingle) GetOrdType() (v enum.OrdType, err quickfix.MessageRejectError) {
var f field.OrdTypeField
if err = m.Get(&f); err == nil {
v = f.Value()
}
return
}
开发者ID:quickfixgo,项目名称:examples,代码行数:8,代码来源:NewOrderSingle.generated.go
示例3: GetOrdType
//GetOrdType gets OrdType, Tag 40
func (m OrderCancelReplaceRequest) GetOrdType() (v enum.OrdType, err quickfix.MessageRejectError) {
var f field.OrdTypeField
if err = m.Get(&f); err == nil {
v = f.Value()
}
return
}
开发者ID:quickfixgo,项目名称:quickfix,代码行数:8,代码来源:OrderCancelReplaceRequest.generated.go
示例4: GetOrdType
//GetOrdType gets OrdType, Tag 40
func (m NoQuoteEntries) GetOrdType() (v enum.OrdType, err quickfix.MessageRejectError) {
var f field.OrdTypeField
if err = m.Get(&f); err == nil {
v = f.Value()
}
return
}
开发者ID:quickfixgo,项目名称:quickfix,代码行数:8,代码来源:MassQuote.generated.go
示例5: 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
}
开发者ID:cbusbey,项目名称:examples,代码行数:49,代码来源:executor.go
示例6: queryNewOrderSingle40
func queryNewOrderSingle40() fix40nos.NewOrderSingle {
var ordType field.OrdTypeField
order := fix40nos.New(queryClOrdID(), field.NewHandlInst("1"), querySymbol(), querySide(), queryOrderQty(), queryOrdType(&ordType))
switch ordType.Value() {
case enum.OrdType_LIMIT, enum.OrdType_STOP_LIMIT:
order.Set(queryPrice())
}
switch ordType.Value() {
case enum.OrdType_STOP, enum.OrdType_STOP_LIMIT:
order.Set(queryStopPx())
}
order.Set(queryTimeInForce())
queryHeader(order.Header.Header)
return order
}
开发者ID:quickfixgo,项目名称:examples,代码行数:19,代码来源:console.go
示例7: queryNewOrderSingle42
func queryNewOrderSingle42() (msg quickfix.Message) {
var ordType field.OrdTypeField
order := fix42nos.New(queryClOrdID(), field.NewHandlInst("1"), querySymbol(), querySide(), field.NewTransactTime(time.Now()), queryOrdType(&ordType))
order.Set(queryOrderQty())
switch ordType.Value() {
case enum.OrdType_LIMIT, enum.OrdType_STOP_LIMIT:
order.Set(queryPrice())
}
switch ordType.Value() {
case enum.OrdType_STOP, enum.OrdType_STOP_LIMIT:
order.Set(queryStopPx())
}
order.Set(queryTimeInForce())
msg = order.ToMessage()
queryHeader(msg.Header)
return
}
开发者ID:quickfixgo,项目名称:examples,代码行数:20,代码来源:console.go
示例8: queryOrdType
func queryOrdType(f *field.OrdTypeField) field.OrdTypeField {
choices := []string{
"Market",
"Limit",
"Stop",
"Stop Limit",
}
values := []string{
string(enum.OrdType_MARKET),
string(enum.OrdType_LIMIT),
string(enum.OrdType_STOP),
string(enum.OrdType_STOP_LIMIT),
}
f.FIXString = quickfix.FIXString(queryFieldChoices("OrdType", choices, values))
return *f
}
开发者ID:quickfixgo,项目名称:examples,代码行数:18,代码来源:console.go
示例9: 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
}
开发者ID:cbusbey,项目名称:examples,代码行数:64,代码来源:executor.go
注:本文中的github.com/quickfixgo/quickfix/field.OrdTypeField类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论