sammchardy / python-binance

Binance Exchange API python implementation for automated trading
https://python-binance.readthedocs.io/en/latest/
MIT License
5.91k stars 2.19k forks source link

Why I can't put futures_create_order? #1284

Closed CopyPasteJedi closed 1 year ago

CopyPasteJedi commented 1 year ago

Hi, What I'm doing wrong that I can't put order? I want to put reduce only market stop loss before opening normal position. I was trying multiple times with diffrent variants, but had no success. I don't get any errors. Code just stops.

symbol = "OPUSDT"       # type str
stopQty = 134.9         # type Decimal
stopPrice = 2.7322000   # type Decimal

stopOrder = await self.exchange.client.futures_create_order(
                                              symbol = symbol,
                                              side = self.exchange.client.SIDE_SELL,
                                              type = self.exchange.client.FUTURE_ORDER_TYPE_STOP_MARKET,
                                              stopPrice = stopPrice,
                                              quantity = stopQty,
                                              workingType="MARK_PRICE",
                                              timeInForce = 'GTC',
                                              reduceOnly = True
                                             )

Market info about symbol:

           pair   status maintMarginPercent requiredMarginPercent baseAsset  \
93  OPUSDT  TRADING             2.5000                5.0000        OP   

   quoteAsset marginAsset  pricePrecision  quantityPrecision  \
93       USDT        USDT               7                  1   

    baseAssetPrecision  quotePrecision underlyingType underlyingSubType  \
93                   8               8           COIN         [Layer-2]   

    settlePlan triggerProtect liquidationFee marketTakeBound   minPrice  \
93           0         0.1000       0.010000            0.10  0.0001000   

   maxPrice     filterType   tickSize stepSize maxQty minQty  limit notional  \
93   100000  PERCENT_PRICE  0.0001000      0.1  50000    0.1     10        5   

   multiplierDown multiplierUp multiplierDecimal  
93         0.9000       1.1000                 4 

I will be grateful for any help. Thx

Resolved. Binance changed the rules and permissions and after I approved rules , I could switched back.