Skip to content
This repository has been archived by the owner on Nov 26, 2022. It is now read-only.

Binance gives the wrong price for executed order #151

Closed
fredfortier opened this issue Jan 11, 2018 · 5 comments
Closed

Binance gives the wrong price for executed order #151

fredfortier opened this issue Jan 11, 2018 · 5 comments

Comments

@fredfortier
Copy link
Contributor

fredfortier commented Jan 11, 2018

In relation to issue #150 , I noticed that binance gives the wrong price for an executed order. Based on this screenshot, I'd expect Binance to respond to the "Avg" price of the order (0.00000827). Instead, it responds with the limit price of the order. This explains why we don't get a price for market orders.
screenshot 2018-01-10 22 44 32

Here is the order object (0.00000827 not in the payload):

{  
   '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
}

We may fix this on the CCXT side after further investigation.

@fredfortier
Copy link
Contributor Author

So, this was answered in the attached CCXT issue. Binance (and a handful of other exchanges) don't put the trade execution data in the filled order objects. We need to use the fetch_my_trades() api to work around this issue. Looking into it.

fredfortier added a commit that referenced this issue Jan 12, 2018
…rocessing order for exchanges supporting "fetch-my-trades"
fredfortier added a commit that referenced this issue Jan 12, 2018
…rocessing order for exchanges supporting "fetch-my-trades"
@fredfortier
Copy link
Contributor Author

Currently testing in live trading before releasing.

@q8888620002
Copy link

Is binance available on catalyst ? It seems that the ingest function does not work for it.

@fredfortier
Copy link
Contributor Author

fredfortier commented Jan 16, 2018 via email

@fredfortier
Copy link
Contributor Author

Fixed on 0.4.6 please re-open if you still notice an issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants