Strategy 4b — Small tweaks that improve performance
With a few small adjustments and a switch in data providers, we get a strategy that has a profit factor of 2.9, Sharpe of 2.2, MaxDD of -11.4%, win rate of 52%, and made $110k in the last two years.
Disclaimer: the following post is an organized representation of my research and project notes. It doesn’t represent any type of advice, financial or otherwise. Its purpose is to be informative and educational. Backtest results are based on historical data, not real-time data. There is no guarantee that these hypothetical results will continue in the future. Day trading is extremely risky, and I do not suggest running any of these strategies live.
I haven’t been able to shake the impulse to keep testing strategy ideas. I wanted to dive into some more programming-oriented work, but each time I start to dig in, I find that my mind is still on strategy testing. Some people would call this obsessive; others might call it an attention disorder. I think it’s a superpower. My mind has unfinished business, and it needs to be solved before I can move on to the next problem to solve.
I have already created Strategy 6 and Strategy 7, and if you have access to GitHub, you can see the current state of both strategies. Spoiler: they are mean reversion strategies. Both are similar to each other, but one is for a universe of stocks, and another is for a universe of futures contracts. However, I am not publishing one of them (this week) for a couple reasons. One is that they aren’t 100% completed yet, and the other is that I wanted to apply some of the concepts I learned to Strategy 4. I also wanted to test it using Norgate Data, not Yahoo! Finance API.
It would be easy to leave a strategy alone after publishing it, but my goal is to create a library of strategies that can be used together to help us make better trading decisions or work in a completely automated manner. I am still on the fence about the latter part. I’m not sure I actually believe in a completely automated strategy. It seems like an “automated” strategy is really just shifting the human involvement from the trader to the developers/researchers. Currently, I am leaning more toward a hybrid approach to automated trading. This seems like the more realistic approach for a retail trader to take.
CB at ATS has a great article about the first ATS live test and the pains of running a hybrid system without a systematic approach (plan). ATS started its first live test of strategies at the beginning of this year and ended with a 196% return at the end of the test. The results are fantastic, but the equity chart doesn’t go straight up. Day 14 of this test was a big upset, and the journey to regain the losses was slow and tedious. Running a test like this (with real money) takes balls. Bigger balls than I have currently. This is the definition of putting your money where your mouth is. However, Day 14 scares me.
This feels like one of those moments where you are prepping us for another lesson from your ridiculously unrelated past.
That’s right, Larry. It’s time to go back in time and talk about something that occurred a long time ago—longer than any of our previous lessons. This one comes from when I was a young man in the Army (that’s the US Army, for those of you who aren’t sure where I’m from).
Wait, if you just addressed Larry… who’s writing this article?
Lesson from the Past
In 2008, I was a 21-year-old (do the math) know-it-all lower enlisted Army soldier. I may have been young, but I had more life experience than many Americans have, but maybe not more than some. That's how growing up poor works. If you don't use sports or scholastic opportunities to make your way, you find other less-than-optimal methods to get real-life experience. Sometimes, those methods are hazardous, with very minimal risk-to-reward ratios. My way of getting out was by joining the military.
So, when I joined the Army and got sent to Iraq within the first couple of months after training, I didn't mind. Time to get some tax-free money. It was hot, but the humidity in Georgia sucked too. It was dangerous, but I had been shot at (or near?) before and robbed. It can't be much worse than that, right? Well, that isn't actually true. It turns out that in the military, especially as a lower enlisted, you don't have any say in how things are done. This means you have to live with the bad decisions someone else makes. Not so oddly, the people who make that decision rarely do.
Anyway, there I was, living with the local Iraqi Army soldiers at a local Iraqi Army base. I was bathing in water that probably came straight from the Tigris and shitting in either a hole in the ground (that's actually what their toilets are, not meant as a slight) or a port-a-potty/sauna that sat out near the base walls. I was running from the occasional camel spider and playing gunner when we ran missions outside the base. Life was okay.
It can always be worse.
Well, the Army was working on making that happen. Next door, the Air Force (I think it was the Air Force) was working on building our own base. It was going to be called "Garry Owen" after the salute saying (there is a whole story) from Air Cav (Vietnam era), or the current 2-7 Cav that we were attached to. It was small, probably designed to accommodate a thousand troops or so (about the size of a battalion), and was just a step up from living with the Iraqis. We upgraded from a hole-in-the-ground bathroom to a barrel you had to pull out each evening and burn. When we started going over to make out water and ice runs, we began to encounter "problems" with the officers.
Remember when I said it was hot? Well, we were spending a lot of our "down" time in t-shirts and shorts, or at least without our long-sleeve military-issue uniform tops on. This was a huge no-no for the officers who started taking up posts in Garry Owen. After one person was found "out of uniform", we suddenly had to wear our uniform in its entirety, long sleeves and all. It was a small annoyance, but it could have been worse.
As we were getting ready to move into Garry Owen I remember accompanying a walk-through of the base with my squad leader and a handful of officers and NCOs. There was something said between them that I found incredibly naive. One of the officers told another that they planned on putting minimal t-barriers and bunkers on the base, showing that we trusted the local population.
This struck me as odd, especially since many stories about issues previous units, such as the British Army and earlier Marines, had faced in the area weren't exactly peaceful. Additionally, we were the closest US base in Iraq to the Iranian border at the time. Therefore, hearing that we would minimally protect the troops inside the base was a bit of a shock to me. Fast forward a couple of weeks and we have been living in the new FOB (forward operating base) and running some mission damn near every day. One morning (around dawn), we got our first IDF (in-direct fire) attack. After that, they became a regular occurrence for us and the surrounding outposts we had soldiers occupying. The IEDs/EFPs (improvised explosive devices/explosively formed projectiles) weren't far behind.
Back to the Present
The IDF attack was our Day 14. Up until that point, everything had been gravy. There is no telling what “more” bunkers and T-barriers would have done, but the base doubled its protection measures (time to make sandbags) and positioned long-range weapon systems on the base corners to deter more attacks. It was an unexpected (well, for some) loss, and it woke up anyone who had previously been complacent.
This is why I really like the hybrid approach. This keeps the trader at the point of control, able to make decisions and changes more rapidly as they see price action unfold in real time. No “officers” necessary. The researcher and the trader are one and the same. Intra-day strategies, like a strategy on a 15-minute chart, would require a trader to watch them occur during the whole trade process, and swing strategies could have a little less strict control. Either way, the trader follows trade entry plans and exit plans systematically, but it leaves room for human intervention if (when) everything goes to shit.
My ideal setup (for now) would look something like this:
Have a robust testing suite that is as accurate and bias-free as possible.
Use reliable data.
Have a diverse library of trading strategies. The more uncorrelated, the better.
Determine trade entries and exits (brackets) with an automated systematic approach.
Place the systematic trader between the automated system and the trade. This is what I discussed above. Traders have the ability to adapt to changes faster as long as they trade systematically.
That’s pretty simple. This could technically be done using Excel and a little VBA or Python. The only options it would remove are those that can only run one test at a time on a single asset.
Of course, it isn’t saying that the trader is going to have an easy time determining when a trade is going to shit. The trade system itself should be robust enough, the trader is there to make minor changes to the setups if they believe it is necessary. This means looking for technically appropriate entry spots on the target assets and assigning technically appropriate targets and stops. The methods used here could be flavored in whatever manor the trader likes, so long as the method is sound.
Backtest Results
This strategy was tested using RealTest and Norgate Data. It was performed on a daily chart across a selective universe of stocks instead of the S&P 100 like the previous version. It was tested using data from the last two years. You will notice in the graphs that there are significant periods where the strategy doesn’t trade. This is due to one of the tweaks to the strategy.