mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 01:01:56 +00:00
fix stock consume
This commit is contained in:
parent
329aa39d26
commit
51700c951a
|
@ -169,8 +169,11 @@ func (m *StockManager) consume(sell Stock) error {
|
|||
|
||||
delta := stock.Consume(sell.Quantity)
|
||||
sell.Consume(delta)
|
||||
|
||||
m.Stocks[idx] = stock
|
||||
|
||||
if zero(sell.Quantity) {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
if !zero(sell.Quantity) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user