Created
February 18, 2014 03:08
-
-
Save milktrader/9063995 to your computer and use it in GitHub Desktop.
MACD code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function macd{T}(ta::TimeArray{T,1}, fast::Int, slow::Int, signal::Int) | |
fastma = ema(ta, fast) | |
slowma = ema(ta, slow) | |
mcdval = fastma - slowma | |
sigval = ema(mcdval, signal) | |
merge(mcdval, sigval, ["macd", "signal"]) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hmm, probably the most descriptive code to match algorithm would be this