qlib icon indicating copy to clipboard operation
qlib copied to clipboard

US data displays negative annualized return for all the models

Open anonymous-papers opened this issue 2 years ago • 2 comments

I tried US data for all the models, but all of them showing negative annualized return, (while the SP500 benchmark showing 12% annualized return). For examples, here are my workflow for LSTM, I wonder did I make any mistakes? (I also checked the SP500 from 2017 to 2020, the portfolio cannot be negative even randomly select stocks) Thanks a lot!

qlib_init: provider_uri: "~/.qlib/qlib_data/us_data" region: us market: &market SP500 benchmark: &benchmark ^gspc data_handler_config: &data_handler_config start_time: 2008-01-01 end_time: 2020-11-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: - <MODEL> - <DATASET> topk: 50 n_drop: 5 backtest: start_time: 2017-01-01 end_time: 2020-11-01 account: 100000000 benchmark: *benchmark exchange_kwargs: deal_price: close open_cost: 0.0000229 close_cost: 0 min_cost: 0.01 task: model: class: LSTM module_path: qlib.contrib.model.pytorch_lstm 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: 7 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-11-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

'The following are analysis results of benchmark return(1day).' risk mean 0.000508 std 0.013132 annualized_return 0.120839 information_ratio 0.596487 max_drawdown -0.382494 'The following are analysis results of the excess return without cost(1day).' risk mean -0.000012 std 0.005776 annualized_return -0.002809 information_ratio -0.031517 max_drawdown -0.191328

anonymous-papers avatar Aug 01 '22 19:08 anonymous-papers

Try to change label to ["Ref($close, -1) / $close - 1"]. The original label is for Chinese market, which has different T0 trading rules. Also, US market is more mature and more competitive, so it is harder to find profitable strategies. If your annualized return is negative, that means your strategy is not profitable.

Try to change label to ["Ref($close, -1) / $close - 1"]. The original label is for Chinese market, which has different T0 trading rules. Also, US market is more mature and more competitive, so it is harder to find profitable strategies. If your annualized return is negative, that means your strategy is not profitable.

I think annualized_return -0.002809 is the "excess return", so that the absolute return should be (0.120839 - 0.002809), which is around 0.118?

pop0121 avatar Sep 13 '22 13:09 pop0121

This issue is stale because it has been open for three months with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days

github-actions[bot] avatar Dec 12 '22 15:12 github-actions[bot]