main.go 612 B

12345678910111213141516171819202122232425262728
  1. package main
  2. import "tickserver/api/fix"
  3. import "fmt"
  4. import "os"
  5. func main() {
  6. path := os.Getenv("GOPATH") + "/bin/data/md.cfg"
  7. fmt.Println(path)
  8. ss , err := fix.NewSessionSettings(path)
  9. if err != nil {
  10. panic(err)
  11. }
  12. sourdatach := make(chan *fix.TickFull)
  13. fix.InitBroadcast(sourdatach)
  14. app := fix.NewMarketInfoApp(sourdatach)
  15. trade, err := fix.NewAppTradeClient(app, ss)
  16. if err != nil {
  17. panic(err)
  18. }
  19. fmt.Println("run start")
  20. trade.Start()
  21. trade.Run()
  22. fmt.Println("run end")
  23. trade.Stop()
  24. trade.Free()
  25. fmt.Println("stop")
  26. }