Backtesting Popular Strategies from YouTube #3

Chandelier Exit + ZLSMA on 5M Heikin Ashi

Rick Hardy
Quant Factory
4 min readOct 29, 2022

--

Hello everyone, and welcome to the third edition of Backtesting Popular Strategies presented on YouTube.

For anyone new to my articles, I’ve started a thread where I will be backtesting trading strategies from YouTube and reporting the results to you transparently. As many of you, who are interested in the subject, know, there are thousands of videos with suggested strategies, where someone is trying to combine a couple of technical indicators in the quest of cracking the code and finding the “Golden Goose”.

Unfortunately, it is not that easy!

That’s why I am set on a mission to explore the more popular ones and run them through my custom Python backtester. That way we can check out and see the actual performance. Also, we can leverage Python by accessing more historical data, a better execution engine, and comprehensive statistics.

How do I choose which strategies to test?

When I am screening through the videos the main thing I am looking for is for them to have a specific set of rules that can be put into an algorithm. Many of the strategies are discretionary and impossible to automate.

So the most important thing we look for is specific conditions that have to be true for the current bar that signals us to enter a trade. Things like support/resistance zones or some kind of retracements or the price that came close to the line and then bounced back are of no interest to us because everyone has their own vision as to what those mean or where those zones are placed.

What strategy are we going to test today?

The strategy I’ve chosen is from the channel TradeIQ and it is based on Chandelier Exit (CE), ZLSMA, and calculated on Bitcoin 5M Heikin Ashi Candles. You can check the video here. The CE is set to 1-period ATR and ATR multiplier of 2 and the ZLSMA is with a length of 50.
The rules for the signals are as follows:

  • Enter Long: CE indicator signals BUY and the price is above the ZLSMA
  • Enter Short: CE indicator signals SELL and the price is below the ZLSMA
  • Exit Long: Stop Loss is set at the recent swing low and Take Profit would be the price crossing below the ZLSMA
  • Exit Short: Stop Loss is set at the recent swing high and Take Profit is price crossing above the ZLSMA

Now, let’s get our hands dirty!

First, we have to download and prepare our data. For that, we use the FTX API and download Bitcoin data from the 5M timeframe for the last year and then we transform it into Heikin Ashi candles.
Heikin Ashi candles are calculations:

  • Open: (Open (previous candle) + Close (previous candle)) / 2
  • High: same as Japanese candles
  • Low: same as Japanese candles
  • Close: (Open + Low + Close + High) / 4

Okay, let’s plot the candles so that we are sure we have the Heikin Ashi ready.

Perfect, we now use the Heikin Ashi values to calculate all the indicators that we will need for the signals.

Final DataFrame

After we have everything prepared, clean and neat, we code the entry and exit logic and run the backtester.

1 Year Results

The the results show that we lost cumulative -7.2% with a Max Drawdown of -11.3% and Sharpe Ratio of -0.33

As the timeframe we are using (5M) is too low we cannot show the usual comprehensive performance plots and statistics.

Unfortunately that strategy didn’t turn out to be a winner, but we won’t stop here in our search of success.

What do you think about the strategy? How do you think it can be improved?

I would love to hear your thoughts in the comment section below.

Also if you have any particular strategy in mind that you want me to backtest, do please share it in the comments below and I will write an article covering it.

A Message from QuantFactory:

Thank you for being part of our community! Before you go:

  • Master Quantitative Research with Python👉 here.
  • Join our Premium Discord Server👉 here.
  • Subscribe to our Exclusive Stocks Newsletter 👉 here.
  • If you liked the story feel free to clap 👏 and follow the author
  • For more stories from the Algorithmic Trading and Quantitative Analysis world you should follow the Quant Factory Publication

*Note that this article does not provide personal investment advice and I am not a qualified licensed investment advisor. All information found here is for entertainment or educational purposes only and should not be construed as personal investment advice.

--

--

Rick Hardy
Quant Factory

Top writer in Investing, Finance, Data Science | Co-founder of Quant Factory