mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
backtest: set order price for market order
This commit is contained in:
parent
609b6a7a50
commit
b32cfef2fd
|
@ -172,6 +172,10 @@ func (m *SimplePriceMatching) PlaceOrder(o types.SubmitOrder) (*types.Order, *ty
|
|||
order := m.newOrder(o, orderID)
|
||||
|
||||
if isTaker {
|
||||
if order.Type == types.OrderTypeMarket {
|
||||
order.Price = m.LastPrice
|
||||
}
|
||||
|
||||
// emit the order update for Status:New
|
||||
m.EmitOrderUpdate(order)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user