Kismuz / btgym

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

Base Strategy Missing Attributes in 'Very Basic Environment Setup' Example #65

Closed nathanmargaglio closed 6 years ago

nathanmargaglio commented 6 years ago
Running environment:

Running Jupyter Notebook from Anaconda in Ubuntu

Files or part of package has been run:

/notebooks/very_basic_env_setup.ipynb

Expected behaviour:

Runs second cell without error

Actual behaviour:

Throws error: AttributeError: 'AutoInfoClass_LineRoot_LineMultiple_LineSeries_Lin' object has no attribute 'gamma'

Steps to reproduce:

Run the first two cells in the notebook (import the module and reset the environment)

It looks like it expects the BTgymBaseStrategy class's p variable to have an attribute gamma which is never being assigned. Giving it a value (such as 1) fixes the error, but is replaced by a similar error saying p's _rewardscale variable exists. I'm not sure where these are supposed to be set, but it's not happening in the basic example.

Kismuz commented 6 years ago

@nathanmargaglio - fixed, update pls.