tensortrade.env.stoppers.max_loss_stopper module

class tensortrade.env.stoppers.max_loss_stopper.MaxLossStopper(*args, **kwargs)[source]

Bases: AbstractStopper

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.

max_allowed_loss

The maximum percentage of initial funds that is willing to be lost before stopping the episode.

Type:

float

Notes

This stopper also stops if it has reached the end of the observation feed.

stop() bool[source]

Computes if the environment satisfies the defined stopping criteria. :return: If the environment should stop or continue. :rtype: bool