LiquidTap Python Client 사용 ②
목차
소개
"Liquid by Quoine" 의 API를 두드리자~그 2~
"Liquid by Quoine"의 "Orders" 얻기
BTC/JPY의 발주와 취소를 실행한 결과를 취득해 본다.
(2020.02.07)
코드 작성
orders.pyimport liquidtap
import time
def order_callback(data):
print("order:" + data)
if __name__ == "__main__":
token = "APIトークンID"
secret = "APIトークン秘密鍵"
tap = liquidtap.Client(token, secret)
tap.pusher.connect()
tap.subscribe("user_account_jpy_orders").bind('updated', order_callback)
while True: # 無限ループ
time.sleep(1)
실행
orders.py를 실행하고 거래 도구에서 주문 및 취소를 실행해보십시오.
$ 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}
표시되었습니다!
무한 루프이므로 Ctrl+c 로 정지합니다.
이번 발주한 것은 이런 느낌의 것입니다.
이미지가 작고 스미마센.
Reference
이 문제에 관하여(LiquidTap Python Client 사용 ②), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://qiita.com/may-bee-39/items/a39b4e7c20cabb6f05de
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)
BTC/JPY의 발주와 취소를 실행한 결과를 취득해 본다.
(2020.02.07)
코드 작성
orders.py
import liquidtap
import time
def order_callback(data):
print("order:" + data)
if __name__ == "__main__":
token = "APIトークンID"
secret = "APIトークン秘密鍵"
tap = liquidtap.Client(token, secret)
tap.pusher.connect()
tap.subscribe("user_account_jpy_orders").bind('updated', order_callback)
while True: # 無限ループ
time.sleep(1)
실행
orders.py를 실행하고 거래 도구에서 주문 및 취소를 실행해보십시오.
$ 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}
표시되었습니다!
무한 루프이므로 Ctrl+c 로 정지합니다.
이번 발주한 것은 이런 느낌의 것입니다.
이미지가 작고 스미마센.
Reference
이 문제에 관하여(LiquidTap Python Client 사용 ②), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/may-bee-39/items/a39b4e7c20cabb6f05de텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)