Fixed more stupid
This commit is contained in:
parent
8c3299f9d5
commit
5ae22ddede
2 changed files with 10 additions and 9 deletions
|
@ -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()
|
||||
|
||||
|
|
3
main.py
3
main.py
|
@ -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])
|
||||
|
|
Loading…
Reference in a new issue