2012Fall7646 Homework 8

From Quantwiki
Jump to: navigation, search


In this homework you will train the learners you created to forecast 5 day future returns of stock prices. Whoo Hoo! In order to make this homework a little more satisfying we're going to train your learners with data that we know is predictable (sine waves). You can, on your own, try with actual stock data to see how well it works there.

  • Use the following technical indicator features (provided by QSTK) to train your learners.
    • simple moving average
    • momentum
    • bollinger
    • NOTE: more detail of parameters to come here
  • Train your learners on the following symbol (NOTE CSV file to be provided by Sourabh).
  • Note that X for your training data should be the value of these features, and Y is the 5 day return (different from one day return provided by returnize0).
  • Train using data from 2008, then test with data from 2009.
  • Create 3 plots, one for each learner:
    • One plot for each LEARNER: KNN, RF, LinReg
    • Three separate plots, each one with two lines.On each plot, show a time series (one point for each day in 2009): actual 5 day return in red and predicted 5 day return in blue
    • Use the fast sine wave without noise.

Use the example code in QSTK/Examples/Features/featuretest.py for hints on aspects of this project.


Submit these files:

  • forecaster.py Python program that produces the output for one of the charts listed above (presumably you can easily swap learners).
  • report.pdf a PDF including the 3 charts.

Extra Credit

  • Assess your learner more deeply (scatter plots, correlation, etc.)
  • Try it on real stock data.
  • Try it with different indicators.

How to submit

Go to the t-square site for the class, then click on the "assignments" tab. Click on "add attachment" to add your files. Once you are sure you've added the files, click "submit."