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.
0
Comments
I think I've recommended this before: put $SPX in your list(s) and rank the list by your choice of performance measurement. Symbols appearing above $SPX are outperforming. If you save the results to CSV files daily, you can compare, day by day, which symbols are moving up and down, including, which are crossing above or below $SPX. More work, but might be worth it.
Rank By [PctRelative(12,$spx)] // is probably a good bet.
As to your original question, I've never had it work using the MA. A multiplier might work like PctRelative > 21 days ago PctRelative * 1.12 but still not exactly what you are looking for.
Creating a list with the Relation symbols of interest might also be of value to you. This list can be viewed in Summary view to see how it's changed over time. Also you can use that list in scans as you see fit. So your list would have the AAPL:$SPX, GOOG:$SPX, etc. or whatever relationship you would like to view.