• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Golang field.NewSide函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Golang中github.com/quickfixgo/quickfix/field.NewSide函数的典型用法代码示例。如果您正苦于以下问题:Golang NewSide函数的具体用法?Golang NewSide怎么用?Golang NewSide使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了NewSide函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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)
}
开发者ID:quickfixgo,项目名称:examples,代码行数:27,代码来源:ordermatch.go


示例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
}
开发者ID:quickfixgo,项目名称:examples,代码行数:55,代码来源:executor.go


示例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)
}
开发者ID:cbusbey,项目名称:examples,代码行数:21,代码来源:ordermatch.go


示例4: querySide

func querySide() field.SideField {
	choices := []string{
		"Buy",
		"Sell",
		"Sell Short",
		"Sell Short Exempt",
		"Cross",
		"Cross Short",
		"Cross Short Exempt",
	}

	values := []string{
		string(enum.Side_BUY),
		string(enum.Side_SELL),
		string(enum.Side_SELL_SHORT),
		string(enum.Side_SELL_SHORT_EXEMPT),
		string(enum.Side_CROSS),
		string(enum.Side_CROSS_SHORT),
		"A",
	}

	return field.NewSide(enum.Side(queryFieldChoices("Side", choices, values)))
}
开发者ID:quickfixgo,项目名称:examples,代码行数:23,代码来源:console.go


示例5: SetSide

//SetSide sets Side, Tag 54
func (m NoRelatedSym) SetSide(v string) {
	m.Set(field.NewSide(v))
}
开发者ID:cbusbey,项目名称:quickfix,代码行数:4,代码来源:QuoteRequest.generated.go


示例6: SetSide

//SetSide sets Side, Tag 54
func (m OrderMassCancelRequest) SetSide(v string) {
	m.Set(field.NewSide(v))
}
开发者ID:cbusbey,项目名称:quickfix,代码行数:4,代码来源:OrderMassCancelRequest.generated.go


示例7: SetSide

//SetSide sets Side, Tag 54
func (m NoBidComponents) SetSide(v string) {
	m.Set(field.NewSide(v))
}
开发者ID:cbusbey,项目名称:quickfix,代码行数:4,代码来源:BidRequest.generated.go


示例8: SetSide

//SetSide sets Side, Tag 54
func (m DontKnowTrade) SetSide(v string) {
	m.Set(field.NewSide(v))
}
开发者ID:cbusbey,项目名称:quickfix,代码行数:4,代码来源:DontKnowTrade.generated.go


示例9: SetSide

//SetSide sets Side, Tag 54
func (m IOI) SetSide(v string) {
	m.Set(field.NewSide(v))
}
开发者ID:cbusbey,项目名称:quickfix,代码行数:4,代码来源:IOI.generated.go


示例10: SetSide

//SetSide sets Side, Tag 54
func (m NoRelatedSym) SetSide(v enum.Side) {
	m.Set(field.NewSide(v))
}
开发者ID:quickfixgo,项目名称:quickfix,代码行数:4,代码来源:QuoteRequest.generated.go


示例11: SetSide

//SetSide sets Side, Tag 54
func (m IndicationofInterest) SetSide(v string) {
	m.Set(field.NewSide(v))
}
开发者ID:cbusbey,项目名称:quickfix,代码行数:4,代码来源:IndicationofInterest.generated.go


示例12: SetSide

//SetSide sets Side, Tag 54
func (m OrderCancelRequest) SetSide(v enum.Side) {
	m.Set(field.NewSide(v))
}
开发者ID:quickfixgo,项目名称:quickfix,代码行数:4,代码来源:OrderCancelRequest.generated.go


示例13: SetSide

//SetSide sets Side, Tag 54
func (m NoStrikes) SetSide(v enum.Side) {
	m.Set(field.NewSide(v))
}
开发者ID:quickfixgo,项目名称:quickfix,代码行数:4,代码来源:ListStrikePrice.generated.go


示例14: SetSide

//SetSide sets Side, Tag 54
func (m Allocation) SetSide(v string) {
	m.Set(field.NewSide(v))
}
开发者ID:cbusbey,项目名称:quickfix,代码行数:4,代码来源:Allocation.generated.go


示例15: SetSide

//SetSide sets Side, Tag 54
func (m NewOrderList) SetSide(v enum.Side) {
	m.Set(field.NewSide(v))
}
开发者ID:quickfixgo,项目名称:quickfix,代码行数:4,代码来源:NewOrderList.generated.go


示例16: SetSide

//SetSide sets Side, Tag 54
func (m QuoteStatusRequest) SetSide(v enum.Side) {
	m.Set(field.NewSide(v))
}
开发者ID:quickfixgo,项目名称:quickfix,代码行数:4,代码来源:QuoteStatusRequest.generated.go


示例17: SetSide

//SetSide sets Side, Tag 54
func (m OrderStatusRequest) SetSide(v string) {
	m.Set(field.NewSide(v))
}
开发者ID:cbusbey,项目名称:quickfix,代码行数:4,代码来源:OrderStatusRequest.generated.go


示例18: SetSide

//SetSide sets Side, Tag 54
func (m ExecutionReport) SetSide(v enum.Side) {
	m.Set(field.NewSide(v))
}
开发者ID:quickfixgo,项目名称:examples,代码行数:4,代码来源:ExecutionReport.generated.go


示例19: SetSide

//SetSide sets Side, Tag 54
func (m OrderCancelReplaceRequest) SetSide(v string) {
	m.Set(field.NewSide(v))
}
开发者ID:cbusbey,项目名称:quickfix,代码行数:4,代码来源:OrderCancelReplaceRequest.generated.go


示例20: SetSide

//SetSide sets Side, Tag 54
func (m SettlementInstructions) SetSide(v enum.Side) {
	m.Set(field.NewSide(v))
}
开发者ID:quickfixgo,项目名称:quickfix,代码行数:4,代码来源:SettlementInstructions.generated.go



注:本文中的github.com/quickfixgo/quickfix/field.NewSide函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Golang field.NewStateOrProvinceOfIssue函数代码示例发布时间:2022-05-28
下一篇:
Golang field.NewSettlmntTyp函数代码示例发布时间:2022-05-28
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap