tensortrade.rewards.risk_adjusted_returns module

class tensortrade.rewards.risk_adjusted_returns.RiskAdjustedReturns(return_algorithm='sharpe', risk_free_rate=0.0, target_returns=0.0, window_size=1)[source]

Bases: tensortrade.rewards.reward_scheme.RewardScheme

A reward scheme that rewards the agent for increasing its net worth, while penalizing more volatile strategies.

__init__(return_algorithm='sharpe', risk_free_rate=0.0, target_returns=0.0, window_size=1)[source]
Parameters:
  • return_algorithm (optional) – The risk-adjusted return metric to use. Options are ‘sharpe’ and ‘sortino’. Defaults to ‘sharpe’.
  • risk_free_rate (optional) – The risk free rate of returns to use for calculating metrics. Defaults to 0.
  • target_returns (optional) – The target returns per period for use in calculating the sortino ratio. Default to 0.
get_reward(portfolio)[source]

Return the reward corresponding to the selected risk-adjusted return metric.

Return type:float