Fire and Fortitude in Algorithmic Trading (Part 1)
Posted by Mark on December 9, 2019 at 07:57 | Last modified: April 25, 2020 05:42Today I want to review where I’ve been (starting here) in this discussion of algorithmic trading and then move forward.
I have three main critiques of technical analysis (TA). First, it’s not always objective (as discussed here and here). Second, it’s rarely backed by supporting evidence. Finally, it seems really difficult to find viable trading strategies.
With regard to critique #3, I feel like I want to climb to the nearest mountaintop and yell “nothing works, folks!” An infinite number of possible strategies await to be tested, though, as mentioned in [1]. If I have 40 different indicators then I can test them on 20 different markets, throw in daily + 4h + hourly + 5m time frames, and voila: 3,200 strategies. What I have tested in my first three months is tiny in comparison.
Seldom have I experienced failure like I have in my brief stint as a quant. One by one, I saw hallmarks of popular TA fall by the wayside: momentum, moving averages, Bollinger Bands, RSI, Williams %R, trend-following, mean-reversion, etc. None of these have worked sufficiently well over a long period of time, and many are losers. I went through books with each setup presented accompanied by [deceptive?] claims of live-trading success on different markets. None of these worked either. Having immersed myself in the financial domain for a while, I’m not surprised to see an indicator or two not work very well. I have read books, articles, and sat through countless presentations these indicators over the years, though, and failure to find a single viable strategy, is quite the shock.
My discipline and commitment have eroded over time. I started by testing one strategy per day. As I learned the process better, I increased to two, five, and eventually 10/day. I started to run lean of strategy ideas. It’s very important to have this in strong supply because once my time had to be devoted to finding strategies, my daily testing decreased and I felt less productive as a result. Up until that point, I was able to achieve my daily goal, but as I watched the tally of total strategies tested continue to mount, my frustration and fatigue got real.
What I experienced is to be expected according to algorithmic trading guru KD. KD is a vendor of algorithmic trading education. He has my respect (until he doesn’t, and I’ll let you know if that happens). He says we can expect to find one viable strategy for every 100 – 200 strategies tested. He also says to break for a few weeks if you start to get frustrated and impatient.
In other words, those who undertake this trading approach will need to settle in for a very long haul…
Categories: System Development | Comments (0) | PermalinkDoes Any Technical Analysis Work? (Part 5)
Posted by Mark on December 3, 2019 at 07:16 | Last modified: April 22, 2020 10:27Today I continue with a sample of internet opinions on whether algorithmic trading with TA can actually work.
> If someone created a bot that is profitable with good metrics,
> they would never sell it. Ask yourself this: if you have an ATM
> that magically refills itself every night, would you sell it for
> petty cash? The ones selling bots are… not producing a
> profit… [9]
I’ve heard this many times and find it to be a compelling, but not ironclad argument. If I had a large chunk of money then I could certainly turn it into millions. If I had little money, then I might still benefit from selling to others for point-of-sale profit while I execute it myself and make a high return percentage on a small amount. Alternatively, for the sake of diversification I might never want to trade it in large size. Since I could not count on making too much money from this one system, I might as well sell it to others to get some guaranteed money while I continue work on developing others.
> “There are a lot of people arguing they can make profit just
> using TA, following some pattern or indicator rule.” A lot of
> idiots, zeros, make a few dollars a month selling PDFs explaining
> how to “make millions with simple patterns or indicator rules!!”
> In contrast… few quants have indeed made a lot of money
> using incredibly difficult and sophisticated software systems,
> which have utterly no connection whatsoever to some trivial
> pattern rules. The bots you have made and you refer to are a
> joke—the equivalent of looking up spelling in a dictionary
> file—whereas quants are like Siri. [10]
I’ve written much in this blog about optionScam.com. Like me, this person has also observed the financial industry to have some nefarious (see third paragraph here) contributors.
> “I just wanted to know if those public and typical strategies
> work or if they are just scam to fool beginners like me.” I think
> they are a scam to fool everyone! You know how large brokerage
> companies will have a large “TA” department, headed by major
> experts making millions per year and dozens of PhD staff. Many
> traders would tell you it’s an utter scam—they just add
> those departments purely so they can say to clients “well,
> we have this impressive TA department…” you know? [11]
I’m not a conspiracy theorist (see third paragraph here), but given that a decent amount of misconduct exists in certain segments of the financial industry, I think we need to acknowledge the possibility described. I think the only way to know with more certainty would be to work in the industry proper—maybe for multiple firms to gain perspective on tactics used by a large sample size of institutions.
I will wrap up these comments next time.
Categories: Option Trading, System Development | Comments (0) | PermalinkDoes Any Technical Analysis Work? (Part 2)
Posted by Mark on November 22, 2019 at 12:06 | Last modified: April 21, 2020 11:39The initial impressions of trading system development discussed last time begs the question about whether technical analysis (TA) is all hoax.
I did an internet search for “do simple technical indicators work” and found some interesting posts.* Here is the first:
> There is no blanket strategy of “TA.” No TA gospel definitively says
> buy/sell when the price crosses the 200-MA. You’re simply looking for some
> pricing pattern that appears in the chart to influence your decision to buy
> or sell, but there are literally an infinite number of pricing patterns.
> Maybe it’s not a 200-MA but a ratio of 200 * (1 minus the index
> increase over that period). People come up with all sorts of weird
> algorithms; some people even find one that will work for a bit. Ultimately,
> it could be anything… [it qualifies as TA] as long as it involves the
> quoted price relative to some historical metric… [emphasis mine] [1]
This argues certain combinations of TA indicators can be developed into profitable trading strategies. Yay!
This also provides some hope for data mining, which is an approach I will discuss in future posts.
Here’s another take that is similar in nature:
> You seem to think “TA…” is some fixed, specific thing… there are a
> hundred different ideas on so-called “TA” and every person who trades
> argues bitterly about different aspects of charting… everyone who
> uses one form of charting assumes that every other charting technique
> is completely stupid. [emphasis mine] [2]
Mention of “hundred” different TA ideas is deceptively small since the actual amount is infinite (see [1] above).
Unfortunately, people posting online engage in name calling, flaming, and trolling. I often see an oozing excess of pride, arrogance, and ego. In the world of statistics and valid trading system development where strategies either pass or fail, I see no reason to get emotional or to passionately defend things. Follow the data and start testing where the data ends.
Out of those commenting online about TA and trading, I wonder what percentage actually has supporting data? Nobody is credible without large sample sizes under their belt and that includes number of strategies tested.
My algorithmic trading journey has just begun with 300 strategies tested. Even were I to have tested 10x that, though:
> …just because YOU haven’t found one that you think works well enough
> to rely on… [doesn’t] mean… [others have]. And when people do, they don’t
> divulge it. If someone had a strategy that worked, it would not be on sale. [3]
Similarly:
> When people figure something out and it’s vital to their own profitability,
> they don’t run around sharing it. Why don’t people understand this? It
> would save a lot of heartaches… [4]
This is a very interesting concept to consider. In other words, don’t expect anything you see, hear, or read to actually work.
Gotta love the smear campaign, too. You can’t say online financial forums lack entertainment!
I’ll continue next time.
* — Online content may or may not be credible. You have to decide for yourself, and this applies to my blog as well.
Categories: System Development | Comments (0) | PermalinkDoes Any Technical Analysis Work? (Part 1)
Posted by Mark on November 19, 2019 at 09:15 | Last modified: April 20, 2020 16:19I went over my second critique of technical analysis (TA) here. My third criticism is that finding a viable TA-based strategy is extremely difficult.
As discussed in this second paragraph, my goal with trading system development is to find viable strategies: not necessarily profitable ones. I will go into more detail about what makes for a viable trading strategy in future posts.
As discussed in the second paragraph here, in order to test strategies I need objective, codable guidelines. Many, but not all, TA-based strategies are this way.
I borrow from Kevin Davey’s approach and define a strategy as a particular code and/or particular time frame and/or particular market. If I take three different codes, for example, and test them on five different markets and two different time frames, then I have studied 3 * 5 * 2 = 30 different strategies.
I have tested nearly 300 strategies on three different markets. I would guess this to be a lot relative to the average trader because most people don’t learn to code, learn to test, or learn to develop strategies. As I discussed in the linked post from the first paragraph, most traders don’t show or provide any data.
Nevertheless, 300 strategies just barely qualifies me as a newbie when it comes to algorithmic trading. I’m not talking about the options work I have been doing for the last several years. I’m talking about my work on futures markets. Thus far, I’ve tested strategies on US equities, on gold, and on crude oil. What has taken me months would take a seasoned quant days (hours?). I am still learning how to code, still finding strategies, and still trying to figure out how I plan to organize all this.
My initial impression thus far is that finding viable trading strategies is really, really difficult.
Many things about the financial industry and trading domain do not surprise me. I’m not surprised by the fraudulent claims. I’m not surprised by the statistical manipulation. The whole debate about whether successful traders actually exist implies not only that something works but also that someone has discovered it. I’ve questioned whether a better way exists somewhere.
In discussing all these topics, I’ve been talking around the issue of viability.
With regard to viability itself, what does surprise me is to fail time after time after time—nearly 300 in all—at my attempt to find it. I have not found any strategies that meet all my criteria. I have not found any strategies that have compelled me to start trading them straight away.
I will continue this discussion next time.
Categories: System Development | Comments (0) | PermalinkCurve Fitting 101 (Part 3)
Posted by Mark on November 11, 2019 at 07:22 | Last modified: April 18, 2020 14:34Last time, I discussed how specific trade rules may result in curve fitting.
One way to avoid this is to use optimization to explore the surrounding parameter space. When applied as discussed in Part 1, optimization is a bad word. Testing all variable combinations in this manner, however, can be useful as I discussed in paragraphs 4-5 here. Borrowing from this post, look at the following visual:
This is a three-dimensional plot with performance (net return) on the z-axis. An optimization may pick the highlighted (red arrow) peak as the best, but if it’s surrounded by losers then the results are probably more fluke (lucky) than due to signal being identified. I would feel much more confident trading a strategy in the middle of a high plateau region where I can choose variables knowing if I am a little off to either side, then I may still have a good chance for good future performance.
Do not use optimization only to choose the best; use optimization as a tool to explore the surrounding parameter space. Test all combinations and survey the landscape. Spikes are bad and high plateau regions are good. The objective is to assess the probability that good performance is not just a matter of random chance.
A standard optimization tests all variable combinations, which are called iterations. Looking back at the plot above, the iterations are ordered pairs along the xy-plane. The total iterations to be tested in a standard (exhaustive) optimization is the product of the number of values each variable can take. The Part 1 strategy had nine iterations: 20 – 100 by 10. Suppose I wanted to add an m-day exit and test exits between 3 – 21 days by an increment of three. Now I have a total of 9 * 7 = 63 iterations to test. If I also add a momentum rule and optimize momentum lookback from 10 – 30 by four, for example, then I have a total of 9 * 7 * 6 = 378 iterations. You can see how fast the iterations add up (especially if I increment by one or two instead of five or 10). This can dramatically impact computer (or especially manual: UGH!) processing time.
Going back to the Part 2 example, if I wanted to incorporate a VIX filter, then I should test different values rather than looking at just 35 (e.g. 20-50 by increments of three) to survey the surrounding parameter space.
Next time, I will discuss one final curve-fitting method.
Categories: System Development | Comments (0) | Permalink