Torben’s Repeated-Scan Method for a Moving Median Indicator
Summary
This document explains a moving median indicator based on Torben Mogensen’s selection method. A median is the central value in an ordered set and is less affected by outliers than common averages. The described method searches between the minimum and maximum values: it tests a midpoint, counts observations below, above, and equal to it, then narrows the search range until it can identify the median. The included implementation applies this process to a rolling price window, with a default length of 20 bars and a closed-bar setting.
The method’s practical advantage is that it leaves the input array unchanged and scans values sequentially, which can avoid copying large read-only datasets. Its trade-off is repeated passes through the data; the document explicitly says it is not the fastest median-finding approach. It provides implementation detail but no benchmark, trading rule, backtest, or evidence that using the indicator improves trading results.
Key ideas
- A median is a central value that is less sensitive to outliers than an average.
- Torben’s method narrows a search range through repeated midpoint checks and counts.
- The method leaves the input data unchanged and accesses values sequentially.
- Repeated scans make the approach slower than some alternatives.
- The example applies the method to a rolling price window of 20 bars.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.