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.

Expanding moving averages

I have looked a little and I can't find anything. Is there a code already written or a simple code for the separation between two moving averages expanding or contracting? Example, the two moving averages that I want to experiment with are the daily SMA(14) and the daily SMA(20) either growing farther apart or contracting closer together. I would like to see how that compares to the daily MACD Fline and signal line converging or diverging.

Comments

  • If you are OK with ema instead of sma, MACD Line(12,26,1) is the difference between the two emas. On the chart, MACD(12,26,1) plots just one line, not two. So that line is the difference between the two emas. Thats because the ema 1 of Line is the same value as Line.

    But, if you change the 1 to a 9, you get the ema 9 of MACD Line, which is the Signal line, and is either above (more) or below (less) than Line (except rarely they might come out equal). That difference between Line and Signal is plotted with MACD Hist bars above and below zero.

    If you want sma, as far as I know there is no indicator that will show the difference as a line. Unfortunately there is no "Hist" for the smas either. But the difference wouldn't be that much most of the time.

    You can SEE the difference on the chart (obviously) just by plotting ema 14 and sma 14, and ema 20 and sma 20.

    If you wanted to scan for the differences between emas and between sma, it could be done but it would be pretty lengthy and maybe not too fruitful as a trading signal.
  • Thank you. I have another of my thousands of ideas that I'd like to study for a while. I am interested in SMA's not EMA's for this one. I may be able to just write out sma14 - sma 20 > 1 day ago or some such thing.
Sign In or Register to comment.