Support and Resistance (RicardoSantos)
Category: market_structure
Identifies dual-layered support and resistance levels (short-term and long-term) based on price extremas within lookback windows.
Formula
\begin{cases} R_{ST} = \text{valuewhen}(H \ge \text{max}(H, W_1), H) \\ S_{ST} = \text{valuewhen}(L \le \text{min}(L, W_1), L) \\ R_{LT} = \text{valuewhen}(H \ge \text{max}(H, W_2), H) \\ S_{LT} = \text{valuewhen}(L \le \text{min}(L, W_2), L) \end{cases} \text{ where } W_1 < W_2 \text{ and trade zones are calculated as a % offset of the range } (R_{ST} - S_{ST}).
Inputs
- Alternative source: (default: false)
- alt_src (default: close)
- lookback window 1: (default: 8)
- lookback window 2: (default: 21)
- Percent of the diff to use for trade zone: (default: 25.0)
- Use Alert Signals? (default: false)
See signal primitives and every published strategy that uses Support and Resistance (RicardoSantos) on WOBR StrategyVerse.