MarketTechnicals.jl
MarketTechnicals.jl copied to clipboard
Percentage Price Oscillator - PPO
https://www.investopedia.com/terms/p/ppo.asp
I would like to tackle this. Would something like below suffice?
Largely inspired by macd
.
function ppo(ta::TimeArray{T,N}, fast::Int=12, slow::Int=26, signal::Int=9; wilder::Bool=false) where {T,N})
x = ema(ta, fast, wilder=wilder)
y = ema(ta, slow, wilder=wilder)
dif = x .- y
sig = ema(ta, signal, wilder=wilder)
osc = dif ./ y .* 100
cols = ["ppo", "dif", "signal"]
new_cols = (N > 1) ? gen_colnames(ta.colnames, cols) : cols
merge(merge(osc, dif), sig, colnames=new_cols)
end
Just saw #114.
I guess we can revive #114, add some tests, and merge.
yeah, that's a good starting point.