Class06 Answer:

Backtest years 2000 through 2016.

I wrote a script named backtest.bash to do this lab:


#!/bin/bash

# ~/mljs/backtest.bash

# I should run this script at 8pm Calif-time.
# Demo:
# ./backtest.bash

# This script should generate some static content each night
# after the market has closed and the most recent GSPC-closing-price
# is available from Yahoo.

# The static content should help me judge feasibility of keras-js for
# predicting GSPC daily direction.

# If you have questions, e-me: bikle101@gmail.com

# I should cd to the right place:

cd `dirname $0`

# I should get prices:
./curl_gspc.bash

# I should compute features from the prices:
python genf.py SLOPES='[2,3,4,5,6,7,8,9]'
# The above call should give me feat.csv

# I should learn, test, and report:

thisyr=`date +%Y`
for (( yr=2000; yr<=${thisyr}; yr++ ))
do
    echo Busy...
    echo backtesting: $yr
    ./keras_tensorflow.bash learn_tst_rpt.py TRAINSIZE=25 TESTYEAR=$yr
done

exit

Class06 Lab


ml4.us About Blog Contact Class01 Class02 Class03 Class04 Class05 Class06 Class07 Class08 Class09 Class10 dan101 Forum Google Hangout Vboxen