Read backtesting notes, definitions on web investopedia, wikipedia
Thought about backtesting strategies I have heard of and saw at the stock expo
Though about how I wanted to integrate it into a grand project of mine, or more of as a side project, to first learn the concept of programming a backtesting example
Decided it would be easier and more appropriate timeline for class, to make a simplistic backtesting mechnism based on a prior excel spreadsheet
StockTrading.xls is a stock trading simulation
simulates various technical analysis ‘strategies’
I had modified this in IS601, but never got it to a 100% stable state
Decided to use the original implementation for ease of understanding and use
Named versions of past StockTrading.xls’s
I had many versions and edits of the StockTrading.xls worksheet
Naming begins with main file name ‘StockTrading’
has a fork name ‘Original’ or ‘Strategies’ or ‘Backtesting’
has a version number, or date ‘071023’; YYMMDD; Oct 23, 2007
Forking off of ‘StockTrading.Original.v071021.xls’
Calling it ‘StockTrading.Backtesting.vYYMMDD.xls’
Updated ‘Summary’ worksheet to be like new summary in Strategies fork
Tested version with many runs to make sure that it was stable
When renaming or making a new version name, you must SAVE AS... a new copy from inside of excel
-
Got really confused and in depth to Yahoo api, decided to use my time elsewhere, can pick this up later
Visit this subject later
Started a new worksheet ‘Comparison’ that will take many trials of different variables and show them in a nice neat chart!
Split data into two main sections, ‘Outputs’ and ‘Inputs’
started recording what I needed done, mainly to bring values in different sheets into the ‘Comparison’ sheet
modified and used recorded code to do what I needed
recorded code not good enough, used recycled With code to bring over cells
Tested that cells would come over even if stuff was moved around in the ‘Comparison’ worksheet.
Took longer than expected to implement last row
Each Comparison result set at the end of a run will be concatenated or added to the end of the comparison list
Works, tested, tested, tested!
adding a single line of code.
It is difficult to add variables or outputs to the ‘Comparison’ worksheet. It should be a matter of making a new column, giving it a name, and
I now Started to actually effectively use my functionality to run what-if tests
I would change 1 or 2 variables and record what would happen
You can start to see patterns, and hopefully make more correct hypothesis or conclusions on the patterns
Made different areas of runs... comments and colors on the right of the Comparison page
I was able to successfully change variables to get higher returns!
This method could be used in conjunction with AI algorithms, that repeatedly run these what-if scenarios to get better and better profits