If I’m reading this right, the condition that you described – the highest slope – would be the greatest difference between the EPS four quarters ago and the most recent quarter, expressed as a ratio. If a>b and b>c and c>d, and you wanted to get the maximum distance between each of them, then you’d just like the difference between a and d.
That would simply be:
(EPSExclXor(0,TTM)-EPSExclXor(4,TTM))/abs(EPSExclXor(4,TTM))
By using abs, you’re eliminating the problem of negative earnings. This is, by the way, fundamentally the same as the existing factor EPS%ChgTTM.
There is no particular reason that you couldn’t do it for the last 20 quarters, though, if you use the formulas.
(EPSExclXor(0,TTM)-EPSExclXor(20,TTM))/abs(EPSExclXor(20,TTM))
These are the terms that you’d rank on.
If you want to ensure that a company never backsteps in those 20 quarters, you’d use this rule:
LoopSum("EPSExclXor(CTR,TTM)>EPSExclXor(CTR+1,TTM)",20)=20
It is simply counting the number of prior quarters that are higher than the quarter beforehand.
I would note that this approach eliminates anything that’s regularly seasonal. For example, no retail company will ever pass (because Q4 is usually much higher than Q1).