Supertrend strategy: rules and how to test it

By Oalgo · Last reviewed

A Supertrend strategy follows the side of the Supertrend line. A common rule is to enter when the close crosses above the line, which is when the line flips from above price to below it, and to exit when the close crosses back below it.

Chart: example prices with the Supertrend line. The line is below price in up-moves and above price in down-moves, and a rule acts where it flips side.PriceHigh to lowBelow priceAbove price
Example prices, made up for this page. Settings 10 and 3.

What are the rules of a Supertrend strategy?

#
  • Entry: the close crosses above the Supertrend line (settings 10 and 3).
  • Exit: the close crosses back below the line.
  • Settings: a larger multiplier keeps the line further from price, so it flips less often. A smaller one flips sooner.
  • Stop: a Stop Loss as a percentage. The line itself trails price, and a stop can follow it, in a test and in a Live Strategy.

How do you write this strategy in Oalgo?

#

In Oalgo you can tell Oalgo AI your Supertrend rule in your own words, check the rule it builds, and test it. After testing, if you choose, you Go Live with your own Live Strategy on your own Venue Account at a Supported Venue.

For example, you could tell Oalgo AI: "Enter when the close crosses above the Supertrend line (10, 3). Exit when the close crosses back below it. Use a 2% Stop Loss and a 4% exit target." These numbers are examples to change. A Live Strategy needs a stop on each side it can enter, and an exit target is optional. The example names both.

How do you test this strategy honestly?

#
  • Run a backtest on more than one date range, including a sideways one.
  • Check the fees and the number of trades. In a sideways market price crosses the line again and again.
  • Change the multiplier and the period a little. If the report changes a lot, the first result may be fitted to one period.
  • Run a forward test on new prices, with simulated funds.

What can a Supertrend strategy not tell you?

#

Supertrend only follows price, so every flip comes after the turn has started, and the exit comes after price has already moved back. It does not say how far a trend will run. The line can sit far from price, so the fall between the entry and the exit can be large. The trend following page compares this rule with other trend rules.

Read next