Moving Averages
Example
using Temporal, Indicators, Plots
X = quandl("CHRIS/CME_CL1", rows=252, sort='d')
x = cl(X)
x.fields[1] = :Crude
mafuns = [sma, ema, wma, trima]
m = hcat([f(x, n=40) for f in mafuns]...)
plot(x, linewidth=3, color=:black)
plot!(m, linewidth=2)
/home/travis/.julia/packages/GR/oiZD3/src/../deps/gr/bin/gksqt: error while loading shared libraries: libQt5Widgets.so.5: cannot open shared object file: No such file or directory
connect: Connection refused
GKS: can't connect to GKS socket application
Did you start 'gksqt'?
GKS: Open failed in routine OPEN_WS
GKS: GKS not in proper state. GKS must be either in the state WSOP or WSAC in routine ACTIVATE_WS
Reference
Indicators.alma
— Methodalma{T}(x::Array{T}; n::Int64=9, offset::T=0.85, sigma::T=6.0)::Array{T}
Arnaud-Legoux moving average (ALMA)
Indicators.dema
— Methoddema(x::Array{T}; n::Int64=10, alpha=2.0/(n+1), wilder::Bool=false)::Array{T}
Double exponential moving average (DEMA)
Indicators.ema
— Methodema(x::Array{T}; n::Int64=10, alpha::T=2.0/(n+1.0), wilder::Bool=false)::Array{T}
Exponential moving average (EMA)
Indicators.hma
— Methodhma(x::Array{T}; n::Int64=20)::Array{T}
Hull moving average (HMA)
Indicators.kama
— MethodKaufman adaptive moving average (KAMA)
Indicators.mama
— Methodmama(x::Array{T}; fastlimit::T=0.5, slowlimit::T=0.05)::Matrix{T}
MESA adaptive moving average (MAMA)
Indicators.mma
— Methodmma(x::Array{T}; n::Int64=10)::Array{T}
Modified moving average (MMA)
Indicators.sma
— Methodsma(x::Array{T}; n::Int64=10)::Array{T}
Simple moving average (SMA)
Indicators.swma
— MethodSine-weighted moving average
Indicators.tema
— Methodtema(x::Array{T}; n::Int64=10, alpha=2.0/(n+1), wilder::Bool=false)::Array{T}
Triple exponential moving average (TEMA)
Indicators.trima
— Methodtrima(x::Array{T}; n::Int64=10, ma::Function=sma, args...)::Array{T}
Triangular moving average (TRIMA)
Indicators.wma
— Methodwma(x::Array{T}; n::Int64=10, wts::Array{T}=collect(1:n)/sum(1:n))::Array{T}
Weighted moving average (WMA)
Indicators.zlema
— Methodzlema(x::Array{T}; n::Int=10, ema_args...)::Array{T}
Zero-lag exponential moving average (ZLEMA)