pedma Profile picture
Aug 23 18 tweets 6 min read Twitter logo Read on Twitter
Day 10: "MACD Crossover"

I'm sharing a simple backtest of trading strategies & ideas I find online for 30 days.

Today we go over a simple MACD crossover and analyze its historical performance.

Let's put the strategy to the test. Check it out below!
Image
Image
The MACD is an indicator commonly used for its trend identification properties.

The MACD is typically calculated by subtracting the 26 EMA from the 12 EMA.

A 9 EMA of the MACD, termed the "signal line," is then plotted on top of the MACD line, which acts as a trigger.
Strategy Rules:

Entry Rules:

1. MACD line is greater than the Signal line on the previous day, indicating a bullish crossover.
2. The MACD line is below the Signal line on the day before the previous day, ensuring that the crossover has just occurred. Image
Exit Rules:

1. The MACD line is below the Signal line on the previous day, indicating a bearish crossover.
2. The MACD line was above the Signal line on the day before the previous day, ensuring that the crossover has just occurred.
Testing Assets:
- BTC/USD
- ETH/USD
- XRP/USD
- LTC/USD
- BCH/USD

Backtest Parameters:
- Timeframe: 1 Day
- Fees: 0.0004
- Slippage: 0.0002

Initial Portfolio Value: $10,000
Start Year: 2016
This is the section where we get these rules into code. Image
📊 BTC/USD Performance Metrics:

• Start: 2016-01-08
• End: 2023-08-17

• Equity Initial: $10,000
• Final: $75,285
• Equity Peak: $84,465

• Total Trades: 97
• Win Rate: 50.52%
• Exposure: 3.48%

• Return: $65,285
• Avg Win: $1,982
• Avg Loss: -$663
• Max DD: -20.88%
Image
Image
Being a trend following strategy, strength in the asset definitely correlates to better performance.

Drawdowns are heavily reduced as exposure in the markets are way less and more focused on strong regimes.
Image
Image
If we look at the return to drawdown ratio, we can see that is not that bad when we compare to buy and hold.

We decreased our drawdown by 75% and decreased our return to drawdown by around half.

It's a good indication of risk mitigation when comparing to simple buy and hold. Image
There's a skew to the right side of the axis as it is expected from trend following systems.

We can expect higher average returns and lower win rates because we are trying to take advantage of trends.

Predicting a trend is hard but if we bet enough times, eventually we get it. Image
Now let's take a look at other correlated assets.

They all display some sort of resemblance and XRP showcasing outperformance.

This is because XRP has experienced extreme positive periods back in 2017 which helps in trend strategies.
Image
Image
Now let's look at the same strategy but on traditional assets:

1) NASDAQ Composite
2) SPX
3) Amazon
4) Apple


Image
Image
Image
Image
We can see that such a simple strategy is not optimal in traditional markets.

This is natural as this markets are more "mature" and require better strategic approach to make strategies work.

AAPL does display good returns to this day which is interesting.
Now let's take a look of red flags with these assumptions:

1) The fees and slippage used for these tests might be misleading because we don't know how much real costs there were in the past. Also slippage is heavily influenced by liquidity and the size at the time of trades.
2) Survivorship biases are not taken into consideration in these tests. For the sake of simplicity, I randomly picked assets that were available in Bitstamp, and used them for this simple testing.

A careful backtester will use all assets from those times, including the failures.
3) We know that these things have gone up in the past and we don't know if they ever will again. This is an assumption we make and further thought into it might be wise.
Conclusion:

This is just meant as a test of a common indicator and how it has performed historically with over-simplified rules.

Optimization and a more strategic approach is required to make it robust and produce returns that are actually attractive.

Good luck!
I hope you've found this thread helpful.

Follow me @pedma7 for more as I'll be sharing more backtests in the following weeks.

Like/Retweet the first tweet below if you can:

• • •

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

Keep Current with pedma

pedma 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 @pedma7

Aug 24
Day 11: "ROC's RSI"

Today we backtest a strategy that tries to capture short-term weakness on an uptrend.

We will be using the RSI but instead of applying it directly to price, we will apply it to the rate of change.

Let's put the strategy to the test below.
Image
Image
Author:

As with any strategy, we must start with an idea. I just went on the internet and typed in trading strategies examples.

I randomly picked on for us to test here and see how it translates to the crypto market.quantifiedstrategies.com/bull-market-tr…
Strategy Rules:

Entry Rules:

1. The close must be above the 200-day average.
2. The 5-day RSI indicator of the 5-day Rate of Change indicator must be below 20.

Exit Rule:

1. We sell when the 5-day RSI is above 50. Image
Read 14 tweets
Aug 24
"Smoothing Volatile Alpha"

We all read concepts that we don't fully understand what they mean or their implications.

That's fine, we don't know everything.

I try to understand by writing.

Let's go over this concept and simplify what's discussed below.

I want to start by saying that I am exploring the concepts in this tweet and by no means am I going to represent them in perfection.

I welcome anyone to correct me in the way I am representing the thoughts here shared.
Let's imagine we are trying to predict tomorrow's weather.

We have a feature or set of features that give us a prediction.

However these features are very "jumpy" and change their mind a lot.

This is the volatile alpha that is mentioned in the conversation.
Read 14 tweets
Aug 21
Day 9: "EMA Positive and Volume Expansion Strategy"

I'm sharing a simple backtest of trading strategies I find online for 30 days.

Today we go over a strategy that displayed 78% win rate since 2016.

Let's put the strategy to the test. Check it out below!
Image
Image
This idea emerged when I was researching ideas around volume and trend and has been laying around in my own research folders.

The simple concept is about trying to understand if after a volume expansion in a positive trend, we can extract some profits from that.
So we use two exponential moving averages to gauge higher timeframe trend and then we look at the current volume to understand its relationship to the average volume.

If it's above average than we assume there's some interest for whatever reason and we buy the next bar open.
Read 21 tweets
Aug 20
Day 8: "20-Day High Breakout"

I'm sharing a simple backtest of trading strategies I find online for 30 days.

Today we will be looking into a momentum strategy and how it has performed vs a simple buy and hold.

Let's put the strategy to the test. Check it out below!
Image
Image
Even though this idea of a breakout is well known by momentum and trend-following traders, I got the idea for this backtest from this interview:



In the interview @therobotjames also mentions a momentum strategy he used in crypto back in 2020/2021.
James mentions the following ideas:

1) "Around price extremes, conditional returns tend to be higher"
2) "Around a new high it's a good place to be long"
3) "Around a new low it's a good place to be short"

These are core fundamental principles for any trend/momentum system.
Read 24 tweets
Aug 19
Day 7: "Day of Week Seasonality"

I'm sharing a simple backtest of trading strategies I find online for 30 days.

Today I am sharing the backtest of an idea that @therobotjames mentioned in his latest interview.

Let's put the strategy to the test. Check it out below!
Image
Image
First and foremost, I recommend anyone interested in trading to watch this interview:

This is where @therobotjames talks about multiple ways he traded in 2020/2021, including seasonality.

The goal of this thread is to backtest this idea up until today.
Strategy Rules:

Entry Rules:
• Day of week is either monday, wednesday or friday
• Enter on bar open

Exit Rules:
• Exit on same day close Image
Read 27 tweets
Aug 17
Day 6: "RSI as a Mean Reversion Tool"

I'm sharing a simple backtest of trading strategies I find online for 30 days.

In order to keep these coming every day, I will keep them as simple as possible.

Let's put the strategy to the test. Check it out below!
Image
Image
I found this strategy on quantified strategies website.

Link:

It was originally designed for stocks.quantifiedstrategies.com/what-happens-w…
Strategy Rules:

Entry Rules:
• RSI of the last 3 bars is below 20.
• Enter on next bar open

Exit Rules:
• The close price is higher than previous bar's high.
• Exit on next bar open Image
Read 21 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 on Twitter!

:(