Pine Script v5 · TradingView Indicator

Quarterly EPS
& Sales
at a Glance

A MarketSmith-inspired overlay indicator that surfaces earnings-per-share and revenue data directly on your chart — with YoY growth, QoQ momentum, analyst surprises, and forward estimates.

12 Quarters of History
2 Table Layouts
IBD Style Methodology
Free Open Source (MPL 2.0)
Live Table Preview
Quarterly EPS($) %Chg %Surp Sales($Mil) %Chg %Surp
Jun-25 est 3.62 +18% 94,200.0 +12%
Mar-25 3.07 +22% +4% 89,498.0 +15% +2%
Dec-24 2.98 +19% +6% 85,100.0 +11% +3%
Sep-24 2.51 +31% +8% 78,400.0 +18% +5%
Jun-24 2.52 +14% -2% 84,300.0 +9% 0%
Mar-24 2.51 +11% +3% 77,800.0 +7% +1%
Dec-23 2.50 +16% +5% 76,600.0 +8% +2%
Sep-23 1.92 +9% -1% 66,400.0 +6% 0%

Everything a Fundamental Trader Needs

Built on IBD/MarketSmith methodology. Pulls data directly from TradingView's financial APIs with intelligent fallback logic.

📊

Dual Table Layouts

Switch between a compact Weekly Table (up to 8 quarters in a column) and a wide HeadBand Table (4 quarters side-by-side, MarketSurge-style).

📈

YoY & QoQ Growth

Toggle between Year-over-Year and Quarter-over-Quarter percentage changes for both EPS and Sales. Color-coded positive/negative with ±999% cap.

🎯

Analyst Surprises

Beat or miss vs. consensus estimates shown as a separate %Surp column for both EPS and Sales, with independent color controls.

🔮

Forward Estimates

Next quarter's EPS and Sales estimates displayed at the top of the table, labeled est, so you always see what the market expects.

⬆️

Chart Arrows

Triangle markers placed at each earnings release bar, annotated with EPS % change (and optionally Sales %). Configurable size, color, and YoY/QoQ mode.

#

Hash Notation

When growth is calculated against a prior negative EPS, the result is prefixed with # — matching IBD's convention for turnaround situations.

💹

Gross Margin & ROE

Optional extra rows for Gross Margin and Return on Equity, giving a fuller picture of profitability quality alongside the headline numbers.

🎨

MarketSmith & MarketSurge Themes

One-click presets that replicate the exact color schemes of both platforms. Or fully customize every color, border, and background independently.

Input Parameters Reference

Every setting, what it controls, and its default value. Click a group to expand.

ParameterTypeDefaultDescription
Displays Arrows bool true Show/hide the triangle markers at each earnings bar on the chart.
Digits Only bool false When enabled, shows only the percentage text without the triangle shape.
Arrow QoQ bool false Switch arrow annotation from YoY to QoQ percentage change.
Sales bool false Append the Sales % change to the arrow label (e.g. +22% | +15%).
Arrow Size string "Small" Size of the arrow label. Options: Tiny, Small, Normal, Large.
Arrow Colors color Transparent Color of the triangle shape itself (separate from the text color).
%Pos color Blue Text color for positive EPS/Sales % change on arrows.
%Neg color Red Text color for negative EPS/Sales % change on arrows.

Two Table Modes

Choose the layout that fits your workflow. Switch instantly via the Type of Table setting.

Weekly / Vertical Table

The default layout. Displays up to 8 quarters (or 5 with "Less Quarters") stacked vertically, with the most recent quarter at the top. Ideal for weekly charts where you want a compact, always-visible summary.

  • ✓ Configurable screen position (9 options)
  • ✓ Optional forward estimate row
  • ✓ Up to 11 columns (EPS, %Chg, QoQ, %Surp, Sales, %Chg, QoQ, %Surp, GM, ROE, Date)
  • ✓ Alternating row colors for readability
  • ✓ Right-aligned numbers, left-aligned dates
QuarterlyEPS($)%Chg%SurpSales($Mil)%Chg%Surp
Jun-25 est3.62+18%94,200.0+12%
Mar-253.07+22%+4%89,498.0+15%+2%
Dec-242.98+19%+6%85,100.0+11%+3%
Sep-242.51+31%+8%78,400.0+18%+5%
Jun-242.52+14%-2%84,300.0+9%0%
Mar-242.51+11%+3%77,800.0+7%+1%
Dec-232.50+16%+5%76,600.0+8%+2%
Sep-231.92+9%-1%66,400.0+6%0%

Earnings Arrows

Triangle markers placed directly on the chart at each earnings release, annotated with the key growth metrics.

EPS
+22%
EPS & Sales
+31% | +18%
EPS
-8%

Arrow Configuration

YoY Mode default

Shows the Year-over-Year EPS % change. Compares current quarter to the same quarter one year prior — the IBD standard.

EPS +22%
QoQ Mode

Shows the Quarter-over-Quarter EPS % change. Useful for tracking sequential momentum.

EPS +8%
With Sales

Appends the Sales % change after a pipe separator. Both EPS and Sales growth visible at a glance.

EPS & Sales +22% | +15%
Digits Only

Removes the triangle shape, showing only the text annotation. Cleaner look on busy charts.

+22%

Data & Methodology

EPS Data Sources

The indicator requests three EPS series from TradingView: actual (reported), standardized (adjusted), and estimate. When actual is unavailable, standardized is used as fallback — matching MarketSmith's approach.

Change Detection

Earnings events are detected by monitoring when any of the three EPS series changes value. Using ta.barssince() with a compound condition reduces false negatives when consecutive quarters report identical EPS.

Sales Growth Correction

TradingView sometimes returns stale REVENUE_ONE_YEAR_GROWTH values. The indicator detects this by comparing consecutive growth values and recalculates from raw revenue figures when a mismatch is found.

Hash (#) Notation

When EPS growth is calculated against a prior negative EPS, the result is mathematically valid but directionally misleading. The # prefix flags these cases, following IBD convention. Toggle Remove # to hide it.

Sales Scale

Sales are displayed in millions by default. When revenue exceeds $10 billion, the indicator automatically switches to billions and updates the column header from Sales($Mil) to Sales($Bil).

Duplicate Detection

A sameSales flag detects when TradingView returns the same sales figure as the prior quarter (a known API bug). Affected cells are blanked to avoid displaying stale data.

Pine Script Source

The full indicator source. Licensed under the Mozilla Public License 2.0.

Pine Script v5 ~650 lines © Fred6724