Create a gist now

Instantly share code, notes, and snippets.

anonymous /zaif_btc_jpy_if
Created Sep 16, 2016

Embed
What would you like to do?
import requests
url = 'https://api.zaif.jp/api/1/depth/btc_jpy'
bj_board = requests.get(url, timeout=3).json()
bj_board_bid_top = bj_board['bids'][0]
bj_board_ask_top = bj_board['asks'][0]
if bj_board_ask_top[0] < 60000:
print 'time to buy!!'
elif bj_board_bid_top[0] > 70000:
print 'time to sell'
else:
print 'HODL...'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment