tensortrade.rewards.simple_profit_strategy module

class tensortrade.rewards.simple_profit_strategy.SimpleProfitStrategy[source]

Bases: tensortrade.rewards.reward_strategy.RewardStrategy

A reward strategy that rewards the agent for profitable trades and prioritizes trading over not trading.

This strategy supports simple action strategies that trade a single position in a single instrument at a time.

get_reward(current_step, trade)[source]

Reward -1 for not holding a position, 1 for holding a position, 2 for opening a position, and 1 + 5^(log_10(profit)) for closing a position.

The 5^(log_10(profit)) function simply slows the growth of the reward as trades get large.

Return type

float

reset()[source]

Necessary to reset the last purchase price and state of open positions.