Simplify test strategy

This commit is contained in:
Matthias 2022-01-15 17:36:13 +01:00
parent 6684bff963
commit 270d7ebbf5

View File

@ -6,7 +6,6 @@ import talib.abstract as ta
from pandas import DataFrame from pandas import DataFrame
import freqtrade.vendor.qtpylib.indicators as qtpylib import freqtrade.vendor.qtpylib.indicators as qtpylib
from freqtrade.exceptions import DependencyException
from freqtrade.persistence import Trade from freqtrade.persistence import Trade
from freqtrade.strategy.interface import IStrategy from freqtrade.strategy.interface import IStrategy
@ -166,9 +165,7 @@ class StrategyTestV2(IStrategy):
current_profit: float, min_stake: float, max_stake: float, **kwargs): current_profit: float, min_stake: float, max_stake: float, **kwargs):
if current_profit < -0.0075: if current_profit < -0.0075:
try: orders = trade.select_filled_orders('buy')
return self.wallets.get_trade_stake_amount(trade.pair, None) return round(orders[0].cost, 0)
except DependencyException:
pass
return None return None