This commit is contained in:
Janne Sinivirta
2018-01-09 12:59:06 +02:00
parent 7cdbd550c8
commit 1b6b0ad9d2
8 changed files with 115 additions and 115 deletions

View File

@@ -122,20 +122,20 @@ def backtest(stake_amount: float, processed: Dict[str, DataFrame],
if min_roi_reached(trade, row2.close, row2.date) or \
(row2.sell == 1 and use_sell_signal) or \
current_profit_percent <= stoploss:
current_profit_btc = trade.calc_profit(rate=row2.close)
lock_pair_until = row2.Index
current_profit_btc = trade.calc_profit(rate=row2.close)
lock_pair_until = row2.Index
trades.append(
(
pair,
current_profit_percent,
current_profit_btc,
row2.Index - row.Index,
current_profit_btc > 0,
current_profit_btc < 0
)
trades.append(
(
pair,
current_profit_percent,
current_profit_btc,
row2.Index - row.Index,
current_profit_btc > 0,
current_profit_btc < 0
)
break
)
break
labels = ['currency', 'profit_percent', 'profit_BTC', 'duration', 'profit', 'loss']
return DataFrame.from_records(trades, columns=labels)
@@ -193,6 +193,6 @@ def start(args):
use_sell_signal=config.get('experimental', {}).get('use_sell_signal', False)
)
logger.info(
'\n==================================== BACKTESTING REPORT ====================================\n%s', # noqa
'\n==================================== BACKTESTING REPORT ====================================\n%s', # noqa
generate_text_table(data, results, config['stake_currency'], args.ticker_interval)
)

View File

@@ -194,7 +194,7 @@ def format_results(results: DataFrame):
results.profit_percent.mean() * 100.0,
results.profit_BTC.sum(),
results.duration.mean() * 5,
)
)
def buy_strategy_generator(params):