A stopper that stops an episode if the portfolio has lost a particular percentage of its wealth.
Parameters: max_allowed_loss (float) – The maximum percentage of initial funds that is willing to be lost before stopping the episode.
The maximum percentage of initial funds that is willing to be lost before stopping the episode.
This stopper also stops if it has reached the end of the observation feed.
stop(env: tensortrade.env.generic.environment.TradingEnv) → bool¶
Computes if the environment satisfies the defined stopping criteria.
Parameters: env (TradingEnv) – The trading environment. Returns: bool – If the environment should stop or continue.