//SetOrdType sets OrdType, Tag 40
func (m NoRelatedSym) SetOrdType(v enum.OrdType) {
	m.Set(field.NewOrdType(v))
}
//SetOrdType sets OrdType, Tag 40
func (m OrderCancelReplaceRequest) SetOrdType(v string) {
	m.Set(field.NewOrdType(v))
}
//SetOrdType sets OrdType, Tag 40
func (m ExecutionReport) SetOrdType(v enum.OrdType) {
	m.Set(field.NewOrdType(v))
}
//SetOrdType sets OrdType, Tag 40
func (m NoOrdTypeRules) SetOrdType(v enum.OrdType) {
	m.Set(field.NewOrdType(v))
}
Example #5
0
func main() {
	fmt.Println("hello world")

	msg := quickfix.NewMessage()

	group := NewNoOrdersRepeatingGroup()
	order1 := group.Add()
	order1.SetClOrdID(field.ClOrdIDField{FIXString: "1"})

	order2 := group.Add()
	order2.SetClOrdID(field.ClOrdIDField{FIXString: "2"})

	msg.Header.Set(field.NewBeginString(enum.BeginStringFIX42))
	msg.Header.Set(field.NewMsgType(enum.MsgType_NEW_ORDER_CROSS))
	msg.Body.SetGroup(group)

	b, _ := msg.Build()
	fmt.Println(string(b))

	m, err := quickfix.ParseMessage(b)
	if err != nil {
		panic(err)
	}

	g := NewNoOrdersRepeatingGroup()
	m.Body.GetGroup(g)

	fmt.Println(g.Len())

	clordid1, _ := g.Get(0).GetClOrdID()
	clordid2, _ := g.Get(1).GetClOrdID()

	fmt.Println(clordid1)
	fmt.Println(clordid2)

	m, err = quickfix.ParseMessage([]byte("8=FIX.4.29=10835=D34=249=TW52=20160421-14:43:5056=ISLD11=ID21=440=154=138=002000.0055=INTC60=20160421-14:43:5010=004"))
	//	m, err = quickfix.ParseMessage([]byte("8=FIX.4.29=10835=D34=249=TW52=20160421-14:43:5056=ISLD11=ID21=438=002000.0040=154=255=INTC60=20160421-14:43:5010=005"))
	//	m, err = quickfix.ParseMessage([]byte("8=FIX.4.29=11835=D34=249=TW52=20160421-14:43:5056=ISLD11=ID21=438=002000.0040=154=255=INTC58=oh hai60=20160421-14:43:5010=218"))

	if err != nil {
		panic(err)
	}

	nos := newordersingle.FromMessage(m)
	if side, err := nos.GetSide(); err != nil {
		panic(err)
	} else {
		fmt.Printf("Side is %v\n", side)
	}
	nos.SetSide(enum.Side_SELL)
	nos.Set(field.NewText("oh hai"))

	m = nos.ToMessage()
	b, err = m.Build()
	if err != nil {
		panic(err)
	}
	fmt.Println(string(b))

	newNos := newordersingle.New(
		field.NewClOrdID("1234"),
		field.NewHandlInst("1"),
		field.NewSymbol("TSLA"),
		field.NewSide(enum.Side_BUY),
		field.NewOrderQty(100.0),
		field.NewOrdType(enum.OrdType_MARKET),
	)

	//newNos.Set(field.NewTransactTime(time.Now()))
	newNos.Set(field.NewTransactTimeNoMillis(time.Now()))

	m = newNos.ToMessage()
	b, err = m.Build()
	if err != nil {
		panic(err)
	}
	fmt.Println(string(b))
}
//SetOrdType sets OrdType, Tag 40
func (m NoQuoteEntries) SetOrdType(v enum.OrdType) {
	m.Set(field.NewOrdType(v))
}
//SetOrdType sets OrdType, Tag 40
func (m OrderCancelReplaceRequest) SetOrdType(v enum.OrdType) {
	m.Set(field.NewOrdType(v))
}
//SetOrdType sets OrdType, Tag 40
func (m NoRelatedSym) SetOrdType(v string) {
	m.Set(field.NewOrdType(v))
}
Example #9
0
//SetOrdType sets OrdType, Tag 40
func (m NoQuoteEntries) SetOrdType(v string) {
	m.Set(field.NewOrdType(v))
}
//SetOrdType sets OrdType, Tag 40
func (m NewOrderList) SetOrdType(v string) {
	m.Set(field.NewOrdType(v))
}
Example #11
0
//SetOrdType sets OrdType, Tag 40
func (m Quote) SetOrdType(v string) {
	m.Set(field.NewOrdType(v))
}
//SetOrdType sets OrdType, Tag 40
func (m ExecutionReport) SetOrdType(v string) {
	m.Set(field.NewOrdType(v))
}
//SetOrdType sets OrdType, Tag 40
func (m QuoteStatusReport) SetOrdType(v enum.OrdType) {
	m.Set(field.NewOrdType(v))
}
Example #14
0
//SetOrdType sets OrdType, Tag 40
func (m Quote) SetOrdType(v enum.OrdType) {
	m.Set(field.NewOrdType(v))
}
//SetOrdType sets OrdType, Tag 40
func (m NewOrderList) SetOrdType(v enum.OrdType) {
	m.Set(field.NewOrdType(v))
}
//SetOrdType sets OrdType, Tag 40
func (m NewOrderSingle) SetOrdType(v string) {
	m.Set(field.NewOrdType(v))
}
//SetOrdType sets OrdType, Tag 40
func (m NoOrdTypeRules) SetOrdType(v string) {
	m.Set(field.NewOrdType(v))
}
//SetOrdType sets OrdType, Tag 40
func (m NewOrderSingle) SetOrdType(v enum.OrdType) {
	m.Set(field.NewOrdType(v))
}
//SetOrdType sets OrdType, Tag 40
func (m QuoteStatusReport) SetOrdType(v string) {
	m.Set(field.NewOrdType(v))
}