Exemple #1
0
# Trade History
print("返回最新80条历史成交记录")
print(gate_query.tradeHistory('btc_usdt'))

# Get account fund balances
print("获取帐号资金余额API")
print(gate_trade.balances())

# get new address
print(gate_trade.depositAddres('btc'))

# get deposit withdrawal history
print(gate_trade.depositsWithdrawals('1469092370', '1569092370'))

# Place order sell
print(gate_trade.buy('etc_btc', '0.001', '123'))

# Place order sell
print(gate_trade.sell('etc_btc', '0.001', '123'))

# Cancel order
print(gate_trade.cancelOrder('267040896', 'etc_btc'))

# Cancel all orders
print(gate_trade.cancelAllOrders('0', 'etc_btc'))

# Get order status
print(gate_trade.getOrder('267040896', 'eth_btc'))

# Get my last 24h trades
print(gate_trade.mytradeHistory('etc_btc', '267040896'))
Exemple #2
0
    #if (bal_usd >= 3*USD and s_bcx_usd >= f_bcx_usd and avg_bal_usd+BAL >= bal_bcx_usd): gate.buy('bcx_usdt', d_b_bcx_usd, BCX)
    #elif (bal_usd >= 3*USD and s_bcx_usd >= f_bcx_usd and proc_bcx_usd >= 2): gate.buy('bcx_usdt', d_b_bcx_usd, BCX)
    #elif (bal_usd >= 3*USD and avg_bal_usd+BAL >= bal_bcx_usd): gate.buy('bcx_usdt', d_b_bcx_usd-f_bcx_usd, BCX)

    #if($bal_rur > 100 && $s_usd_rur > $f_usd_rur)
    #{$val_usd2 = round($bal_rur*0.348/(2*$d_s_usd_rur+$f_usd_rur), 5);
    #print_r("ХОРОШИЙ СПРЕД, КУПИТЬ ".$val_usd2." USD\n");
    #$buy_usd = $BTCeAPI->makeOrder($val_usd2, 'usd_rur', BTCeAPI::DIRECTION_BUY, $d_b_usd_rur-0.3);}

    #elseif ($bal_rur > 100)
    #{$val_usd2 = round($bal_rur*0.348/(2*$d_s_usd_rur+$f_usd_rur), 5);
    #print_r("КУПИТЬ ".$val_usd2." USD\n");
    #buy_usd = $BTCeAPI->makeOrder($val_usd2, 'usd_rur', BTCeAPI::DIRECTION_BUY, $d_b_usd_rur-0.3);}

    if (bal_btc >= B * BTC and s_btc_usd >= f_btc_usd and BAL <= bal_usd):
        gate.buy('btc_usdt', d_b_btc_usd + 0.01, val_b_btc_usd)
    elif (bal_btc >= B * BTC and BAL <= bal_usd):
        gate.buy('btc_usdt', d_b_btc_usd - f_btc_usd, val_b_btc_usd)

    if (bal_usd >= B * USD and s_eth_usd >= f_eth_usd and BAL >= bal_eth_usd):
        gate.buy('eth_usdt', d_b_eth_usd + 0.01, val_b_eth_usd)
    elif (bal_usd >= B * USD and bal_eth_usd < 2 * BAL and proc_eth_usd >= X):
        gate.buy('eth_usdt', d_b_eth_usd + 0.01, val_b_eth_usd)
    elif (bal_usd >= B * USD and BAL >= bal_eth_usd):
        gate.buy('eth_usdt', d_b_eth_usd - f_eth_usd, val_b_eth_usd)

    if (bal_usd >= B * USD and s_trx_usd >= f_trx_usd and BAL >= bal_trx_usd):
        gate.buy('trx_usdt', d_b_trx_usd + 0.00001, val_b_trx_usd)
    elif (bal_usd >= B * USD and bal_trx_usd < 2 * BAL and proc_trx_usd >= X):
        gate.buy('trx_usdt', d_b_trx_usd + 0.00001, val_b_trx_usd)
    elif (bal_usd >= B * USD and BAL >= bal_trx_usd):