Giter Site home page Giter Site logo

albert-z-guo / deep-reinforcement-stock-trading Goto Github PK

View Code? Open in Web Editor NEW
515.0 515.0 123.0 10.2 MB

A light-weight deep reinforcement learning framework for portfolio management. This project explores the possibility of applying deep reinforcement learning algorithms to stock trading in a highly modular and scalable framework.

License: GNU General Public License v3.0

Python 1.01% Jupyter Notebook 98.99%

deep-reinforcement-stock-trading's People

Contributors

albert-z-guo avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

deep-reinforcement-stock-trading's Issues

why don't agent balance learn slow on DDPG

Hi Albert,

I am trying to learn a DDPG model, and I refer the code from your GitHub repository, but I always get a large gap between the reward and the real price.
Can you do me a favor?
I would like to know why the learning process of DDPG is very slow and the reward balance is so small?

Thanks for your reply in advanced!

Best regards,
CCC

Loss is in millions ...experience_replay()

Hello Albert,
Please pardon this note as an issue, new to github, not sure where else i can ask a question.

I am trying to run your DQN model, and i find that the loss value reported is very high, not sure how to read the loss...
I have printed the following in the training.py file -

print(e, loss, action_dict[action], reward, agent.balance, len(agent.inventory),len(agent.memory),agent.buffer_size)
logger.info('Episode {}\tLoss: {:.2f}\tAction: {}\tReward: {:.2f}\tBalance: {:.2f}\tNumber of Stocks: {}'.format(e, loss, action_dict[action], reward, agent.balance, len(agent.inventory)))

image

Could you please clarify about the loss ?

Thank You
Arjun

how to save DDQN model

Hi! Thank you for your last answer!
Recently I try to train the DDQN in your project,so I write" if model_name == 'DDQN':
agent.model.save('saved_models/DDQN_ep' + str(e) + '.h5')"

But when I try to run "evaluate" the project reminded me "SavedModel file does not exist ".
I found that in DDQN.py there should be a file named"DDQN_target.h5". So could you tell me how to write exact code to save the model?
Thank you very much!!!

Save DDQN

Hi! Thank you for your answering!
I know what you mean,but my problem is that I modify model file names there like
if model_name == 'DDQN':
agent.model.save('saved_models/DDQN_ep' + str(e) + '.h5')
but the evaluate.py needs two files,one is"DDQN_ep10.h5", another is "DDQN_ep10_target.h5". I don't know how to save the "DDQN_ep10_target.h5",I can only save "DDQN_ep10.h5".
So I want to know how to do it.
Hope you can answer me ~
Sincerely!

Memory issue

Greetings,
this seems a robust project. Unfortunately, I had several crashes because of lack of memory and never could finish even a episode in the training
:(

Saved models are only working on ^DJI_2016 stock

I get error or session ends abruptly in google collab hence I am not able to train DQN on other stocks and hence I am using your saved models. Only able to train till 2 episodes with 1 year of stock data

Your DQN saved models are only producing profits on stock ^DJI_2016 and not on any other stocks ( not even on ^DJI_2010-2015 )
DQN_DJI_2016
DQN_GSPC2018
DQN_NVDIA2018

I have tried evaluating DQN on other stocks such as Alphabet Inc , Shanghai Composite etc still model produces only a straight line of portfolio value
DDPG_PetroChina_2018
DQN_FB2018

I have tried changing initial portfolio value as well from 50k to 500k and 5k still to no avail .

What should I do ?

Please help !!

Thanks Raghav

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.