chore: protect users who dont read log warnings
This commit is contained in:
@@ -11,6 +11,8 @@ from gymnasium import spaces
|
|||||||
from gymnasium.utils import seeding
|
from gymnasium.utils import seeding
|
||||||
from pandas import DataFrame
|
from pandas import DataFrame
|
||||||
|
|
||||||
|
from freqtrade.exceptions import OperationalException
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
@@ -80,8 +82,9 @@ class BaseEnvironment(gym.Env):
|
|||||||
self.can_short: bool = can_short
|
self.can_short: bool = can_short
|
||||||
self.live: bool = live
|
self.live: bool = live
|
||||||
if not self.live and self.add_state_info:
|
if not self.live and self.add_state_info:
|
||||||
self.add_state_info = False
|
raise OperationalException("`add_state_info` is not available in backtesting. Change "
|
||||||
logger.warning("add_state_info is not available in backtesting. Deactivating.")
|
"parameter to false in your rl_config. See `add_state_info` "
|
||||||
|
"docs for more info.")
|
||||||
self.seed(seed)
|
self.seed(seed)
|
||||||
self.reset_env(df, prices, window_size, reward_kwargs, starting_point)
|
self.reset_env(df, prices, window_size, reward_kwargs, starting_point)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user