llSourcell / How-to-Predict-Stock-Prices-Easily-Demo

How to Predict Stock Prices Easily - Intro to Deep Learning #7 by Siraj Raval on Youtube
768 stars 589 forks source link

The prediction result looks not so good. #5

Open songqiqqq opened 7 years ago

songqiqqq commented 7 years ago

Thanks for your sharing! However, the prediction result looks not so good as shown in the last figure. how do you think about this prediction result? image

Besides, could you share your thoughts that why you design 2 LSTM layers with the output length of 50 and 100 for this price prediction problem? What's your detailed consideration behind this design ?

Steviey commented 7 years ago

+1

jamesmgg commented 6 years ago

wtf did I do wrong? image

houcem-ds46 commented 6 years ago

I have same wrong curves as jamesmgg

awt135 commented 6 years ago

default

Endran commented 6 years ago

I have the same as @jamesmgg . The main difference with the original demo is python 2 vs 3. Have a look at this PR; https://github.com/llSourcell/How-to-Predict-Stock-Prices-Easily-Demo/pull/6 . It fixed it for me :)

wizzwizz4 commented 6 years ago

This isn't a predictable value. If stock prices were predictable, people would use the program to anticipate that, meaning that the values would change. This repeats until it isn't predictable.

Steviey commented 6 years ago

@wizzwizz4 It's all about probability dude... https://www.youtube.com/watch?v=RTKWbwZ8X-w

wizzwizz4 commented 6 years ago

@Steviey This type of algorithm can't predict what is, to it, random noise. There are correlations with real-world events in the stock market, but this algorithm can't see those. It just sees something it can't predict, tries to predict it, and fails.

Steviey commented 6 years ago

@wizzwizz4
Well, in fact the term "prediction" is somehow missleading in the area of machine learning and trading. Actually what you do is accumulation of propapility, with dozens or hundreds of algorithms and indicators- at the same time, for the same problem. "LSTM" is only one method among many others. Whereby a user could decide to cancel the mehtod "LSTM" completely from his problem solving strategy list- or to use it only to build a feature, indicator etc., to support a validated "prediction", forecast, what ever.

If you find a good working algorithm-combination, you can became rich, like blackrock.com or famous like a kaggle star.

Be aware, every method has to be statistically validated on unseen real world data. In case of stock prices, all what you need, is a combination of algorithms, which "predicts" with 51% success into the right market direction. This seems to be happened many times since the late seventies... https://www.youtube.com/watch?v=gjVDqfUhXOY There are also "older" methods like fibonacci retracements/extensions and others, which don't correlate to machine learning, but to chart analyzing. And there are newer state of the art algos, like neural networks and deep learning methods.

To prefer many methods over a single one, for the same problem, corresponds to a paradigm change of the last ten years in the ai science.

In any case, the art lies in preparing validated algo-combinations and the so called feature engineering.

This example by Siraj is a very basic entry point. It took me over a year- to get the big picture :-). But I like Sirajs "Disco-Style".

wizzwizz4 commented 6 years ago

@Steviey Ok. I understand what you meant now.

But this algorithm is far to simple to have a hope of working. Predicting the weather by extrapolation is easier than predicting the stock market by extrapolation; the former is at least potentially plausible. Perhaps this repo should be rebranded slightly?

jamesmgg commented 6 years ago

^ but how is Siraj gonna get those clicks without the click-bait title maaaaan?

Steviey commented 6 years ago

Yep, it's an inspiring click bait title- but not useless to get an initial, very basic environment running and try to predict something. Siraj needs clicks? That's ok for me. He does a lot of work.

wizzwizz4 commented 6 years ago

@Steviey Yes, the work is good... but this particular example is not the best, since without making the system much more complicated with extra sources of data you're going to end up with something that isn't a good prediction.

Steviey commented 6 years ago

@wizzwizz4 Yes it's a simplified example. But you will not find any out of the box solution. In any case one have to dig deeper and compare this example with others, for example here: https://machinelearningmastery.com/?s=lstm&submit=Search

And even then, this does not mean that any LSTM example will fit your needs for a specific stock price prediction. As I said, you have to parameterize, compare, combine and validate.

I'm currently running 50 algorithms on the same problem and still measuring the performance under specific conditions and learning :-). If you want, it's a continuous tuning process in the hope to find something useful. A bread crumb of evidence. If you are able to bake a new bread by this bread crumbs, you are the winner.

My benefit here was to get a first impression and a running Python environment. Meanwhile I use multiple techniques like Python, R and others. And of course, an exciting list of algorithms .-). If I'm right, I got my functional, tiny little LSTM-prototype from the link above. But in comparison, there are much more better performing methods- matching my needs.

Anonym123Abb commented 5 years ago

@Steviey Hi, you mean that you've predicted 50 algorithms such as reinforcement, LSTM and so, and you don't have gotten any valid results? I tried some codes but get nothing with the same problems, I need your help to say me what way I should pursue, should I improve my data except data in popular APIs? for example involving tweeter conversations or something like that? In which way I should add complexity to develop my performance?

Steviey commented 5 years ago

@AbbasGLN

Meanwhile I have a 100 algos-framework prepared. As I said, some perform better, some do less.

There are already social-sentiment-APIs on the market (some with ML-algos implemented). Not only for tweets. You can simply subscribe to them (mostly payed services). If you want to code this by your own, you have to resolve Webservices-API's and for example- learn NLP-algos.

These techniques are used, to produce so called trading signals (which direction a stock price will move). There are also other API's available, which provide stock market analysis data out of the box. You can easily use them, for your own ML-based, or statistical analysis. Example: https://intrinio.com/

A good approach is, to explore 'traditional' algo-trading, for example with MT4, before planning the golden machine learning platform for stock price predictions. I do both in parallel. Once your skills are grown, you get a better idea, on what to use for specific problems.

Be aware, in many cases, there is no need for machine learning, to do the right automated trade. HF-trading for example, is mostly based on low level mathematics/statistics, like moving averages etc.. A big ML-algo would be way to slow, for high frequency trading. Although you could feed your HF-algos, with some additional 'long term knowledge' coming from ML-background. :-)