OPEN-SOURCE SCRIPT

Fosback High Low Logic Index [NYSE]

316
OVERVIEW

This indicator implements Norman Fosback's High Low Logic Index (HLLI) as described in his 1976 book Stock Market Logic. The HLLI detects internal market divergence by measuring how many stocks are simultaneously hitting 52-week highs and 52-week lows on the NYSE. When both counts are elevated, the market's internal structure is bifurcated, which historically precedes significant declines even when headline indices appear healthy.

This is a pure breadth indicator plotted in its own pane beneath price, not an overlay.


CONCEPT

Most breadth indicators track net direction: advances minus declines, or new highs minus new lows. The HLLI takes a fundamentally different approach. Instead of asking "which side is winning," it asks "are both extremes active at the same time?" A market where many stocks are making new highs and many are making new lows is structurally fragile regardless of which count is larger.

The core formula:

Raw Ratio = min(New 52W Highs, New 52W Lows) / Total Issues Traded × 100

By taking the minimum of the two counts, the index isolates the "disagreement" component. If 200 stocks hit new highs and 5 hit new lows, the ratio is tiny because the market is moving coherently upward. If 200 hit new highs and 150 hit new lows, the ratio spikes because the market is deeply split.

The raw ratio is then smoothed with an exponential moving average (default 50 bars, approximating Fosback's original 10-week EMA on a daily chart) to filter noise and reveal the underlying regime.


HOW TO READ IT

High readings (above the bearish threshold)
The market is internally divided. A large number of stocks are reaching 52-week extremes on both sides simultaneously. This condition historically precedes broad market weakness. The rally, if one exists, is narrow or rotational rather than broad-based.

Low readings (below the bullish threshold)
The market is moving coherently. Very few stocks are at opposing extremes at the same time. This internal agreement, whether the market is trending up or down, historically supports sustained directional moves.

Neutral readings (between thresholds)
No strong signal in either direction. The background shading is absent in this zone.


FEATURES

• The smoothed HLLI line is color-coded by regime: red when above the bearish threshold,
green when below the bullish threshold, and gray when neutral.
• The unsmoothed raw ratio is plotted as a faded area behind the HLLI line, allowing you
to see individual spikes before smoothing absorbs them.
• A status label on the last bar displays the current HLLI value, raw ratio, underlying
new highs/lows counts, total issues traded, and the active regime.
• Background shading highlights bearish (red) and bullish (green) regimes.
• Two alert conditions fire on threshold crossovers: one when the HLLI crosses above the
bearish level, one when it crosses below the bullish level.


INPUTS

EMA Smoothing Length: Controls the smoothing period for the raw ratio. Default is
50 bars (approximately 10 trading weeks on a daily chart). Shorter values increase
sensitivity; longer values produce a slower, more stable signal.
Bearish Threshold %: The level above which the HLLI signals elevated divergence.
Default is 2.5%. This may require adjustment depending on the historical period and
your risk tolerance.
Bullish Threshold %: The level below which the HLLI signals market coherence.
Default is 1.0%.


DATA SOURCES

This script uses four external data feeds via request.security():

MMAHN : NYSE new 52-week highs
MMALN : NYSE new 52-week lows
AADV : NYSE advancing issues
DDECL : NYSE declining issues

Total issues traded is computed as advancing + declining issues. Fosback's original formulation included unchanged issues in the denominator, but TradingView does not provide a reliable NYSE unchanged-issues feed, so this script uses the two-component total. The practical impact on the ratio is minimal.


LIMITATIONS

• This is a regime indicator, not a timing tool. The 50-bar EMA smoothing means the HLLI
responds slowly to sudden shifts. It is best used as a confirmation layer alongside
faster signals.
• The default thresholds (2.5% bearish, 1.0% bullish) are starting points derived from
historical convention. The NYSE universe has changed substantially since 1976 due to
ETF proliferation and structural changes in listed issues. Backtesting threshold
sensitivity on your timeframe of interest is recommended.
• Historical data availability for the underlying breadth feeds varies by TradingView
subscription tier.
• The script uses four request.security() calls. Keep this in mind if you are near
TradingView's per-script limit when combining with other multi-feed indicators.


NOTES

This indicator should not be confused with the "High-Low Index" (sometimes called the Record High Percent indicator), which computes new highs / (new highs + new lows). That is a directional measure. Fosback's HLLI specifically uses min(new highs, new lows) in the numerator to capture divergence, which makes it conceptually distinct.

Fosback's original research is published in:
Fosback, Norman G. Stock Market Logic: A Sophisticated Approach to Profits on Wall Street. Dearborn Financial Publishing, 1976.


═════════════════════════════════════════════════════════════════════════

Disclaimer: This script is provided for educational and informational purposes only. It is not financial advice. Past indicator behavior does not guarantee future results.

면책사항

해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.