Predicting Stock Prices with Python using Machine Learning - Linear Regression

preview_player
Показать описание
In this video we are covering the simplest form of Machine Learning to predict stock prices (or rather returns) in Python using a Linear Regression.

Get the Notebook/Source code by becoming a Tier-2 Channel member:

As said in the video you should not take this as a valid trading strategy. It is just an idea how a linear Regression can be used and how overfitting can be avoided or at least diminished using a train test split.

I am purposely NOT showing a time horizon where this is working or looking nicely to make you aware of that.

I am planning on covering other algorithms and extending the strategy. If you find that interesting please leave the video a like and subscribe :-)

Mentioned videos:
Logit regression:

Multiple linear regression:

The video series is inspired by the Hands-On Algorithmic Trading with Python course by Deepak Kanungo. Anyhow, the code and some approaches strongly deviate from his.

#Python #MachineLearning #Regression

Disclaimer: This video is not an investment advice and is for informational and educational purposes only.

0:00 - 01:04 Introduction
01:04 - 04:53 Data prep
04:53 - 06:15 Model building, fitting & prediction
06:15 - 08:24 Strategy, Performance and Visualization
08:24 - 14:40 Overfitting and avoiding with train test split
14:40 - 16:42 Number of trades
16:42 - 18:59 Playing around with different assets, lags (skippable)
Рекомендации по теме
Комментарии
Автор

Fantastic how easy this was to follow and get some practical display of how to use these tools.

santiagoricoy
Автор

Another great video.
one comment (or request), I totally agree that price predication using ML is a very risky idea, however, direction predication is might be a good approach with ML, please try to go further deep in ML classification for price direction prediction, I hope you will explain in simple way how to predict future (or next day) price direction. Thanks a lot.

cealgo-ctrader
Автор

Thanks Man! Cool video as always! Could you possibly do a video on Reinforcement Learning in the future? I'd love to see your perspective and application on the that particular subject. Again thanks for your work! Amazing!

tudatostrader
Автор

Thx man i was searching everywhere for this I'm started learing python a month ago

josephpalakunnel
Автор

Very good video. Thank you for sharing!

lfz
Автор

great video, have been going back through some of your old videos. question, how do you get the next day's prediction based on the train_test_split?

scottbirkby
Автор

Hi Algovibes. I found this video useful for learning about linear regression and data frames. I am trying to recreate your code but am encountering an error on the model fitting. Key error: "None of [Index(['lag_1', 'lag_2', 'lag_3', 'lag_4', 'lag_5'], dtype='object')] are in the [columns]" I have copied your code 1:1 and can't figure out what is going wrong. Do you have any ideas? Thank you!

nasimabu-dagga
Автор

Hey nice video !
Maybe I'm wrong, but in 13:35 shouldn't we subtract -1 to account for the initial investment ?

jorgitozor
Автор

More Machine Learning vidoes :D :D :D It was great!

srengodbersen
Автор

can you please make a video on detecting breakouts like a stock price breaking their high low chain?

cold_aim
Автор

Is there an option to add a plot title with this command in your code: np.exp(df[["returns", I don't see matplotlib being imported explicitly where the title method is available. Thanks.😀

MathaGoram
Автор

please make video on machine learning on option chain

sumeetsheokand
Автор

how Can I do to get the recommendation from strategy? like the signals to buy and sell?

danielcampos
Автор

I wish i understood WTF you are doing with this coding stuff but i enjoy watching it... just watching thses makes me feel smarter EVEN THO idk wtf this code really does or what each part mean but hey.... its a view hahaha

lovecodwaw
Автор

how can we use this to predict future prices?

ShakTMT
Автор

oh yessss tks u any thing beside bitcoin

GameFlife
Автор

I see you fixed the variables to fit your beliefs about returns 😂. Once I am done with python than we can discuss this.

simplySunny
Автор

I see the content on this channel is heating up

Septumsempra