Software design, trading development process, and Ikea
I spent a few months between 2010 and 2011 not on the market, not on coming up with new strategies, but on developing a software framework for my trading system. For my trading strategy development, I make use of a continuous systems development life cycle process from the engineering realm. Starting from planning, to analysis, to design, to implementation, to maintenance, and finally, back to planning, and so on for each and every new concept that I have. (see Sir James Dyson’s guest column on Wired)
Imagine that if you need to write a new strategy file for each and every idea and for each of its design iteration. Pretty soon you’ll have many strategy files and a lot of boilerplate codes. What if you found a bug or figured out some enhancements to a particular component of your strategy? Then you’ll have to sift through all those files and make the changes to all those relevant codes to make the update across the board.
Hopefully, this isn’t the approach you’re taking. Yet, a few trading API that I have used before inherently encourage or even limit you (EasyLanguage and MQL4) to this archaic procedural programming paradigm.
Luckily, Java is an object-oriented programming language. However, it is only as object-oriented as you make it to be. JForex, the trading API that I use, actually runs on the edge of breaking this object-orientedness as I have recently lamented.
The bad news for the beginning developer is that practically every published strategy which I have seen or guilty of posting myself are illustrations of what not to do with software design. In that there’s none in it whatsoever. Think of common published strategies like the Ikea mini-model showrooms. Everything is crammed into a tiny space but it is a simple way to convey the gist of a room design (read: the trading algorithm). However, they are not built for practical use. Real strategies are like suites in an apartment building. There is an underlying architectural commonality for easy management and maintenance while enabling diversity in the strategies.
My recently completed software framework dramatically made my life easier in the tasks of implementation and maintenance. Software maintenance, in particular, is most often needlessly and overly complicated in trading strategy development because of the lack of a good design. Because at the end of the day, most programmers spend the majority of their time debugging, maintaining, and extending their code. A true object-oriented design decouples all its components so that you can use a divide and conquer approach with no repetition of work.
Do you have a development process in place? I’d like to hear how you tackle this problem.
read morePerversion in odds and values
Dan Gilbert talks about mistaken expectations. What he talks about have everything to do with trading. Our innate tendency to misjudge odds and values is one of the reasons why I use a statistical approach to assess market anomalies.
read moreOne year down, nineteen more to go until I can trade for a living
Early in 2010, I discussed about my plan to grow my trading accounts organically and eventually trade for a living (i.e. live and breath in the market 24/7). Now that the first whole year of my long term plan has passed, I can update my visualization table as shown.

2010 was a good year. My starting capital for 2011 is 63% more than expected. This is mostly due to the $13,000 prize money from winning six of nine Dukascopy automated trading contests.
On the contrary to my fortuitous success, I revised some of my estimations noted in the table to be even more conservative. In particular, I reduced my annual deposit to reflect real bookkeeping data in 2010 and lowered my investment yield expectation based on my performance data throughout the past 10 years of my trading. To mitigate these reductions, I expect to continue depositing funds while I receive a salaried income rather than stop mid-way as originally proposed.
The effect of inflation is deliberately ignored in this table because I’m discounting its effect in my investment yield estimate rather than adding more columns. It’s all guess work for now anyway.
Nineteen years is indeed a long time. It is a worst case scenario assuming that I will grow my accounts organically and not do anything else. I doubt I will need that much time as there are means other than trading a personal account to achieve trading for a living. I might discuss more about this later in the year once something materialize.
My focus this year is to finish developing my proprietary Java trading platform with my partner and put it to good use in the forex market.
Nineteen years or not, the fact that trading for a living is even possible for a self-taught amateur such as myself is testament to these incredible times that we’re living in. I fully intend to enjoy every second of it.
read moreThe Power of Tangential Learning
According to Wikipedia,
tangential learning is the process by which some portion of people will self-educate if a topic is exposed to them in something that they already enjoy.
I was just organizing my bookshelf the other day and is surprised by how fast my collection of statistics books have grown. I studied statistics back in school as a stepping stone to learning stochastic process for wireless communication theories (e.g. CDMA). Detecting radio-frequency and resolving wireless signals to meaningful messages is fundamentally about assessing the state of random processes. I hated statistics back then because I didn’t get it and did poorly in those courses. It is ironic that years later I would realize how much I have grown to rely and love the little p‘s and q‘s in my little hobby of quantitative trading.
I still don’t like statistics (or theoretical math), per se. I just love applying them in my trading and quant programs. The more that I learn about statistics, the more that I realize how powerful they can be and how ignorant I am. For example, in my clinical study days I used either t-test or ANOVA for everything under the sun. Now that I’ve come to understanding about inferential statistics, I am aware of the assumptions and pitfalls such as the assumption of t-tests of homogeneity of variance between the two samples tested. If this assumption is violated, then the unequal variance t-test should be used.
Finer points like these are routinely ignored in practice because many clinical studies are inherently designed in the experiment to meet these criteria. However, that’s not the case when I am making creative use of statistics in my trading. I don’t have a clinical study committee watching over my back. If I make a false or weaker-than-expected claim and don’t know better, then it is my bank account that will suffer the consequences.
Learning statistics was initially due to this got-to-know-better necessity. However, the more that I learn about statistics, the more that I appreciate it. If used correctly, statistics can provide a new dimension to the scientific assessment of your trading performance and market data.
read moreMaking the best use of my time
I pondered over this issue over the holiday as I’m finding myself juggling too many tasks. I was participating in two trading contests, developing an automated trading system with a team, managing an open-source project, actively trading, and writing this blog, all on top of a full time job. I got greedy in what I wanted to accomplish and it is negatively affecting my performance.
The first symptom popped up in my trading, not surprisingly. I made a bad call and missed a long-awaited opportunity. This was a wakeup call as the performance statistics from my recent trades is showing statistically significant deviations (I will publish the data soon).
So before anything gets out of hand, I’ve decided to manage my time more professionally rather than just do what needs to be done. Taking a page from my professional work, I will prioritize my trading and development work using the Eisenhower Method.
Basically, I mentally stamp an importance and urgentness ranking to each of my tasks. Then I will work on the important and urgent tasks first and leave the rest til later in order of the ranking criteria.
For example, the automated contest is important and urgent because I’ve won over USD$10,000 in 2010 and there’s a monthly deadline for it. So I work on it first if there’s work to do, which isn’t much. The manual trading contest, on the other hand, is urgent but not so important. If I were to participate in it seriously, I would need to allocate an hour or so each night to trade. This is time that I would rather spend working on other stuff.
On the other end of the importance/urgentness spectrum is my equities trading. I am rating it as an unimportant and non-urgent task. Although I’ve written the most about it and that my account has been up 21% in 2010, it takes a lot of my time and the absoluate return is small. That is because my equities account is the smallest of my various trading accounts. So 21% profit of a small account is still very small. Thus, this account isn’t worth devoting too much time for now. My plan is to use a beta strategy for my equities account. I already have some ideas on what to do with it. This will be discussed in another post.
Ultimately, here’s an excerpt of my priority list:
- trading system development
- automated trading contest
- quant research
- documentation and blog posting
- trading strategy R&D
- manual trading contest
- equities trading
What this means to you as a reader is that there will be fewer charts and more technical discussion. My goal for 2011 is to post something at least once a week. This is a good time to subscribe to my RSS feed to have new posts delivered to you rather than having to keep checking here for updates.
read more

Recent Comments