Skip to content

Commit 554c6b9

Browse files
author
Your Name
committed
first commit
1 parent b0c6376 commit 554c6b9

2 files changed

Lines changed: 26 additions & 1 deletion

File tree

examples/backtest_examples.livemd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Untitled notebook
1+
# Backtest examples
22

33
## Untitled notebook
44

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Strategy optimization examples
2+
3+
```elixir
4+
Mix.install([
5+
{:quant, "0.1.0-alpha.1"},
6+
{:explorer, "~> 0.11"},
7+
{:kino, "~> 0.12"},
8+
{:decimal, "~> 2.0"},
9+
{:kino_vega_lite, "~> 0.1.13"},
10+
{:vega_lite, "~> 0.1.11"}
11+
])
12+
```
13+
14+
## Section
15+
16+
```elixir
17+
{:ok, df} = Quant.Explorer.history("AAPL", provider: :yahoo_finance, period: "1y")
18+
param_ranges = %{fast_period: 5..20, slow_period: 20..50}
19+
{:ok, results} = Quant.Strategy.Optimization.run_combinations(df, :sma_crossover, param_ranges)
20+
```
21+
22+
```elixir
23+
# Find best parameters
24+
best = Quant.Strategy.Optimization.find_best_params(results, :total_return)
25+
```

0 commit comments

Comments
 (0)