CryptoBot/plot.py
2021-02-03 15:00:44 -07:00

32 lines
595 B
Python

import time, threading, pandas
import matplotlib.pyplot as plt
from api.kraken import Kraken
from api.fake import Fake
if __name__ == "__main__":
currency_buy = "XXBT"
currency_sell = "ZUSD"
currency_pair = "XXBTZUSD"
k = Kraken()
print(1)
time.sleep(1)
k.get_ohlc_prices(currency_pair, time=round(time.time())-(24*3600), interval=1)
print(2)
time.sleep(1)
k.get_current_price(currency_pair)
print(3)
k.calculate_ema()
print(4)
plt.plot(k.short_ema)
plt.plot(k.long_ema)
plt.plot(k.prices)
plt.show()