Comments (11)
I have met the same problem. The error log is shown below.
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-22-1960ecceda46> in <module>()
1 env_train = env_setup.create_env_training(data = train,
----> 2 env_class = SingleStockEnv)
/usr/local/lib/python3.6/dist-packages/finrl/env/environment.py in create_env_training(self, data, env_class, turbulence_threshold)
54
55 def create_env_training(self, data, env_class, turbulence_threshold=150):
---> 56 env_train = DummyVecEnv([lambda: env_class(df = data,
57 stock_dim = self.stock_dim,
58 hmax = self.hmax,
/usr/local/lib/python3.6/dist-packages/stable_baselines3/common/vec_env/dummy_vec_env.py in __init__(self, env_fns)
23
24 def __init__(self, env_fns: List[Callable[[], gym.Env]]):
---> 25 self.envs = [fn() for fn in env_fns]
26 env = self.envs[0]
27 VecEnv.__init__(self, len(env_fns), env.observation_space, env.action_space)
/usr/local/lib/python3.6/dist-packages/stable_baselines3/common/vec_env/dummy_vec_env.py in <listcomp>(.0)
23
24 def __init__(self, env_fns: List[Callable[[], gym.Env]]):
---> 25 self.envs = [fn() for fn in env_fns]
26 env = self.envs[0]
27 VecEnv.__init__(self, len(env_fns), env.observation_space, env.action_space)
/usr/local/lib/python3.6/dist-packages/finrl/env/environment.py in <lambda>()
63 action_space = self.action_space,
64 tech_indicator_list = self.tech_indicator_list,
---> 65 turbulence_threshold = turbulence_threshold)])
66 return env_train
67
<ipython-input-17-33a3af6cb4c6> in __init__(self, df, stock_dim, hmax, initial_amount, transaction_cost_pct, reward_scaling, state_space, action_space, tech_indicator_list, turbulence_threshold, day)
93 self.turbulence_threshold = turbulence_threshold
94 # initalize state: inital amount + close price + shares + technical indicators + other features
---> 95 self.state = [self.initial_amount] + [self.data.close] + [0]*self.stock_dim + sum([[self.data[tech]] for tech in self.tech_indicator_list ], [])+ [self.data.open] + [self.data.high] + [self.data.low] + [self.data.daily_return]
96 # initialize reward
97 self.reward = 0
/usr/local/lib/python3.6/dist-packages/pandas/core/generic.py in __getattr__(self, name)
5139 if self._info_axis._can_hold_identifiers_and_holds_name(name):
5140 return self[name]
-> 5141 return object.__getattribute__(self, name)
5142
5143 def __setattr__(self, name: str, value) -> None:
AttributeError: 'Series' object has no attribute 'daily_return'
from finrl.
I guess this issue occurred since the column daily_return
in DataFrame data_df
missed. I would appreciate it if you could check it.
from finrl.
I fixed it. Please try again. Please do runtime, and factory reset runtime, and run everything again.
from finrl.
It works well now. Thanks for your effort.
from finrl.
Sorry I have a relevant question regarding 'daily_return': why it cannot be found before doing feature engineering? Does that mean 'daily_return' is a technical indicator? If so why it is not included in the tech_indicator_list? Thanks
from finrl.
This code is incredible awesome! thank you for! some idea to try it on binance future testnet? or to implement ccxt?
https://github.com/ccxt/ccxt
https://binance-docs.github.io/apidocs/testnet/en/#change-log
from finrl.
Sorry I have a relevant question regarding 'daily_return': why it cannot be found before doing feature engineering? Does that mean 'daily_return' is a technical indicator? If so why it is not included in the tech_indicator_list? Thanks
good question, I found this 'daily_return' is actually hardcoded into the env file for single stock trading, that's not good, I will work on improvements.
from finrl.
This code is incredible awesome! thank you for! some idea to try it on binance future testnet? or to implement ccxt?
https://github.com/ccxt/ccxt
https://binance-docs.github.io/apidocs/testnet/en/#change-log
Great library. We are actually doing research papers on cryptocurrencies, if you are an expert, let's work together.
from finrl.
i am not an expert but i would gladly help you in some way
from finrl.
I'd like to implement some stuff inFinRL:
Autoregressive Integrated Moving Average:
https://towardsdatascience.com/aifortrading-2edd6fac689d
Add to dataframe all the indicator of TA lib together:
https://github.com/bukosabino/ta/blob/master/examples_to_use/all_features_example.py
https://github.com/bukosabino/ta
Use of Ray agent for crypto
https://www.tensortrade.org/en/latest/agents/overview.html#ray
Implement Tensorflow2.4
from finrl.
I'd like to implement some stuff inFinRL:
Autoregressive Integrated Moving Average:
https://towardsdatascience.com/aifortrading-2edd6fac689dAdd to dataframe all the indicator of TA lib together:
https://github.com/bukosabino/ta/blob/master/examples_to_use/all_features_example.py
https://github.com/bukosabino/taUse of Ray agent for crypto
https://www.tensortrade.org/en/latest/agents/overview.html#rayImplement Tensorflow2.4
https://join.slack.com/t/ai4financeworkspace/shared_invite/zt-jyaottie-hHqU6TdvuhMHHAMXaLw_~w
Please join our open source community.
from finrl.
Related Issues (20)
- Question : DRL_prediciton : if deterministic=True then no actions are taken after the first one HOT 1
- Reproducibility Issue of Stablebaseline3 ( FinRL ) HOT 5
- Installation issues in installing finrl on Ubuntu 22.04 on aarch64 HOT 2
- ImportError: cannot import name 'ERL_PARAMS' from 'finrl.config' HOT 1
- Environment HOT 2
- Newcomer here. Can you recommend articles?
- Environments - Stocktrading and stocktrading_np
- StockTradingEnv.py HOT 1
- issue with stable-baselines3 and eleganrl enviroment
- why action not any change after episode 3? HOT 1
- I downloaded the compressed file of finrl and installed it using setup.py. However, when importing finrl, I encountered the error ModuleNotFoundError: No module named 'gyrasium', and the environment installed gyrVersion: 0.25.2. What's going on
- Attribute Error HOT 1
- FinRL Paper Trading demo bug HOT 3
- AttributeError: 'Series' object has no attribute 'iteritems' error HOT 1
- FinRL/examples/FinRL_PaperTrading_Demo_refactored.py: failed with NASDAQ tickers
- Incorrect initialization in env_stocktrading for single asset
- Intraday Trading HOT 1
- Unable to add technical indicators for BSE500 (Indian) tickers HOT 5
- Normalization/Standardization input data
- State Space Composition Modification HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from finrl.