CryptoBot/plot.py

31 lines
548 B
Python
Raw Normal View History

2021-02-06 00:09:58 -05:00
import time, threading, pandas, sys
2021-02-01 22:34:35 -05:00
import matplotlib.pyplot as plt
from api.kraken import Kraken
from api.fake import Fake
if __name__ == "__main__":
2021-02-06 00:09:58 -05:00
currency_pair = sys.argv[1]
2021-02-01 22:34:35 -05:00
k = Kraken()
2021-02-03 16:15:05 -05:00
print(1)
2021-02-01 22:34:35 -05:00
time.sleep(1)
2021-02-03 16:15:05 -05:00
2021-02-06 00:09:58 -05:00
k.get_ohlc_prices(currency_pair, time=round(time.time())-(72*3600), interval=1)
2021-02-03 16:15:05 -05:00
print(2)
time.sleep(1)
2021-02-03 17:00:44 -05:00
k.get_current_price(currency_pair)
2021-02-03 16:15:05 -05:00
print(3)
2021-02-03 17:00:44 -05:00
k.calculate_ema()
2021-02-03 16:15:05 -05:00
print(4)
2021-02-01 22:34:35 -05:00
2021-02-03 17:00:44 -05:00
plt.plot(k.short_ema)
plt.plot(k.long_ema)
2021-02-01 22:34:35 -05:00
plt.plot(k.prices)
plt.show()