Save Every Change, Improving the Process

System Trading

Jun 18

In my recent exploratory analysis and back testing, I have started to employ the formal process of capturing the entire change history of my work. Programmers have long made use of the concept of “version control” or “revision control” which is the formal process of saving all the modifications of a program’s source code to a database. This is done primarily for debugging purposes. For the purposes of strategy development, there are additional significant benefits such as, having the entire state history which can be used to see how many revisions were made during the development of a strategy– which might be useful during the meta-analysis process of analyzing the likelihood of a statistically significant finding, to document all ideas that transpired over the development for future exploration, and as a way to document previous ideas to avoid repeating the same work.

Tradestation’s Easylanguage editor and most other editors do not provide for this functionality out of the box. So, what I do is simply to comment out each line or section that I will modify, and then copy and paste that line for modications. A hypothetical example of what this looks like is shown below:

//Buy = Average(Close,5) cross over Average(Close,10);
//Buy = XAverage(Close,5) cross over XAverage(Close,10);
{ Buy = Highest(Buycondition,5) >=1 and Close < Open; }

All semantically correct and compiling modifications are stored in the history of the comments. Of course, if I am working from an existing strategy that has shown value then I will save the new version as a revision, as well.

One extra tip for Tradestation, as an alternative for studies or indicators and to avoid too much file duplication, I will add a conditional switch which can be used to make an indicator work in two or more ways. Example shown below

//An indicator study can be made to work in different ways 
//by using a mode state/switch variable
inputs:
OperationalMode(0);

if OperationalMode = 0 then begin
//do stuff for mode 0 here
end

if OperationalMode = 1 then begin;
//do stuff for mode 0 here
end

If you do not have a process for documenting your changes then you may want to give it a try: it only takes a few seconds to copy, paste, and comment out the code. And, the rewards are that you have a complete record, a complete memory, of your work. And, if you have an existing method that works well then please do share it in the comments below!

About the Author

Curtis is passionate about markets. He has developed top ranked futures strategies. His core focus is (1) applying machine learning and developing systematic strategies, and (2) solving the toughest problems of discretionary trading by applying quantitative tools, machine learning, and performance discipline. You can contact him at curtis@beyondbacktesting.com.

    • Curtis says:

      Simple explanation: as I develop a strategy, instead of simply making changes to the code to improve it, I comment out previous code so that in the future I can see every change that I ever made to it. The idea is basically so that in the future, instead of just seeing the strategy as it existed as the end product, I can see the complete history of the process that I used. Hope it helps!

  • >