forked from robcarver17/pysystemtrade
-
Notifications
You must be signed in to change notification settings - Fork 0
/
defaults.yaml
278 lines (278 loc) · 6.83 KB
/
defaults.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
# YAML
#
# PRODUCTION STUFF
#
#
## Strategy configuration
# This won't actually work unless you have a strategy called example.. so don't uncomment use as a template
#strategy_list:
# example:
# load_backtests:
# object: sysproduction.strategy_code.run_system_classic.runSystemClassic
# function: system_method
# reporting_code:
# function: sysproduction.strategy_code.report_system_classic.report_system_classic
#
# Allocate capital to strategies
# strategy_weights *must* be defined in private config
strategy_capital_allocation:
function: sysproduction.strategy_code.strategy_allocation.weighted_strategy_allocation
# strategy_weights:
# example: 100.0
#
## Where do we save backtests
backtest_store_directory: 'backtests'
#
# And backups
csv_backup_directory: 'data.backups_csv'
mongo_dump_directory: 'data.mongo_dump'
echo_directory: 'data.echos'
#
# Interactive brokers
ib_ipaddress: 127.0.0.1
ib_port: 4001
ib_idoffset: 100
#
# Mongo DB
mongo_host: 127.0.0.1
mongo_db: 'production'
# DO NOT CHANGE THIS VALUE!!!! IT WILL SCREW UP ARCTIC. If you need to use a port other than 27017, use the url
# format for mongo_host, eg mongodb://127.0.0.1:27018
mongo_port: 27017
#
# Needs to be consistent with what you are using in crontab
echo_extension: '.txt'
# Spike checker
max_price_spike: 8
#
# Price frequency (we collect daily data, and separately this frequency
intraday_frequency: H
#
# Capital calculation
production_capital_method: 'full'
#
# BACKTESTING STUFF
#
# Raw data
#
volatility_calculation:
func: "sysquant.estimators.vol.robust_vol_calc"
days: 35
min_periods: 10
vol_abs_min: 0.0000000001
vol_floor: True
floor_min_quant: 0.05
floor_min_periods: 100
floor_days: 500
#
# forecast capping and scaling
# fixed values
#
forecast_scalar: 1.0
#
# with varying stuff
#
#
instruments_with_threshold: []
use_forecast_scale_estimates: False
#
forecast_scalar_estimate:
pool_instruments: True
func: "sysquant.estimators.forecast_scalar.forecast_scalar"
window: 250000
min_periods: 500
backfill: True
#
# capping
forecast_cap: 20.0
#
average_absolute_forecast: 10.0
#
#
# forecast combination
#
forecast_div_multiplier: 1.0
#
use_forecast_div_mult_estimates: False
#
forecast_correlation_estimate:
pool_instruments: True
func: sysquant.estimators.pooled_correlation.pooled_correlation_estimator
frequency: "W"
date_method: "expanding"
using_exponent: True
ew_lookback: 250
min_periods: 20
cleaning: True
rollyears: 20
floor_at_zero: True
forward_fill_data: True
#
forecast_div_mult_estimate:
func: sysquant.estimators.diversification_multipliers.diversification_multiplier_from_list
# this moving average is in business day space to smooth jumps
ewma_span: 125
dm_max: 2.5
#
use_forecast_weight_estimates: False
#
forecast_cost_estimates:
use_pooled_costs: False
use_pooled_turnover: True
#
# Smooth forecast weights; weights are in business days
forecast_weight_ewma_span: 125
#
# Set this to 0.13 to enforce the speed limit even for fixed weights or
# regardless of what an estimator does
forecast_post_ceiling_cost_SR: 999
#
forecast_weight_estimate:
func: sysquant.optimisation.generic_optimiser.genericOptimiser
pool_gross_returns: True
equalise_gross: False
cost_multiplier: 2.0
apply_cost_weight: False
ceiling_cost_SR: 9999
frequency: "W"
date_method: "expanding"
rollyears: 20
method: handcraft
cleaning: True
equalise_SR: False
ann_target_SR: 0.5
equalise_vols: True
shrinkage_SR: 0.9
shrinkage_corr: 0.5
correlation_estimate:
func: sysquant.estimators.correlation_estimator.correlationEstimator
using_exponent: True
ew_lookback: 50000
min_periods: 10
cleaning: False
floor_at_zero: False
mean_estimate:
func: sysquant.estimators.mean_estimator.meanEstimator
using_exponent: True
ew_lookback: 50000
min_periods: 5
vol_estimate:
func: sysquant.estimators.stdev_estimator.stdevEstimator
using_exponent: True
ew_lookback: 50000
min_periods: 5
#
# Capital correction
#
percentage_vol_target: 16.0
notional_trading_capital: 1000000
base_currency: "USD"
capital_multiplier:
func: syscore.capital.fixed_capital
#
# Portfolio creation
#
instrument_div_multiplier: 1.0
#
use_instrument_div_mult_estimates: False
#
instrument_correlation_estimate:
func: sysquant.estimators.correlation_over_time.correlation_over_time_for_returns
frequency: "W"
date_method: "expanding"
using_exponent: True
ew_lookback: 250
min_periods: 20
cleaning: True
rollyears: 20
floor_at_zero: True
forward_fill_price_index: True
#
instrument_div_mult_estimate:
func: sysquant.estimators.diversification_multipliers.diversification_multiplier_from_list
# smooth IDM in daily space
ewma_span: 125
dm_max: 2.5
#
use_instrument_weight_estimates: False
#
# smooth weights they will are in daily space
instrument_weight_ewma_span: 125
#
instrument_weight_estimate:
func: sysquant.optimisation.generic_optimiser.genericOptimiser
method: handcraft
frequency: "W"
equalise_gross: False
cost_multiplier: 1.0
apply_cost_weight: False
date_method: "expanding"
rollyears: 20
cleaning: True
equalise_SR: True
ann_target_SR: 0.5
equalise_vols: True
shrinkage_mean: 1.00
shrinkage_corr: 0.50
monte_runs: 100
correlation_estimate:
func: sysquant.estimators.correlation_estimator.correlationEstimator
using_exponent: True
ew_lookback: 500000
min_periods: 10
floor_at_zero: False
cleaning: False
mean_estimate:
func: sysquant.estimators.mean_estimator.meanEstimator
using_exponent: True
ew_lookback: 50000
min_periods: 5
vol_estimate:
func: sysquant.estimators.stdev_estimator.stdevEstimator
using_exponent: True
ew_lookback: 50000
min_periods: 5
#
# buffering / position inertia
buffer_method: position
buffer_size: 0.10
buffer_trade_to_edge: False
# costs and accounting
use_SR_costs: True
#
# risk overlay
risk_overlay:
max_risk_fraction_normal_risk: 2.0
max_risk_fraction_correlation_risk: 4.0
max_risk_fraction_stdev_risk: 6.0
#
# small system optimisation
small_system:
instrument_returns_correlation:
func: sysquant.estimators.correlation_over_time.correlation_over_time_for_returns
interval_frequency: "1M"
frequency: "W"
date_method: "expanding"
using_exponent: True
ew_lookback: 25
min_periods: 10
cleaning: True
rollyears: 20
floor_at_zero: False
forward_fill_price_index: True
offdiag: 0.0
clip: 0.90
risk_aversion_coefficient: 2.0
max_risk_per_instrument:
risk_shifting_multiplier: 2.0
max_risk_per_instrument_for_large_instrument_count: 0.1
max_risk_ceiling_as_fraction_normal_risk: 2.0
use_process_pool: True
cost_multiplier: 1.0
ignore_instruments:
- CRUDE_W
- GAS_US
- GOLD
- KOSPI
- NASDAQ
- SP500