Giter Site home page Giter Site logo

rl-trading-agent's People

Contributors

clementperroud avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

rl-trading-agent's Issues

Multiple errors when running notebook

When running the notebook there are several errors, some of which seem like inconsistency between the Rainbow library version and this notebook. Some of the errors are easy to solve such as:

First error

training_envs = gym.vector.SyncVectorEnv([lambda: make_env("/notebooks/data/processed/training/*.pkl") for _ in range(5)])
validation_envs = gym.vector.SyncVectorEnv([lambda: make_env("/notebooks/data/processed/validation/*.pkl") for _ in range(5)])

These lines does not work because the manage_data.ipynb file doesn´t output to training or validation folder.

Second error

env.add_metric('Position Changes', lambda history : f"{ 100*np.sum(np.diff(history['position']) != 0)/len(history['position']):5.2f}%" )
env.add_metric('Max Drawdown', max_drawdown)

These lines throw the error: WARN: env.add_metric to get variables from other wrappers is deprecated and will be removed in v1.0, to get this variable you can do env.unwrapped.add_metric for environment variables or env.get_attr('add_metric') that will search the reminding wrappers.

Changing to:

env.unwrapped.add_metric('Position Changes', lambda history : f"{ 100*np.sum(np.diff(history['position']) != 0)/len(history['position']):5.2f}%" )
env.unwrapped.add_metric('Max Drawdown', max_drawdown)

Fixes it

Third error

'Rainbow' object has no attribute 'e_greedy_pick_actions_or_random'

I think this one is because the method was renamed to e_greedy_pick_actions on this commit

Fourth error

This one I haven´t found how to fix it
could not broadcast input array from shape (15,7) into shape (15,6)

when the following line is ran:
agent.store_replays(obs, actions, rewards, next_obs, dones, truncateds)

P.D. Thanks for the amazing project!

robust_scale is use future prices ?

def add_features(df):
df["feature_close"] = robust_scale(df["close"].pct_change())
df["feature_open"] = robust_scale(df["open"]/df["close"])
df["feature_high"] = robust_scale(df["high"]/df["close"])
df["feature_low"] = robust_scale(df["low"]/df["close"])
df["feature_volume"] = robust_scale(df["volume"] / df["volume"].rolling(7*24).max())
df.dropna(inplace= True) # Clean your data !
return df
I think robust_scale must use future info

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.