Assignment 2
1. Pull last five years of data for stock of your choice using yahoo/Google or Quandl API. Make a
time series plot of stock price. (Goal: learn to use the API to pull stock prices) - 10
2. Calculate 5 technical indicators. You can use the package (https://github.com/bukosabino/ta) to
calculate the technical indicators. - RSI (3 period), difference between EMA (5 days) and close
price, MACD, ATR, Stochastic Oscillator (SR). Make sure to lag indicators to avoid forward
looking bias. (Goal: Learn to use a package that is not standard and Learn about technical
indicators). - 30
3. Calculate daily return and create a new classification variable UP/Down based on returns. (Goal:
Learn to calculate the return, learn about shift function and manipulating data frames). - 10
4. Use decision tree algorithm on 75% of data to predict the up/down classification using the
indicators as features. 30
5. Show the result of your prediction on remaining 25% data. Show the summary statistics of
accuracy of your prediction. 20
Extra Credit - Assume that you go long/short based on your prediction, show the return of your
investment strategy on an equal weighted portfolio of 50 stocks.
At each stage make sure to use indicators up to day t-1 for predictions of day t to avoid the bias. Submit
the notebook by Nov 10. Notebook should not have dependency on any other additional files.
版权所有:留学生编程辅导网 2020 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。