Kismuz / btgym

Scalable, event-driven, deep-learning-friendly backtesting library
https://kismuz.github.io/btgym/
GNU Lesser General Public License v3.0
985 stars 260 forks source link

Reward function #33

Closed Nicolas99-9 closed 6 years ago

Nicolas99-9 commented 6 years ago

I would like to know how is computed the reward function ? Is it based on the open/low price ? Also, what is the meaning of the action "close" ?

Kismuz commented 6 years ago

@Nicolas99-9 ,

what is the meaning of the action "close" ?

= issue a [set of] orders necessary to close entire position opened at time present. Refer to https://www.backtrader.com/docu/order.html for details.

how is computed the reward function ?

In it's base form it is log utility of current to initial portfolio value ratio. See: https://kismuz.github.io/btgym/btgym.strategy.html#btgym.strategy.base.BTgymBaseStrategy.get_reward

In it's more advanced and real-applicable form it is a weighted sum of:

... and potential-based reward shaping functions:

See: https://kismuz.github.io/btgym/btgym.research.html#btgym.research.strategy_4.DevStrat_4_6.get_reward and source code for details.

Nicolas99-9 commented 6 years ago

Thank you very much