Code Monkey home page Code Monkey logo

Comments (16)

satinder147 avatar satinder147 commented on August 20, 2024 3

@Kalelv45 @kkuette @iorobot @edwardhdlu.I tried it myself and found that tweaking the code a little bit yields very good results. I changed the way reward was provided. If there were more that 20 consecutive buys or 50 consecutive "no action", then I gave the agent a big negative reward like -500. Apart from this I removed the max(in the buy action) and multiplied the reward by 100. I trained the model for 220 episodes and the 220th showed a profit of 25000 dollars on the last three year google stock price data.

from q-trader.

gucciwang avatar gucciwang commented on August 20, 2024 1

I used a window size of 20, and found that my model converges and profits the most on my 30th episode. All models after 100 seems to diverge and just never buy anything. Any ideas on how to tweak the model to further converge?

image

from q-trader.

kkuette avatar kkuette commented on August 20, 2024

Your agent did not learn well, i think it's just overfitting.

from q-trader.

iorobot avatar iorobot commented on August 20, 2024

Look at #1.
I also have that problem but even with that solution my results using almost the same model(model_1000 or model_1010) are extremely volatile.

from q-trader.

kkuette avatar kkuette commented on August 20, 2024

Try to tweak your settings.
if you want something with more functionalities you can look at this

from q-trader.

iorobot avatar iorobot commented on August 20, 2024

Nice!Can you pull the code?

from q-trader.

chmbrs avatar chmbrs commented on August 20, 2024

@Kalelv45 @kkuette @iorobot @edwardhdlu.I tried it myself and found that tweaking the code a little bit yields very good results. I changed the way reward was provided. If there were more that 20 consecutive buys or 50 consecutive "no action", then I gave the agent a big negative reward like -500. Apart from this I removed the max(in the buy action) and multiplied the reward by 100. I trained the model for 220 episodes and the 220th showed a profit of 25000 dollars on the last three year google stock price data.

You mean that you removed the max function in the sell action, right?

from q-trader.

kkuette avatar kkuette commented on August 20, 2024

Are you sure that your model isnt overfitted ?

from q-trader.

satinder147 avatar satinder147 commented on August 20, 2024

I removed the max function because otherwise the model is not penalized for wrong decisions. Then you can increase the size of the penalty(not everytime) by multiplying the reward it gets after selling by 100.
As far as overfitting is concerned, I have tried it with a bunch of other stocks and it is working really good.

from q-trader.

gucciwang avatar gucciwang commented on August 20, 2024

What's the window size you're using? @satinder147

from q-trader.

satinder147 avatar satinder147 commented on August 20, 2024

@calvin-is-seksy 10

from q-trader.

satinder147 avatar satinder147 commented on August 20, 2024

I just made an pull request. You all can have a look

from q-trader.

iorobot avatar iorobot commented on August 20, 2024

Even with your code i still have 0 profit with the GSPC dataset. Any ideas why?

from q-trader.

iorobot avatar iorobot commented on August 20, 2024

well, it seems to me that is only a coincidence, have you try to use different data?Do you find the same behaviour?

from q-trader.

GarfieldHuang avatar GarfieldHuang commented on August 20, 2024

I used a window size of 20, and found that my model converges and profits the most on my 30th episode. All models after 100 seems to diverge and just never buy anything. Any ideas on how to tweak the model to further converge?

image

hello, I want to know how to plot this graph??

from q-trader.

rui-ren avatar rui-ren commented on August 20, 2024

I used a window size of 20, and found that my model converges and profits the most on my 30th episode. All models after 100 seems to diverge and just never buy anything. Any ideas on how to tweak the model to further converge?

image

@ How about your running time? It is super slow on my laptop, I have RTX 2060 , But still 10 episodes took 1 hour. THX

from q-trader.

Related Issues (20)

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.