As promised, a thread on my approach to building a rules-based model. There's no perfect way, you won't get a blueprint of what I do, just how I approach a systematic trading model. I hope this provides some value in constructing a strategy, rules-based or not!
Let's go!
First, let's define a systematic approach. You're essentially taking defined and measurable inputs and packaging them together to form coherent and consistent rules to establishing positions in various market instruments.
Ever notice how some traders refer to their "system" even
if they're not actually using a computer model? Bc that's all it is. You have rules, you have a style, you ADHERE to it. Models, systems, rules-based, it's all just a way to formalize and codify your approach to trading.
How complex you get is really up to you and your style.
Without establishing consistency, you can never really evaluate your methodology for trading through a lens of replication. And this is what it's about; observable, repeatable, consistent behaviour.
At least, that's how I view it! So, what do I do, how and why? Let's dive in. 1/
Why did I even build a systematic approach to trading?
Because my macro trading sucked.
I won some, i lost some. I chickened out and missed wins, i went too hard and got kicked in the balls (Fuck you BTPs). I did some of this, i did some of that. Did I have a process? Eh.
2/
Biggest trap with macro trading, esp with a wide mandate is LACKING FOCUS. Focus and refine your scope. It's better to do a few things well than a lot in mediocre fashion.
Start with style. Are you bullish? Bearish? Agnostic? I come from fixed income. I'M BEARISH AS FUCK.
3/
But obviously, I keep getting my ass kicked. I didn't want any of that. So I built a model to trade for me based on the things I look at and know to possibly be empirically true, even if my heart cannot agree.
Pretty quickly, backtests showed me permabearishness sucks balls.
4/
So, I know I want to be agnostic. If the market is risk-on, I wanna be risk-on. If it's risk-off, I want to be risk-off OR just not risk-on.
I have something I THINK can give me signals. If you see my previous tweets, it's how I look at cross-asset vol.
Simple enough right?
5/
No, not really.
6/
So I can see that: 1. Permabears die 2. I want to trade directionally 3. But be able to either short risk appropriately or exit long risk.
The two things I need for something like this and honestly, any half-good rules based strategy is LIQUIDITY & RISK-MANAGEMENT.
7/
I'm not a quant. My math & stats suck. I'm objectively dumb by many standards. But I'm a trader (also suck). And trading is about staying in the game, not winning everyday.
The best traders out there have the best risk management.
This is where you start building from.
8/
What if I told you that my win ratio this year was barely above 60%? And that 15 years of backtested performance shows a win ratio of ~52%?
Yet this year gross return is 38%+ and that 52% of backtested win ratio comes with 29% annualized returns?
How? Risk management.
9/
I have defined stops. I have defined target profits. Can they change dynamically? Yes. But are they always there? Absolutely.
Simple example: i will risk $1 for $5 of profit.
I could win once and lose 5 times to end up breakeven. And that would be a win ratio of just 16.7%
10/
(P.s. don't run a model with 17% win ratio)
Do you start to see how firmly defining a risk/reward setup contributes to a winning strategy and higher sharpe/sortino/etc?
Risk management should be the first thing you build, not the last imo.
11/
So now I know some more about how I want to do things: 1. I want to trade directionally but agnostically. 2. I need liquidity for my strat 3. I need strong risk management
What do I need next? Well...some evidence you're on the right track. Backtesting.
12/
Ok, give me a sec. I'm grabbing some coffee. But in the meantime, just think about whether backtests are useful or not and why. Ask yourself the same question about analogs.
brb.
13/
So backtests vs reality. In-sample vs out-sample. Ex-post vs ex-ante. Why should backtests matter, if they do at all? Why do i talk about analogs as well?
My thinking goes like this - they are useful insofar as helping you understand behaviour, not results.
14/
Don't agree? Buy spooz at any point in the last 15 years. Add 1.5x leverage. Congrats, you've beaten the market. But that's not what we're trying to do here.
/15
You must always ask a question about WHY something is happening in the context of what happened. It's why analogs to '87 or GFC often don't pan out. Because you're trying to match results, not behaviour.
Remember, the point of a systematic approach is to formalize behavior.
16/
I use backtests to understand WHY my model acted THAT way in THAT market. Are my rules & factors consistent then as they are now? Bc if they're not then performance figures are useless!
It's why you can build perfect models in backtesting and see it fail with live capital.
/17
Embrace imperfection. Because if not you fall into the trap of overfitting. There is a high likelihood you started with a signal that you are observing to be true TODAY. Now you want to make your backtests wicked smaht so you adjust for historical patterns.
/18
But what you've now done is neutered your model today for the sake of pretty numbers in the past. Don't make no sense.
And that's why it comes back to consistent, repeatable, observable behaviour. I'm not saying your inputs have to be static, hell no! A ton of my factors are
/19
dynamic in nature that adjust with the market cycle. But you need to be using inputs that were relevant then and still are now.
I won't go into machine learning and AI because, well I know nothing about them. But I do know that I won't use them.
/20
FOR ME, this is still a discretionary style that I am formalising and codifying. But I need to understand it, I need to be able to observe and refine it myself.
I will not be as fast, I will not be as smart.
That's fine.
/21
So now i know the following: 1. I want to trade directionally but agnostically. 2. I need liquidity for my strat 3. I need strong risk management 4. Observable & consistent inputs over time
Now, assuming you have a strat returning good results. You can start to refine.
/22
1. Am I trading more than 1 instrument? 2. How much overall leverage am I prepared to use? 3. What portfolio volatility am i willing to bear? 4. Can I operationally handle this strategy?
/23
I do trade more than 1 instrument. I have 3 - Each have their own model, hence each have a distinct return volatility profile. They way I approach it is that those models are my assets, not the instrument themselves.
/24
Bc of risk mgmt, I have transformed the return vol profile of spooz into my own version of it. I'm long my model, im not long spooz.
This is how I construct my portfolio now: I constrain leverage and port variance, and optimize for sharpe with floored portfolio return
/25
And that's basically it. There's obviously a ton more to it but this is how I approach things. These are some of the lessons i've learnt that I think are important building blocks for designing a strategy.
This is my model. There are many like it but this one is my own.
26/26
• • •
Missing some Tweet in this thread? You can try to
force a refresh
As much as this is an outlook of the year ahead it’s a review of past views. In November, fresh off the election I wrote the following thread and not much has changed but here’s the lowdown: 1. Equity price has moved faster than earnings but remains correlated 2. Mid-year risk unwind was mechanical but underpinned by growth scare 3. June CPI ignited consensus for cuts – but Fed went big and now looks like a mistake 4. TY skew is back to negative, forward cuts are getting priced out 5. Risk of curve bear flattening less durable. I favoured bear steepening, which was right 6. HY issuance has been shortened, relying on rate cuts to materialize 7. Dollar is rate dependent for now 8. Clearing of rate vol sets it up for an expansion that could upset fincon 9. Gold like rate vol, was a hedge whose use was over post-election but I thought could still come back x.com/EffMktHype/sta…
Since then, I can happily report that much of it was on point 1. Equity valuations and spreads have marginally weakened 2. This was driven by tighter fincon as yields rose, the curve bear steepened and vol sustained/increased 3. Dollar has continued its march higher (which tends to be an SPX headwind) 4. Gold demand has sustained as inflation concerns gained traction
So let’s look at the basic framework of
1.Why or why not do I want to own bonds
2.And depending on that, where do I want to put my money otherwise
To begin, let’s look economically. The U.S. 3Q24 GDP was 2.7% YoY and is expected to come in at 2.4% for the full year. On a quarterly basis, growth in the US has been accelerating through 2024 with 3.1% annualized in the 3rd quarter. Globally, it’s well above everyone else. In terms of inflation however, everyone is pretty in line.
What does this mean? Assuming the trend persists, with higher growth and similar inflation I would expect the U.S. sees an overall higher level of nominal interest rates relative to its peers.
Haven't done a markets thread in a bit but it's good for me to journal this out so I can spot mental mistakes and gaps when I review this. Main question for me is, where are we now and can we keep going?
The main question is actually where did we come from to get here, as things don't feel as simple as I once thought.
/
There have been three major economic events in the last 6 months (I'm ignoring market events like August selloff) marked out on the chart: 1. The June CPI released in late July ⚪️ 2. The first Fed rate cut of the cycle (by 50bps) 🔵 3. The U.S. presidential and general election🔴
Using that main chart as our framework let's break it down into detail one by one.
SPX Forward P/E (12mths blended forward) have moved largely in line with price, generally implying that earnings expectations have lagged while price was the driving factor.
Contrast this to periods like 2009 where P/Es were rangebound while price trended higher, indicating that earnings expectations were growing in line with price appreciation. I.e. companies grew into their valuations as opposed to valuations growing with the market like now.
/
Hello and welcome to Backtest Tuesday!
Welcome to Backtest Tuesday! This will be an ongoing discourse for everyone to participate in random backtesting, realize market falsehoods and try out things that may or may not work, myself included! We will use the terminal backtesting function (augmented with custom studies) and through the week the thread is open to ANY idea within the parameters of the model.
To recap, last week we added some basic trend and breakout rules to the range-bound strategy and tweaked the exits. The equity curve looks nice, our objective function (profit factor) has been maximized while drawdowns have been lowered. Today we take the next step and move into testing with out of sample data to see how awesome this strat is!
drumroll please
Here is the "OOS" return from 2023 to present!
.
..
...
......fuck.
Welcome to Backtest Tuesday!
This will be an ongoing discourse for everyone to participate in random backtesting, realize market falsehoods and try out things that may or may not work, myself included! We will use the terminal backtesting function (augmented with custom studies) and through the week the thread is open to ANY idea within the parameters of the model.
To recap, last week we built a range-trading strategy for Russel 2000 Futures using moving retracement levels. The ultimate goal is to try and build an all-in one model that switches between range-bound and trend following.
They key points from the range-bound strategy are: 1. Short at the upper retracement, long at the lower retracement 2. Only when price action is range-bound 3. And only if that range is compressed 4. We stop out if price action exits the established range and losing more than 2.5% at the close 5. We place trailing stops using retracement levels inside the range where short term momentum is weak
Please read last week's thread QT'd here for a full rundown of how we got here.
This week - we will tackle the trend portion!
The equity curve of the model with just range-trading is what we expect to see, a general positive performance during sideways periods with pockets of being flat during larger moves (and naturally expanded volatility). The aim now is to fill in these quiet periods with effective positioning to capture trend.
Based on the final poll from last week, you guys prefer to trade on a breakout. These blends into the range-bound strat as we are already trading using resistance and support levels. So the simplest way to implement a breakout strat is to use our stops.
This will be an ongoing discourse for everyone to participate in random backtesting, realize market falsehoods and try out things that may or may not work, myself included! We will use the terminal backtesting function (augmented with custom studies)
Through the week the thread is open to ANY idea within the parameters of the model. To start...
This week we will use Russell 2000 futures. The objective for this week is to find out: 1) Can you build a model that switches between range-bound and trending 2) How do you trade either one 3) Is it even worth it?
For the sake of simplicity we will use the following parameters: 1. A constant capital amount of 100k (no compounding) with 1MM equity. 2. Daily frequency 3. Long/Short 4. 2017-2022 as our in-sample period. At the end we will then review performance using 2023-2024 as our out of sample period.
To set up the first part of this I will naively define the asset as being range-bound if it is trading in between two (or more) established levels in a lookback and trending to be anything outside of that.
To set up the rangebound conditions, I am using moving retracement levels built in STDY
The top panel defines the parameters for the lookback period, and 4 variable retracement levels.
The middle panel is to output the moving retracement levels and the bottom is just to output the actual data onto the chart.
Here is the moving retracement "bands" output in our in-sample data. For the time being we are using the classic Fibonacci retracement levels (76.4/61.8/50/23.6)
The reason why I bring up the neutral rate is because I think the market is actively debating it without realizing it or explicitly saying so.
Much of the consternation around Fed pricing right now is how many cuts is appropriate this year, but that implies that cuts themselves are appropriate.
One of the key tenets for this view is that with inflation moderating and (to a lesser extent) activity cooling, the NOMINAL Fed Funds rate, if left unchanged gets more restrictive as inflation falls due to the real-FF increasing (Nominal-FF minus Inflation = Real-FF). Thus, in order to cool the economy without overtightening the Fed has to cut rates.
The extension of this is that should the Fed see the soft landing they are hoping for, inflation is at/near target while growth is at a steady state. For now the median long run expectation is 2.5% nominal FF which implies a 0.5% real-FF with 2% inflation.
Cameron Crise picked up on this with Waller's Q&A on Jan 16.