Vertox Profile picture
Jul 4, 2023 10 tweets 4 min read Read on X
Structural Breaks, what they are, how to spot them and how they appear in finance.

🧵
1/n
What is a Structural Break?

A structural break is when a timeseries suddenly starts behaving very differently.
This could be when it switches regimes for example.

2/n
What are some examples for structural breaks?

-Shift in local mean
-Much higher / lower volatility
-From Mean Reverting to Trending or the other way around
-Sudden different regression coefficients
etc.

3/n
How to detect Structural Breaks?

Method 1: CUSUM Filter
Let's say you have a mean reverting process that looks like the one below, we can cumulatively add up the change of this variable and set it to 0 whenever we exceed some threshold, let's say 0.005.

4/n

Now consider the following variable and look at what happens to the cusum filter.

It goes above out upper threshold which means we got a structural break at that point, at this point it resets to 0 meaning that this is now our new normal behavior.

5/n

Now look at the following variable: you will notice that there is a sudden increase in variance.
Let's define a new variable which is the standard deviation of our variable of let's say the past 30 values.
We can now run the cusum filter on the volatility of our variable.

6/n

Here I used a threshold of 0.002 .
As you can see it actually detected 2 structural breaks in a row, we can get around this by having more data.
Let's simulate 5000 data points instead of 500.

7/n
Using a threashold of 0.005 we get the following results.
The values for the thresholds are basically something you need to play around with historically.
Too high of a threshold and you don't catch structural breaks.
Too low and you capture too much randomness.

8/n



There are other tests used for detecting structural breaks like the chow test.
It basically fits models to different segments of your time series and then compares how different the coefficients are.

9/n
Structural breaks are often pretty exciting moments with potential to make lots of profit from.

Structural Break in correlation or vol? Run a momentum / mean reversion strat depending on the type of stuctural break.
etc.

10/n

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Vertox

Vertox Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @Vertox_DF

Aug 16
Moving Averages don't do well when data changes abruptly.

We can do better by solving a 100000-dimensional Second Order Cone Program.

Let's talk about Total variation denoising: Image
When to use it:

If you have a noisy dataset whose mean changes abruptly and you want to filter out all the noise and get the underlying process then Total variation denoising is perfect.

In the image below the black line is what we get after denoising. Image
Definition:

We have our original data x_1, x_2, ... and want to construct data y_1, y_2, ... such that the total variation V(y) is kept low while also keeping the sum of squared errors between the original data and our estimate y E(x, y) low. Image
Read 6 tweets
Aug 14
Crypto is practically the only big market where retail can compete in market making.

There aren't many sophisticated players and the technology you need to compete is available to everyone.

Here are all the resources you need to learn market making:
In this article we build out simple infrastructure in python and NATS and take a simple market making bot online.

It goes over all the components of a market making system and how they play together.

vertoxquant.com/p/how-to-start…
This article gives a big overview of all the literature on market making models like the popular paper by Avellaneda & Stoikov and other popular papers in market making.

Most of those papers use convention that's used in real market making systems like fair price, spreads, etc. so you should get familiar with them.

vertoxquant.com/p/market-makin…
Read 10 tweets
Aug 10
There are so many underrated quant resources.

I've discovered those resources over 7+ years of studying quant finance.

And now, they're yours to explore:
I've been studying stochastic calculus lately and this blog explains stochastic calculus in a really simple and intuitive way!

jiha-kim.github.io
This GitHub contains a bunch of code on super important financial methods and numerical methods.

The perfect place to start applying what you've learned in the previous blog!

github.com/cantaro86/fina…
Read 8 tweets
Jun 25
How to make your backtests more accurate.

This is the type of backtest you often see in pairs trading strategies backtested by beginners.

Here is the problem with it 👇
🧵1/n Image
Using trades data on a large timescale isn't usually a problem but once you start using minutely data you face a problem: Bid-Ask Bounce.

The last traded price keeps bouncing between the best bid and best ask after each maker order. This movement is not tradable!

2/n Image
The first way to make this more accurate without introducing complexity is constructing minutely bars from midprice.

This will eliminate bid-ask-bounce but you also can't trade at the midprice which will move a lot after multiple levels get wiped by a big order.

3/n Image
Read 6 tweets
Sep 8, 2023
Reducing variance via positive cashflow

🧵
1/n
Image
Above you can see the pnl of a strategy with an average win of 0.1%, and average loss of 0.09% and standard deviation of 0.1% over 2000 trades.

2/n
It obviously makes money which is nice but you may not be a fan of some of those long drawdown periods there.

This is why positive cashflow, like in any business, is really important in trading.

3/n
Read 9 tweets
Aug 29, 2023
The Leverage Effect and Volatility Decay

Why more leverage doesn't necessarily mean more profit and how to find the optimal leverage.

🧵
1/n
Let's say you have $100. You do a trade, make 1% and are now at $101. You do a trade again with your $101 and this time you loose 1%.
Intuitively it would seem like you would be break even but if you do the math then 0.99*$101 is actually $99.99. You lost a penny!

2/n
Above is an example of what would happen to your equity if you did this 1000 times.
The bigger your returns are the more extreme this becomes.
If you have a 1% loss you only need a 1.0101...% return to make back your losses.
With a 50% loss you need a 100% return.

3/n
Read 9 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(