Exercises in System Building – Part 2
Let’s be honest. Most of us came into trading, expecting to be good at it, discovered we weren’t, and tried to fix that before we blew up our accounts. I desperately scoured the internet for people I thought knew what they were doing. When I could I reverse engineered, or learned, or stole, their “setups”. I did their courses and read their books. If we were lucky the gurus we decided to pilfer from had real stuff to steal. Sometimes I was lucky, sometimes not.
What I’m covering today is the bedrock of trading. How to know if your setup is an edge. The gurus of trading like to emphasise the mental game of trading, but without a real edge in the market you are wasting your time.
“90% of trading is mental – the other half is solid math” – Laurent Bernut
In the comment section of the previous post Zsoult was talking about Inside Periods, a topic close to my heart, which we mentioned in the previous post also.
The problem with just backtesting the Inside period, is that you are not just testing one thing, but the complicated interaction of many different variables. A fragile fucking thing indeud.
If the setup bar is small, the distance to target is small, so it is possible to get a small win not just based on some inherent edge, just because you were only aiming for a small win within the normal range of movement. So you are testing setup bar length, how quickly you move stop to breakeven, the target and stop logic, and anything else you want to build into your system. You literally have no idea if there is an inherent edge, or different factors of randomness conspiring to fool you. Humans are easily fooled, and I’m as gullible as the next fool.
Let’s settle the argument, once and for all. And for the record, I’ve personally risked my own money well over 1000 times on this setup, I have skin in the game here. I really, really, wouldn’t like to think I was that dumb fucking yutz who got conned by a guru scam.
Methodology: I tested EURUSD 60m bar inside periods for the month of March 2017 to date. Not many data points but you get the idea if you want to continue the work. You can check my work on this public spreadsheet here or even fill in more data yourself.
What I did is measure the change in close from the setup bar to the bar of entry, and then the subsequent bar. If we have an edge we should see price tend to move in the direction of the setup working on both bars, positive if its a long setup, and negative if it’s a short setup. You can see clearly it is a weak negative correlation. What that means is that if you get long, what you would like to see the next further bar is the trade to move in your favour. Instead you see the exact opposite. When you get short what you would like to see is EURUSD get weaker after you are short. Instead it has a statistical tendency to get stronger. Well, that is fucked, isn’t it? Not just an edge but the opposite of an edge.
Let’s be clear. Saying it’s not an edge on EURUSD 60m bars is not the same as saying it’s not an edge everywhere. And the sample size is too small, this is just an illustration.
On EURUSD 480m bars on 502 real world trades (not backtest) it did 18R from 502 trades to the long side. To the short side it did slightly better, 47R from 541 trades. A net total of .06 expectancy before commissions. Roughly breakeven after paying brokerage on 1043 trades. Could be worse, it could have been a terrible loser. But in a way this is a tragedy, a not-edge that doesn’t lose much money will go through periods where it behaves like an edge, and makes money. In the long run, it’s going to just waste your time, and drive you crazy. This is why this setup is not part of Mole’s Crazy Ivan BTW. It also kind of fits with a hypothesis that lower timeframes are marginally less edge due to more noise and less signal, which would make intuitive sense.
Now, as I was typing this, I had a horrible feeling, that my own production systems might be based on this same kind of spurious correlation and curve fitted non-edge bullshit (let’s call it the Ivan method for now). After all I’ve been trading my current systems since 2014, before I learned all this new stuff. Entirely possible that I’m the one looking stupid here, turning over a billion dollars a year (yeah I really do) on a non-edge.
So as much as I wanted to hide from it, I’m forced to eat my own cooking, and test my own setups, which are based on a hammer candle in an uptrend, which pulls back and touches the 8EMA. A hammer candle is defined objectively as a candle with a close in the upper half of the range and a lower wick equal to or greater than 2x the real body of the candle. The 8EMA means nothing by itself, it is just objective proxy for a “reasonable pullback”.
Now, we can see that even on a small amount of data we clearly have a weak positive correlation. I’ll obviously fill this in completely over time, but 15 minutes of work and I have something illustrative and able to sketch out a quick test of hypothesis.
To those who are thinking this is too hard, 15 minutes on a scrap of paper in my laptop in my hotel room, transcribe to google docs spreadsheet, and I have a viable quick test of a trading hypothesis.
What that is telling us is that the trend is tending to continue, which is exactly what we want to see for a trend following setup (the opposite for a mean reverting setup obviously). The advantage of testing this way is that we aren’t testing the exit mechanism, the stop distance, how quickly we move to breakeven, or any other filter conditions we might have. We are plainly and simply testing the raw edge of the setup.
When we test ONE THING, we cannot get fooled by randomness.
If we don’t have an edge, all the rest of the system building process is garbage. Garbage in, garbage out. We can produce all the backtests we want, but even non-edges can produce impressive backtests over hundreds of trades samples.
What kinds of things could we test with this?
Almost any hypothesis. Does price have a mean reverting tendency at bollinger/keltner/envelope extremes. I don’t mean to pick on the Gerb but let’s look at an image he posted in the comment section today.
Now obviously pointing to two prior instances of something happening doesn’t mean a thing. For example the last two Tuesdays of the month both went up, does that mean Tuesdays have an inherent bullish bias? (no, it doesn’t). So how could we test this concept without involving too much bias?
Firstly, mean reversion tendency is HIGHLY MARKET SPECIFIC. You can’t do it like trend following by lumping a whole pile of markets together and hoping one of them will trend. So if you want to test XLE for mean reversion, you must *just* test XLE. What you would do in this instance is test a few days before the touch of the mid line, and plot that against a few days after the touch of the mid line. If the mid line in the chart above means anything at all, we should see a strong negative correlation when plotted.
We could test the tendency of markets to revert to mean at an extreme, we could test whether certain days of week or month or times of day have a statistical edge. We could test whether momentum effect (strong markets stay strong and weak ones stay weak) is real or imaginary. We could test intermarket correlations and their breakdown (the basis of Victor Neiderhoffer’s game).
So now we have an extremely powerful tool in our toolbox. We can use that tool to build ROBUST systems that don’t fall apart at the most inopportune times. My friend Daniel told me once “Scott, you build great systems, that suck sometimes.” And this is why, I never used this kind of analysis to build them. Without this, your systems are fragile, and you try and fix them by adding more conditions and rules, but every extra rule makes them more fragile, not less fragile.
So now then, how about our prospective systems? What I’m proposing is to test two different things, a momentum system and a mean reversion system. What timeframe should we be building for? Please vote in the comment section and we will build accordingly.
The two setups I’d like to test are
Ivan Krastins Fakeout Sell off a historical extreme like a donchian channel
And one of Ken Long’s (a brilliant trader whom I admire) setups. What we are looking for here is a situation where price has left the 1 standard deviation bollinger band AND a short and longer period linear regression line also have left the 1 standard deviation bollinger. The rationale here is that the 1 standard deviation is a “reasonably strong” market without being at an extreme that will be subject to mean reversion tendencies.
Let me know your thoughts on markets and timeframes in the comment section. Those who want to participate we will crowdsource the grunt work out and hopefull build something useable.
As for today’s markets, we have what at first glance looks like a textbook bullish setup. A hammer candle in an uptrend. A perfectly proportioned pullback in a historically strong bull move. I think it smells like a trap.
Look a little closer. The big bar a few days ago was late bulls who have been sitting on the sidelines for a few weeks watching the market go up, wishing they were long. That big bar is literally traders going “fuckit, I just need to be long this market, and I don’t care what it costs”. A trader in a new position is a weak hand. If you held your position since the lows you don’t really care about a little pullback, you are secure in your profit, but if you bought last week and are underwater now, you start to become a little nervous. Any weakness here sets off a cascade of further weakness as those weak hands give up. In my opinion the highest probability is an attempt at going up, success or failure uncertain, without breaking out to a new leg up. I don’t believe we have betting odds of getting to fresh highs at this point. If your horizon was very short you could get long for a quick scalp, but I would be out with a quick win here. In my opinion, there are easier setups than this.
One other thing (which we will cover in the coming week) is that this move is a “low volatility melt up” which has very specific characteristics. At the first sign of volatility in a low vol melt up, you want to be open to both long and short again.
Tomorrow we resume the tape reading again. I plan to alternate between tape reading and system building. For your information, this is all preliminary to me releasing very comprehensive and much more detailed online courses in both these things, as well as all my production systems, which Mole will have a whitelabel version of to sell to you.
Questions in the comment section, you have me for 12 more days until Mole gets back.