Fix the fee calculation

This commit is contained in:
Gerald Lonlas
2017-12-17 13:07:56 -08:00
parent 642422d5c4
commit d613d63fdc
9 changed files with 344 additions and 83 deletions

View File

@@ -99,7 +99,7 @@ def backtest(config: Dict, processed: Dict[str, DataFrame],
open_rate=row.close,
open_date=row.date,
amount=config['stake_amount'],
fee=exchange.get_fee() * 2
fee=exchange.get_fee()
)
# calculate win/lose forwards from buy point
@@ -109,7 +109,7 @@ def backtest(config: Dict, processed: Dict[str, DataFrame],
trade_count_lock[row2.date] = trade_count_lock.get(row2.date, 0) + 1
if min_roi_reached(trade, row2.close, row2.date) or row2.sell == 1:
current_profit = trade.calc_profit(row2.close)
current_profit = trade.calc_profit_percent(row2.close)
lock_pair_until = row2.Index
trades.append((pair, current_profit, row2.Index - row.Index))