Loading ...

BitZ 合约相关汇总

Author: 小小梦, Created: 2019-10-21 17:47:00, Updated: 2020-05-09 10:20:17

BitZ 合约相关汇总

策略用例

接口使用相关汇总

  • 测试账户资产数据

    /* 测试账户资产数据 
    {
    Info:map[
        status:200 
        msg: 
        data:map[
            time:1.571122558e+09 
            estimate_BTC:0.01323647 
            estimate_USD:110.00 
            estimate_CNY:778.35 
            balances:[
                map[
                    coin:BTC 
                    balance:0.00000000 
                    positionMargin:0.00000000 
                    unrlzPnl:0.00000000 
                    estimate_BTC:0.00000000 
                    estimate_USD:0.00 
                    orderMargin:0.00000000 
                    total:0.00000000 
                    estimate_CNY:0.00
                ] 
                map[
                    unrlzPnl:0.00000000 
                    estimate_CNY:0.00 
                    estimate_USD:0.00 
                    coin:ETH 
                    balance:0.00000000 
                    positionMargin:0.00000000 
                    orderMargin:0.00000000 
                    total:0.00000000 
                    estimate_BTC:0.00000000
                ] 
                map[unrlzPnl:0.00000000 total:0.00000000 estimate_CNY:0.00 coin:LTC balance:0.00000000 orderMargin:0.00000000 positionMargin:0.00000000 estimate_BTC:0.00000000 estimate_USD:0.00]   
    
                map[coin:EOS orderMargin:0.00000000 estimate_CNY:0.00 balance:0.00000000 positionMargin:0.00000000 unrlzPnl:0.00000000 total:0.00000000 estimate_BTC:0.00000000 estimate_USD:0.00]   
    
                map[balance:110.00000000 positionMargin:0.00000000 estimate_USD:110.00 estimate_CNY:778.35 coin:USDT orderMargin:0.00000000 unrlzPnl:0.00000000 total:110.00000000 estimate_BTC:0.01323647]   
    
                map[unrlzPnl:0.00000000 estimate_CNY:0.00 orderMargin:0.00000000 total:0.00000000 estimate_BTC:0.00000000 estimate_USD:0.00 coin:BZ balance:0.00000000 positionMargin:0.00000000]
            ]
        ] 
        time:1.571122558e+09 
        microtime:0.81880700 1571122558 
        source:api
    ] 
    Stocks:0 FrozenStocks:0 Balance:0 FrozenBalance:0}
    */
    
  • 接口中参数需要传数值型是合约ID,需要先访问交易所接口获取具体合约的映射,合约详情。

  • 合约分为 正向合约 和 反向合约,结算和计价不同。

  • 币本位合约为反向合约,用币结算(非USDT结算)

  • 测试,不能在有一种杠杆持仓的情况下,使用其他杠杆值下单,会报错:
    map[status:-200 msg:Leverage error data: time:1.571130679e+09 microtime:0.37469600 1571130679 source:api]

  • 持有仓位时,平仓,如果杠杆值不一样,无法平仓,报错: map[status:-200 msg:Leverage error data: time:1.571366118e+09 microtime:0.74409100 1571366118 source:api]

  • 没有持仓时,API 访问持仓接口返回的原始信息为: {map[status:200 msg: data:[] time:1.571366357e+09 microtime:0.23304400 1571366357 source:api]}

  • 下单时有全仓逐仓之分,切换全仓逐仓。

  • 持有仓位时,下平仓方向的订单,不超过仓位时,账户不会有保证金扣除。超出可平仓部分会扣除账户中资金作为保证金。


More

上古战神梁朝伟 https://www.fmz.com/robot/163279 发现了一个机器人,哈哈哈

BigFish 没有设置全仓和逐仓的接口吧