forked from robcarver17/pysystemtrade
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefaults.yaml
333 lines (333 loc) · 7.93 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
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
# YAML
#
# PRODUCTION STUFF
#
## process configuration
#
#process_configuration_host_name:
# run_capital_update: boromir
process_configuration_start_time:
default: '00:01'
run_stack_handler: '00:01'
run_capital_update: '01:00'
run_daily_prices_updates: '20:00'
run_systems: '20:05'
run_strategy_order_generator: '20:10'
run_backups: '20:15'
run_cleaners: '20:20'
run_reports: '20:25'
process_configuration_stop_time:
default: '23:50'
run_strategy_order_generator: '19:30'
run_stack_handler: '19:45'
run_capital_update: '19:50'
run_daily_prices_updates: '23:50'
run_systems: '23:50'
run_backups: '23:50'
run_cleaners: '23:50'
run_reports: '23:50'
process_configuration_previous_process:
run_systems: 'run_daily_prices_updates'
run_strategy_order_generator: 'run_systems'
run_cleaners: 'run_strategy_order_generator'
run_backups: 'run_cleaners'
run_reports: 'run_strategy_order_generator'
# we include every method to make process monitoring easier
process_configuration_methods:
run_capital_update:
update_total_capital:
frequency: 120
max_executions: 10
strategy_allocation:
max_executions: 1
run_daily_prices_updates:
update_fx_prices:
max_executions: 1
update_sampled_contracts:
max_executions: 1
update_historical_prices:
max_executions: 1
update_multiple_adjusted_prices:
max_executions: 1
run_stack_handler:
check_external_position_break:
frequency: 0
max_executions: -1
spawn_children_from_new_instrument_orders:
frequency: 0
max_executions: -1
generate_force_roll_orders:
frequency: 0
max_executions: 1
create_broker_orders_from_contract_orders:
frequency: 0
max_executions: -1
process_fills_stack:
frequency: 0
max_executions: -1
handle_completed_orders:
frequency: 0
max_executions: -1
safe_stack_removal:
run_on_completion_only: True
run_reports:
status_report:
max_executions: 1
roll_report:
max_executions: 1
daily_pandl_report:
max_executions: 1
reconcile_report:
max_executions: 1
trade_report:
max_executions: 1
run_backups:
backup_arctic_to_csv:
max_executions: 1
backup_files:
backup_files: 1
run_cleaners:
clean_backtest_states:
max_executions: 1
clean_echo_files:
max_executions: 1
clean_log_files:
max_executions: 1
process_configuration_run_over_strategies:
- run_systems
- run_strategy_order_generator
#previous_process: need to write these up
#
## Strategy configuration
strategy_list:
example:
run_systems:
object: sysproduction.strategy_code.run_system_classic.runSystemClassic
function: run_system_classic
backtest_config_filename: systems.provided.futures_chapter15.futures_config.yaml
max_executions: 1
run_strategy_order_generator:
object: sysexecution.strategies.classic_buffered_positions.orderGeneratorForBufferedPositions
function: get_and_place_orders
frequency: 60
max_executions: 1
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_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'
#
# 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: "syscore.algos.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: "syscore.algos.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: syscore.correlations.CorrelationEstimator
frequency: "W"
date_method: "expanding"
using_exponent: True
ew_lookback: 250
min_periods: 20
cleaning: True
rollyears: 20
floor_at_zero: True
#
forecast_div_mult_estimate:
func: syscore.divmultipliers.diversification_multiplier_from_list
ewma_span: 125
dm_max: 2.5
#
use_forecast_weight_estimates: False
#
forecast_cost_estimates:
use_pooled_costs: False
use_pooled_turnover: True
#
forecast_weight_ewma_span: 125
forecast_weight_estimate:
func: syscore.optimisation.GenericOptimiser
method: handcraft
pool_gross_returns: True
equalise_gross: False
cost_multiplier: 2.0
apply_cost_weight: False
ceiling_cost_SR: 0.13
frequency: "W"
date_method: "expanding"
rollyears: 20
cleaning: True
equalise_SR: False
ann_target_SR: 0.5
equalise_vols: True
shrinkage_SR: 0.90
shrinkage_corr: 0.50
monte_runs: 100
bootstrap_length: 50
correlation_estimate:
func: syscore.correlations.correlation_single_period
using_exponent: False
ew_lookback: 500
min_periods: 20
floor_at_zero: True
mean_estimate:
func: syscore.algos.mean_estimator
using_exponent: False
ew_lookback: 500
min_periods: 20
vol_estimate:
func: syscore.algos.vol_estimator
using_exponent: False
ew_lookback: 500
min_periods: 20
#
# 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: syscore.correlations.CorrelationEstimator
frequency: "W"
date_method: "expanding"
using_exponent: True
ew_lookback: 250
min_periods: 20
cleaning: True
rollyears: 20
floor_at_zero: True
#
instrument_div_mult_estimate:
func: syscore.divmultipliers.diversification_multiplier_from_list
ewma_span: 125
dm_max: 2.5
#
use_instrument_weight_estimates: False
#
instrument_weight_ewma_span: 125
instrument_weight_estimate:
func: syscore.optimisation.GenericOptimiser
method: handcraft
frequency: "W"
equalise_gross: False
cost_multiplier: 0.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
bootstrap_length: 50
correlation_estimate:
func: syscore.correlations.correlation_single_period
using_exponent: False
ew_lookback: 500
min_periods: 20
floor_at_zero: True
mean_estimate:
func: syscore.algos.mean_estimator
using_exponent: False
ew_lookback: 500
min_periods: 20
vol_estimate:
func: syscore.algos.vol_estimator
using_exponent: False
ew_lookback: 500
min_periods: 20
#
# 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