diff --git a/exps/trading/baselines.py b/exps/trading/baselines.py index d33db01..7332412 100644 --- a/exps/trading/baselines.py +++ b/exps/trading/baselines.py @@ -210,5 +210,23 @@ if __name__ == "__main__": args.save_dir, args.gpu, ) - else: - print("-") + elif len(args.alg) > 1: + assert args.shared_dataset, "Must allow share dataset" + configs = [ + update_gpu(update_market(alg2configs[name], args.market), args.gpu) + for name in args.alg + ] + qlib.init(**configs[0].get("qlib_init")) + dataset_config = configs[0].get("task").get("dataset") + dataset = init_instance_by_config(dataset_config) + pprint(dataset_config) + pprint(dataset) + for alg_name, config in zip(args.alg, configs): + for irun in range(args.times): + run_exp( + config.get("task"), + dataset, + alg_name, + "recorder-{:02d}-{:02d}".format(irun, args.times), + "{:}-{:}".format(args.save_dir, args.market), + ) diff --git a/scripts/trade/tsf-all.sh b/scripts/trade/tsf-all.sh index 821966a..2563a2b 100644 --- a/scripts/trade/tsf-all.sh +++ b/scripts/trade/tsf-all.sh @@ -22,8 +22,11 @@ depths="1 2 3 4 5 6" for channel in ${channels} do - for depth in ${depths} - do - python exps/trading/baselines.py --alg TSF-${depth}x${channel}-drop${drop} --gpu ${gpu} --market ${market} - done + python exps/trading/baselines.py --alg TSF-1x${channel}-drop${drop} \ + TSF-2x${channel}-drop${drop} \ + TSF-3x${channel}-drop${drop} \ + TSF-4x${channel}-drop${drop} \ + TSF-5x${channel}-drop${drop} \ + TSF-6x${channel}-drop${drop} \ + --gpu ${gpu} --market ${market} --shared_dataset True done