Skip to content

Commit

Permalink
Merge pull request #15 from dysonance/femtotrader-patch-1
Browse files Browse the repository at this point in the history
Update paramset.jl
  • Loading branch information
dysonance authored Apr 25, 2018
2 parents 2961c15 + c52cf1b commit 133b58f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/paramset.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function get_n_runs(ps::ParameterSet)::Int
return n_runs
end

function get_param_combos(ps::ParameterSet, n_runs::Int=get_n_runs(ps))::Matrix
function get_param_combos(ps::ParameterSet; n_runs::Int=get_n_runs(ps))::Matrix
combos = Matrix{Any}(n_runs, ps.n_args)
P = 1
for j in 1:ps.n_args
Expand Down
4 changes: 2 additions & 2 deletions src/strategy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ function optimize(strat::Strategy; samples::Int=0, seed::Int=0, verbose::Bool=tr
else
samples = n_runs
end
combos = get_param_combos(strat.indicator.paramset, n_runs)[idx_samples,:]
combos = get_param_combos(strat.indicator.paramset, n_runs=n_runs)[idx_samples,:]
result = zeros(samples)
for (run, combo) in enumerate(idx_samples)
verbose ? println("Run $run/$samples") : nothing
Expand All @@ -137,7 +137,7 @@ function optimize!(strat::Strategy; samples::Int=0, seed::Int=0, verbose::Bool=t
else
samples = n_runs
end
combos = get_param_combos(strat.indicator.paramset, n_runs)[idx_samples,:]
combos = get_param_combos(strat.indicator.paramset, n_runs=n_runs)[idx_samples,:]
strat.results.optimization = zeros(samples,1)
for (run, combo) in enumerate(EachRow(combos))
verbose ? println("Run $run/$samples") : nothing
Expand Down

0 comments on commit 133b58f

Please sign in to comment.