basic_profit_max

Classes

BasicProfitMax

Base class for reward functions in trading environments.

BasicRealizedProfitMax

Base class for reward functions in trading environments.

SharpeRatio

Base class for reward functions in trading environments.

SortinoRatio

Base class for reward functions in trading environments.

CalmarRatio

Base class for reward functions in trading environments.

Module Contents

class basic_profit_max.BasicProfitMax(cfg, initial_state)

Bases: trading.src.alg.environments.reward_functions.base_reward_function.RewardFunction

Base class for reward functions in trading environments. @TODO pass in the profit calculated from the position step

Parameters:
initial_net
previous_net
__repr__()
Return type:

str

reset()

Reset the reward function state.

compute_reward(pf, df, realized_profit)

Compute the reward for a given action and state transition.

Parameters:
  • pf (trading.src.portfolio.portfolio.Portfolio)

  • df (pandas.DataFrame)

  • realized_profit (float)

Return type:

float

class basic_profit_max.BasicRealizedProfitMax(cfg, initial_state)

Bases: trading.src.alg.environments.reward_functions.base_reward_function.RewardFunction

Base class for reward functions in trading environments. @TODO pass in the profit calculated from the position step

Parameters:
compute_reward(pf, df, realized_profit)

Compute the reward for a given action and state transition.

Parameters:
  • pf (trading.src.portfolio.portfolio.Portfolio)

  • df (pandas.DataFrame)

  • realized_profit (float)

Return type:

float

class basic_profit_max.SharpeRatio(cfg, initial_state)

Bases: trading.src.alg.environments.reward_functions.base_reward_function.RewardFunction

Base class for reward functions in trading environments. @TODO pass in the profit calculated from the position step

Parameters:
initial_state
risk_free_rate
compute_reward(pf, df, realized_profit)

Compute the reward for a given action and state transition.

Parameters:
  • pf (trading.src.portfolio.portfolio.Portfolio)

  • df (pandas.DataFrame)

  • realized_profit (float)

Return type:

float

class basic_profit_max.SortinoRatio(cfg, initial_state)

Bases: trading.src.alg.environments.reward_functions.base_reward_function.RewardFunction

Base class for reward functions in trading environments. @TODO pass in the profit calculated from the position step

Parameters:
initial_state
risk_free_rate
compute_reward(pf, df, realized_profit)

Compute the reward for a given action and state transition.

Parameters:
  • pf (trading.src.portfolio.portfolio.Portfolio)

  • df (pandas.DataFrame)

  • realized_profit (float)

Return type:

float

class basic_profit_max.CalmarRatio(cfg, initial_state)

Bases: trading.src.alg.environments.reward_functions.base_reward_function.RewardFunction

Base class for reward functions in trading environments. @TODO pass in the profit calculated from the position step

Parameters:
initial_state
risk_free_rate
compute_reward(pf, df, realized_profit)

Compute the reward for a given action and state transition.

Parameters:
  • pf (trading.src.portfolio.portfolio.Portfolio)

  • df (pandas.DataFrame)

  • realized_profit (float)

Return type:

float