Add stuff after rebase
This commit is contained in:
parent
365ba98131
commit
060469fefc
@ -200,7 +200,7 @@ class IStrategy(ABC):
|
|||||||
|
|
||||||
# check if we have a special stop loss for positive condition
|
# check if we have a special stop loss for positive condition
|
||||||
# and if profit is positive
|
# and if profit is positive
|
||||||
stop_loss_value = self.strategy.stoploss
|
stop_loss_value = self.stoploss
|
||||||
sl_offset = self.config.get('trailing_stop_positive_offset', 0.0)
|
sl_offset = self.config.get('trailing_stop_positive_offset', 0.0)
|
||||||
|
|
||||||
if 'trailing_stop_positive' in self.config and current_profit > sl_offset:
|
if 'trailing_stop_positive' in self.config and current_profit > sl_offset:
|
||||||
|
@ -45,7 +45,7 @@ def patch_get_signal(freqtrade: FreqtradeBot, value=(True, False)) -> None:
|
|||||||
:param value: which value IStrategy.get_signal() must return
|
:param value: which value IStrategy.get_signal() must return
|
||||||
:return: None
|
:return: None
|
||||||
"""
|
"""
|
||||||
freqtrade.strategy.get_signal = lambda e, s, t: value
|
freqtrade.get_signal = lambda e, s, t: value
|
||||||
|
|
||||||
|
|
||||||
def patch_RPCManager(mocker) -> MagicMock:
|
def patch_RPCManager(mocker) -> MagicMock:
|
||||||
@ -1833,7 +1833,6 @@ def test_trailing_stop_loss_offset(default_conf, limit_buy_order, fee, caplog, m
|
|||||||
patch_get_signal(mocker)
|
patch_get_signal(mocker)
|
||||||
patch_RPCManager(mocker)
|
patch_RPCManager(mocker)
|
||||||
patch_coinmarketcap(mocker)
|
patch_coinmarketcap(mocker)
|
||||||
mocker.patch('freqtrade.freqtradebot.Analyze.min_roi_reached', return_value=False)
|
|
||||||
mocker.patch.multiple(
|
mocker.patch.multiple(
|
||||||
'freqtrade.exchange.Exchange',
|
'freqtrade.exchange.Exchange',
|
||||||
validate_pairs=MagicMock(),
|
validate_pairs=MagicMock(),
|
||||||
@ -1851,6 +1850,8 @@ def test_trailing_stop_loss_offset(default_conf, limit_buy_order, fee, caplog, m
|
|||||||
conf['trailing_stop_positive'] = 0.01
|
conf['trailing_stop_positive'] = 0.01
|
||||||
conf['trailing_stop_positive_offset'] = 0.011
|
conf['trailing_stop_positive_offset'] = 0.011
|
||||||
freqtrade = FreqtradeBot(conf)
|
freqtrade = FreqtradeBot(conf)
|
||||||
|
freqtrade.strategy.min_roi_reached = lambda trade, current_profit, current_time: True
|
||||||
|
|
||||||
freqtrade.create_trade()
|
freqtrade.create_trade()
|
||||||
|
|
||||||
trade = Trade.query.first()
|
trade = Trade.query.first()
|
||||||
|
Loading…
Reference in New Issue
Block a user