Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
f0cii committed Oct 20, 2020
1 parent 953c145 commit 536ce49
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions exchanges/exsim/exsim.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,13 @@ func (b *ExSim) matchMarketOrder(order *Order) (changed bool, err error) {
return
}

ob := b.getOrderBook()
var ob *OrderBook
//ob := b.getOrderBook()
if order.Symbol != "" {
ob, _ = b.GetOrderBook(order.Symbol, 25)
} else {
ob = b.getOrderBook()
}

// 判断开仓数量
margin := b.balance
Expand Down Expand Up @@ -344,7 +350,13 @@ func (b *ExSim) matchLimitOrder(order *Order, immediate bool) (match bool, err e

side := b.getOrderSide(order)

ob := b.getOrderBook()
var ob *OrderBook
//ob := b.getOrderBook()
if order.Symbol != "" {
ob, _ = b.GetOrderBook(order.Symbol, 25)
} else {
ob = b.getOrderBook()
}
if order.Direction == Buy { // Bid order
filledAmount, avgPrice := b.matchBid(order.Amount, ob.Asks...)
//if order.Price < ob.AskPrice() {
Expand Down

0 comments on commit 536ce49

Please sign in to comment.