fix custom_info
This commit is contained in:
@@ -20,8 +20,8 @@ class Base4ActionRLEnv(BaseEnvironment):
|
||||
"""
|
||||
Base class for a 4 action environment
|
||||
"""
|
||||
def __init__(self, *args):
|
||||
super().__init__(*args)
|
||||
def __init__(self, **kwargs):
|
||||
super().__init__(**kwargs)
|
||||
self.actions = Actions
|
||||
|
||||
def set_action_space(self):
|
||||
|
@@ -75,7 +75,7 @@ class BaseEnvironment(gym.Env):
|
||||
else:
|
||||
self.fee = 0.0015
|
||||
|
||||
# set here to default 5Ac, but all children envs can overwrite this
|
||||
# set here to default 5Ac, but all children envs can override this
|
||||
self.actions: Type[Enum] = BaseActions
|
||||
self.custom_info: dict = {}
|
||||
|
||||
@@ -121,7 +121,6 @@ class BaseEnvironment(gym.Env):
|
||||
self._total_unrealized_profit: float = 1
|
||||
self.history: dict = {}
|
||||
self.trade_history: list = []
|
||||
self.custom_info: dict = {}
|
||||
|
||||
@abstractmethod
|
||||
def set_action_space(self):
|
||||
|
@@ -42,7 +42,7 @@ class TensorboardCallback(BaseCallback):
|
||||
)
|
||||
|
||||
def _on_step(self) -> bool:
|
||||
custom_info = self.training_env.custom_info
|
||||
custom_info = self.training_env.get_attr("custom_info")[0]
|
||||
self.logger.record("_state/position", self.locals["infos"][0]["position"])
|
||||
self.logger.record("_state/trade_duration", self.locals["infos"][0]["trade_duration"])
|
||||
self.logger.record("_state/current_profit_pct", self.locals["infos"]
|
||||
|
Reference in New Issue
Block a user