Skip to content

earnings - PineScript Variable

The earnings record provides forward-looking fundamentals for the next scheduled earnings report of the chart’s symbol. Fields populate when TradingView has data from corporate filings or analyst estimates.

FieldTypeDescription
earnings.future_epsseries floatEstimated earnings per share for the next report.
earnings.future_revenueseries floatEstimated total revenue for the upcoming report.
earnings.future_period_end_timeseries intUNIX timestamp (ms) marking the end of the financial period being reported.
earnings.future_timeseries intUNIX timestamp (ms) of the expected earnings announcement.
  • Values are fetched once when the script loads and remain unchanged until the script recalculates.
  • Fields return na if no projection is available for the instrument.
  • For historical analysis, use request.earnings() to retrieve past values across time.
//@version=5
indicator("Earnings tracker", overlay=false, max_labels_count=1)
if not na(earnings.future_time)
daysUntilReport = (earnings.future_time - timenow) / 1000 / 86400
plot(daysUntilReport, "Days until earnings", color=color.teal)
if barstate.islast
label.new(bar_index, daysUntilReport,
text = "Next EPS est: " + str.tostring(earnings.future_eps, "#.##"),
bgcolor = color.new(color.teal, 70),
textcolor = color.white)
else
plot(na, "Days until earnings")