macjoe11 1 posts msg #159788 - Ignore macjoe11 |
11/17/2022 7:22:05 AM
Can anyone suggest a filter phrase where the difference between two moving averages is less than a percentage of the greater moving average? e.g. 34dMA minus 21dMA is less than, say, 0.5% of the 34dMA?
Thanks.
|
glgene 616 posts msg #159791 - Ignore glgene |
11/17/2022 3:30:35 PM
Try this. If I have misread your desired output, simply switch the ma(34) and ma(21) in the calculation.
-- Gene in FL
|
xarlor 587 posts msg #159792 - Ignore xarlor |
11/17/2022 3:31:54 PM
|
glgene 616 posts msg #159793 - Ignore glgene |
11/18/2022 8:00:12 AM
Macjoe … The reason I chose my approach of (/) instead of (-) to your question is because a $2.00 “diff” on a $10 stock is not the same as a $2.00 “diff” on a $100 stock or a $2.00 “diff” on a $1,000 stock. By dividing the ema(34) and ema(21) numbers, it equalizes the “diff” to a percentage (%) comparison.
For example, on 11/17/2022, MSFT comes in first at 100.34. That means the “% diff” is +0.34%. AAPL is 98.90, which means the “% diff” is actually -1.10% (98.90 - 100.00). Remember: 100.00 is 100% parity (where both ema(34) and ema(21) are identical numbers). 100.00 is the starting point.
Using (/) in the equation makes the result a “Relative Moving Average.” Which means you can sort on that column (which I did, as you can see) … from highest to lowest.
I added 1 day ago, 5 days ago, 10 days ago and 1 month (21 days) ago … so you can readily view if a stock’s ema(34) vs. ema(21) comparison is improving or getting worse.
Again — from my original post, you may (if I misread your question) want to change the equation by switching the order of ema(34) and ema(21) in the calculation equation.
Hope this helps. I welcome your feedback.
Gene in FL
|