Skip to content

Commit

Permalink
Default to LWC_LOGARITHMIC
Browse files Browse the repository at this point in the history
  • Loading branch information
g-gundam committed Aug 22, 2024
1 parent b5fabc4 commit cbd62f7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/visualize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ function visualize(srsi::StochRSI, opts, df::DataFrame)
)
d_kwargs = merge(d_defaults, opts[:d])
d_start = findfirst(!ismissing, df[!, :stochrsi_d])
@info "start" k_start d_start
#@info "start" k_start d_start
k = replace_missing_with(0, df[!, :stochrsi_k])
#k = Padded(df[!, :stochrsi_k])
d = replace_missing_with(0, df[!, :stochrsi_d])
Expand Down Expand Up @@ -199,7 +199,7 @@ end
Return an LWCLayout that visualizes all the components in chart appropriately.
"""
function visualize(chart::Chart; min_height=550)
function visualize(chart::Chart; min_height=550, mode=LWC_LOGARITHMIC)
opts = Dict(
:label_name => "$(chart.name) $(abbrev(chart.tf))",
:up_color => "#52a49a",
Expand All @@ -215,12 +215,14 @@ function visualize(chart::Chart; min_height=550)
for (p, d) in zip(plots, denom) # If there's a better way, let me know.
ismissing(p) && continue
if d == 1
# denominated in price -- I couldn't use polymorphism here.
if typeof(p) <: Vector
push!(plots_price, p...)
else
push!(plots_price, p)
end
else
# not denominated in price
push!(plots_other, p)
end
end
Expand All @@ -229,7 +231,8 @@ function visualize(chart::Chart; min_height=550)
# indicators denominated in price all go in one panel along with the candlesticks.
lwc_panel(
candlesticks,
plots_price...
plots_price...;
mode
),
# indicators that are not denominated in price get their own panel.
make_panel.(plots_other)...;
Expand Down

0 comments on commit cbd62f7

Please sign in to comment.