【问题标题】:Binance API order endpoint in R POST methodR POST方法中的Binance API订单端点
【发布时间】:2018-03-04 00:23:46
【问题描述】:

我正在尝试通过 R 中的 Binance API 下订单,我的所有其他端点都可以正常工作,但是,我收到错误 HTTP/1.1 400 Bad Request ....请帮助。

**url="https://api.binance.com/api/v3/order/test"
     timestamp <- GET(
      url = "https://api.binance.com",
      path = "/api/v1/time") 
    timestamp=content(timestamp, as="parsed")
    timestamp=timestamp$serverTime
    signature <- openssl::sha256(postmsg, key=secretKey)
    postmsg <- paste0("timestamp=", timestamp, "&recvWindow=", recvWindow,"&symbol=",symbol,
                      "&side=",side,"&type=",type,"&quantity=",quantity,"&timeInForce=",timeInForce)
    signature <- openssl::sha256(postmsg, key=secretKey)
    order = POST(
      url = url,
      content_type('application/json'), add_headers(.headers = c("X-MBX-APIKEY"=apiKey)),
      query=list(signature=signature), 
      encode = 'json'
    )**

【问题讨论】:

    标签: r api httr algorithmic-trading cryptocurrency


    【解决方案1】:

    造成这种情况的最常见原因 (https://github.com/ccxt/ccxt/issues/663) 是每个订单都需要最低成本 - 0.001 BTC、0.01 ETH 或 1 BNB 或 1 USDT,具体取决于您使用的 4 个报价符号中的哪一个.

    在仅接受整数的符号对上提交小于 1 的金额时,我也发现自己遇到了这种情况。

    您可能还会发现他们的开发者电报组很有用。

    【讨论】:

      猜你喜欢
      • 2021-05-10
      • 1970-01-01
      • 2019-01-05
      • 2020-11-25
      • 2022-11-22
      • 1970-01-01
      • 1970-01-01
      • 2023-01-04
      • 2022-08-06
      相关资源
      最近更新 更多