mirror of
https://github.com/Death916/emailtrade.git
synced 2026-04-10 03:04:40 -07:00
testing
This commit is contained in:
parent
4192b6090c
commit
3e1e41cb8e
2 changed files with 5 additions and 3 deletions
|
|
@ -18,6 +18,7 @@ def tradehist(msg):
|
||||||
log.close()
|
log.close()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def tradecsv(DATE, *args):
|
def tradecsv(DATE, *args):
|
||||||
with open('/home/death/code/python/emailtrade/emailtrade/bottrades.csv','a', newline= '') as csvfile:
|
with open('/home/death/code/python/emailtrade/emailtrade/bottrades.csv','a', newline= '') as csvfile:
|
||||||
args = [*args]
|
args = [*args]
|
||||||
|
|
@ -29,4 +30,4 @@ def tradecsv(DATE, *args):
|
||||||
|
|
||||||
csvfile.close
|
csvfile.close
|
||||||
|
|
||||||
tradecsv(DATE,TIME,EXCHANGE,PRICE,PROFIT,TYPE,PAIR)
|
#tradecsv(DATE,TIME,EXCHANGE,PRICE,PROFIT,TYPE,PAIR)
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ def open_trade():
|
||||||
balance = balancedf.vol["ZUSD"]
|
balance = balancedf.vol["ZUSD"]
|
||||||
global buy_amount
|
global buy_amount
|
||||||
buy_amount = (balance / buyprice) - (balance / buyprice) * 0.0025
|
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)
|
print("buying", buy_amount, "of", TICKER)
|
||||||
hist.tradehist(
|
hist.tradehist(
|
||||||
"bought " + str(buy_amount) + " of " + TICKER+ " at " + str(buyprice)
|
"bought " + str(buy_amount) + " of " + TICKER+ " at " + str(buyprice)
|
||||||
|
|
@ -63,7 +63,8 @@ def close_trade():
|
||||||
balance = kraken.get_account_balance()
|
balance = kraken.get_account_balance()
|
||||||
sell_amount = buy_amount
|
sell_amount = buy_amount
|
||||||
#sell_amount = balance.vol[symbol]
|
#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)
|
print("selling", sell_amount, "of", TICKER)
|
||||||
hist.tradehist(
|
hist.tradehist(
|
||||||
"sold " + str(sell_amount) + " of " + TICKER+ " at " + str(sell_price)
|
"sold " + str(sell_amount) + " of " + TICKER+ " at " + str(sell_price)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue