-
Notifications
You must be signed in to change notification settings - Fork 842
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
46 changed files
with
6,512 additions
and
1,054 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
-36 Bytes
(100%)
B-因子构建类/个股动量效应的识别及球队硬币因子/src/__pycache__/plotting.cpython-38.pyc
Binary file not shown.
Binary file modified
BIN
+106 Bytes
(100%)
B-因子构建类/个股动量效应的识别及球队硬币因子/src/__pycache__/qlib_workflow.cpython-38.pyc
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
+167 Bytes
(100%)
B-因子构建类/个股动量效应的识别及球队硬币因子/src/__pycache__/utils.cpython-38.pyc
Binary file not shown.
81 changes: 81 additions & 0 deletions
81
B-因子构建类/个股动量效应的识别及球队硬币因子/src/config/workflow_config_TabNet_Alpha158.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
qlib_init: | ||
provider_uri: "~/.qlib/qlib_data/cn_data" | ||
region: cn | ||
market: &market csi300 | ||
benchmark: &benchmark SH000300 | ||
data_handler_config: &data_handler_config | ||
start_time: 2008-01-01 | ||
end_time: 2020-08-01 | ||
fit_start_time: 2008-01-01 | ||
fit_end_time: 2014-12-31 | ||
instruments: *market | ||
infer_processors: | ||
- class: RobustZScoreNorm | ||
kwargs: | ||
fields_group: feature | ||
clip_outlier: true | ||
- class: Fillna | ||
kwargs: | ||
fields_group: feature | ||
learn_processors: | ||
- class: DropnaLabel | ||
- class: CSRankNorm | ||
kwargs: | ||
fields_group: label | ||
label: ["Ref($close, -2) / Ref($close, -1) - 1"] | ||
port_analysis_config: &port_analysis_config | ||
strategy: | ||
class: TopkDropoutStrategy | ||
module_path: qlib.contrib.strategy | ||
kwargs: | ||
signal: <PRED> | ||
topk: 50 | ||
n_drop: 5 | ||
backtest: | ||
start_time: 2017-01-01 | ||
end_time: 2020-08-01 | ||
account: 100000000 | ||
benchmark: *benchmark | ||
exchange_kwargs: | ||
limit_threshold: 0.095 | ||
deal_price: close | ||
open_cost: 0.0005 | ||
close_cost: 0.0015 | ||
min_cost: 5 | ||
task: | ||
model: | ||
class: TabnetModel | ||
module_path: qlib.contrib.model.pytorch_tabnet | ||
kwargs: | ||
d_feat: 158 | ||
pretrain: True | ||
seed: 993 | ||
dataset: | ||
class: DatasetH | ||
module_path: qlib.data.dataset | ||
kwargs: | ||
handler: | ||
class: Alpha158 | ||
module_path: qlib.contrib.data.handler | ||
kwargs: *data_handler_config | ||
segments: | ||
pretrain: [2008-01-01, 2014-12-31] | ||
pretrain_validation: [2015-01-01, 2016-12-31] | ||
train: [2008-01-01, 2014-12-31] | ||
valid: [2015-01-01, 2016-12-31] | ||
test: [2017-01-01, 2020-08-01] | ||
record: | ||
- class: SignalRecord | ||
module_path: qlib.workflow.record_temp | ||
kwargs: | ||
model: <MODEL> | ||
dataset: <DATASET> | ||
- class: SigAnaRecord | ||
module_path: qlib.workflow.record_temp | ||
kwargs: | ||
ana_long_short: False | ||
ann_scaler: 252 | ||
- class: PortAnaRecord | ||
module_path: qlib.workflow.record_temp | ||
kwargs: | ||
config: *port_analysis_config |
81 changes: 81 additions & 0 deletions
81
B-因子构建类/个股动量效应的识别及球队硬币因子/src/config/workflow_config_TabNet_Alpha360.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
qlib_init: | ||
provider_uri: "~/.qlib/qlib_data/cn_data" | ||
region: cn | ||
market: &market csi300 | ||
benchmark: &benchmark SH000300 | ||
data_handler_config: &data_handler_config | ||
start_time: 2008-01-01 | ||
end_time: 2020-08-01 | ||
fit_start_time: 2008-01-01 | ||
fit_end_time: 2014-12-31 | ||
instruments: *market | ||
infer_processors: | ||
- class: RobustZScoreNorm | ||
kwargs: | ||
fields_group: feature | ||
clip_outlier: true | ||
- class: Fillna | ||
kwargs: | ||
fields_group: feature | ||
learn_processors: | ||
- class: DropnaLabel | ||
- class: CSRankNorm | ||
kwargs: | ||
fields_group: label | ||
label: ["Ref($close, -2) / Ref($close, -1) - 1"] | ||
port_analysis_config: &port_analysis_config | ||
strategy: | ||
class: TopkDropoutStrategy | ||
module_path: qlib.contrib.strategy | ||
kwargs: | ||
signal: <PRED> | ||
topk: 50 | ||
n_drop: 5 | ||
backtest: | ||
start_time: 2017-01-01 | ||
end_time: 2020-08-01 | ||
account: 100000000 | ||
benchmark: *benchmark | ||
exchange_kwargs: | ||
limit_threshold: 0.095 | ||
deal_price: close | ||
open_cost: 0.0005 | ||
close_cost: 0.0015 | ||
min_cost: 5 | ||
task: | ||
model: | ||
class: TabnetModel | ||
module_path: qlib.contrib.model.pytorch_tabnet | ||
kwargs: | ||
d_feat: 360 | ||
pretrain: True | ||
seed: 993 | ||
dataset: | ||
class: DatasetH | ||
module_path: qlib.data.dataset | ||
kwargs: | ||
handler: | ||
class: Alpha360 | ||
module_path: qlib.contrib.data.handler | ||
kwargs: *data_handler_config | ||
segments: | ||
pretrain: [2008-01-01, 2014-12-31] | ||
pretrain_validation: [2015-01-01, 2016-12-31] | ||
train: [2008-01-01, 2014-12-31] | ||
valid: [2015-01-01, 2016-12-31] | ||
test: [2017-01-01, 2020-08-01] | ||
record: | ||
- class: SignalRecord | ||
module_path: qlib.workflow.record_temp | ||
kwargs: | ||
model: <MODEL> | ||
dataset: <DATASET> | ||
- class: SigAnaRecord | ||
module_path: qlib.workflow.record_temp | ||
kwargs: | ||
ana_long_short: False | ||
ann_scaler: 252 | ||
- class: PortAnaRecord | ||
module_path: qlib.workflow.record_temp | ||
kwargs: | ||
config: *port_analysis_config |
87 changes: 87 additions & 0 deletions
87
B-因子构建类/个股动量效应的识别及球队硬币因子/src/config/workflow_config_adarnn_Alpha360.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
qlib_init: | ||
provider_uri: "~/.qlib/qlib_data/cn_data" | ||
region: cn | ||
market: &market csi300 | ||
benchmark: &benchmark SH000300 | ||
data_handler_config: &data_handler_config | ||
start_time: 2008-01-01 | ||
end_time: 2020-08-01 | ||
fit_start_time: 2008-01-01 | ||
fit_end_time: 2014-12-31 | ||
instruments: *market | ||
infer_processors: | ||
- class: RobustZScoreNorm | ||
kwargs: | ||
fields_group: feature | ||
clip_outlier: true | ||
- class: Fillna | ||
kwargs: | ||
fields_group: feature | ||
learn_processors: | ||
- class: DropnaLabel | ||
- class: CSRankNorm | ||
kwargs: | ||
fields_group: label | ||
label: ["Ref($close, -2) / Ref($close, -1) - 1"] | ||
port_analysis_config: &port_analysis_config | ||
strategy: | ||
class: TopkDropoutStrategy | ||
module_path: qlib.contrib.strategy | ||
kwargs: | ||
signal: <PRED> | ||
topk: 50 | ||
n_drop: 5 | ||
backtest: | ||
start_time: 2017-01-01 | ||
end_time: 2020-08-01 | ||
account: 100000000 | ||
benchmark: *benchmark | ||
exchange_kwargs: | ||
limit_threshold: 0.095 | ||
deal_price: close | ||
open_cost: 0.0005 | ||
close_cost: 0.0015 | ||
min_cost: 5 | ||
task: | ||
model: | ||
class: ADARNN | ||
module_path: qlib.contrib.model.pytorch_adarnn | ||
kwargs: | ||
d_feat: 6 | ||
hidden_size: 64 | ||
num_layers: 2 | ||
dropout: 0.0 | ||
n_epochs: 200 | ||
lr: 1e-3 | ||
early_stop: 20 | ||
batch_size: 800 | ||
metric: loss | ||
loss: mse | ||
GPU: 0 | ||
dataset: | ||
class: DatasetH | ||
module_path: qlib.data.dataset | ||
kwargs: | ||
handler: | ||
class: Alpha360 | ||
module_path: qlib.contrib.data.handler | ||
kwargs: *data_handler_config | ||
segments: | ||
train: [2008-01-01, 2014-12-31] | ||
valid: [2015-01-01, 2016-12-31] | ||
test: [2017-01-01, 2020-08-01] | ||
record: | ||
- class: SignalRecord | ||
module_path: qlib.workflow.record_temp | ||
kwargs: | ||
model: <MODEL> | ||
dataset: <DATASET> | ||
- class: SigAnaRecord | ||
module_path: qlib.workflow.record_temp | ||
kwargs: | ||
ana_long_short: False | ||
ann_scaler: 252 | ||
- class: PortAnaRecord | ||
module_path: qlib.workflow.record_temp | ||
kwargs: | ||
config: *port_analysis_config |
92 changes: 92 additions & 0 deletions
92
B-因子构建类/个股动量效应的识别及球队硬币因子/src/config/workflow_config_add_Alpha360.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
qlib_init: | ||
provider_uri: "~/.qlib/qlib_data/cn_data" | ||
region: cn | ||
market: &market csi300 | ||
benchmark: &benchmark SH000300 | ||
data_handler_config: &data_handler_config | ||
start_time: 2008-01-01 | ||
end_time: 2020-08-01 | ||
fit_start_time: 2008-01-01 | ||
fit_end_time: 2014-12-31 | ||
instruments: *market | ||
infer_processors: | ||
- class: RobustZScoreNorm | ||
kwargs: | ||
fields_group: feature | ||
clip_outlier: true | ||
- class: Fillna | ||
kwargs: | ||
fields_group: feature | ||
learn_processors: | ||
- class: DropnaLabel | ||
- class: CSRankNorm | ||
kwargs: | ||
fields_group: label | ||
label: ["Ref($close, -2) / Ref($close, -1) - 1"] | ||
port_analysis_config: &port_analysis_config | ||
strategy: | ||
class: TopkDropoutStrategy | ||
module_path: qlib.contrib.strategy | ||
kwargs: | ||
signal: <PRED> | ||
topk: 50 | ||
n_drop: 5 | ||
backtest: | ||
start_time: 2017-01-01 | ||
end_time: 2020-08-01 | ||
account: 100000000 | ||
benchmark: *benchmark | ||
exchange_kwargs: | ||
limit_threshold: 0.095 | ||
deal_price: close | ||
open_cost: 0.0005 | ||
close_cost: 0.0015 | ||
min_cost: 5 | ||
task: | ||
model: | ||
class: ADD | ||
module_path: qlib.contrib.model.pytorch_add | ||
kwargs: | ||
d_feat: 6 | ||
hidden_size: 64 | ||
num_layers: 2 | ||
dropout: 0.1 | ||
dec_dropout: 0.0 | ||
n_epochs: 200 | ||
lr: 1e-3 | ||
early_stop: 20 | ||
batch_size: 5000 | ||
metric: ic | ||
base_model: GRU | ||
gamma: 0.1 | ||
gamma_clip: 0.2 | ||
optimizer: adam | ||
mu: 0.2 | ||
GPU: 0 | ||
dataset: | ||
class: DatasetH | ||
module_path: qlib.data.dataset | ||
kwargs: | ||
handler: | ||
class: Alpha360 | ||
module_path: qlib.contrib.data.handler | ||
kwargs: *data_handler_config | ||
segments: | ||
train: [2008-01-01, 2014-12-31] | ||
valid: [2015-01-01, 2016-12-31] | ||
test: [2017-01-01, 2020-08-01] | ||
record: | ||
- class: SignalRecord | ||
module_path: qlib.workflow.record_temp | ||
kwargs: | ||
model: <MODEL> | ||
dataset: <DATASET> | ||
- class: SigAnaRecord | ||
module_path: qlib.workflow.record_temp | ||
kwargs: | ||
ana_long_short: False | ||
ann_scaler: 252 | ||
- class: PortAnaRecord | ||
module_path: qlib.workflow.record_temp | ||
kwargs: | ||
config: *port_analysis_config |
Oops, something went wrong.