tensortrade-org / tensortrade

An open source reinforcement learning framework for training, evaluating, and deploying robust trading agents.
https://discord.gg/ZZ7BGWh
Apache License 2.0
4.52k stars 1.02k forks source link

treynor_ratio() missing 1 required positional argument: 'benchmark' in train_and_evaluate.ipynb Cell 10 #440

Open Quentin168 opened 2 years ago

Quentin168 commented 2 years ago

Please make sure that this is a Bug or a Feature Request and provide all applicable information asked by the template. If your issue is an implementation question, please ask your question on StackOverflow or on the TensorTrade Discord #help-desk channel instead of opening a GitHub issue.

System information

You can obtain the TensorFlow version with:
python -c "import tensorflow as tf; print(tf.GIT_VERSION, tf.VERSION)"

### _d:\tensortrade-master\examples\train_andevaluate.ipynb Cell 10'**** in <cell line: 1>() ----> 1 data = generate_features(data) d:\tensortrade-master\examples\train_and_evaluate.ipynb Cell 9' in generate_all_default_quantstats_features(data) 54 for indicator_name in indicators_list: 55 try: 56 #print(indicator_name) ---> 57 indicator = qs.stats.dictindicator_name 58 if isinstance(indicator, pd.Series): 59 indicator = indicator.to_frame(name=indicator_name)

TypeError: treynor_ratio() missing 1 required positional argument: 'benchmark'

Describe the expected behavior treynor_ratio() is special, missing 1 required positional argument: 'benchmark'

Code to reproduce the issue
Provide a reproducible test case that is the bare minimum necessary to generate the problem.

Other info / logs
Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.

segatrade commented 2 years ago

Got the same bug

sanoj2021 commented 2 years ago

Same here after following @selentium0 advise in issue #443

lifehsiwu commented 2 years ago

Got the same bug

fsz168 commented 1 year ago

The same problem, many bugs

nexon33 commented 1 year ago

same

newzapster commented 1 year ago

Same here. Any solution?

newzapster commented 1 year ago

Solved by adding treynor_ratio in the excluded_indicators like below:

def generate_all_default_quantstats_features(data): excluded_indicators = [ 'compare', 'greeks', 'information_ratio', 'treynor_ratio', 'omega', 'r2', 'r_squared', 'rolling_greeks', 'warn' ]