-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
>Legoux claimed the ALMA moving average was inspired significantly by >the Gaussian Filter and often compares his developed moving average >to the Hull Moving Average (HMA), which is said to be outperformed by >the ALMA in effectiveness and smoothness. I love the Hull Moving Average, so I had to see what ALMA had to offer. My initial impression is positive.
- Loading branch information
Showing
4 changed files
with
43 additions
and
1 deletion.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
denominated_price(alma::ALMA) = true | ||
|
||
"""$(TYPEDSIGNATURES) | ||
Return an lwc_line for visualizing an ALMA indicator. | ||
""" | ||
function visualize(alma::ALMA, opts::Union{AbstractDict,Nothing}, df::DataFrame) | ||
name = indicator_fields(alma)[1] | ||
start = findfirst(!ismissing, df[!, name]) | ||
kwargs = Dict( | ||
:label_name => "ALMA $(alma.period)", | ||
:line_color => "#5B9CF6", | ||
:line_width => 2 | ||
) | ||
if opts !== nothing | ||
merge!(kwargs, opts) | ||
end | ||
return lwc_line( | ||
df.ts[start:end], | ||
[df[!, name][start:end]...]; | ||
kwargs... | ||
) | ||
end |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using TechnicalIndicatorCharts | ||
|
||
@testset "ALMA" begin | ||
if !isdefined(Main, :sample_candles) | ||
include("helper/main.jl") | ||
end | ||
chart = Chart( | ||
"TEST", Minute(1), | ||
indicators=[ALMA{Float64}(;period=5)], | ||
visuals=[nothing] | ||
) | ||
candles = sample_candles() | ||
for c in candles | ||
update!(chart, c) | ||
end | ||
@test visualize(chart) isa Any | ||
# If it gets this far, we can instantiate, update, and visualize. | ||
end |