GetActualEarnings

GetActualEarnings ();

Description

Returns actual earnings for the current symbol.

Example 1

declare lower;
def AECont = if IsNaN(GetActualEarnings()) then AECont [1] else GetActualEarnings();
plot DilutedEarnings = if AECont <> 0 then AECont else Double.NaN;

The example draws values of diluted earnings for the current symbol. Values between earnings are saved using the AECont variable.

Example 2

declare lower;
def AE = if IsNaN(GetActualEarnings()) then 0 else GetActualEarnings();
plot EPS_TTM = Sum(AE, 252);
def pe = close / EPS_TTM;
AddLabel(yes, "P/E Ratio: " + pe);

The code draws values of diluted earnings for approximately twelve months. Also it shows the current Price-Earnings Ratio in the chart label. Note that this example works only for daily charts because it uses an assumption that there are 252 daily bars in a year.