AminHP / gym-anytrading

The most simple, flexible, and comprehensive OpenAI Gym trading environment (Approved by OpenAI Gym)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to maximize the sharpe ratio?

GXY2017 opened this issue · comments

Current step_reward is linear and maximize step_reward will maximize the self._total_reward.
But Sharpe ratio requires historical yield data, and maximizing the Sharpe ratio in each step may not get the best strategy for the whole training data.
Do you have any idea to maximize Sharpe ratio? Thank you.

Hi @GXY2017

First of all, the current reward function is just a simple example and does not consider everything.
The historical data is available in the history attribute in the trading env class. I think it contains all the required information you need.