Skip to main content
Track Trend following
36 / 38
Library

2018issue C038-11

A recursive median as shared state for trend rules

A mechanical trend system can read one spike-resistant filter as market state, so an isolated print does not rewrite the average that decides whether the rules may act or must stand aside.

  • Isolated extreme price or volume prints can distort the averages a mechanical system uses as market state. A short median window can ignore those extremes instead of folding them into the output.
  • A recursive-median-filter is specified as an exponential moving average of a five-bar median, so each new output reuses the prior output and the blending constant stays between zero and one.
  • A second-order highpass can turn that filter into a recursive-median-oscillator by removing the constant level and very long wavelengths, giving the rules a series that can swing around zero.
  • Rule-based-entry, stay-in, and abstention then read one fully specified path, so trend-following can treat the larger directional move as the shared state and stand aside when that state does not allow a position.
Entries in this reading3 entries

When averages absorb an isolated print

A mechanical-trading-system is a fully specified calculation path from raw prints through a short median, a recursive smooth, and an optional highpass. Every rule reads one output. Isolated extreme price or volume prints can distort the averages that path would otherwise treat as market state. A median window can ignore those extremes instead of folding them into the output.

How the recursive median is specified

A recursive-median-filter takes the median of a short lookback and then exponentially blends that median with the previous filter output. For trading, that can be specified as an exponential moving average of a five-bar median, so each new output reuses the prior output. The exponential blending constant lies between zero and one. It can be set from a critical-period with a cosine-sine identity, or approximated as five divided by that period. The critical-period is the design length that separates wavelengths the filter is meant to pass from those it is meant to reject.

Why the median is not an ordinary smoother

A median operator is nonlinear and is not a convolution, so its output has no Fourier representation, is not differentiable, and has no Taylor expansion. Those properties block ordinary polynomial curve-fitting of the filtered series. Repeating the median operation rapidly converges to a reduced series that matches the input except for computational lag. Impulsive-noise is the one-off extreme price or volume print that would dominate an average if it were blended into the filter instead of discarded.

An oscillator the rules can share

An oscillator-type rule input can be formed by sending the recursive median through a second-order highpass that removes the constant level and very long wavelengths, including long components associated with a fractal, pink-noise spectrum of market data. The result is a recursive-median-oscillator that can swing around zero as a rule input. The second-order highpass shortens its critical-period by about 70 percent relative to an exponential moving average of the same design period.

On a 2017 calendar-year equity-index example, a recursive-median-oscillator with a 40-bar highpass and 16-bar smoothing was compared with a 14-bar relative-strength calculation also smoothed at 16 bars and rescaled to swing from minus one to plus one. The median oscillator showed less lag and a faster response to large price moves.

Entry, stay-in, and abstention as one procedure

Trend-following is a signal procedure that uses shared rule inputs, market state, and execution constraints over the system holding period so the larger directional move, not an isolated extreme, governs whether the system is in, out, or flat. Rule-based-entry is a predefined, testable condition on that shared filtered state. The same condition family is used to allow a new position, keep it, or refuse it. When prints contain impulsive fluctuations, discarding outliers on this recursive-median path is specified as a way to smooth with limited lag so a trend procedure can read the larger move as shared state for entry, exit, and abstention.

Educational research material, not investment advice. Historical source context does not establish present-day performance.
36 of 38 in the Trend following track
202028-31 pp.Next on Trend followingMoving-average construction as an objective trend filterA moving average averages ordered prices over a chosen lookback so short-term fluctuations are filtered and a smoother path remains for reading underlying direction.
All readings on this track · 38 readings
  1. 1986A Marshall Wave book is assembled one confirmed stance at a time
  2. 1987Operator gut check when two systems conflict
  3. 1988Visual trend rules need one testable procedure
  4. 1988Audit trend and breakout rules sold without tests
  5. 1992Weekly 4 percent close reversal case study
  6. 1992Write down the plan, then wait for the cross
  7. 1994Constructing a three-rule moving-average system
  8. 1995Weekly long-only trend rules with a gated retracement exit
  9. 1997Constructing rainbow charts with repeated smoothing
  10. 1997Three-line break as a one-parameter mechanical filter
  11. 2000Nested horizon trend alignment with a momentum stack
  12. 2001When certainty turns off the stop
  13. 2001Price must confirm every setup
  14. 2001Constructing a color stack from every lookback
  15. 2002Evaluating mechanical trend signals from ten-session average excursions
  16. 2004Trend pullbacks with a fifty-day average and relative strength index
  17. 2005Stochastic overbought as a trend-regime state
  18. 2005Trend-following as one testable signal procedure
  19. 2007One checklist for entry, exit and abstention after a market switch
  20. 2008Parallel listings and divergent trend behavior
  21. 2008Recovery headlines versus trend-regime rules
  22. 2008Constructing an intraday trend procedure with confirming close, retest, and planned exits
  23. 2010Mechanical trend-following system design, stops, and validation
  24. 2010A trading-plan that sets entry, stop, trail, and pause together
  25. 2010Multi-horizon cycle signals, trend filters, and stops
  26. 2012Weekly bear-market and shock signals as a mechanical procedure
  27. 2013A 2013 rates week as a structure-first exit drill
  28. 2013Trend following as one testable procedure
  29. 2013A forex veto checklist: trend, pair economy, and crowd bias
  30. 2015Relative-strength-index rules under a 20-percent trend filter
  31. 2015Trend-gated oscillator entry and exit rules
  32. 2016Trend process versus end-goal trading
  33. 2017Gold as a classroom for one midterm-trend procedure
  34. 2017Falling-knife FX longs wait for a four-hour trend turn
  35. 2018A closed procedure for quarterly sector rank slots
  36. 2018A recursive median as shared state for trend rules
  37. 2020Moving-average construction as an objective trend filter
  38. 2020Constructing first and second cross trend entries
All 168 readings tagged Trend following
Also on Trend following5 readings