mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-09-20 01:21:11 +00:00
Don't surprise people with "after_fill" calls
This commit is contained in:
parent
fc60c0df19
commit
bef5e191a4
|
@ -218,6 +218,11 @@ class StrategyResolver(IResolver):
|
|||
"Please update your strategy to implement "
|
||||
"`populate_indicators`, `populate_entry_trend` and `populate_exit_trend` "
|
||||
"with the metadata argument. ")
|
||||
|
||||
after_fill = 'after_fill' in getfullargspec(strategy.custom_stoploss).args
|
||||
if after_fill:
|
||||
strategy._ft_stop_uses_after_fill = True
|
||||
|
||||
return strategy
|
||||
|
||||
@staticmethod
|
||||
|
|
|
@ -720,6 +720,8 @@ class IStrategy(ABC, HyperStrategyMixin):
|
|||
# END - Intended to be overridden by strategy
|
||||
###
|
||||
|
||||
_ft_stop_uses_after_fill = False
|
||||
|
||||
def __informative_pairs_freqai(self) -> ListPairsWithTimeframes:
|
||||
"""
|
||||
Create informative-pairs needed for FreqAI
|
||||
|
@ -1168,6 +1170,10 @@ class IStrategy(ABC, HyperStrategyMixin):
|
|||
:param low: Low value of this candle, only set in backtesting
|
||||
:param high: High value of this candle, only set in backtesting
|
||||
"""
|
||||
if after_fill and not self._ft_stop_uses_after_fill:
|
||||
# Skip if the strategy doesn't support after fill.
|
||||
return
|
||||
|
||||
stop_loss_value = force_stoploss if force_stoploss else self.stoploss
|
||||
|
||||
# Initiate stoploss with open_rate. Does nothing if stoploss is already set.
|
||||
|
|
Loading…
Reference in New Issue
Block a user