Introduction to Algorithmic Trading with Python: Create a Mean Reverting Trading Algorithm

preview_player
Показать описание
#python #stocktrading #algorithm
How to create a Trading Algorithm - Algorithmic Trading Using Python

Become an Algorithmic Trader - Use Python to download stock price data and create a mean-reverting trading algorithm.

Please SUBSCRIBE:

Download the notebook from github:

See how to create a momentum trading algorithm:

* Note the information contained in this video is for educational purposes only and should not be construed as investment advice
Рекомендации по теме
Комментарии
Автор

You saved my time. Was looking for this for my project ! Thank you Matt.

mrityunjaypathak
Автор

Thanks man! I’m a long time trader but beginner “quant” and python user. This is very helpful

nj-bzpv
Автор

Thank you very much for sharing your Python codes.

botancitil
Автор

Outstanding! Thank you for the tutorial, very clean code.

Krath
Автор

Your approach to algorithmic trading is novel. I've never seen an approach like this. I 've become aware of a problem with most indicators used by traders to generate Buy and Sell signals. One such indicator is the RSI. So, what I did was to add a column to your gld dataframe. I then ran a correlation between the gld['ratio] column and the gld['RSI'] column. I got the following correlation: 0.9120, which indicates that the ratio is highly correlated with the RSI. That, my friend, is the problem with most (all?) indicators that are based on price. In short, they all seem to be highly correlated. Using more than one indicator is oversampling, or superfluous. One doesn't really appear to be much better than another as far as I can tell. I'm curious, however, if there are any strategies that work better than others, relatively consistently. I'd also like to know if there are indicators that aren't correlated with price movement. I'm interested in any feedback, but if someone feels the need to attack me, please, keep it to yourself.

mkaberli
Автор

Hi, great tutorial! Just one quick question, for the value of the moving average, what does 21 stand for, is it the length of the moving average or the actual value of the moving average? Can you elaborate further on how you derived the value of 21 for the moving average?

HisyamHilmiOmar-jxmx
Автор

It would be great if you make another video about how to look at this strategy from linear regression point of view

ahmadz
Автор

Hallo I have 3 question here

1. Why do we use np.exp at the back?
2. why do we need to shift the position to 1 ahead?

SEVENCRYPTOCHANNEL
Автор

a small correction while u were interpreting the graph : percentile 50% is the median not the mean

ahmadz
Автор

Could you please suggest a solution for ( since not working pdr.get_data_yahoo) while I am executing the code for GLD?

muratkonuklar
Автор

Can you please show us how to write the for loop to backtest a portfolio stock, for example 10 stocks. I can understand the code for backtesting one instrument, but can't figure how to to write the code for testing 10 stocks in one go. Thanks a lot.

twtw
Автор

Superb tutorial, thanks! One question, how can we incorporate the cost of each transaction in the case of the strategy version? Would that mean its final return is likely to be smaller than that of buy and hold? Thanks

Frdy
Автор

May I know why you use close price instead of adjusted close price?

jesslyn
Автор

Thank you very much man for this upload ! It's perfect. Can you make the same video with exit point, neutral point and calculate fees ? Thnx :-)

eliotharreau
Автор

Hello Matt, I hope you are good some questions: this strategy does not consider commissions right and that's why it outperforms buy and hold? what is the difference between a strategy of moving averages signals and this ratio? and if we wanted to add some commissions how would we do it?

Thank you so much!

jaguar