Implmentation of Market-GAN: Adding Control to Financial Market Data Generation with Semantic Context (AAAI24)
You may download the model checkpoint and use it by putting the files into the output/ folder.
Use the AAAI_MarketGAN.yml to create a conda environment
conda env create -f AAAI_MarketGAN.yml
This repo contains (1) The Market Dynamics Modeling tool, (2) Market-GAN, (3) Example usage of generated data on the downstream task. Follow these steps to walkthrogh the whole process.
In the MarketDynamicsModeling folder
python get_DJI_dataset.py
(1) Move the DJI_data.csv to the data folder of Market_GAN_AAAI/data
(2) Change the "process_datafile_path=" in the config file MarketDynamicsModeling/configs/market_dynamics_modeling/djia.py to the path of the data set you downloaded
(3) Run the following command to label the data set.
(the file is at configs/market_dynamics_modeling/djia.py)
use python tools/market_dynamics_labeling/run.py
( we have already done the (1) and (2) for you)
or
use python run.py --config {path of you djia.py config file}
if you want to implement (1) and (2) by yourself
In the Market_GAN_AAAI folder
sh Pretrain_DJI_V2_50.sh
sh DJI_V2_RT_train.sh
sh Evaluate_DJI_V2_RT.sh
sh Plot_DJI_V2_RT.sh
The results will be saved to the Market_GAN_AAAI/output. You may download the model checkpoint and use it by putting the files into the output/ folder.
(1) Export the model information for inference by running sh DJI_V2_RT_info_export.sh
(2) Generate the data by running sh run_MarketGAN.sh
in the /service folder
(3) Move the generated data to downstream_tasks/data/downstream_tasks/data
(4) Run scripts for different forecasting models like sh run_MarketGAN.sh
in downstream_tasks/
(1) Run sh DJI.sh
in downstream_tasks/data/
(2) Run scripts for different forecasting models like sh run_real.sh
in downstream_tasks/
We thank these projects in helping the development of Market-GAN:
Codebase for "Time-series Generative Adversarial Networks (TimeGAN)"
timegan-pytorch
Time Series Library (TSlib)