mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 23:05:15 +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)
|
delta := stock.Consume(sell.Quantity)
|
||||||
sell.Consume(delta)
|
sell.Consume(delta)
|
||||||
|
|
||||||
m.Stocks[idx] = stock
|
m.Stocks[idx] = stock
|
||||||
|
|
||||||
|
if zero(sell.Quantity) {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if !zero(sell.Quantity) {
|
if !zero(sell.Quantity) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user