Rearview Download

Breakout with trend strength

Breakouts work better when a trend is already under way: buy a new 20-day high only when ADX says the trend is strong and the directional lines agree. Positions risk 1% of equity each, with an ATR stop and an ATR trailing stop.

Strategies · adx_breakout.rvw

language 1
strategy "Breakout with trend strength" {
  universe   members("SYN500")
  enter long when close > donchian_high(20)[1] and adx(14) > strength and plus_di(14) > minus_di(14)
  rank by    adx(14)
  stop       2 x atr(14)
  trail      3 x atr(14)
  size       risk 1% with stop, max 10 positions
  max position 20%
  exit when  close < donchian_low(10)[1]
  param      strength = 25 in 15..35 step 5
}

Functions it uses

donchian_high, adx, plus_di, minus_di, atr, donchian_low

Try it

File ▸ New Script from Example adds it to a project. The examples read the sample’s index label, SYN500, and market ETF, SYNSPY; when your data has neither, a sheet asks what to read instead, one of your index labels (or every stock and ETF) and a ticker, so the example runs on your data as it is.

Before you trust what it does on your data, see whether it’s luck: Is this result luck?