Indicator · Pine Script v5 · On the chart

Diluted EPS Signal

by regalouisei· code credited to AstrideUnicorn

This indicator tracks fundamental earnings data directly on the price chart.

View on GitHub

GitHub stars2on the repository
Pine versionv5runs as is
Lines of code32
Settings1inputs
LicenceNone statedfile: MPL-2.0
Last update8 months ago25 Feb 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above, or the copy button on the code below.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.

Source Code

32 lines of Pine Script v5 from pinescript/editors_picks/diluted-earnings-per-share-signal-astrideunicorn.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.

diluted-earnings-per-share-signal-astrideunicorn.pine
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © AstrideUnicorn

//@version=5
indicator('Diluted EPS Signal', shorttitle='DEPSS' ,overlay=true)

// Input earnings surprise thershold
threshold1 = input.float(defval=20, title='Earnings Surprise Threshold (%)', step=0.01)

// Get Eanings Per Share Estimate and Earnings Per Share Diluted
EPS_estimate = request.earnings(syminfo.tickerid, earnings.estimate)
EPS_diluted = request.financial(syminfo.tickerid, 'EARNINGS_PER_SHARE_DILUTED', 'FQ')

// Convert percentafe value of the treshold to a decimal one
threshold = threshold1/100

// Calcuate the absolute value of eranings suprise
absolute_earnings_surprise = math.abs((EPS_diluted - EPS_estimate) / EPS_estimate)

// Condition that determines if the current earnings signal is significant
significant = absolute_earnings_surprise >= threshold

// Define BUY and SELL signals
buy_signal = EPS_diluted - EPS_estimate >= 0 and significant
sell_signal = EPS_diluted - EPS_estimate < 0 and significant

// Calculate eranings date
Earnings_date = ta.barssince(EPS_estimate - EPS_estimate[1] != 0) == 0

// plot signal arrows
plotshape(Earnings_date and buy_signal, style=shape.triangleup, color=color.new(color.green, 0), location=location.belowbar, size=size.normal)
plotshape(Earnings_date and sell_signal, style=shape.triangledown, color=color.new(color.red, 0), location=location.abovebar, size=size.normal)

Overview

Diluted EPS Signal retrieves consensus earnings-per-share estimates and reported diluted EPS using financial data requests. When a new earnings report is detected, it calculates the percentage surprise. If the absolute surprise meets or exceeds the user-defined threshold, it plots a green upward triangle for positive earnings surprises or a red downward triangle for negative surprises. It relies strictly on equity earnings release bars.

Details

Published by

regalouisei on GitHub

Code credit

AstrideUnicorn, as written in the script's header

Type

Indicator, Pine Script v5

Draws

On the price chart

Markets

Stocks

Timeframes

H4 and above

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
Earnings Surprise Threshold (%)float20threshold1
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

948 stars

The Adaptive Laguerre Filter calculates a smoothed, dynamically adjusted trendline plotted directly on the main price chart. It dynamically adjusts its damping factor (alpha) based on recent price range variations and median percentile calculations over a spec

Indicator v4 TrendMoving averages
Updated 10 days ago · GPL-3.0 GitHub repository of Adaptive Laguerre Filter
575 stars

The indicator plots ICT displacement candles on the price chart and can switch to retracement scanning. Displacement requires a move larger than a set share of the 14-bar average high-low range, lasting at least a chosen number of bars, with optional close, pr

Indicator v6 SMC / ICT / price actionCandlestick patterns
Updated 1 year ago · MPL-2.0 GitHub repository of ICT Displacement Candles Indicator
330 stars

This script plots three moving averages on the price chart: a fast EMA or SMA with 10 periods, a slow EMA or SMA with 20 periods, and a trend EMA or SMA with 100 periods. It signals trend changes by drawing a white cross when the fast moving average crosses ab

Indicator v4 TrendMoving averages
Updated 2 months ago · None stated GitHub repository of 3 EMA/SMA + Cross [Alorse]
318 stars

This indicator calculates an ATR trailing stop line derived from the highest high minus an average true range multiple over a specified lookback period. It plots the trailing stop line directly on the price chart and colors price bars based on whether the clos

Indicator v5 TrendVolatility & bands
Updated 2 months ago · MIT GitHub repository of ATR Trailing Stoploss

1833 Tracker

by Allen1212
303 stars

1833 Tracker is an overlay indicator that visualizes historical buy and sell transactions executed by ARK Invest ETFs for the stock on the main price chart. It displays trade dates using green buy and red sell labels positioned relative to price bars, indicati

Indicator v4
Updated 2 years ago · None stated GitHub repository of 1833 Tracker

More indicators

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers