Rearview Download

Six-month trend timing

Trend timing with one fund: own the market ETF while its price is above its six-month average, and hold cash otherwise. It is checked once a week, on the week's first trading day, so a dip below the average during the week doesn't trigger a trade; the 10% band keeps the position from being trimmed and topped up by a few shares each week.

Strategies · trend_timing_etf.rvw

language 1
strategy "Six-month trend timing" {
  universe   symbols("SYNSPY")
  trend      monthly(close) > monthly(sma(close, months))
  enter long when trend
  size       95% of equity
  max positions 1
  rebalance  weekly, band 10%
  param      months = 6 in 4..12 step 2
}

Functions it uses

monthly, sma

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?