Skip to content

Instantly share code, notes, and snippets.

Created September 16, 2016 07:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/3bada9cbbd74fc3de01d871a72c600db to your computer and use it in GitHub Desktop.
Save anonymous/3bada9cbbd74fc3de01d871a72c600db to your computer and use it in GitHub Desktop.
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