Thanks for sharing, I realized this is actually close to something I want and that is way to tell how strong the difference is between a MA compared to recent history. This might help remove false-starts on MA (mostly MACD) indicators. I'm not quite sure what I'm looking for though. I can't just grab the median(x, length).
#Plot lines with differences between two moving averages
input price = close;
input sma1 = 9;
input sma2 = 26;
plot line1 = Average(price, sma1) - Average(price, sma2);
plot ZeroLine = 0;
plot Max = Highest(Average(price, sma1) - Average(price, sma2), sma2);
plot StrongUpSignal = if line1 equals Max
and line1 crosses Max
and price is greater than Zeroline
then ZeroLine else Double.NaN;
Hello, just joined this forum, finding it very helpful. Thank you all. I tried the search but not able to find an answer to this question. In ToS, is there a way to scan for stocks where two moving averages are x% apart. For example, if EMA 8 is 10% above EMA 21? I am finding that EMA doesn't always cross to give a momentum indication. Sometimes, it comes close and bounced up (or down) again. Thanks
Thanks tradegeek and FoofandFun, I will try those and see how they perform.