def METHOD_NAME(self, action: int) -> float:
    """
    An example reward function. This is the one function that users will likely
    wish to inject their own creativity into.
                Warning!
    This is function is a showcase of functionality designed to show as many possible
    environment control features as possible. It is also designed to run quickly
    on small computers. This is a benchmark, it is *not* for live production.
    :param action: int = The action made by the agent for the current candle.
    :return:
    float = the reward to give to the agent for current step (used for optimization
        of weights in NN)
    """
    # first, penalize if the action is not valid
    if not self._is_valid(action):
        self.tensorboard_log("invalid", category="actions")
        return -2
    pnl = self.get_unrealized_profit()
    factor = 100.
    # reward agent for entering trades
    if (action == Actions.Long_enter.value
            and self._position == Positions.Neutral):
        return 25
    if (action == Actions.Short_enter.value
            and self._position == Positions.Neutral):
        return 25
    # discourage agent from not entering trades
    if action == Actions.Neutral.value and self._position == Positions.Neutral:
        return -1
    max_trade_duration = self.rl_config.get('max_trade_duration_candles', 300)
    trade_duration = self._current_tick - self._last_trade_tick  # type: ignore
    if trade_duration <= max_trade_duration:
        factor *= 1.5
    elif trade_duration > max_trade_duration:
        factor *= 0.5
    # discourage sitting in position
    if (self._position in (Positions.Short, Positions.Long) and
            action == Actions.Neutral.value):
        return -1 * trade_duration / max_trade_duration
    # close long
    if action == Actions.Long_exit.value and self._position == Positions.Long:
        if pnl > self.profit_aim * self.rr:
            factor *= self.rl_config['model_reward_parameters'].get('win_reward_factor', 2)
        return float(pnl * factor)
    # close short
    if action == Actions.Short_exit.value and self._position == Positions.Short:
        if pnl > self.profit_aim * self.rr:
            factor *= self.rl_config['model_reward_parameters'].get('win_reward_factor', 2)
        return float(pnl * factor)
    return 0.