Hi there, firstly great video! How would it be possible to add another variable to the trend line? So essentially it would be multiple linear regression
Hello Matt, first of all, thank you for your work. I have tried to reproduce this exercise and when executing the line 'data = pdr.get_data_yahoo(stocks, start)' I get the following error message: 'TypeError: string indices must be integers, not 'str'. I have tried to solve it in different ways, but nothing, it always gives me that message. I downloaded your code in case there was something written incorrectly, and it gives me the same error. Any suggestions?
Thanks. The problem is the pandas_datareader has not kept up with changes to the yahoo finance API. The workaround is to install yfinance (pip install yfinance). Then it would be yfinance.download(stocks, start)
Thank you for the video!! How would I add another more trend lines to subset set specific times or dates? I am trying to plot my X and Y for 9 am 10am 12pm and have multiple trend lines. Hope that makes sense, thank you in advance!
Could you possibly provide a link to the data set you actually used in this tutorial? I would like to follow it locally on my PC as I go through this. Thank you.
Thank you Matt. Would like to know what is different btw "np.log().diff()" and "pct_change().cumsum()", I've tried those two syntax then got a different result. Could you pls solve this question? Thanks again Matt.
Very Nice, Hello Matt, in the section "trend as a technical indicateur", how to put the value of the trend line in a dataframe to detect later when it cross the curve ? Thank you. 👍👍
Thank you Matt. You explain things so well. I've watched several of your videos and intend to watch more.
Thanks very much. Glad it's helping.
Thank you for your work and the video!
Thanks. Glad it helped
Thank you! Is this also good for predicting a range? Say 30 periods out?
Glad it helped. It's tough to predict out that far, but yes it might give you something better than just guessing.
@@MattMacarty thank you Matt!
Thank you for this. I was looking for a way to code a trend line. With many traders it becomes subjective. This makes it more precise.
Thanks. Glad it helped
@@MattMacarty hi bro thank u so much for the video its help a lot , but could u tell me why we use the np log diff ?
Great. Glad it helped.
Glad it helped. Yes you can copy tables. see this video: th-cam.com/video/68XMlO9fciA/w-d-xo.html
@@aimenslamat1264 The log change is referred to as the instantaneous rate of return and is commonly used to price securities, particularly derivatives
Hi there, firstly great video! How would it be possible to add another variable to the trend line? So essentially it would be multiple linear regression
Thanks. Generally two explanatory variables would be graphed as a plane.
Hello Matt, first of all, thank you for your work. I have tried to reproduce this exercise and when executing the line
'data = pdr.get_data_yahoo(stocks, start)'
I get the following error message:
'TypeError: string indices must be integers, not 'str'.
I have tried to solve it in different ways, but nothing, it always gives me that message. I downloaded your code in case there was something written incorrectly, and it gives me the same error. Any suggestions?
Thanks. The problem is the pandas_datareader has not kept up with changes to the yahoo finance API. The workaround is to install yfinance (pip install yfinance). Then it would be yfinance.download(stocks, start)
@@MattMacarty i also faced same issue.. can i send a github PR to update the notebook if already not updated?
@@vimalk78 Sure I will post updated code using yfinance.
Thank you sir for explaing the code in the detail
explaining*
Glad it helped
Matt, if I wanted to take the first derivative of the linear regression function, how could I execute that? is there a certain package?
Sure, you can use NumPy, SciPy, scikit-learn. Probably a number of others but that's what comes to mind.
Thank you for the video!! How would I add another more trend lines to subset set specific times or dates? I am trying to plot my X and Y for 9 am 10am 12pm and have multiple trend lines. Hope that makes sense, thank you in advance!
You mean for different time periods, say an hour for each? You should be able to subset the data and then run a regression on each subset.
Very good Thank you.
Glad it helped
Could you possibly provide a link to the data set you actually used in this tutorial? I would like to follow it locally on my PC as I go through this. Thank you.
Hi the data was downloaded from Yahoo finance. Here is a link to the notebook: github.com/mjmacarty/alphavantage
Thank you Matt. Would like to know what is different btw "np.log().diff()" and "pct_change().cumsum()", I've tried those two syntax then got a different result. Could you pls solve this question? Thanks again Matt.
pct_change is E/B - 1, np.log is LN(E/B). LN is a continuously compounding rate.
Very Nice, Hello Matt, in the section "trend as a technical indicateur", how to put the value of the trend line in a dataframe to detect later when it cross the curve ? Thank you. 👍👍
You need the slope and intercept coefficient and then you can create a column with the trend line
@@MattMacarty Yess my friend it s exactly what i want, maybe if you have a small example ? Thnx.
import pandas_datareader as pdr is not working , what shoul di do
This probably means it is not installed. From the command line run pip install pandas-datareader
@@MattMacarty looks like Yahoo might have changed something
Hi I am running into this error:
No data fetched using 'YahooDailyReader'
Can you send me the line of code that caused the error?
what to do if the x-axis is time series ?
Probably the easiest thing to do is make time the independent variable.
i get error: "ModuleNotFoundError: No module named 'pandas_datareader'"
Hi this means you need to install it. Run !pip install pandas-datareader in a code cell in your notebook
Correlation != Causality !!!
Exactly
i got two points
Hi. You can download the notebook I used here: alphabench.com/data/python-linear-regression.html
@@MattMacarty yeah i still got two points for spy and Google might be due to a crash
do you want to look at my notebook when I finish it.
changed the symbols still got two points using goog