Noon Barbari
Sign up

Back to strategy library

Trend followingLong & short15m1h4h1d

TradingView SuperTrend strategy

Classic ATR-band trail — long when the trend flips up, short when it flips down.

Thesis

Classic ATR-band trail — long when the trend flips up, short when it flips down.

Fits Trend following setups — works best when the underlying market behavior matches the thesis, and breaks down when it doesn't. Pair with the backtester's walk-forward mode before committing real capital.

Trend-friendly equity curve — clean in directional regimes, whipsaws in chop. The 10/3.0 default fires frequently on intraday timeframes and less often on daily candles.

YAML rule-set

Paste this into the Strategy Designer's Text tab, or use the dashboard button above to load it as a template.

_template:
  title: SuperTrend trend-flip
  category: trend_following
  skill: beginner
name: super_trend
weight: 1.0
long_only: false
indicators:
  st:
    kind: super_trend
    atr_period: 10
    factor: 3.0
  c:
    kind: sma
    period: 1
entry:
  combine: OR
  rules:
    - combine: AND
      direction: long
      rules:
        - {lhs: {indicator: st, field: state}, op: crosses_up, rhs: {value: 0}}
    - combine: AND
      direction: short
      rules:
        - {lhs: {indicator: st, field: state}, op: crosses_down, rhs: {value: 0}}
exit:
  combine: OR
  rules:
    - {lhs: {indicator: st, field: state}, op: crosses_down, rhs: {value: 0}}
    - {lhs: {indicator: st, field: state}, op: crosses_up, rhs: {value: 0}}
risk:
  trailing_stop_pct: 0.04
  cooldown_bars: 2

Indicators

  • stSuperTrend (ATR 10, factor 3.0)

    Port of TradingView's built-in ta.supertrend: an ATR-band trailing stop anchored on hl2. state = +1 above the band (bull), -1 below (bear).

Entry conditions

The bot opens a position the bar after every condition below has fired.

  • Long the bar after state crosses up through zero.
  • Short the bar after state crosses down through zero.

Exit conditions

Any of the conditions below will close the position.

  • Any state flip closes the active position.
  • 4% trailing stop on the runner; 2-bar cooldown.

Expected behavior

Trend-friendly equity curve — clean in directional regimes, whipsaws in chop. The 10/3.0 default fires frequently on intraday timeframes and less often on daily candles.

Equity-curve character, not a return forecast. Backtests are not promises about live performance.

Try it on your own data

Open the template in the dashboard to backtest it on BTC, ETH, or any CCXT symbol — or copy the YAML into the Strategy Designer to edit it first.

Past behavior on backtests is not a guarantee of future performance. Markets change; rule sets need re-validation. Trade at your own risk.