Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change httype to symbol #129

Merged
merged 4 commits into from
Jun 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Backtest/strategies/FALM.jl
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function falm_initialize!(
transactionCost::Real=0.02, # Transaction cost
currency::String="FEX/USD", # Currency to use
forecaster::Forecaster=LinearForecaster(1; reparameterise_window=0), # Forecasting function
httype::Int=1, # 1: Weighted Average holding time, 2: Minimum holding time
httype::Symbol=:average, # 1: Weighted Average holding time, 2: Minimum holding time
min_alloc_threshold::Float64=0.7,
min_returns_threshold::Float64=0.0002,
)
Expand Down Expand Up @@ -232,7 +232,7 @@ function compute_portfolio!(context::ContextTypeA; data=DataFrame())
)
end

if context.extra.httype == 1
if context.extra.httype == :average
# Weighted Average Holding time
context.extra.htcounter = round(Int, holding_time)
else
Expand Down
Loading