New Members: Be sure to confirm your email address by clicking on the link that was sent to your email inbox. You will not be able to post messages until you click that link.
Performance Relative to an Index
I want to set up a scan that looks at when the ratio of a stock price vs $SPX crosses above the 12DEMA of the ratio. Basically trying to capture which stocks start outperforming $SPX over a 12D lookback period.
For example, AAPL:$SPX x EMA(12, AAPL:$SPX).
However, I believe ratios are not allowed in scans. Best alternative is probably PctRelative.
I have tried several different values of a and b parameters in PctRelative(a,$SPX) x EMA(b, PctRelative(a,$SPX)). Can't get the same results as the ratio when i look at the charts of stocks from the scan results. I want the crossing point to be captured by the scan but i get it either before or after.
Can the correct parameters be mathematically derived? If there is a way, it would give me flexibility to try other lookback periods without a lot of trial and error for each lookback period.