The fields request.earnings can return: earnings.actual, earnings.estimate and earnings.standardized (the surprise).
earnings.actual, earnings.estimate and earnings.standardized go in the field argument of request.earnings. earnings.actual is the reported earnings per share. earnings.estimate is the analysts' consensus. earnings.standardized is the surprise: the actual figure measured against the estimate, in standard deviations of past estimate errors.
Earnings arrive on the report date, so with gaps on the series is na on every other bar.
Constants
| Name | Value | Description |
|---|---|---|
earnings.actual | Reported earnings per share. | |
earnings.estimate | Analysts' consensus earnings estimate. | |
earnings.standardized | The surprise, in standard deviations of past estimate errors. |
Remarks
- Not every symbol has earnings data; funds, forex and crypto return na throughout.
- On Sidechair:
request.earningsis not supported yet; it warns once and returns na.
Example
//@version=6
indicator("Earnings")
actual = request.earnings(syminfo.tickerid, earnings.actual, barmerge.gaps_on)
estimate = request.earnings(syminfo.tickerid, earnings.estimate, barmerge.gaps_on)
plot(actual, "Actual", color.green, style = plot.style_circles, linewidth = 4)
plot(estimate, "Estimate", color.orange, style = plot.style_circles, linewidth = 4)
plot(close, "Close", color.gray)See also
Runs on Sidechair