简体   繁体   中英

Binance OCO Order -> MIN_NOTIONAL | python-binance

Im trying to create an OCO order for ETHUSDT

This is the function I created:

def OcoOrder(symbol, bet, takeProfit, stopLoss):
    client.order_oco_sell(symbol=symbol,
                          quantity=str(bet),
                          price=str(round(takeProfit, 2)),
                          stopPrice=str(round(stopLoss, 2)),
                          stopLimitPrice =str(round(stopLoss, 2)),
                          stopLimitTimeInForce="GTC")

Heres the call:

buyPrice = 3803.57
stopLossValue = buyPrice * stopLoss
takeProfitValue = buyPrice * takeProfit
OcoOrder(symbol, "0.0028", takeProfitValue, stopLossValue)

The quantity Im having is 0.0028 which equals a bit more than 10USDT在此处输入图片说明

After I execute the code I get the error:

APIError(code=-1013): Filter failure: MIN_NOTIONAL

I checked the binance exchange information for the MIN_NOTINAL value and it is 10. Means the minimum quantity i can sell is 10 ETH or in other words 38.000€ ?!?!?!

{
     "symbol":"ETHUSDT",
     "status":"TRADING",
     "baseAsset":"ETH",
     "baseAssetPrecision":8,
     "quoteAsset":"USDT",
     "quotePrecision":8,
     "quoteAssetPrecision":8,
     "baseCommissionPrecision":8,
     "quoteCommissionPrecision":8,
     "orderTypes":[
        "LIMIT",
        "LIMIT_MAKER",
        "MARKET",
        "STOP_LOSS_LIMIT",
        "TAKE_PROFIT_LIMIT"
     ],
     "icebergAllowed":true,
     "ocoAllowed":true,
     "quoteOrderQtyMarketAllowed":true,
     "isSpotTradingAllowed":true,
     "isMarginTradingAllowed":true,
     "filters":[
        {
           "filterType":"PRICE_FILTER",
           "minPrice":"0.01000000",
           "maxPrice":"1000000.00000000",
           "tickSize":"0.01000000"
        },
        {
           "filterType":"PERCENT_PRICE",
           "multiplierUp":"5",
           "multiplierDown":"0.2",
           "avgPriceMins":5
        },
        {
           "filterType":"LOT_SIZE",
           "minQty":"0.00010000",
           "maxQty":"9000.00000000",
           "stepSize":"0.00010000"
        },
        {
           "filterType":"MIN_NOTIONAL",
           "minNotional":"10.00000000",
           "applyToMarket":true,
           "avgPriceMins":5
        },
        {
           "filterType":"ICEBERG_PARTS",
           "limit":10
        },
        {
           "filterType":"MARKET_LOT_SIZE",
           "minQty":"0.00000000",
           "maxQty":"1459.84229583",
           "stepSize":"0.00000000"
        },
        {
           "filterType":"MAX_NUM_ORDERS",
           "maxNumOrders":200
        },
        {
           "filterType":"MAX_NUM_ALGO_ORDERS",
           "maxNumAlgoOrders":5
        }
     ],
     "permissions":[
        "SPOT",
        "MARGIN"
     ]
  },

If I swap it around and use the USDT value as the quantity I get Account has insufficient balance for requested action. because Im obviously not having 10 ETH

Am I overseeing something? It cant be true that the minimum qty is 10 ETH

Its ridiculous. The solution is simple.

You HAVE to use BTC if you want to execute ETH orders via API. Otherwise binance is really expecting from you to use at least 38.000€ or 10 ETH per order for every other pair except of BTC.

Min notational is measured in dollars, not quantity of the coin. This order must have just been on the cusp of that level that it was getting rejected. I tried your code and it worked. I then scaled down in increments of .0001 and got min notational error as I neared $10.

The main thing to consider here is your stop loss, which also cannot fall below min notational as you are effectively putting in an order for x amount minus losses, which likely took you over. Just need to trade a bit more as to give yourself a buffer.

Cheers friend!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM