Skip to content

Commit 1a4aa73

Browse files
committed
Add sample config file for object type inputs.
1 parent 1d9717f commit 1a4aa73

File tree

5 files changed

+78
-16
lines changed

5 files changed

+78
-16
lines changed

R/Simulation.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
#' data(sample_inputs)
1616
#'
1717
#' # Load sample configuration file
18-
#' config_file <- system.file("application/strategy_config.yaml", package = "strand")
18+
#' config_file <- system.file("application/strategy_config_obj.yaml", package = "strand")
1919
#'
20-
#' Create the Simulation object and run
20+
#' # Create the Simulation object and run
2121
#' sim <- Simulation$new(config_file,
2222
#' raw_input_data = sample_inputs,
2323
#' raw_pricing_data = sample_pricing,

README.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ data(sample_pricing)
4545
data(sample_inputs)
4646
4747
# Load sample configuration file
48-
config_file <- system.file("application/strategy_config.yaml", package = "strand")
48+
config_file <- system.file("application/strategy_config_obj.yaml", package = "strand")
4949
5050
# Create the Simulation object and run
5151
sim <- Simulation$new(config_file,

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ data(sample_pricing)
5959
data(sample_inputs)
6060

6161
# Load sample configuration file
62-
config_file <- system.file("application/strategy_config.yaml", package = "strand")
62+
config_file <- system.file("application/strategy_config_obj.yaml", package = "strand")
6363

6464
# Create the Simulation object and run
6565
sim <- Simulation$new(config_file,
@@ -73,16 +73,16 @@ sim$overallStatsDf()
7373
```
7474

7575
## Item Gross Net
76-
## 1 Total P&L 913 -3,177
77-
## 2 Total Return on GMV (%) 0.0 -0.2
78-
## 3 Annualized Return on GMV (%) 0.5 -1.8
79-
## 4 Annualized Vol (%) 0.5 0.6
80-
## 5 Annualized Sharpe 1.10 -3.15
81-
## 6 Avg GMV 1,999,714
82-
## 7 Avg NMV 55
83-
## 8 Avg Count 402
84-
## 9 Avg Daily Turnover 112,711
85-
## 10 Holding Period (months) 1.7
76+
## 1 Total P&L 419 -2,507
77+
## 2 Total Return on GMV (%) 0.0 -0.1
78+
## 3 Annualized Return on GMV (%) 0.5 -3.2
79+
## 4 Annualized Vol (%) 0.5 0.7
80+
## 5 Annualized Sharpe 1.12 -4.61
81+
## 6 Avg GMV 1,999,350
82+
## 7 Avg NMV 73
83+
## 8 Avg Count 403
84+
## 9 Avg Daily Turnover 220,439
85+
## 10 Holding Period (months) 0.9
8686

8787
### Docker demo
8888

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
from: 2019-01-02
2+
to: 2019-01-15
3+
name: shiny_sim
4+
turnover_limit: 25e3
5+
solver: glpk
6+
strategies:
7+
strategy_1:
8+
in_var: alpha_1
9+
strategy_capital: 1e6
10+
ideal_long_weight: 1
11+
ideal_short_weight: 1
12+
position_limit_pct_adv: 30
13+
position_limit_pct_lmv: 0.5
14+
position_limit_pct_smv: 0.5
15+
trading_limit_pct_adv: 5
16+
constraints:
17+
factor_1:
18+
type: factor
19+
in_var: factor_1
20+
upper_bound: 0.03
21+
lower_bound: -0.01
22+
factor_2:
23+
type: factor
24+
in_var: factor_2
25+
upper_bound: 0.01
26+
lower_bound: -0.01
27+
factor_3:
28+
type: factor
29+
in_var: factor_3
30+
upper_bound: 0.01
31+
lower_bound: -0.01
32+
factor_4:
33+
type: factor
34+
in_var: factor_4
35+
upper_bound: 0.01
36+
lower_bound: -0.01
37+
category_1:
38+
type: category
39+
in_var: category_1
40+
upper_bound: 0.02
41+
lower_bound: -0.02
42+
simulator:
43+
fill_rate_pct_vol: 4
44+
transaction_cost_pct: 0.1
45+
financing_cost_pct: 1
46+
calculate_exposures:
47+
category_vars: category_1
48+
factor_vars: [factor_1, factor_2, factor_3, factor_4]
49+
input_data:
50+
type: object
51+
track_metadata: [factor_1, factor_2, factor_3, factor_4]
52+
pricing_data:
53+
type: object
54+
columns:
55+
close_price: price_unadj
56+
prior_close_price: prior_close_unadj
57+
adjustment_ratio: adjustment_ratio
58+
volume: volume
59+
dividend: dividend_unadj
60+
distribution: distribution_unadj
61+
secref_data:
62+
type: object

man/Simulation.Rd

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)