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

Golang field.NewMsgType函数代码示例

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

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



在下文中一共展示了NewMsgType函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。

示例1: Builder

//Builder returns an initialized MessageBuilder with specified required fields for ExecutionReport.
func Builder(
	orderid *field.OrderIDField,
	execid *field.ExecIDField,
	exectranstype *field.ExecTransTypeField,
	ordstatus *field.OrdStatusField,
	symbol *field.SymbolField,
	side *field.SideField,
	orderqty *field.OrderQtyField,
	lastshares *field.LastSharesField,
	lastpx *field.LastPxField,
	cumqty *field.CumQtyField,
	avgpx *field.AvgPxField) MessageBuilder {
	var builder MessageBuilder
	builder.MessageBuilder = quickfix.NewMessageBuilder()
	builder.Header().Set(field.NewBeginString(fix.BeginString_FIX40))
	builder.Header().Set(field.NewMsgType("8"))
	builder.Body().Set(orderid)
	builder.Body().Set(execid)
	builder.Body().Set(exectranstype)
	builder.Body().Set(ordstatus)
	builder.Body().Set(symbol)
	builder.Body().Set(side)
	builder.Body().Set(orderqty)
	builder.Body().Set(lastshares)
	builder.Body().Set(lastpx)
	builder.Body().Set(cumqty)
	builder.Body().Set(avgpx)
	return builder
}
开发者ID:jarlwolfganger,项目名称:quickfix,代码行数:30,代码来源:ExecutionReport.go


示例2: Builder

//Builder returns an initialized MessageBuilder with specified required fields for NewOrderList.
func Builder(
	listid *field.ListIDField,
	listseqno *field.ListSeqNoField,
	listnoords *field.ListNoOrdsField,
	clordid *field.ClOrdIDField,
	handlinst *field.HandlInstField,
	symbol *field.SymbolField,
	side *field.SideField,
	orderqty *field.OrderQtyField,
	ordtype *field.OrdTypeField) MessageBuilder {
	var builder MessageBuilder
	builder.MessageBuilder = quickfix.NewMessageBuilder()
	builder.Header().Set(field.NewBeginString(fix.BeginString_FIX40))
	builder.Header().Set(field.NewMsgType("E"))
	builder.Body().Set(listid)
	builder.Body().Set(listseqno)
	builder.Body().Set(listnoords)
	builder.Body().Set(clordid)
	builder.Body().Set(handlinst)
	builder.Body().Set(symbol)
	builder.Body().Set(side)
	builder.Body().Set(orderqty)
	builder.Body().Set(ordtype)
	return builder
}
开发者ID:jarlwolfganger,项目名称:quickfix,代码行数:26,代码来源:NewOrderList.go


示例3: Builder

//Builder returns an initialized MessageBuilder with specified required fields for Allocation.
func Builder(
	allocid *field.AllocIDField,
	alloctranstype *field.AllocTransTypeField,
	noorders *field.NoOrdersField,
	side *field.SideField,
	symbol *field.SymbolField,
	shares *field.SharesField,
	avgpx *field.AvgPxField,
	tradedate *field.TradeDateField,
	noallocs *field.NoAllocsField) MessageBuilder {
	var builder MessageBuilder
	builder.MessageBuilder = quickfix.NewMessageBuilder()
	builder.Header().Set(field.NewBeginString(fix.BeginString_FIX40))
	builder.Header().Set(field.NewMsgType("J"))
	builder.Body().Set(allocid)
	builder.Body().Set(alloctranstype)
	builder.Body().Set(noorders)
	builder.Body().Set(side)
	builder.Body().Set(symbol)
	builder.Body().Set(shares)
	builder.Body().Set(avgpx)
	builder.Body().Set(tradedate)
	builder.Body().Set(noallocs)
	return builder
}
开发者ID:jarlwolfganger,项目名称:quickfix,代码行数:26,代码来源:Allocation.go


示例4: Builder

//Builder returns an initialized MessageBuilder with specified required fields for AssignmentReport.
func Builder(
	asgnrptid *field.AsgnRptIDField,
	accounttype *field.AccountTypeField,
	settlprice *field.SettlPriceField,
	settlpricetype *field.SettlPriceTypeField,
	underlyingsettlprice *field.UnderlyingSettlPriceField,
	assignmentmethod *field.AssignmentMethodField,
	openinterest *field.OpenInterestField,
	exercisemethod *field.ExerciseMethodField,
	settlsessid *field.SettlSessIDField,
	settlsesssubid *field.SettlSessSubIDField,
	clearingbusinessdate *field.ClearingBusinessDateField) MessageBuilder {
	var builder MessageBuilder
	builder.MessageBuilder = quickfix.NewMessageBuilder()
	builder.Header().Set(field.NewBeginString(fix.BeginString_FIX44))
	builder.Header().Set(field.NewMsgType("AW"))
	builder.Body().Set(asgnrptid)
	builder.Body().Set(accounttype)
	builder.Body().Set(settlprice)
	builder.Body().Set(settlpricetype)
	builder.Body().Set(underlyingsettlprice)
	builder.Body().Set(assignmentmethod)
	builder.Body().Set(openinterest)
	builder.Body().Set(exercisemethod)
	builder.Body().Set(settlsessid)
	builder.Body().Set(settlsesssubid)
	builder.Body().Set(clearingbusinessdate)
	return builder
}
开发者ID:jarlwolfganger,项目名称:quickfix,代码行数:30,代码来源:AssignmentReport.go


示例5: Builder

//Builder returns an initialized MessageBuilder with specified required fields for Heartbeat.
func Builder() MessageBuilder {
	var builder MessageBuilder
	builder.MessageBuilder = quickfix.NewMessageBuilder()
	builder.Header().Set(field.NewBeginString(fix.BeginString_FIX40))
	builder.Header().Set(field.NewMsgType("0"))
	return builder
}
开发者ID:jarlwolfganger,项目名称:quickfix,代码行数:8,代码来源:Heartbeat.go


示例6: Timeout

func (state inSession) Timeout(session *Session, event event) (nextState sessionState) {
	switch event {
	case needHeartbeat:
		heartBt := NewMessageBuilder()
		heartBt.Header().Set(field.NewMsgType("0"))
		session.send(heartBt)
	case peerTimeout:
		testReq := NewMessageBuilder()
		testReq.Header().Set(field.NewMsgType("1"))
		testReq.Body().Set(field.NewTestReqID("TEST"))
		session.send(testReq)
		session.peerTimer.Reset(time.Duration(int64(1.2 * float64(session.heartBeatTimeout))))
		return pendingTimeout{}
	}
	return state
}
开发者ID:jarlwolfganger,项目名称:quickfix,代码行数:16,代码来源:in_session.go


示例7: Builder

//Builder returns an initialized MessageBuilder with specified required fields for PositionMaintenanceReport.
func Builder(
	posmaintrptid *field.PosMaintRptIDField,
	postranstype *field.PosTransTypeField,
	posmaintaction *field.PosMaintActionField,
	origposreqrefid *field.OrigPosReqRefIDField,
	posmaintstatus *field.PosMaintStatusField,
	clearingbusinessdate *field.ClearingBusinessDateField,
	account *field.AccountField,
	accounttype *field.AccountTypeField,
	transacttime *field.TransactTimeField) MessageBuilder {
	var builder MessageBuilder
	builder.MessageBuilder = quickfix.NewMessageBuilder()
	builder.Header().Set(field.NewBeginString(fix.BeginString_FIX44))
	builder.Header().Set(field.NewMsgType("AM"))
	builder.Body().Set(posmaintrptid)
	builder.Body().Set(postranstype)
	builder.Body().Set(posmaintaction)
	builder.Body().Set(origposreqrefid)
	builder.Body().Set(posmaintstatus)
	builder.Body().Set(clearingbusinessdate)
	builder.Body().Set(account)
	builder.Body().Set(accounttype)
	builder.Body().Set(transacttime)
	return builder
}
开发者ID:jarlwolfganger,项目名称:quickfix,代码行数:26,代码来源:PositionMaintenanceReport.go


示例8: Builder

//Builder returns an initialized MessageBuilder with specified required fields for SecurityList.
func Builder() MessageBuilder {
	var builder MessageBuilder
	builder.MessageBuilder = quickfix.NewMessageBuilder()
	builder.Header().Set(field.NewBeginString(fix.BeginString_FIXT11))
	builder.Header().Set(field.NewDefaultApplVerID(enum.ApplVerID_FIX50SP2))
	builder.Header().Set(field.NewMsgType("y"))
	return builder
}
开发者ID:jarlwolfganger,项目名称:quickfix,代码行数:9,代码来源:SecurityList.go


示例9: doReject

func (s *Session) doReject(msg Message, rej MessageRejectError) {
	reply := msg.reverseRoute()

	if s.sessionID.BeginString >= fix.BeginString_FIX42 {

		if rej.IsBusinessReject() {
			reply.Header().Set(field.NewMsgType("j"))
			reply.Body().Set(field.NewBusinessRejectReason(int(rej.RejectReason())))
		} else {
			reply.Header().Set(field.NewMsgType("3"))
			switch {
			default:
				reply.Body().Set(field.NewSessionRejectReason(int(rej.RejectReason())))
			case rej.RejectReason() > rejectReasonInvalidMsgType && s.sessionID.BeginString == fix.BeginString_FIX42:
				//fix42 knows up to invalid msg type
			}
		}
		reply.Body().Set(field.NewText(rej.Error()))

		var msgType field.MsgTypeField
		if err := msg.Header.Get(&msgType); err == nil {
			reply.Body().Set(field.NewRefMsgType(msgType.Value))
		}

		if refTagID := rej.RefTagID(); refTagID != nil {
			reply.Body().Set(field.NewRefTagID(int(*refTagID)))
		}
	} else {
		reply.Header().Set(field.NewMsgType("3"))

		if refTagID := rej.RefTagID(); refTagID != nil {
			reply.Body().Set(field.NewText(fmt.Sprintf("%s (%d)", rej.Error(), *refTagID)))
		} else {
			reply.Body().Set(field.NewText(rej.Error()))
		}
	}

	var seqNum field.MsgSeqNumField
	if err := msg.Header.Get(&seqNum); err == nil {
		reply.Body().Set(field.NewRefSeqNum(seqNum.Value))
	}

	s.send(reply)
	s.log.OnEventf("Message Rejected: %v", rej.Error())
}
开发者ID:jarlwolfganger,项目名称:quickfix,代码行数:45,代码来源:session.go


示例10: Builder

//Builder returns an initialized MessageBuilder with specified required fields for QuoteAcknowledgement.
func Builder(
	quoteackstatus *field.QuoteAckStatusField) MessageBuilder {
	var builder MessageBuilder
	builder.MessageBuilder = quickfix.NewMessageBuilder()
	builder.Header().Set(field.NewBeginString(fix.BeginString_FIX42))
	builder.Header().Set(field.NewMsgType("b"))
	builder.Body().Set(quoteackstatus)
	return builder
}
开发者ID:jarlwolfganger,项目名称:quickfix,代码行数:10,代码来源:QuoteAcknowledgement.go


示例11: Builder

//Builder returns an initialized MessageBuilder with specified required fields for SecurityStatus.
func Builder(
	symbol *field.SymbolField) MessageBuilder {
	var builder MessageBuilder
	builder.MessageBuilder = quickfix.NewMessageBuilder()
	builder.Header().Set(field.NewBeginString(fix.BeginString_FIX42))
	builder.Header().Set(field.NewMsgType("f"))
	builder.Body().Set(symbol)
	return builder
}
开发者ID:jarlwolfganger,项目名称:quickfix,代码行数:10,代码来源:SecurityStatus.go


示例12: Builder

//Builder returns an initialized MessageBuilder with specified required fields for BidResponse.
func Builder(
	nobidcomponents *field.NoBidComponentsField) MessageBuilder {
	var builder MessageBuilder
	builder.MessageBuilder = quickfix.NewMessageBuilder()
	builder.Header().Set(field.NewBeginString(fix.BeginString_FIX44))
	builder.Header().Set(field.NewMsgType("l"))
	builder.Body().Set(nobidcomponents)
	return builder
}
开发者ID:jarlwolfganger,项目名称:quickfix,代码行数:10,代码来源:BidResponse.go


示例13: Builder

//Builder returns an initialized MessageBuilder with specified required fields for Quote.
func Builder(
	quoteid *field.QuoteIDField) MessageBuilder {
	var builder MessageBuilder
	builder.MessageBuilder = quickfix.NewMessageBuilder()
	builder.Header().Set(field.NewBeginString(fix.BeginString_FIX43))
	builder.Header().Set(field.NewMsgType("S"))
	builder.Body().Set(quoteid)
	return builder
}
开发者ID:jarlwolfganger,项目名称:quickfix,代码行数:10,代码来源:Quote.go


示例14: Builder

//Builder returns an initialized MessageBuilder with specified required fields for ListStatusRequest.
func Builder(
	listid *field.ListIDField) MessageBuilder {
	var builder MessageBuilder
	builder.MessageBuilder = quickfix.NewMessageBuilder()
	builder.Header().Set(field.NewBeginString(fix.BeginString_FIX41))
	builder.Header().Set(field.NewMsgType("M"))
	builder.Body().Set(listid)
	return builder
}
开发者ID:jarlwolfganger,项目名称:quickfix,代码行数:10,代码来源:ListStatusRequest.go


示例15: Builder

//Builder returns an initialized MessageBuilder with specified required fields for SequenceReset.
func Builder(
	newseqno *field.NewSeqNoField) MessageBuilder {
	var builder MessageBuilder
	builder.MessageBuilder = quickfix.NewMessageBuilder()
	builder.Header().Set(field.NewBeginString(fix.BeginString_FIX43))
	builder.Header().Set(field.NewMsgType("4"))
	builder.Body().Set(newseqno)
	return builder
}
开发者ID:jarlwolfganger,项目名称:quickfix,代码行数:10,代码来源:SequenceReset.go


示例16: Builder

//Builder returns an initialized MessageBuilder with specified required fields for MarketDataRequestReject.
func Builder(
	mdreqid *field.MDReqIDField) MessageBuilder {
	var builder MessageBuilder
	builder.MessageBuilder = quickfix.NewMessageBuilder()
	builder.Header().Set(field.NewBeginString(fix.BeginString_FIX44))
	builder.Header().Set(field.NewMsgType("Y"))
	builder.Body().Set(mdreqid)
	return builder
}
开发者ID:jarlwolfganger,项目名称:quickfix,代码行数:10,代码来源:MarketDataRequestReject.go


示例17: Builder

//Builder returns an initialized MessageBuilder with specified required fields for Reject.
func Builder(
	refseqnum *field.RefSeqNumField) MessageBuilder {
	var builder MessageBuilder
	builder.MessageBuilder = quickfix.NewMessageBuilder()
	builder.Header().Set(field.NewBeginString(fix.BeginString_FIX42))
	builder.Header().Set(field.NewMsgType("3"))
	builder.Body().Set(refseqnum)
	return builder
}
开发者ID:jarlwolfganger,项目名称:quickfix,代码行数:10,代码来源:Reject.go


示例18: Builder

//Builder returns an initialized MessageBuilder with specified required fields for TestRequest.
func Builder(
	testreqid *field.TestReqIDField) MessageBuilder {
	var builder MessageBuilder
	builder.MessageBuilder = quickfix.NewMessageBuilder()
	builder.Header().Set(field.NewBeginString(fix.BeginString_FIXT11))
	builder.Header().Set(field.NewMsgType("1"))
	builder.Body().Set(testreqid)
	return builder
}
开发者ID:jarlwolfganger,项目名称:quickfix,代码行数:10,代码来源:TestRequest.go


示例19: Builder

//Builder returns an initialized MessageBuilder with specified required fields for MarketDataIncrementalRefresh.
func Builder(
	nomdentries *field.NoMDEntriesField) MessageBuilder {
	var builder MessageBuilder
	builder.MessageBuilder = quickfix.NewMessageBuilder()
	builder.Header().Set(field.NewBeginString(fix.BeginString_FIX43))
	builder.Header().Set(field.NewMsgType("X"))
	builder.Body().Set(nomdentries)
	return builder
}
开发者ID:jarlwolfganger,项目名称:quickfix,代码行数:10,代码来源:MarketDataIncrementalRefresh.go


示例20: Builder

//Builder returns an initialized MessageBuilder with specified required fields for SecurityTypeRequest.
func Builder(
	securityreqid *field.SecurityReqIDField) MessageBuilder {
	var builder MessageBuilder
	builder.MessageBuilder = quickfix.NewMessageBuilder()
	builder.Header().Set(field.NewBeginString(fix.BeginString_FIX43))
	builder.Header().Set(field.NewMsgType("v"))
	builder.Body().Set(securityreqid)
	return builder
}
开发者ID:jarlwolfganger,项目名称:quickfix,代码行数:10,代码来源:SecurityTypeRequest.go



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Golang fix40.NewHeader函数代码示例发布时间:2022-05-28
下一篇:
Golang field.NewDefaultApplVerID函数代码示例发布时间: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