pbinance icon indicating copy to clipboard operation
pbinance copied to clipboard

Python Binance API interface

Results 9 pbinance issues
Sort by recently updated
recently updated
newest added

对照币安官方文档,当binance.um.account.Trade.set_order_test()中timeInForce="GTD"时,goodTillDate参数是必要的,但是本项目中的binance.um.account.Trade.set_order_test()模块中缺少这个参数

大佬可以把代理功能集成一下吗

```python def get_leverageBracket(self, symbol: str = '', recvWindow: int = ''): ''' https://binance-docs.github.io/apidocs/futures/cn/#user_data-9 Name Type Mandatory Description symbol str NO recvWindow int NO ''' return self.send_request(*self.endpoints.get_leverageBracket, **to_local(locals())) ``` 根据官网介绍 |...

接口返回: {'code': 0, 'msg': "Service unavailable from a restricted location according to 'b. " "Eligibility' in https://www.binance.com/en/terms. Please contact " 'customer service if you believe you received this message in...

Hi, 目前我用官方的python-binance,它没有对Futures Order做TP/SL一键设置,目前查询到以及目前我正在使用的有瑕疵的方式是: ```python //创建买入Limit订单 client.futures_create_order(symbol="BTCUSDT",side='BUY',type='LIMIT',quantity=quantity,timeinforce='GTC',price = entry_price) //创建Market止损订单 client.futures_create_order(symbol="BTCUSDT",side = 'SELL',type ='STOP_MARKET',stopPrice=stop_price,closePosition='true') //创建Market止盈订单 client.futures_create_order(symbol="BTCUSDT",side = 'SELL',type ='TAKE_PROFIT_MARKET',stopPrice=profit_price,closePosition='true') ``` 即一次发出三次独立委托,在大多数情况下,这么设置是可行的,但是有些情况下会出现比较危险的状况。 上述的止损止盈订单虽然加上了closePosition参数,即只做减仓动作,不会主动开仓,但是价格触及之后无论账户有没有仓位,它都会执行并Fill。 于是就会衍生出一种情况是: 假如当前BTC的价格为100美金,我在90美金挂入Limit Buy Order,止损价格为80美金,止盈价格为110美金,我会同时发出上述三笔order。假如价格此时没有回落,而是直接上涨达到110美金,那么止盈订单会触发,由于没有仓位可减少,该止盈订单会Fill然后消失,此时我委托的订单就只有Limit Buy 和 Market止损,假如此时价格回落到90美金,我的Buy Order被执行,此时我的交易就只有止损订单而没有止盈订单,除非我时刻盯着手机看,否则这笔订单几乎就是一定会被止损,即使打到了止盈线。 当然也有一种解决办法是利用Websocket监控Limit...

![image](https://user-images.githubusercontent.com/28851617/220695485-62a02021-2b30-4d1f-80f4-3651bc3cf339.png)