Last active
August 29, 2015 14:00
-
-
Save mzupan/11375306 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from termcolor import colored | |
import requests | |
import time | |
while True: | |
ltc = requests.get("https://btc-e.com/api/2/ltc_usd/ticker").json() | |
btc = requests.get("https://btc-e.com/api/2/btc_usd/ticker").json() | |
sellratio = 1.0 / (1.0 / (float(ltc['ticker']['sell'] / float(btc['ticker']['sell'])))) | |
buyratio = 1.0 / (1.0 / (float(ltc['ticker']['buy'] / float(btc['ticker']['buy'])))) | |
print colored("Buy Ratio is: %.5f" % buyratio, "green"), colored("Sell Ratio is: %.5f" % sellratio, "red") | |
time.sleep(3) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment