 # Which earnings column is most accurate? EPS and GetActualEarnings returns two different value?

#### jngy2k

##### Member
Code:
``````def AECont = if IsNaN(GetActualEarnings()) then AECont  else GetActualEarnings();
plot Earnings = if AECont <> 0 then AECont else Double.NaN;``````

This is the code for a column on the scan to get earnings of latest earnings.
TOS also has fundamental columns where "EPS" is available AND a "Earnings Per Share 'period - current'" column is available.

They ALL return different values. Isn't EPS the last earnings the same?

My strat plan on trading only stocks with higher earnings than those that don't.

Anyone know which is most reliable?

Last edited:

#### BenTen

Staff member
Staff
VIP
The EPS column could be a different indicator, and it may have nothing to do with earnings at all. I would stick with Earnings Per Share.

#### jngy2k

##### Member
hey @BenTen i found out by comparing to finviz that EPS is EPS(ttm).
Btw what should i do with the code
if i wanted to compare earnings of last earnings to the previous earnings aecont ?
i got this but it won't work.
The math formula is correct though.
Code:
``````def AECont = if IsNaN(GetActualEarnings()) then AECont  else GetActualEarnings();
def qoqpercent = 100*(aecont / aecont -1);
plot earnings = qoqpercent;``````

#### jngy2k

##### Member
@BenTen
i loooked through it and figured out how to define the earnings before the last as well as the last earnings :

Code:
``````def new = if IsNaN(GetActualEarnings()) then new else GetActualEarnings();
def old = if IsNaN(GetActualEarnings()) then old else GetActualEarnings();``````

i also know the formula for %change
but if the old earnings value is negative or 0
the plot value is a Error
so i have if then else statements for when old earnings is 0 or negative
and now need help putting the if then else statements together

what i have but don't know how to get it to work togther
the math is right
Code:
``````def QoQpercent =
if old is - then
100*((new-old)/absvalue(old))
and if old = 0 then
100*new;
else  100*((new-old)/old);

plot earnings = QoQpercent;``````

edit: i shortened the code to only use absolute values of the denominator old since
if denominator old was positive it will be a mute point
Code:
``````def QoQpercent =
if old = 0 then
100*new;
else
100*((new-old)/absvalue(old));

plot earnings = QoQpercent;``````

Last edited:

#### jngy2k

##### Member
Code:
``````def new = if IsNaN(GetActualEarnings()) then new else GetActualEarnings();
def old = if IsNaN(GetActualEarnings()) then old else GetActualEarnings();

def qoqpercent = if old==0 then 100*new else 100*((new-old)/absvalue(old));

plot earnings = qoqpercent;``````

got it to work but problem is with TOS
sometimes TOS doesn't grab the earnings for most recent
even though it is shown on the graph
when it does grab the earnings whether negative or positive
the formula will work correctly

• BenTen