This commit is contained in:
Death916 2021-08-15 04:15:43 -07:00
parent 4192b6090c
commit 3e1e41cb8e
2 changed files with 5 additions and 3 deletions

View file

@ -18,6 +18,7 @@ def tradehist(msg):
log.close()
def tradecsv(DATE, *args):
with open('/home/death/code/python/emailtrade/emailtrade/bottrades.csv','a', newline= '') as csvfile:
args = [*args]
@ -29,4 +30,4 @@ def tradecsv(DATE, *args):
csvfile.close
tradecsv(DATE,TIME,EXCHANGE,PRICE,PROFIT,TYPE,PAIR)
#tradecsv(DATE,TIME,EXCHANGE,PRICE,PROFIT,TYPE,PAIR)

View file

@ -42,7 +42,7 @@ def open_trade():
balance = balancedf.vol["ZUSD"]
global buy_amount
buy_amount = (balance / buyprice) - (balance / buyprice) * 0.0025
# kraken.add_standard_order(TICKER,)
print(kraken.add_standard_order(pair=TICKER, type="buy", ordertype="market", volume=buy_amount, price=buyprice, validate=True))
print("buying", buy_amount, "of", TICKER)
hist.tradehist(
"bought " + str(buy_amount) + " of " + TICKER+ " at " + str(buyprice)
@ -63,7 +63,8 @@ def close_trade():
balance = kraken.get_account_balance()
sell_amount = buy_amount
#sell_amount = balance.vol[symbol]
# print(trex.sell_limit(TICKER, sell_amount, rate=sellprice))
print(kraken.add_standard_order(pair=TICKER, type="sell", ordertype="market", volume=buy_amount, validate=False))
print("selling", sell_amount, "of", TICKER)
hist.tradehist(
"sold " + str(sell_amount) + " of " + TICKER+ " at " + str(sell_price)