mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 00:35:15 +00:00
bbgo: push to the buffer first
This commit is contained in:
parent
7d853a9c74
commit
06a1f018c2
|
@ -66,15 +66,7 @@ func (c *TradeCollector) Run(ctx context.Context) {
|
|||
c.EmitPositionUpdate(c.position)
|
||||
|
||||
case trade := <-c.tradeC:
|
||||
if c.orderStore.Exists(trade.OrderID) {
|
||||
c.EmitTrade(trade)
|
||||
if profit, netProfit, madeProfit := c.position.AddTrade(trade) ; madeProfit {
|
||||
c.EmitProfit(trade, profit, netProfit)
|
||||
}
|
||||
c.EmitPositionUpdate(c.position)
|
||||
} else {
|
||||
c.tradeStore.Add(trade)
|
||||
}
|
||||
c.tradeStore.Add(trade)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user