mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-25 16:25:16 +00:00
fix streambook usage
This commit is contained in:
parent
ca71c81284
commit
008b606121
|
@ -67,13 +67,15 @@ var rootCmd = &cobra.Command{
|
||||||
return
|
return
|
||||||
|
|
||||||
case <-streambook.C:
|
case <-streambook.C:
|
||||||
if valid, err := streambook.IsValid(); !valid {
|
book := streambook.Get()
|
||||||
|
|
||||||
|
if valid, err := book.IsValid(); !valid {
|
||||||
log.Errorf("order book is invalid, error: %v", err)
|
log.Errorf("order book is invalid, error: %v", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
bestBid, hasBid := streambook.BestBid()
|
bestBid, hasBid := book.BestBid()
|
||||||
bestAsk, hasAsk := streambook.BestAsk()
|
bestAsk, hasAsk := book.BestAsk()
|
||||||
if hasBid && hasAsk {
|
if hasBid && hasAsk {
|
||||||
log.Infof("================================")
|
log.Infof("================================")
|
||||||
log.Infof("best ask %f % -12f",
|
log.Infof("best ask %f % -12f",
|
||||||
|
|
Loading…
Reference in New Issue
Block a user