measure the spread between two MA periods
Author: marchus
Creation Date: 1/12/2009 5:30 AM
profile picture

marchus

#1
Is there any way of measuring the spread between two MA periods. If the short ma is farther away from the long MA (SMA) its given a higher rank , number then the once having the two MA periods closer ?
profile picture

Eugene

#2
Sure, it's called MACD.
profile picture

Cone

#3
The standard MACD is approximated by the difference between the 12 and 26 EMAs, the actual exponents used in MACD make for a slightly different calculation.

Anyway, marchus, for the spread, just take the difference between the two moving averages -
CODE:
Please log in to see this code.
profile picture

Eugene

#4
I know, I know :) But I couldn't resist since there's a known tendency to invent indicators anyway (like Williams %R which is simply an inverted Stochastic).
profile picture

Cone

#5
yah, I never knew how he got away with that either ;)
profile picture

marchus

#6
Sorry did it again, Im using wld 4, will the code for fetching the data described be different ?
profile picture

Cone

#7
Use SubtractSeries.
profile picture

Eugene

#8
QUOTE:
Im using wld 4


Marchus, pardon my curiosity but are you a registered customer?
profile picture

marchus

#9
yes
profile picture

marchus

#10
but not for the WLD.NET platform just earlier version
profile picture

Eugene

#11
The reason for my curiosity is that neither VK (in an old support portal ticket) nor me were able to find a customer with credentials similar to "Marchus Wagenberg". Nevertheless, you enjoyed our support and the support from the Wealth-Lab community with hundreds of daily questions through the years. This is where it ends.