mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 06:53:52 +00:00
fix streambook usage
This commit is contained in:
parent
ca71c81284
commit
008b606121
|
@ -67,13 +67,15 @@ var rootCmd = &cobra.Command{
|
|||
return
|
||||
|
||||
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)
|
||||
return
|
||||
}
|
||||
|
||||
bestBid, hasBid := streambook.BestBid()
|
||||
bestAsk, hasAsk := streambook.BestAsk()
|
||||
bestBid, hasBid := book.BestBid()
|
||||
bestAsk, hasAsk := book.BestAsk()
|
||||
if hasBid && hasAsk {
|
||||
log.Infof("================================")
|
||||
log.Infof("best ask %f % -12f",
|
||||
|
|
Loading…
Reference in New Issue
Block a user