mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 06:53:52 +00:00
backtest: for types.OrderTypeStopMarket, use stop price to simulate the actual price for balance locking
This commit is contained in:
parent
a370a5e489
commit
26f5f36f7e
|
@ -139,6 +139,11 @@ func (m *SimplePriceMatching) PlaceOrder(o types.SubmitOrder) (*types.Order, *ty
|
|||
switch o.Type {
|
||||
case types.OrderTypeMarket:
|
||||
price = m.LastPrice
|
||||
|
||||
case types.OrderTypeStopMarket:
|
||||
// the actual price might be different.
|
||||
price = o.StopPrice
|
||||
|
||||
case types.OrderTypeLimit, types.OrderTypeStopLimit, types.OrderTypeLimitMaker:
|
||||
price = o.Price
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user