Fixed stupid

This commit is contained in:
Logan G 2021-02-01 21:23:32 -07:00
parent 0a9730d958
commit 75f42e7353
Signed by: logan
GPG key ID: E328528C921E7A7A
3 changed files with 2 additions and 3 deletions

View file

@ -27,8 +27,6 @@ class Kraken:
# Calculates the exponential moving average by grabbing data from Kraken on the conversion rate every interval minutes.
def calculateEMA(self, shortTime=round(time.time())-(7*24*3600), longTime=round(time.time())-(30*24*3600), interval=60):
#self.prices = self.krakenWrapper.get_ohlc_data("XXBTZUSD", interval=interval, since=longTime)[0].close.iloc[::-1]
self.longEMA = self.prices.ewm(span=12).mean()
self.shortEMA = self.prices.ewm(span=3).mean()

View file

@ -26,6 +26,7 @@ if __name__ == "__main__":
new_row = pandas.DataFrame([[current_price]], index=[pandas.to_datetime(time.time(), unit = "s")])
k.prices = pandas.concat([k.prices, pandas.DataFrame(new_row)], ignore_index=False)
k.calculateEMA()
# If we have crypto, check for sell behaviour, if we have fiat, check for buy behavior, otherwise, get really confused
if k.balances["vol"][currency_buy] > 10**-5:

View file

@ -15,7 +15,7 @@ if __name__ == "__main__":
k.getBalances()
print("2")
time.sleep(1)
k.getPrices(currency_pair)
k.getPrices(currency_pair, time=round(time.time())-(24*3600), interval=1)
print("3")
k.calculateEMA()
print("4")