mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-12-08 17:01:15 +00:00
Merge branch 'develop' into hyperopt-trailing-space
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
"""
|
||||
IHyperOpt interface
|
||||
This module defines the interface to apply for hyperopts
|
||||
This module defines the interface to apply for hyperopt
|
||||
"""
|
||||
import logging
|
||||
import math
|
||||
@@ -27,8 +27,8 @@ def _format_exception_message(method: str, space: str) -> str:
|
||||
|
||||
class IHyperOpt(ABC):
|
||||
"""
|
||||
Interface for freqtrade hyperopts
|
||||
Defines the mandatory structure must follow any custom hyperopts
|
||||
Interface for freqtrade hyperopt
|
||||
Defines the mandatory structure must follow any custom hyperopt
|
||||
|
||||
Class attributes you can use:
|
||||
ticker_interval -> int: value of the ticker interval to use for the strategy
|
||||
@@ -106,10 +106,10 @@ class IHyperOpt(ABC):
|
||||
roi_t_alpha = 1.0
|
||||
roi_p_alpha = 1.0
|
||||
|
||||
ticker_interval_mins = timeframe_to_minutes(IHyperOpt.ticker_interval)
|
||||
timeframe_mins = timeframe_to_minutes(IHyperOpt.ticker_interval)
|
||||
|
||||
# We define here limits for the ROI space parameters automagically adapted to the
|
||||
# ticker_interval used by the bot:
|
||||
# timeframe used by the bot:
|
||||
#
|
||||
# * 'roi_t' (limits for the time intervals in the ROI tables) components
|
||||
# are scaled linearly.
|
||||
@@ -117,8 +117,8 @@ class IHyperOpt(ABC):
|
||||
#
|
||||
# The scaling is designed so that it maps exactly to the legacy Freqtrade roi_space()
|
||||
# method for the 5m ticker interval.
|
||||
roi_t_scale = ticker_interval_mins / 5
|
||||
roi_p_scale = math.log1p(ticker_interval_mins) / math.log1p(5)
|
||||
roi_t_scale = timeframe_mins / 5
|
||||
roi_p_scale = math.log1p(timeframe_mins) / math.log1p(5)
|
||||
roi_limits = {
|
||||
'roi_t1_min': int(10 * roi_t_scale * roi_t_alpha),
|
||||
'roi_t1_max': int(120 * roi_t_scale * roi_t_alpha),
|
||||
|
||||
Reference in New Issue
Block a user