Software development seems to inevitably take longer than scheduled.  I thought I’d have a working alpha model by “Day 4”, but it took me until “Day 7”.  Happily, yesterday my program produced its first algorithmically-generated portfolios.  These portfolios were generated from a small “universe” of stocks optimized using simple heuristics.  To test my new algorithm, I designed the two extremes of the search-space to have known solutions.  The solutions between the extremes along the test efficient frontier, however, have no obvious closed-form solutions.  One of the two trial portfolio heuristics is, by design, extremely non-linear as well as non-monotonic.

So far, on relatively small data sets, the run time is very good.  This is despite being coded in an interpreted language, and code that contains several known inefficiencies (such as repeating heuristic computations repeatedly on the same portfolio… caching will solve this particular issue).  I am now well positioned to begin refining the algorithms’ parameters and heuristics as well as to make run time improvement.

I have taken care, and extra time to build extensibility and testability (and of course revision control) into my Linux-based software development environment.  For example the portfolio software supports n-dimensions of analysis heuristics, not just 2 or 3.  Additionally the security selection space has no built-in limits.  Selecting from all listed, investable securities available on Earth is possible.  So long as the portfolio population is constrained (to say <= 100), the investable securities list can be very large.  Similarly, portfolios can contain many securities (1000+) without significant slow-down.

Regression testing can be a bit of a challenge with rand() being part of the of algorithm.  However srand() is very, very helpful in creating targeted software regression tests.  So far, I’ve been able to maintain regression-based testability for the entire program.

I also set aside some SEO, SEM, social media time on this project.  While the SEO and SEM efforts are very tedious, they are critical to building market awareness.  The social media aspect is somewhat more fun, and occasionally pays dividends that extend beyond the potential marketing benefits.

All in all I am relatively happy with the progress to date.  Sigma1 now has working, readable, extensible code for portfolio optimization.  The current software is pre-alpha, and very likely to have undiscovered bugs and numerous opportunities for efficiency and rate-of-convergence improvement.  At least I believe the code has arrived at the initial proof of concept stage.  This is only the “end of the beginning”.   Much work remains to improve the golden (Ruby) version of the software.  Once the Ruby code has sufficiently “gelled”, then begins the task of duplicating it with a C/C++ version.  I intend to refine both the Ruby and C/C++ versions so that they produce identical results in regression.   This will be a tedious process, but is extremely likely to find and squash subtle bugs.

Leave a Reply

Your email address will not be published. Required fields are marked *