fixing pep8 compliance
This commit is contained in:
parent
eb53a796e2
commit
ea6a1c629d
@ -118,23 +118,23 @@ def backtest(stake_amount: float, processed: Dict[str, DataFrame],
|
|||||||
current_profit_percent = trade.calc_profit_percent(rate=row2.close)
|
current_profit_percent = trade.calc_profit_percent(rate=row2.close)
|
||||||
if (sell_profit_only and current_profit_percent < 0):
|
if (sell_profit_only and current_profit_percent < 0):
|
||||||
continue
|
continue
|
||||||
if min_roi_reached(trade, row2.close, row2.date)
|
if min_roi_reached(trade, row2.close, row2.date) or \
|
||||||
or (row2.sell == 1 and use_sell_signal)
|
(row2.sell == 1 and use_sell_signal) or \
|
||||||
or current_profit_percent <= stoploss:
|
current_profit_percent <= stoploss:
|
||||||
current_profit_btc = trade.calc_profit(rate=row2.close)
|
current_profit_btc = trade.calc_profit(rate=row2.close)
|
||||||
lock_pair_until = row2.Index
|
lock_pair_until = row2.Index
|
||||||
|
|
||||||
trades.append(
|
trades.append(
|
||||||
(
|
(
|
||||||
pair,
|
pair,
|
||||||
current_profit_percent,
|
current_profit_percent,
|
||||||
current_profit_btc,
|
current_profit_btc,
|
||||||
row2.Index - row.Index,
|
row2.Index - row.Index,
|
||||||
current_profit_btc > 0,
|
current_profit_btc > 0,
|
||||||
current_profit_btc < 0
|
current_profit_btc < 0
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
break
|
||||||
break
|
|
||||||
labels = ['currency', 'profit_percent', 'profit_BTC', 'duration', 'profit', 'loss']
|
labels = ['currency', 'profit_percent', 'profit_BTC', 'duration', 'profit', 'loss']
|
||||||
return DataFrame.from_records(trades, columns=labels)
|
return DataFrame.from_records(trades, columns=labels)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user