question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

fetch_order() order from Binance gives the limit price instead of the executed price

See original GitHub issue

I noticed this discrepancy in context of this issue: https://github.com/enigmampc/catalyst/issues/151.

Basically, I’m doing a fetch_order() on a filled order to determine the avg executed price. However, the price attribute corresponds to the limit price. I don’t see this data in the info dict either. Let me know if you are already aware of this. If not, I’ll do a PR to fix it. screenshot 2018-01-10 22 44 32

Here is the output. 0.00000836 is my limit. It’s missing my avg price which is 0.00000827. Dividing cost by amount also gives me 0.00000836.

{  
   'status':'closed',
   'timestamp':1515641853506,
   'price':8.36e-06,
   'datetime':'2018-01-11T03:37:33.506Z',
   'cost':0.0030346799999999997,
   'id':'17210371',
   'remaining':0.0,
   'info':{  
      u'orderId':17210371,
      u'clientOrderId':u'z8xl93tiQH5ZRTOGEtNI9D',
      u'origQty':u'363.00000000',
      u'icebergQty':u'0.00000000',
      u'symbol':u'TRXBTC',
      u'side':u'BUY',
      u'timeInForce':u'GTC',
      u'status':u'FILLED',
      u'stopPrice':u'0.00000000',
      u'time':1515641853506,
      u'isWorking':True,
      u'type':u'LIMIT',
      u'price':u'0.00000836',
      u'executedQty':u'363.00000000'
   },
   'fee':None,
   'side':u'buy',
   'amount':363.0,
   'type':u'limit',
   'symbol':u'TRX/BTC',
   'filled':363.0
}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
kroitorcommented, Jun 28, 2018

@benediamond you can obtain that info with this.options['newOrderRespType']. 'ACK' for order id, 'RESULT' for full order or 'FULL' for order with fills. 'RESULT' is their default.

1reaction
fredfortiercommented, Jan 11, 2018

Yes, that makes sense. We’ll work with fetchMyTrades() to get this info.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What Is a Limit Order? - Binance Academy
A limit order is a type of trading order that has a specific buy or sell price. It will only be executed if...
Read more >
Different Order Types in Spot Trading | Binance Support
A limit order is an order that you place on the order book with a specific limit price. It will not be executed...
Read more >
Types of Order on Binance Futures
A Stop Limit order is a conditional order over a set timeframe, executed at a specified price after a given stop price has...
Read more >
What are Market Order and Limit Order, and How to Place Them
A market order is an instruction to buy or sell an asset immediately (at the market's current price), while a limit order is...
Read more >
What is The Stop-Limit Function and How to Use It - Binance
A stop-limit order is a limit order that has a limit price and a stop price. When the stop price is reached, the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found