mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 10:21:59 +00:00
Cleanups
This commit is contained in:
parent
58ced36445
commit
51aa469f67
|
@ -7,7 +7,6 @@ Most of the strategy files already include the optimal `stoploss`
|
|||
value. This parameter is optional. If you use it in the configuration file, it will take over the
|
||||
`stoploss` value from the strategy file.
|
||||
|
||||
|
||||
## Stop Loss support
|
||||
|
||||
At this stage the bot contains the following stoploss support modes:
|
||||
|
|
|
@ -93,7 +93,6 @@ class FreqtradeBot(object):
|
|||
"""
|
||||
Called on startup and after reloading the bot - triggers notifications and
|
||||
performs startup tasks
|
||||
: return: None
|
||||
"""
|
||||
self.rpc.startup_messages(self.config, self.pairlists)
|
||||
if not self.edge:
|
||||
|
|
|
@ -436,7 +436,6 @@ class Trade(_DECL_BASE):
|
|||
# Stoploss value got changed
|
||||
|
||||
logger.info(f"Stoploss for {trade} needs adjustment.")
|
||||
logger.info(f"Stoploss: {trade.initial_stop_loss_pct}: {desired_stoploss}")
|
||||
# Force reset of stoploss
|
||||
trade.stop_loss = None
|
||||
trade.adjust_stop_loss(trade.open_rate, desired_stoploss)
|
||||
|
|
|
@ -114,7 +114,7 @@ def test_cleanup(mocker, default_conf, caplog) -> None:
|
|||
def test_worker_running(mocker, default_conf, caplog) -> None:
|
||||
mock_throttle = MagicMock()
|
||||
mocker.patch('freqtrade.worker.Worker._throttle', mock_throttle)
|
||||
mocker.patch('freqtrade.persistence.Trade.adjust_initial_stoploss', MagicMock())
|
||||
mocker.patch('freqtrade.persistence.Trade.stoploss_reinitialization', MagicMock())
|
||||
|
||||
worker = get_patched_worker(mocker, default_conf)
|
||||
|
||||
|
|
|
@ -822,7 +822,6 @@ def test_stoploss_reinitialization(default_conf, fee):
|
|||
assert trade_adj.initial_stop_loss == 0.96
|
||||
assert trade_adj.initial_stop_loss_pct == -0.04
|
||||
|
||||
|
||||
# Trailing stoploss (move stoplos up a bit)
|
||||
trade.adjust_stop_loss(1.02, 0.04)
|
||||
assert trade_adj.stop_loss == 0.9792
|
||||
|
|
Loading…
Reference in New Issue
Block a user