Frappons l'API de "Liquid by Quoine" -Partie 2-
Essayez d'obtenir le résultat de l'exécution de la commande et de l'annulation de BTC / JPY. (2020.02.07)
orders.py
import liquidtap
import time
def order_callback(data):
print("order:" + data)
if __name__ == "__main__":
token = "ID de jeton API"
secret = "Clé privée du jeton API"
tap = liquidtap.Client(token, secret)
tap.pusher.connect()
tap.subscribe("user_account_jpy_orders").bind('updated', order_callback)
while True: #boucle infinie
time.sleep(1)
Exécutez orders.py et essayez de commander et d'annuler à partir de l'outil de trading.
$ python3 orders.py
order:{"average_price":0.0,"client_order_id":null,"created_at":1581080779,"crypto_account_id":null,"currency_pair_code":"BTCJPY","disc_quantity":0.0,"filled_quantity":0.0,"funding_currency":"JPY","iceberg_total_quantity":0.0,"id":2079030430,"leverage_level":1,"margin_interest":0.0,"margin_type":null,"margin_used":0.0,"order_fee":0.0,"order_type":"limit","price":1500000.0,"product_code":"CASH","product_id":"5","quantity":0.001,"side":"sell","source_action":"manual","source_exchange":"QUOINE","status":"live","stop_loss":null,"take_profit":null,"target":"spot","trade_id":null,"trading_type":"spot","unwound_trade_id":null,"unwound_trade_leverage_level":null,"updated_at":1581080779}
order:{"average_price":0.0,"client_order_id":null,"created_at":1581080779,"crypto_account_id":null,"currency_pair_code":"BTCJPY","disc_quantity":0.0,"filled_quantity":0.0,"funding_currency":"JPY","iceberg_total_quantity":0.0,"id":2079030430,"leverage_level":1,"margin_interest":0.0,"margin_type":null,"margin_used":0.0,"order_fee":0.0,"order_type":"limit","price":1500000.0,"product_code":"CASH","product_id":"5","quantity":0.001,"side":"sell","source_action":"manual","source_exchange":"QUOINE","status":"cancelled","stop_loss":null,"take_profit":null,"target":"spot","trade_id":null,"trading_type":"spot","unwound_trade_id":null,"unwound_trade_leverage_level":null,"updated_at":1581080832}
C'était affiché! Comme il s'agit d'une boucle infinie, appuyez sur Ctrl + c pour l'arrêter.
C'est ce que j'ai commandé cette fois. L'image est petite et c'est Sumimasen.
Recommended Posts