TradingView breadth workflows

High-Low Logic Index: new extremes and market breadth

The High-Low Logic Index measures how strongly both ends of a market are reaching new extremes. Its raw percentage is 100 × min(new 52-week highs, new 52-week lows) / total issues traded. This guide uses the daily version described by Greg Morris on StockCharts, smoothed with a 50-day exponential moving average. A large value requires both counts to be large relative to the same universe. It is not the new-high-minus-new-low difference, and a small value alone does not establish an upward trend.

See the decision guide

Define the counts and calculation order

Let H be the number of eligible issues recording a new 52-week high, L the number recording a new 52-week low, and N the total eligible issues traded for the same daily observation. Calculate R = 100 × min(H, L) / N first, then smooth R. Greg Morris describes this daily 50-day EMA formulation and distinguishes it from weekly implementations. Record the source interval, universe, extreme definition and denominator alongside the smoothing length.

  • Use counts, not trading volume, the index price or the number of stocks currently loaded on a chart. Confirm whether the provider includes funds, preferred shares and other issue types.
  • Confirm how the provider defines a 52-week extreme, including price adjustment and whether an intraday or closing extreme qualifies. Matching names do not prove matching methods.
  • Taking the minimum after separately smoothing H and L is a different calculation. Keep the daily minimum and daily denominator inside the ratio before applying the EMA.
  • For nonnegative counts with H and L no larger than N, the raw percentage lies between 0% and 100%. A tighter 50% ceiling requires an additional assumption that the two groups cannot overlap; do not impose that assumption without checking the counting convention.

Compare broad disagreement with a directional difference

The following invented daily observations all use N = 3,000 traded issues. They illustrate the formula, not historical market performance. H - L measures the balance between the two groups; the logic percentage measures the smaller group relative to the entire universe.

  • The first two rows have the same +270 difference. Yet the smaller count rises from 30 to 180, so the logic percentage rises from 100 × 30 / 3,000 = 1% to 100 × 180 / 3,000 = 6%. Net breadth alone hides that change.
  • Reversing H and L leaves the logic percentage unchanged. The third row therefore has the same 1% result as the first despite the opposite directional balance.
  • Zero can mean no extremes at all, or just no issues on one side. Read both counts before describing a low value as market agreement or a trend.
  • The fourth and fifth rows both have a zero difference but very different participation at the extremes. Neither calculation identifies which instrument to trade or when its price will turn.
ScenarioHLH - LRaw logic percentage
Mostly new highs30030+2701.00%
Both extremes expand450180+2706.00%
Mostly new lows30300-2701.00%
Neither extreme occurs0000.00%
Equal, substantial extremes18018006.00%

Compare EMA windows on the same observations

For a K-period EMA, alpha = 2 / (K + 1) and E today = alpha × R today + (1 - alpha) × E yesterday. K is the smoothing length; N remains the total-issues count. Assume every EMA starts at 1% and the next five valid daily raw readings are all 6%. The 10- and 20-day alternatives below are sensitivity tests; the selected page definition remains 50 days.

  • The five-day result is 6 + (1 - 6) × (1 - alpha)^5. A hypothetical 3% threshold is reached by the 10-day series within these five days, while the 20- and 50-day series remain below it. The threshold is an example parameter, not a validated trading rule.
  • A 50-day EMA is not mathematically identical to a 10-week EMA. A weekly source samples different observations, and the minimum, denominator and EMA updates can all differ. Five daily new-high counts also cannot simply be summed to count unique weekly issues.
  • State the initial seed and history start. The table assumes a prior EMA of exactly 1%; real chart output depends on its available history and initialization. Compare scripts using the same source history before attributing differences to the formula.
Daily EMA lengthAlphaAfter one 6% dayAfter five 6% days
102 / 111.9091%4.1668%
202 / 211.4762%2.9686%
502 / 511.1961%1.9065%

Audit TradingView inputs and denominator substitutions

The public BY_Tse script titled Fosback High Low Logic Index [NYSE] documents MMAHN and MMALN as its high and low inputs, with advancing plus declining issues as its denominator. Its author explicitly notes that this excludes unchanged issues. Treat these as that implementation's input choices, not proof of full-total equivalence or guaranteed data access in your account.

  • Open the script source and each selected series. Record full symbol prefixes, descriptions, daily field, source dates and available history. Verify that all counts cover the same market before comparing the output with another HLLI.
  • Hypothetical denominator check: H = 450, L = 180 and total traded issues = 3,000 produce 6%. If advancing plus declining issues total only 2,800, the proxy produces 6.4286%. Excluding 200 unchanged issues raises the result by 0.4286 percentage points, or 7.14% relative to 6%.
  • Label an advancing-plus-declining denominator as a proxy. Do not silently copy thresholds from a full-total version. The size of the discrepancy depends on the omitted share.
  • An ETF or index candle cannot recover the underlying new-high and new-low counts. If a complete matched denominator is unavailable, disclose the proxy or leave the full-total version unavailable.

Handle missing values before smoothing or alerting

Use completed daily source observations. TradingView documents that requested series can fill chart gaps with prior values, depending on the gaps setting; a visible value on every intraday bar does not establish a new daily observation. Decide how the calculation handles absent data before comparing any alert history.

  • If the prior 50-day EMA is 2% and the next observation is missing, replacing it with zero incorrectly lowers the EMA to 1.9216%. A real raw value of 6% would instead update it to 2.1569%. Neither result can be inferred from a missing input.
  • For a custom monitor, display unavailable on a missing scheduled day and suppress alerts. One explicit policy is to retain the previous EMA state, then update it only when a fresh matched observation arrives. That resumes an observation-based EMA across the gap; record the gap because it is no longer an uninterrupted daily series.
  • Do not update the daily EMA once per five-minute chart bar with the same carried daily value. If reviewing a daily threshold event, use the time the completed source observation became available, not the start of that day.
Input conditionTreatment for this research workflow
H = 0, valid L and positive totalRaw percentage is zero; retain the valid zero.
H or L missingMark unavailable; do not substitute zero.
Total missing or zeroDo not divide or emit a threshold alert.
Negative count or a count above totalReject the observation and audit universe or field selection.
Mismatched source dates or carried valuesDo not combine them as a fresh matched observation.

Turn the definition into a chart aid and a review record

Give the Pine Script AI Coding Agent the verified symbols, full-total or proxy denominator, daily raw formula, EMA length and missing-data policy. Request the raw percentage, smoothed percentage and input counts together, with an unavailable state and a completed-observation alert. Review the generated source and request a syntax check before comparing its values with the original inputs.

  • Check the 1% and 6% examples, swapped H and L, genuine zeroes, a missing count and a zero denominator. A chart helper should make those states distinguishable.
  • Use Trading Journal session notes to save the hypothesis, formula version, source timestamps, counts, denominator, smoothing length and a screenshot URL. Add a dated outcome afterward without replacing the original observation.
  • A high logic reading describes participation at both extremes. It does not establish a market top, a short entry or expected profit. Test any decision rule separately with its execution costs and risk limits.
Where Pineify fits

Pine Script AI Coding Agent

Draft a breadth chart aid from verified input series and an explicit formula. Inspect the generated code and compare its readings with the source counts.

Also useful: Trading Journal. Keep the formula version, source observations, screenshot links and later review in session notes.

Draft a breadth chart aid

Frequently asked questions

Educational information, not investment advice. All numerical examples are hypothetical. Breadth conditions do not guarantee price direction or returns. Verify the source universe, timing and availability before using a chart aid or alert.

Sources and verification

Published by Pineify. Pineify is an independent product and is not affiliated with TradingView. Sources support the technical explanations; examples do not establish trading performance.