derekbanas / python4finance Goto Github PK
View Code? Open in Web Editor NEWI get many questions about how to analyze the Stock Market with Python. I am creating a new playlist of videos that will completely cover Python for Finance.
I get many questions about how to analyze the Stock Market with Python. I am creating a new playlist of videos that will completely cover Python for Finance.
Hi Derek,
first of all, let me say I appreciate your work a lot, your Youtube tutorials are really helping me.
After watching your video "Stock Market Prediction: Python for Finance 5", I've been working with the code, and I think I found a serious problem. In section Regression Time Series Example with AutoReg, the regression model is initialized as
train_model = AutoReg(a_df['Adj Close'], 500).fit(cov_type="HC0")
The problem is that it uses a_df
to train the model, the whole dataset instead of just train_df
, the training dataset. This is a serious problem because this way we are also using test data to train the model, this is "cheating"!
I tried fixing this with train_model = AutoReg(train_df['Adj Close'], 500).fit(cov_type="HC0")
, and played with the lag
parameter, but the correctly trained model is a really bad predictor for test_df
.
Hi Derek, thanks for your awesome videos!
In Python for Finance
https://www.youtube.com/watch?v=nNkKTJTu-mU&list=PLGLfVvz_LVvTHOWIEBAl-YOr_FC8lRmWX
your output shows that Amazon's stock price rose by ~18% in 2020; I think by your calculation in
def get_return_defined_time:
the number should be 0.6166401575831238
The bug is in your date formatting. Where you compare a date formatted like this:
start = f"{syear}-{smonth}-{sday}"
which look like this:
2020-1-1
with dates in your dataframes that look like this:
2020-01-01
your date comparison fails much of the time.
I think if you change your date formatting from this:
start = f"{syear}-{smonth}-{sday}"
to this
start = dt.datetime(syear, smonth, sday).strftime("%Y-%m-%d")
you will be good to go!
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.