Supertrend Trend Rider

Supertrend Trend Rider is a strategy that trades XAUUSD on 1-hour bars. It takes long trades only, adds up to 2 entries in the same direction and keep

trade management

supertrend-trend-rider.abx
1strategy "Supertrend Trend Rider"
2market: XAUUSD
3bars: 1h
4direction: long
5pyramiding: 2
6min_distance: 300 points
7
8input atr_length = 10
9input factor = 3.0
10
11trend = supertrend(atr_length, factor)
12
13when trend.direction == 1 and crosses_above(close, ema(close, 21)):
14buy risk: 0.75%, stop: trend.line, target: 4R, tag: "rider":
15breakeven at: 1R, offset: 50 points
16partial 25% at: 2R
17trail by: atr(14) * 2, after: 2R
18exit when: trend.direction == -1
19
20plot trend.line, color: if trend.direction == 1 then green else red, width: 2
What this script says

Supertrend Trend Rider is a strategy that trades XAUUSD on 1-hour bars. It takes long trades only, adds up to 2 entries in the same direction and keeps at least 300 points between entries.

You can change 2 inputs: atr_length (default 10) and factor (default 3.0).

It calculates trend as the Supertrend (length atr_length, multiplier factor).

When trend.direction is 1 and the close crosses above the 21-bar EMA of the close, it buys at market, risking 0.75% of the balance, with a stop at trend.line, with a target 4R from the entry and tagged "rider"; once open, it moves the stop to breakeven at 1R plus 50 points, closes 25% at 2R, trails the stop by 2 × the 14-bar ATR once the trade reaches 2R and exits when trend.direction is -1.

On the chart, it plots trend.line.

Try this in the Terminal. AlgoBars is free: $0 a month, no card needed.

Create my free account