From f747de1b917c6b84a2ac5591a16163a01b67448e Mon Sep 17 00:00:00 2001 From: Death916 Date: Tue, 9 Oct 2018 00:15:47 -0700 Subject: [PATCH] fees --- trade.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/trade.py b/trade.py index 3cf050a..d9227cf 100644 --- a/trade.py +++ b/trade.py @@ -25,7 +25,7 @@ def open_trade(): global buyprice buyprice = marketcheck(ticker) balance = trex.get_balance('BTC')['result']['Available'] - buy_amount = balance / buyprice + buy_amount = (balance / buyprice) - (balance / buyprice) * .0025 print(trex.buy_limit(ticker, buy_amount, rate=buyprice)) print('buying', buy_amount, 'of', ticker) hist.tradehist('bought ' + str(buy_amount) + ' of ' + ticker + ' at ' + str(buyprice)) @@ -36,7 +36,7 @@ def close_trade(): sellprice = marketcheck(ticker) - sell_amount = trex.get_balance('ETH')['result']['Available'] + sell_amount = trex.get_balance('ETH')['result']['Available'] print(trex.sell_limit(ticker, sell_amount, rate=sellprice)) print('selling', sell_amount, 'of', ticker) hist.tradehist('sold ' + str(sell_amount) + ' of ' + ticker + ' at ' + str(sellprice))