Created by: cbusbey
Refs #153 (closed). Verified fix works with message in that issue
package main
import (
"log"
"github.com/quickfixgo/quickfix"
fix44sl "github.com/quickfixgo/quickfix/fix44/securitylist"
)
func main() {
fix_msg := `...big message...`
m, err := quickfix.ParseMessage([]byte(fix_msg))
if err != nil {
log.Fatal("ERROR ", err)
}
msg := fix44sl.FromMessage(m)
symGroup, err := msg.GetNoRelatedSym()
if err != nil {
log.Fatal("ERROR ", err)
}
log.Printf("Got %v symbols\n", symGroup.Len())
for i := 0; i < symGroup.Len(); i++ {
sym, err := symGroup.Get(i).GetSymbol()
if err != nil {
log.Fatal("ERROR ", err)
}
log.Println(i, sym)
}
}
Yields
2016/06/21 08:53:24 Got 50 symbols 2016/06/21 08:53:24 0 UNG 2016/06/21 08:53:24 1 SPXPM 2016/06/21 08:53:24 2 ZM 2016/06/21 08:53:24 3 SPY 2016/06/21 08:53:24 4 ODAX 2016/06/21 08:53:24 5 RTS 2016/06/21 08:53:24 6 SPX 2016/06/21 08:53:24 7 HCA 2016/06/21 08:53:24 8 6B 2016/06/21 08:53:24 9 OG 2016/06/21 08:53:24 10 INZ 2016/06/21 08:53:24 11 EW 2016/06/21 08:53:24 12 SPX 2016/06/21 08:53:24 13 EFZ 2016/06/21 08:53:24 14 ES 2016/06/21 08:53:24 15 EW3 2016/06/21 08:53:24 16 EW 2016/06/21 08:53:24 17 VIX 2016/06/21 08:53:24 18 SPXW 2016/06/21 08:53:24 19 GE 2016/06/21 08:53:24 20 ODAX 2016/06/21 08:53:24 21 GE3 2016/06/21 08:53:24 22 6B 2016/06/21 08:53:24 23 ES 2016/06/21 08:53:24 24 EW2 2016/06/21 08:53:24 25 GLD 2016/06/21 08:53:24 26 OESX 2016/06/21 08:53:24 27 SPXW 2016/06/21 08:53:24 28 LO 2016/06/21 08:53:24 29 CVRR 2016/06/21 08:53:24 30 LO 2016/06/21 08:53:24 31 OZM 2016/06/21 08:53:24 32 ON 2016/06/21 08:53:24 33 SO 2016/06/21 08:53:24 34 SPX 2016/06/21 08:53:24 35 SPXPM 2016/06/21 08:53:24 36 GE0 2016/06/21 08:53:24 37 PIM 2016/06/21 08:53:24 38 6E 2016/06/21 08:53:24 39 OESX 2016/06/21 08:53:24 40 FFG 2016/06/21 08:53:24 41 SPY 2016/06/21 08:53:24 42 SPY 2016/06/21 08:53:24 43 BHI 2016/06/21 08:53:24 44 6E1 2016/06/21 08:53:24 45 ES 2016/06/21 08:53:24 46 GCK 2016/06/21 08:53:24 47 EW 2016/06/21 08:53:24 48 OG 2016/06/21 08:53:24 49 VIX