27 lines
546 B
Python
27 lines
546 B
Python
import time, threading
|
|
import matplotlib.pyplot as plt
|
|
import pandas
|
|
|
|
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")
|
|
k.getBalances()
|
|
print("2")
|
|
time.sleep(1)
|
|
k.getPrices(currency_pair, time=round(time.time())-(24*3600), interval=1)
|
|
print("3")
|
|
k.calculateEMA()
|
|
print("4")
|
|
|
|
plt.plot(k.shortEMA)
|
|
plt.plot(k.longEMA)
|
|
plt.plot(k.prices)
|
|
plt.show()
|
|
|