Fixed more stupid

This commit is contained in:
Logan G 2021-02-02 15:48:04 -07:00
parent 8c3299f9d5
commit 5ae22ddede
Signed by: logan
GPG key ID: E328528C921E7A7A
2 changed files with 10 additions and 9 deletions

View file

@ -32,12 +32,16 @@ class Kraken:
def buyOrder(self, currency_pair, currency_buy, currency_sell, amount, ordertype="market"):
self.krakenWrapper.add_standard_order(currency_pair, "buy", ordertype, volume=amount, validate=True)
self.balances["vol"][currency_buy] += amount
self.balances["vol"][currency_sell] -= amount * self.prices.tail(1)[0]
self.krakenWrapper.add_standard_order(currency_pair, "buy", ordertype, volume=amount, validate=False)
#self.balances["vol"][currency_buy] += amount
#self.balances["vol"][currency_sell] -= amount * self.prices.tail(1)[0]
time.sleep(1)
self.getBalances()
def sellOrder(self, currency_pair, currency_buy, currency_sell, amount, ordertype="market"):
self.krakenWrapper.add_standard_order(currency_pair, "sell", ordertype, volume=amount, validate=True)
self.balances["vol"][currency_buy] -= amount
self.balances["vol"][currency_sell] += amount * self.prices.tail(1)[0]
self.krakenWrapper.add_standard_order(currency_pair, "sell", ordertype, volume=amount, validate=False)
#self.balances["vol"][currency_buy] -= amount
#self.balances["vol"][currency_sell] += amount * self.prices.tail(1)[0]
time.sleep(1)
self.getBalances()

View file

@ -16,10 +16,7 @@ if __name__ == "__main__":
time.sleep(1)
k.getPrices(currency_pair)
print("3")
k.calculateEMA()
print("4")
time.sleep(1)
while True:
#print("Main loop")
current_price = float(k.krakenWrapper.get_ticker_information(currency_pair)["c"][0][0])