- **Similar:** [DChannel](../dchannel/dchannel.md), [PChannel](../pchannel/pchannel.md) | **Complementary:** ATR for volatility context | **Trading note:** Min/Max channel; breakout system based on highest high and lowest low.
Min-Max Channel tracks the highest high and lowest low over a lookback period, creating a pure price envelope without any midpoint calculation. Unlike Donchian Channels which include a middle band, MMCHANNEL delivers only the raw extremes. The implementation uses monotonic deques for O(1) amortized updates: each element enters the deque once and leaves at most once, so total work over $N$ bars is $O(N)$ regardless of period length.
Min-max channels are the simplest form of price envelope analysis, predating most technical indicators. The concept is elemental: track where price has been at its highest and lowest points over a defined window.
The approach gained prominence through Richard Donchian's commodity trading work in the 1960s and later through the Turtle Trading system in 1983. Curtis Faith's public disclosure of the Turtle rules revealed that a 20-day breakout channel formed the core entry signal. While Donchian Channels add a midpoint average, MMCHANNEL strips this away, focusing purely on the support and resistance levels defined by actual price extremes.
Most naive implementations suffer from $O(n)$ complexity per update, rescanning the entire window to locate max/min values. For period 200 on tick data, that means 200 comparisons per tick. The monotonic deque approach maintains sorted order implicitly, reducing amortized cost to $O(1)$ per bar.
where $H$ is the high price and $n$ is the period. New highs immediately update the upper band; the band only decreases when the previous maximum exits the lookback window.
The maximum deque stores (value, index) pairs in decreasing order by value; the front element is always the current maximum. The minimum deque stores pairs in increasing order; the front element is always the current minimum. No explicit sorting is needed because superseded elements are removed on insertion.
### 4. No Middle Band
Unlike DCHANNEL and PCHANNEL, MMCHANNEL emits only upper and lower bands. If a midpoint is needed, compute $(U_t + L_t) / 2$ externally.
### 5. Complexity
Streaming: $O(1)$ amortized per bar (each element enters/exits the deque at most once). Worst case $O(n)$ occurs only on monotonically increasing/decreasing sequences that flush the entire deque. Memory: two deques of at most $n$ (value, index) pairs plus two circular buffers of $n$ floats.
Each element is pushed to the deque exactly once and popped at most once (either from the back during insertion or from the front during expiry). Over $N$ operations, total work is $O(N)$, yielding $O(1)$ amortized cost per update.
MMCHANNEL is the lightest channel indicator — no midpoint computation, no band arithmetic. Each element enters and exits each deque exactly once over the full series.
### Batch Mode (SIMD Analysis)
Monotonic deques are inherently sequential. No SIMD parallelization across bars is possible: