The FTX IO function returns the following error Futures_OP 4: 405: 405 Not Allowed

Author: GCC, Created: 2021-12-05 06:22:32, Updated: 2021-12-05 06:49:38

The Code

def short(direction,price,amount):
    exchange.SetDirection('sell')
    logtype = LOG_TYPE_SELL
    para = ""
    para += "market='"+exchange.GetCurrency().replace('_USD', '-PERP') + "'"
    para += "&side='"+ direction + "'"
    para += "&price=" + str(price)
    para += "&type='" + "'limit'" + "'"
    para += "&size=" + str(amount)
    if direction == "'buy'":
        para += "&reduceOnly=true"
        logtype = LOG_TYPE_BUY
        exchange.SetDirection('closesell')
    para+="&postOnly=true"
    # para+="&timestamp="+ str(int(UnixNano() / 1000000))
    ret = exchange.IO("api", "POST", '/orders', para)
    exchange.Log(logtype, price, amount)
    return ret

Real-time addresshttps://www.fmz.com/robot/407656


More

The Little DreamNot Allowed This means insufficient permissions, check if the API KEY permissions are a problem.

The Little DreamCheck if the IO parameter is misspelled.

GCCI checked, it shouldn't be an API problem, you can order directly from the exchange with sell and buy.