Fix some unit-tests. Use common trade entry code.

This commit is contained in:
Reigo Reinmets
2021-12-13 02:27:09 +02:00
parent 98255c18cf
commit 1017b68af9
4 changed files with 51 additions and 309 deletions

View File

@@ -5,7 +5,8 @@ from pandas import DataFrame
import freqtrade.vendor.qtpylib.indicators as qtpylib
from freqtrade.strategy.interface import IStrategy
from freqtrade.persistence import Trade
from datetime import datetime
class StrategyTestV2(IStrategy):
"""
@@ -154,3 +155,11 @@ class StrategyTestV2(IStrategy):
),
'sell'] = 1
return dataframe
def adjust_trade_position(self, pair: str, trade: Trade, current_time: datetime,
current_rate: float, current_profit: float, **kwargs):
if current_profit < -0.0075:
return self.wallets.get_trade_stake_amount(pair, None)
return None