|
| 1 | +qlib_init: |
| 2 | + provider_uri: "~/.qlib/qlib_data/cn_data" |
| 3 | + region: cn |
| 4 | +market: &market csi300 |
| 5 | +benchmark: &benchmark SH000300 |
| 6 | +data_handler_config: &data_handler_config |
| 7 | + start_time: 2008-01-01 |
| 8 | + end_time: 2020-08-01 |
| 9 | + fit_start_time: 2008-01-01 |
| 10 | + fit_end_time: 2014-12-31 |
| 11 | + instruments: *market |
| 12 | + infer_processors: |
| 13 | + - class: FilterCol |
| 14 | + kwargs: |
| 15 | + fields_group: feature |
| 16 | + col_list: ["RESI5", "WVMA5", "RSQR5", "KLEN", "RSQR10", "CORR5", "CORD5", "CORR10", |
| 17 | + "ROC60", "RESI10", "VSTD5", "RSQR60", "CORR60", "WVMA60", "STD5", |
| 18 | + "RSQR20", "CORD60", "CORD10", "CORR20", "KLOW" |
| 19 | + ] |
| 20 | + - class: RobustZScoreNorm |
| 21 | + kwargs: |
| 22 | + fields_group: feature |
| 23 | + clip_outlier: true |
| 24 | + - class: Fillna |
| 25 | + kwargs: |
| 26 | + fields_group: feature |
| 27 | + learn_processors: |
| 28 | + - class: DropnaLabel |
| 29 | + - class: CSRankNorm |
| 30 | + kwargs: |
| 31 | + fields_group: label |
| 32 | + label: ["Ref($close, -2) / Ref($close, -1) - 1"] |
| 33 | + |
| 34 | +port_analysis_config: &port_analysis_config |
| 35 | + strategy: |
| 36 | + class: TopkDropoutStrategy |
| 37 | + module_path: qlib.contrib.strategy |
| 38 | + kwargs: |
| 39 | + model: <MODEL> |
| 40 | + dataset: <DATASET> |
| 41 | + topk: 50 |
| 42 | + n_drop: 5 |
| 43 | + backtest: |
| 44 | + start_time: 2017-01-01 |
| 45 | + end_time: 2020-08-01 |
| 46 | + account: 100000000 |
| 47 | + benchmark: *benchmark |
| 48 | + exchange_kwargs: |
| 49 | + limit_threshold: 0.095 |
| 50 | + deal_price: close |
| 51 | + open_cost: 0.0005 |
| 52 | + close_cost: 0.0015 |
| 53 | + min_cost: 5 |
| 54 | +task: |
| 55 | + model: |
| 56 | + class: TCN |
| 57 | + module_path: qlib.contrib.model.pytorch_tcn_ts |
| 58 | + kwargs: |
| 59 | + d_feat: 20 |
| 60 | + num_layers: 5 |
| 61 | + n_chans: 32 |
| 62 | + kernel_size: 7 |
| 63 | + dropout: 0.5 |
| 64 | + n_epochs: 200 |
| 65 | + lr: 1e-4 |
| 66 | + early_stop: 20 |
| 67 | + batch_size: 2000 |
| 68 | + metric: loss |
| 69 | + loss: mse |
| 70 | + optimizer: adam |
| 71 | + n_jobs: 20 |
| 72 | + GPU: 0 |
| 73 | + dataset: |
| 74 | + class: TSDatasetH |
| 75 | + module_path: qlib.data.dataset |
| 76 | + kwargs: |
| 77 | + handler: |
| 78 | + class: Alpha158 |
| 79 | + module_path: qlib.contrib.data.handler |
| 80 | + kwargs: *data_handler_config |
| 81 | + segments: |
| 82 | + train: [2008-01-01, 2014-12-31] |
| 83 | + valid: [2015-01-01, 2016-12-31] |
| 84 | + test: [2017-01-01, 2020-08-01] |
| 85 | + step_len: 20 |
| 86 | + record: |
| 87 | + - class: SignalRecord |
| 88 | + module_path: qlib.workflow.record_temp |
| 89 | + kwargs: |
| 90 | + model: <MODEL> |
| 91 | + dataset: <DATASET> |
| 92 | + - class: SigAnaRecord |
| 93 | + module_path: qlib.workflow.record_temp |
| 94 | + kwargs: |
| 95 | + ana_long_short: False |
| 96 | + ann_scaler: 252 |
| 97 | + - class: PortAnaRecord |
| 98 | + module_path: qlib.workflow.record_temp |
| 99 | + kwargs: |
| 100 | + config: *port_analysis_config |
0 commit comments