Skip to content

Commit

Permalink
Fix market order actual price (DeviaVir#847)
Browse files Browse the repository at this point in the history
* Use actual price if possible.
In market order the actual price (api_order.price) should be very different from trade price

* Fix comment

Fix comment
  • Loading branch information
MT00x authored and DeviaVir committed Dec 12, 2017
1 parent 940616c commit bba3b75
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ module.exports = function container (get, set, clear) {
msg('order status: ' + order.status)
if (api_order.status === 'done') {
order.time = new Date(api_order.done_at).getTime()
order.price = api_order.price || order.price // Use actual price if possible. In market order the actual price (api_order.price) could be very different from trade price
executeOrder(order)
return syncBalance(function () {
cb(null, order)
Expand Down

0 comments on commit bba3b75

Please sign in to comment.