How to backtest SuperTrend as a filter? + News

In this article I’ll cover how to use SuperTrend EMA as a trend filter for backtesting and some updates on new features released for backtester and 3C sim pine scripts.

Pine script updates

  • Aster has made a massive effort to catch up on all new deal start conditions recently introduced by 3Commas including: SMA, BB%, PSAR, HA, etc.
  • This includes Gavin’s backtester and 3C sim indicator.
  • SuperTrend EMA indicator is now available to add to your own TV account for Gold and VIP members. This means you can set your own alerts, backtest it, change parameters, etc. You should be able to find these indicators in your invite-only section on TV.

News

  • The Fed futures bot contest is still ongoing and we have decided to extend the submission deadline for one more week (as requested by users!) If you are running or planning to run this bot you can get the chance to win up to 400 USD in prices and NFTs.
  • The sale of subscriptions for NFT holders is ending tomorrow, don’t miss to get the chance to get a subscription for up to 50% discount for 6 months or a year.

Backtesting SuperTrend as a trend filter

Many of you have started experimenting using the SuperTrend EMA Orchestrator to help reducing some of the risks of running aggressive setups like the Fed Futures bot.

But also some users mention that they also started using this orchestration signal to start/stop some other bots. And I believe it’s also a cool idea.

Having a longer timeframe orc that doesn’t fire very often like the “original” orchestrator is a must in my opinion, but why not using ST EMA ORC for the shorter term moves of the price?

Deciding to use it might be a pretty straightforward decision: why not! but what about the performance of this approach? can we somehow backtest this idea?

Today we are going to try to take some steps forward to try to backtest it.

I have now published the SuperTrend script that Nader prepared for us so VIP and Gold members can add it to TradingView directly.

There are plenty of SuperTrend free and open source versions available on TV. You can use any of the free versions but if you decide to use our version you will be getting: trend alerts, EMA100 filter and backtestable using Gavin’s backtester.

EMA100 filter bypasses buy alerts when the price is below EMA100. This option can be disabled from the settings if required.

The script prints a 1 for as long as the trend is up and prints a 2 during the bear trend which allows for backtesting.

How to connect ST EMA with the Backtest for long setups?

I follow these instructions:

  1. Open a new chart on TV
  2. Add Gavin’s backtest (from your invite-only area on TV)
  3. Add TTP SuperTrend EMA (from your invite-only area on TV, VIP/Gold tier required)
  4. Set the chart to 5 mins TF
  5. Set ST EMA timeframe to 1 hour
  6. In the backtest settings use
    1. Deal start condition: “3C Simulator + ext indicator combined”.
    2. Deal source: “TTP SuperTrend EMA: ST Signal”
    3. Deal start value: 1 (ST will print a 1 for as long as we are in an uptrend)
    4. Deal close value: 3 (we want to ignore 2 for downtrend, otherwise the backtester will trigger a sell on 2)
  7. Now in the 3C simulator section of the backtest we can select any DSC combination and they will only trigger when ST is in an uptrend.
Deals are only opening when ST is in an uptrend: dotted green lines indicate an uptrend.

How to connect ST EMA with the Backtest for short setups?

For shorts use the same instructions as for long but instead of using 1 for deal start value, use 2 which is what ST prints on a downtrend.

Ideas to try

  • Try different ST timeframes. Keep the backtester in 5 minutes but experiment with different timeframes of ST like 4h or daily.
  • Explore different ST ATR period values. By default it comes with 10, but many traders in crypto tend to reduce it to 7 for a more reactive trend changing signal. It all comes to what you want to do with it.

Known limitations

The ST has a parameter for skipping buy signals if the price is below EMA100. Unfortunately when backtesting this option does not work.

It does filter buy signals when sending alerts but for backtesting it backtests all uptrends, not only the ones that start from above EMA100.

We are working on how to fix this.

Featured products and TTP memberships