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

Allowing Long only positions (no short selling) #15

Closed kfeeeeee closed 6 years ago

kfeeeeee commented 6 years ago

Hi,

great work!! One question: I was trying to test a long only agent but it seems setting the portfolio_action, i.e.: MyCerebro.addstrategy(MyStrategy, drawdown_call=10, skip_frame=1,state_shape=(10,4),portfolio_actions=('hold', 'buy','close')) does not work and the agent continues with short selling.

Could you provide an example explicitly disallowing short selling?

Thanks!

kfeeeeee commented 6 years ago

Nevermind, wrong data type in parameter portfolio_actions - my fault