edwardhdlu / q-trader Goto Github PK
View Code? Open in Web Editor NEWDeep Q-learning driven stock trader bot
Deep Q-learning driven stock trader bot
Regards,
Lam
It seems the "memory" is never cleared? I'm confused with it.
https://github.com/edwardhdlu/q-trader/blob/master/train.py#L49
What is the python training time for this? With default settings 10 window and 1000 episodes, on what hardware?
Also, in Python is the fit() sequential? i mean, the code stops until model.fit() is done?
I'm trying to port this to tfjs and the code rushes through the for loop of the episodes and the data length but doesn't "wait" for the model.fit(). Now i'm using async/await for it to wait for the model.fit() but it's taking a great amount of time. Can someone shed some light?
Hey Edward...I was going to issue apull request, but it is probably faster to just make the quick edit to the readme yourself. At the bottom you state to "mkdir model" when in-fact I believe it should be "mkdir models" as that is the path your existing code references. Just thought I would let you know. Thanks for putting this together. Very interesting!!
Hey, could someone help me with my problem? What am i overseeing? :)
stock_name, window_size, episode_count = sys.argv[1], int(sys.argv[2]), int(sys.argv[3])
IndexError: list index out of range
Kernel died, restarting
I'm trying to implement this in tensorflow js but i'm running into some issue with these lines in agent.py:
target_f = self.model.predict(state)
target_f[0][action] = target
self.model.fit(state, target_f, epochs=1, verbose=0)
What does target_f means? final target?
What is target[action] ? Why are we setting target_f to the predict and then assingning it something else?
thanks,
Tiago
There is a dead link at the bottom of the README file, in the reference section.
hey~
your code is very interesting i like it
but i want to know how to draw the graph of the stock price
i run the code however it didn't draw the graph as you post on the github
I understand your code , please give me idea how we plot graph according to x-y axis.
What we are taken in X-axis and Y-axis.
lines = open("data/" + key + ".csv", "r").read().splitlines()
FileNotFoundError: [Errno 2] No such file or directory: 'data/GSPC.csv'
i got this error
tenroflow 1.10.0
python 3.6.4
w7.
I maked some changes in code couse parenthes was missing
please
File "evaluate.py", line 20, in
window_size = model.layers[0].input.shape.as_list()[1]
AttributeError: 'Shape' object has no attribute 'as_list'
stock_name, model_name = sys.argv[1], sys.argv[2] model = load_model("models/" + model_name) window_size = model.layers[0].input.shape.as_list()[1]
It always stays at profit 0.00 after I evaluate some model.
Why can this be?
Standard library module invoked user code during import; breakpoints disabled for invoked code.
It is an interesting project, and I tried to it on my computer based on your readme. This is what I did.
mkdir models
python train.py ^GSPC 20 100
python evaluate.py ^GSPC_2011 model_ep100
And I got following output in evaluation
/Users/username/Library/Python/2.7/lib/python/site-packages/h5py/init.py:36: FutureWarning: Conversion of the second argument of issubdtype from 'float' to 'np.floating' is deprecated. In future, it will be treated as 'np.float64 == np.dtype(float).type'.
from ._conv import register_converters as _register_converters
Using TensorFlow backend.
2018-01-17 07:29:54.049861: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.2 AVX AVX2 FMA^GSPC_2011 Total Profit: $0.00
The agent did not do any thing to the test data set...
I know 100 training episodes is not enough to produce meaningful result. But I expect insufficient training would yield some bad strategy to loss money rather than no action at all.
My OS is macOS High Sierra. Do you think it is the problem of python environment or just too few training? Have you had such problem before?
Thanks!
I train this model using GTX1080. I ran about 10 hours but just train 200 episodes. have anyone have same problems?
after i run the training program, I get "the program is running, do you want to kill it?" window. I click "okay" and it dies.
I have apple macbook pro laptop.
any thoughts?
I may be wrong but doesn't
mini_batch.append(self.memory.popleft())
do better job than
mini_batch.append(self.memory[i])
in
def expReplay(self, batch_size):
mini_batch = []
l = len(self.memory)
for i in xrange(l - batch_size + 1, l):
mini_batch.append(self.memory[i])
It is much faster too.
Hi, I found that there maybe multiple buying if the action == 1 is true, which means the program will record multiple buy before any sell could happen. And there is no limit of number of "buy" could be allowed. This is very different from real life situation. Am my understanding correct? However, when I tried to limit the "buy" to 1 if the system already hold a long position. I found the result during training is not stable and most of the time is negative. Do I miss something? Many thanks in advance.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.