Building a Price Oscillator with Rolling Highs and Lows
Summary
The document presents a Python charting workflow for a market series, including candlesticks, turning-point markers, and a three-line oscillator. Its core calculation compares the close with rolling highs and lows over two lookback windows, then shifts the resulting values onto a bounded scale. One line uses the shorter window, another averages the longer-window measure, and a third smooths it with an exponential average. The chart adds reference levels and labels line crossings as potential buy or sell signals, with separate conditions for possible overbought and oversold regions.
The material includes formulas and code, but it is primarily a repair and reconstruction of a plotting script, not a research study. The supplied code is lengthy, partly omitted, and contains apparent inconsistencies, including a title referring to volatility while the calculations describe a high-low oscillator. It gives no backtest, asset specification, or evidence that the plotted signals are profitable; the crossing and extreme-zone rules therefore remain unvalidated examples.
Key ideas
- The oscillator compares closing prices with rolling high and low ranges over short and longer windows.
- A longer-window line is averaged, while a separate line is exponentially smoothed to create a middle-term measure.
- The chart marks crossings between lines as possible entry or exit signals and uses extreme levels to flag potential turning regions.
- The script combines the indicator with candlesticks and daily and weekly turning-point markers.
- The code is incomplete and inconsistent, and the document provides no performance tests for its signal rules.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.