Type/to search

币安合约BNB手续费抵扣/ 自动购买自动划转

Tool
0
Follow
14
Followers

Contact : [email protected] / WeChat@stay37
本策略为自动从合约账户划转USDT至现货账户购买BNB,将BNB转入合约账户抵扣手续费。
需提前添加bnb_usdt交易对

Source
Python
# Contact : [email protected] / WeChat@stay37

import time


def supply_bnb(transfer_usdt,i):
    Log("当前BNB不足,补充BNB作为手续费抵扣")
    #获取当前BNB_USDT价格
    depth = _C(exchanges[i].GetDepth)
    #转出transfer_usdt个USDT
    timestamp = time.time() * 1000
    transfer = exchanges[i].IO("api","POST","/sapi/v1/futures/transfer","asset=USDT&amount="+str(transfer_usdt)+"&type=2&timestamp=+"+str(timestamp))
Comment
All comments (5)

    Traceback (most recent call last): File "<string>", line 983, in init_ctx File "<string>", line 65, in <module> File "<string>", line 35, in main NameError: name 'transfer_usdt' is not defined
    请问这个错误应该如何解决?

    5 years ago

    'transfer_usdt' 这里是设置你每次想要用多少USDT购买BNB作为抵扣,程序会自动转出设置的USDT去购买BNB然后转回合约账户

    5 years ago

    'transfer_usdt'这个我弄懂了,币安平台i这个参数应该填什么? 不好意思,因为没什么编程基础所以问题比较小白,请见谅

    5 years ago

    使用需要添加币安现货BNB/USDT交易对,i 指的是添加的交易对序号

    5 years ago

    不错, 点赞

    6 years ago
  • 1
iPhone Download
Forums
PINE Language
© 2015 - ∞ INVENTOR PTE LTD (SG)