Calculate the percentage before smoothing it
Greg Morris documents the formula and timed transition in his published breadth-indicator book chapter; Arthur Hill gives the explicit EMA-of-ratio form for NYSE data. Let A be daily advancing issues, D declining issues, R = A / (A + D), and E the smoothed ratio. The update is E = (2/11) × R + (9/11) × prior E. Plot 100 × E if you prefer a percentage scale.
- EMA(A) / EMA(A + D) is a different calculation when total issue counts vary. Averaging the ratios gives each session its prescribed EMA weight.
- Record the history start and seed. An initial mean of ten ratios is one seed convention; another implementation may start differently. Compare only after matching initialization or establishing sufficient warm-up.
- If either count is missing, negative, or A + D is zero, treat the observation as unavailable. Do not replace it with zero or silently assume equal participation.
| Input or operation | Required meaning |
|---|
| A and D | Counts of issues, not advancing volume, price change, or an accumulated A-D Line. |
| R = A / (A + D) | Unchanged issues are excluded when the feed reports them separately. |
| EMA length = 10 | Weight 2/11 on the newest daily ratio; 9/11 on the prior EMA. |
| Display scale | 0.40 and 0.615 on a decimal scale equal 40 and 61.5 on a percentage scale. |
A complete arithmetic example
Assume a completed day 0 has E = 0.390000 from earlier history. This is a supplied state, not a ten-day EMA estimated from the five rows below. Each of the next four sessions has 2400 advancing and 600 declining issues, so R = 0.8. Keep full precision while calculating; round only the displayed result.
- Day 1: (2/11 × 0.8) + (9/11 × 0.39) = 0.46454545. Day 4 crosses the upper threshold four trading sessions after day 0.
- One day with 80% advancing issues did not trigger the event. The smoothed ratio needed four consecutive observations in this fixture.
- These inputs test arithmetic and event timing. They are neither a historical occurrence nor evidence of a subsequent price gain.
| Trading session | A / D | Daily ratio R | EMA E | Observation |
|---|
| Day 0 | Earlier history | Not supplied | 0.390000 | Below the setup threshold |
| Day 1 | 2400 / 600 | 0.800000 | 0.464545 | Recovery, no thrust yet |
| Day 2 | 2400 / 600 | 0.800000 | 0.525537 | Still below the trigger |
| Day 3 | 2400 / 600 | 0.800000 | 0.575440 | Still below the trigger |
| Day 4 | 2400 / 600 | 0.800000 | 0.616269 | First qualifying high reading |
Write the window convention before counting events
The source definition specifies a ten-day transition, but it is not a complete software specification for counting bars. For the reproducible rule here, day 0 is the most recent completed session below 0.40; sessions 1 through 10 are eligible. A later sub-0.40 observation replaces day 0. This explicit convention should be compared with a provider that counts the setup session as day 1 or starts its clock on a recovery crossing.
- Weekends and exchange holidays are not trading sessions. Use the calendar of the selected breadth universe.
- The EMA length and event deadline are separate settings that both happen to be ten. Extending the deadline changes the event rule without changing the EMA.
- Save the setup date, trigger date, session count, source pair, and unrounded EMA with every event. Those fields make disagreements diagnosable.
| State or boundary | Rule for this implementation |
|---|
| Arm or re-arm | At E < 0.40, save this session as the latest setup and clear any earlier consumed setup. |
| Trigger | At the first E > 0.615, require an unconsumed setup with elapsed sessions from 1 through 10. |
| Consume | Emit one event, then require a new sub-0.40 setup before another event. |
| Expire | After session 10, discard the setup. A later high reading cannot revive it. |
| Exactly 0.40 or 0.615 | Equality does not satisfy the corresponding strict inequality. Compare unrounded values. |
| Missing session data | Mark the candidate unverifiable and withhold an event until the gap is resolved; do not compress a missing session out of the clock. |
A late threshold crossing is an invalid thrust
The following are separate synthetic boundary cases, not consecutive rows from the arithmetic example. Except for the no-setup case, each starts with E = 0.39 on day 0. Unless a row says otherwise, no later observation is below 0.40, and all observations before the stated high remain at or below 0.615.
- A display rounded to 61.5% can conceal either side of the threshold. Inspect the full-precision value before classifying a boundary observation.
- A provider with inclusive ten-observation counting would reject the day-10 case above. Resolve that convention before claiming exact agreement with its historical event list.
| Case | Later observation | Result under the stated convention |
|---|
| Within window | Day 9: E = 0.620 | Valid first event; nine sessions elapsed. |
| Deadline | Day 10: E = 0.620 | Valid first event at the included endpoint. |
| Crossed, but too late | Day 10: E = 0.610; day 11: E = 0.620 | Invalid thrust. The threshold crossing occurred after expiry. |
| Equality | Day 10: E = 0.615 exactly | No event. Above means strictly greater. |
| Fresh setup | Day 8: E = 0.390; day 12: E = 0.620 | Valid if intervening observations have not triggered; four sessions after the new setup. |
| No setup | E rises from 0.50 to 0.62 without a recent sub-0.40 reading | High participation, but no qualifying setup. |
Audit the breadth universe in TradingView
A chart of an index or a single stock does not supply all constituent advances and declines. Identify the exact breadth source symbols and verify their definitions in your account. NYSE exchange breadth and an S&P 500 constituent series cover different populations. A Nasdaq or custom-basket calculation is a separately labeled variant, even when its arithmetic is identical.
- TradingView documents its Market breadth advancing/declining display with declining count defined as change less than or equal to zero. That display therefore includes unchanged stocks on the declining side. Do not assume every breadth symbol or historical NYSE source uses that same convention.
- For example, 1200 advances, 800 declines and 100 unchanged issues give 1200/2000 = 0.60 when unchanged issues are excluded, versus 1200/2100 = 0.571429 when they enter the denominator. This difference precedes smoothing.
- A current-constituent basket applied retrospectively can omit delisted securities and earlier members. Document membership history before using it to count past events.
| Check | Why it can change the result |
|---|
| Issue coverage | Common-stock-only, all-issue, ETF-inclusive, and index-member feeds can count different securities. |
| Unchanged issues | A separate unchanged category and an unchanged-as-declining convention give different denominators. |
| Time alignment | A and D must describe the same completed session and publication cutoff. |
| Historical coverage | Missing sessions, revised counts, and changed membership can alter both EMA and event dates. |
Keep daily confirmation and interpretation separate
Calculate and advance the event clock once per completed daily breadth observation. TradingView documents that requested higher-timeframe values can be developing and that gap handling can fill observations. Repeating a daily ratio across intraday bars and applying an EMA on every repetition changes the smoothing. An intraday chart-bar close does not confirm the daily breadth input.
- Start the audit on a daily chart. Compare A, D, R, E, setup date, elapsed sessions and the event marker with a separate calculation before adding intraday display or alerts.
- Use the actual availability time of final counts. A revised end-of-day value cannot justify an earlier trade that did not have that information.
- The A-D Line accumulates net advances; the McClellan Oscillator compares fast and slow breadth averages. Neither substitutes for this timed low-to-high transition.
- A confirmed event describes a change in participation, not a complete entry or exit rule. Evaluate exits, sizing, costs and price outcomes separately. This page makes no historical win-rate claim.
Give Pineify a specification with expected results
Ask the Pine Script AI Coding Agent to draft a detector after you identify usable breadth feeds. Supply the formula, daily confirmation policy, seed rule, clock convention and one-event-per-setup behavior. Include both the four-session arithmetic example and the day-11 rejection case so the generated logic has concrete checks.
- Request diagnostic outputs for the two counts, ratio, EMA, setup date and elapsed sessions, plus an unavailable state for missing data.
- Review the generated source, run syntax validation and compare completed observations in TradingView. Successful compilation does not verify the data universe or historical signal dates.
- Pineify can help write and revise code; it does not make unavailable exchange breadth feeds accessible or establish the profitability of this signal.