├── __init__.py ├── config ├── __init__.py └── config.py ├── data └── __init__.py ├── model ├── __init__.py ├── .DS_Store └── models.py ├── env ├── __init__.py ├── EnvMultipleStock_train.py ├── EnvMultipleStock_validation.py └── EnvMultipleStock_trade.py ├── preprocessing ├── __init__.py └── preprocessors.py ├── .idea ├── .gitignore ├── misc.xml ├── vcs.xml ├── inspectionProfiles │ └── profiles_settings.xml ├── modules.xml └── Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020.iml ├── figs ├── data.PNG ├── performance.png └── stock_trading.png ├── results ├── .DS_Store └── firstRun │ ├── account_value_train.png │ ├── account_value_validation_1008.png │ ├── account_value_validation_1071.png │ ├── account_value_validation_1134.png │ ├── account_value_validation_1197.png │ ├── account_value_validation_126.png │ ├── account_value_validation_189.png │ ├── account_value_validation_252.png │ ├── account_value_validation_315.png │ ├── account_value_validation_378.png │ ├── account_value_validation_441.png │ ├── account_value_validation_504.png │ ├── account_value_validation_567.png │ ├── account_value_validation_630.png │ ├── account_value_validation_693.png │ ├── account_value_validation_756.png │ ├── account_value_validation_819.png │ ├── account_value_validation_882.png │ ├── account_value_validation_945.png │ ├── account_value_trade_ensemble_126.png │ ├── account_value_trade_ensemble_189.png │ ├── account_value_trade_ensemble_252.png │ ├── account_value_trade_ensemble_315.png │ ├── account_value_trade_ensemble_378.png │ ├── account_value_trade_ensemble_441.png │ ├── account_value_trade_ensemble_504.png │ ├── account_value_trade_ensemble_567.png │ ├── account_value_trade_ensemble_630.png │ ├── account_value_trade_ensemble_693.png │ ├── account_value_trade_ensemble_756.png │ ├── account_value_trade_ensemble_819.png │ ├── account_value_trade_ensemble_882.png │ ├── account_value_trade_ensemble_945.png │ ├── account_value_trade_ensemble_1008.png │ ├── account_value_trade_ensemble_1071.png │ ├── account_value_trade_ensemble_1134.png │ ├── account_value_trade_ensemble_1197.png │ ├── account_rewards_trade_ensemble_1071.csv │ ├── account_rewards_trade_ensemble_1197.csv │ ├── account_rewards_trade_ensemble_945.csv │ ├── account_rewards_trade_ensemble_819.csv │ ├── account_rewards_trade_ensemble_1134.csv │ ├── account_rewards_trade_ensemble_630.csv │ ├── account_rewards_trade_ensemble_1008.csv │ ├── account_rewards_trade_ensemble_756.csv │ ├── account_rewards_trade_ensemble_693.csv │ ├── account_rewards_trade_ensemble_441.csv │ ├── account_value_validation_1197.csv │ ├── account_value_validation_882.csv │ ├── account_value_validation_1134.csv │ ├── account_value_validation_189.csv │ ├── account_value_validation_1008.csv │ ├── account_value_validation_567.csv │ ├── account_rewards_trade_ensemble_882.csv │ ├── account_value_trade_ensemble_945.csv │ ├── account_rewards_trade_ensemble_567.csv │ ├── account_value_validation_252.csv │ ├── account_rewards_trade_ensemble_189.csv │ ├── account_rewards_trade_ensemble_315.csv │ ├── account_rewards_trade_ensemble_504.csv │ ├── account_value_validation_378.csv │ ├── account_rewards_trade_ensemble_126.csv │ ├── account_rewards_trade_ensemble_252.csv │ ├── account_value_trade_ensemble_126.csv │ ├── account_value_validation_315.csv │ ├── account_value_validation_630.csv │ ├── account_value_validation_504.csv │ ├── account_value_validation_819.csv │ ├── account_value_trade_ensemble_882.csv │ ├── account_value_validation_126.csv │ ├── account_value_validation_441.csv │ ├── account_value_validation_945.csv │ ├── account_rewards_trade_ensemble_378.csv │ ├── account_value_trade_ensemble_315.csv │ ├── account_value_trade_ensemble_504.csv │ ├── account_value_validation_693.csv │ ├── account_value_validation_756.csv │ ├── account_value_trade_ensemble_189.csv │ ├── account_value_trade_ensemble_252.csv │ ├── account_value_trade_ensemble_378.csv │ ├── account_value_trade_ensemble_441.csv │ ├── account_value_trade_ensemble_693.csv │ ├── account_value_trade_ensemble_756.csv │ ├── account_value_validation_1071.csv │ ├── account_value_trade_ensemble_567.csv │ ├── account_value_trade_ensemble_819.csv │ ├── account_value_trade_ensemble_1008.csv │ ├── account_value_trade_ensemble_1134.csv │ ├── account_value_trade_ensemble_1197.csv │ ├── account_value_trade_ensemble_630.csv │ ├── account_value_trade_ensemble_1071.csv │ └── last_state_ensemble_62.csv ├── trained_models └── firstRun │ ├── A2C_30k_dow_126.zip │ ├── A2C_30k_dow_189.zip │ ├── A2C_30k_dow_252.zip │ ├── A2C_30k_dow_315.zip │ ├── A2C_30k_dow_378.zip │ ├── A2C_30k_dow_441.zip │ ├── A2C_30k_dow_504.zip │ ├── A2C_30k_dow_567.zip │ ├── A2C_30k_dow_630.zip │ ├── A2C_30k_dow_693.zip │ ├── A2C_30k_dow_756.zip │ ├── A2C_30k_dow_819.zip │ ├── A2C_30k_dow_882.zip │ ├── A2C_30k_dow_945.zip │ ├── A2C_30k_dow_1008.zip │ ├── A2C_30k_dow_1071.zip │ ├── A2C_30k_dow_1134.zip │ ├── A2C_30k_dow_1197.zip │ ├── DDPG_10k_dow_1008.zip │ ├── DDPG_10k_dow_1071.zip │ ├── DDPG_10k_dow_1134.zip │ ├── DDPG_10k_dow_1197.zip │ ├── DDPG_10k_dow_126.zip │ ├── DDPG_10k_dow_189.zip │ ├── DDPG_10k_dow_252.zip │ ├── DDPG_10k_dow_315.zip │ ├── DDPG_10k_dow_378.zip │ ├── DDPG_10k_dow_441.zip │ ├── DDPG_10k_dow_504.zip │ ├── DDPG_10k_dow_567.zip │ ├── DDPG_10k_dow_630.zip │ ├── DDPG_10k_dow_693.zip │ ├── DDPG_10k_dow_756.zip │ ├── DDPG_10k_dow_819.zip │ ├── DDPG_10k_dow_882.zip │ ├── DDPG_10k_dow_945.zip │ ├── PPO_100k_dow_1008.zip │ ├── PPO_100k_dow_1071.zip │ ├── PPO_100k_dow_1134.zip │ ├── PPO_100k_dow_1197.zip │ ├── PPO_100k_dow_126.zip │ ├── PPO_100k_dow_189.zip │ ├── PPO_100k_dow_252.zip │ ├── PPO_100k_dow_315.zip │ ├── PPO_100k_dow_378.zip │ ├── PPO_100k_dow_441.zip │ ├── PPO_100k_dow_504.zip │ ├── PPO_100k_dow_567.zip │ ├── PPO_100k_dow_630.zip │ ├── PPO_100k_dow_693.zip │ ├── PPO_100k_dow_756.zip │ ├── PPO_100k_dow_819.zip │ ├── PPO_100k_dow_882.zip │ ├── PPO_100k_dow_945.zip │ └── firstRun.txt ├── requirements.txt ├── LICENSE ├── .devcontainer ├── Dockerfile └── devcontainer.json ├── run_DRL.py ├── .gitignore └── README.md /__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /config/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /data/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /model/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /env/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /preprocessing/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | -------------------------------------------------------------------------------- /figs/data.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/figs/data.PNG -------------------------------------------------------------------------------- /model/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/model/.DS_Store -------------------------------------------------------------------------------- /results/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/results/.DS_Store -------------------------------------------------------------------------------- /figs/performance.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/figs/performance.png -------------------------------------------------------------------------------- /figs/stock_trading.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/figs/stock_trading.png -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /results/firstRun/account_value_train.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/results/firstRun/account_value_train.png -------------------------------------------------------------------------------- /trained_models/firstRun/A2C_30k_dow_126.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/trained_models/firstRun/A2C_30k_dow_126.zip -------------------------------------------------------------------------------- /trained_models/firstRun/A2C_30k_dow_189.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/trained_models/firstRun/A2C_30k_dow_189.zip -------------------------------------------------------------------------------- /trained_models/firstRun/A2C_30k_dow_252.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/trained_models/firstRun/A2C_30k_dow_252.zip -------------------------------------------------------------------------------- /trained_models/firstRun/A2C_30k_dow_315.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/trained_models/firstRun/A2C_30k_dow_315.zip -------------------------------------------------------------------------------- /trained_models/firstRun/A2C_30k_dow_378.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/trained_models/firstRun/A2C_30k_dow_378.zip -------------------------------------------------------------------------------- /trained_models/firstRun/A2C_30k_dow_441.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/trained_models/firstRun/A2C_30k_dow_441.zip -------------------------------------------------------------------------------- /trained_models/firstRun/A2C_30k_dow_504.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/trained_models/firstRun/A2C_30k_dow_504.zip -------------------------------------------------------------------------------- /trained_models/firstRun/A2C_30k_dow_567.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/trained_models/firstRun/A2C_30k_dow_567.zip -------------------------------------------------------------------------------- /trained_models/firstRun/A2C_30k_dow_630.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/trained_models/firstRun/A2C_30k_dow_630.zip -------------------------------------------------------------------------------- /trained_models/firstRun/A2C_30k_dow_693.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/trained_models/firstRun/A2C_30k_dow_693.zip -------------------------------------------------------------------------------- /trained_models/firstRun/A2C_30k_dow_756.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/trained_models/firstRun/A2C_30k_dow_756.zip -------------------------------------------------------------------------------- /trained_models/firstRun/A2C_30k_dow_819.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/trained_models/firstRun/A2C_30k_dow_819.zip -------------------------------------------------------------------------------- /trained_models/firstRun/A2C_30k_dow_882.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/trained_models/firstRun/A2C_30k_dow_882.zip -------------------------------------------------------------------------------- /trained_models/firstRun/A2C_30k_dow_945.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/trained_models/firstRun/A2C_30k_dow_945.zip -------------------------------------------------------------------------------- /trained_models/firstRun/A2C_30k_dow_1008.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/trained_models/firstRun/A2C_30k_dow_1008.zip -------------------------------------------------------------------------------- /trained_models/firstRun/A2C_30k_dow_1071.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/trained_models/firstRun/A2C_30k_dow_1071.zip -------------------------------------------------------------------------------- /trained_models/firstRun/A2C_30k_dow_1134.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/trained_models/firstRun/A2C_30k_dow_1134.zip -------------------------------------------------------------------------------- /trained_models/firstRun/A2C_30k_dow_1197.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/trained_models/firstRun/A2C_30k_dow_1197.zip -------------------------------------------------------------------------------- /trained_models/firstRun/DDPG_10k_dow_1008.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/trained_models/firstRun/DDPG_10k_dow_1008.zip -------------------------------------------------------------------------------- /trained_models/firstRun/DDPG_10k_dow_1071.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/trained_models/firstRun/DDPG_10k_dow_1071.zip -------------------------------------------------------------------------------- /trained_models/firstRun/DDPG_10k_dow_1134.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/trained_models/firstRun/DDPG_10k_dow_1134.zip -------------------------------------------------------------------------------- /trained_models/firstRun/DDPG_10k_dow_1197.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/trained_models/firstRun/DDPG_10k_dow_1197.zip -------------------------------------------------------------------------------- /trained_models/firstRun/DDPG_10k_dow_126.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/trained_models/firstRun/DDPG_10k_dow_126.zip -------------------------------------------------------------------------------- /trained_models/firstRun/DDPG_10k_dow_189.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/trained_models/firstRun/DDPG_10k_dow_189.zip -------------------------------------------------------------------------------- /trained_models/firstRun/DDPG_10k_dow_252.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/trained_models/firstRun/DDPG_10k_dow_252.zip -------------------------------------------------------------------------------- /trained_models/firstRun/DDPG_10k_dow_315.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/trained_models/firstRun/DDPG_10k_dow_315.zip -------------------------------------------------------------------------------- /trained_models/firstRun/DDPG_10k_dow_378.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/trained_models/firstRun/DDPG_10k_dow_378.zip -------------------------------------------------------------------------------- /trained_models/firstRun/DDPG_10k_dow_441.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/trained_models/firstRun/DDPG_10k_dow_441.zip -------------------------------------------------------------------------------- /trained_models/firstRun/DDPG_10k_dow_504.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/trained_models/firstRun/DDPG_10k_dow_504.zip -------------------------------------------------------------------------------- /trained_models/firstRun/DDPG_10k_dow_567.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/trained_models/firstRun/DDPG_10k_dow_567.zip -------------------------------------------------------------------------------- /trained_models/firstRun/DDPG_10k_dow_630.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/trained_models/firstRun/DDPG_10k_dow_630.zip -------------------------------------------------------------------------------- /trained_models/firstRun/DDPG_10k_dow_693.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/trained_models/firstRun/DDPG_10k_dow_693.zip -------------------------------------------------------------------------------- /trained_models/firstRun/DDPG_10k_dow_756.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/trained_models/firstRun/DDPG_10k_dow_756.zip -------------------------------------------------------------------------------- /trained_models/firstRun/DDPG_10k_dow_819.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/trained_models/firstRun/DDPG_10k_dow_819.zip -------------------------------------------------------------------------------- /trained_models/firstRun/DDPG_10k_dow_882.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/trained_models/firstRun/DDPG_10k_dow_882.zip -------------------------------------------------------------------------------- /trained_models/firstRun/DDPG_10k_dow_945.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/trained_models/firstRun/DDPG_10k_dow_945.zip -------------------------------------------------------------------------------- /trained_models/firstRun/PPO_100k_dow_1008.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/trained_models/firstRun/PPO_100k_dow_1008.zip -------------------------------------------------------------------------------- /trained_models/firstRun/PPO_100k_dow_1071.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/trained_models/firstRun/PPO_100k_dow_1071.zip -------------------------------------------------------------------------------- /trained_models/firstRun/PPO_100k_dow_1134.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/trained_models/firstRun/PPO_100k_dow_1134.zip -------------------------------------------------------------------------------- /trained_models/firstRun/PPO_100k_dow_1197.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/trained_models/firstRun/PPO_100k_dow_1197.zip -------------------------------------------------------------------------------- /trained_models/firstRun/PPO_100k_dow_126.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/trained_models/firstRun/PPO_100k_dow_126.zip -------------------------------------------------------------------------------- /trained_models/firstRun/PPO_100k_dow_189.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/trained_models/firstRun/PPO_100k_dow_189.zip -------------------------------------------------------------------------------- /trained_models/firstRun/PPO_100k_dow_252.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/trained_models/firstRun/PPO_100k_dow_252.zip -------------------------------------------------------------------------------- /trained_models/firstRun/PPO_100k_dow_315.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/trained_models/firstRun/PPO_100k_dow_315.zip -------------------------------------------------------------------------------- /trained_models/firstRun/PPO_100k_dow_378.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/trained_models/firstRun/PPO_100k_dow_378.zip -------------------------------------------------------------------------------- /trained_models/firstRun/PPO_100k_dow_441.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/trained_models/firstRun/PPO_100k_dow_441.zip -------------------------------------------------------------------------------- /trained_models/firstRun/PPO_100k_dow_504.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/trained_models/firstRun/PPO_100k_dow_504.zip -------------------------------------------------------------------------------- /trained_models/firstRun/PPO_100k_dow_567.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/trained_models/firstRun/PPO_100k_dow_567.zip -------------------------------------------------------------------------------- /trained_models/firstRun/PPO_100k_dow_630.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/trained_models/firstRun/PPO_100k_dow_630.zip -------------------------------------------------------------------------------- /trained_models/firstRun/PPO_100k_dow_693.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/trained_models/firstRun/PPO_100k_dow_693.zip -------------------------------------------------------------------------------- /trained_models/firstRun/PPO_100k_dow_756.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/trained_models/firstRun/PPO_100k_dow_756.zip -------------------------------------------------------------------------------- /trained_models/firstRun/PPO_100k_dow_819.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/trained_models/firstRun/PPO_100k_dow_819.zip -------------------------------------------------------------------------------- /trained_models/firstRun/PPO_100k_dow_882.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/trained_models/firstRun/PPO_100k_dow_882.zip -------------------------------------------------------------------------------- /trained_models/firstRun/PPO_100k_dow_945.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/trained_models/firstRun/PPO_100k_dow_945.zip -------------------------------------------------------------------------------- /results/firstRun/account_value_validation_1008.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/results/firstRun/account_value_validation_1008.png -------------------------------------------------------------------------------- /results/firstRun/account_value_validation_1071.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/results/firstRun/account_value_validation_1071.png -------------------------------------------------------------------------------- /results/firstRun/account_value_validation_1134.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/results/firstRun/account_value_validation_1134.png -------------------------------------------------------------------------------- /results/firstRun/account_value_validation_1197.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/results/firstRun/account_value_validation_1197.png -------------------------------------------------------------------------------- /results/firstRun/account_value_validation_126.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/results/firstRun/account_value_validation_126.png -------------------------------------------------------------------------------- /results/firstRun/account_value_validation_189.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/results/firstRun/account_value_validation_189.png -------------------------------------------------------------------------------- /results/firstRun/account_value_validation_252.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/results/firstRun/account_value_validation_252.png -------------------------------------------------------------------------------- /results/firstRun/account_value_validation_315.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/results/firstRun/account_value_validation_315.png -------------------------------------------------------------------------------- /results/firstRun/account_value_validation_378.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/results/firstRun/account_value_validation_378.png -------------------------------------------------------------------------------- /results/firstRun/account_value_validation_441.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/results/firstRun/account_value_validation_441.png -------------------------------------------------------------------------------- /results/firstRun/account_value_validation_504.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/results/firstRun/account_value_validation_504.png -------------------------------------------------------------------------------- /results/firstRun/account_value_validation_567.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/results/firstRun/account_value_validation_567.png -------------------------------------------------------------------------------- /results/firstRun/account_value_validation_630.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/results/firstRun/account_value_validation_630.png -------------------------------------------------------------------------------- /results/firstRun/account_value_validation_693.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/results/firstRun/account_value_validation_693.png -------------------------------------------------------------------------------- /results/firstRun/account_value_validation_756.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/results/firstRun/account_value_validation_756.png -------------------------------------------------------------------------------- /results/firstRun/account_value_validation_819.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/results/firstRun/account_value_validation_819.png -------------------------------------------------------------------------------- /results/firstRun/account_value_validation_882.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/results/firstRun/account_value_validation_882.png -------------------------------------------------------------------------------- /results/firstRun/account_value_validation_945.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/results/firstRun/account_value_validation_945.png -------------------------------------------------------------------------------- /results/firstRun/account_value_trade_ensemble_126.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/results/firstRun/account_value_trade_ensemble_126.png -------------------------------------------------------------------------------- /results/firstRun/account_value_trade_ensemble_189.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/results/firstRun/account_value_trade_ensemble_189.png -------------------------------------------------------------------------------- /results/firstRun/account_value_trade_ensemble_252.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/results/firstRun/account_value_trade_ensemble_252.png -------------------------------------------------------------------------------- /results/firstRun/account_value_trade_ensemble_315.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/results/firstRun/account_value_trade_ensemble_315.png -------------------------------------------------------------------------------- /results/firstRun/account_value_trade_ensemble_378.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/results/firstRun/account_value_trade_ensemble_378.png -------------------------------------------------------------------------------- /results/firstRun/account_value_trade_ensemble_441.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/results/firstRun/account_value_trade_ensemble_441.png -------------------------------------------------------------------------------- /results/firstRun/account_value_trade_ensemble_504.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/results/firstRun/account_value_trade_ensemble_504.png -------------------------------------------------------------------------------- /results/firstRun/account_value_trade_ensemble_567.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/results/firstRun/account_value_trade_ensemble_567.png -------------------------------------------------------------------------------- /results/firstRun/account_value_trade_ensemble_630.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/results/firstRun/account_value_trade_ensemble_630.png -------------------------------------------------------------------------------- /results/firstRun/account_value_trade_ensemble_693.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/results/firstRun/account_value_trade_ensemble_693.png -------------------------------------------------------------------------------- /results/firstRun/account_value_trade_ensemble_756.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/results/firstRun/account_value_trade_ensemble_756.png -------------------------------------------------------------------------------- /results/firstRun/account_value_trade_ensemble_819.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/results/firstRun/account_value_trade_ensemble_819.png -------------------------------------------------------------------------------- /results/firstRun/account_value_trade_ensemble_882.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/results/firstRun/account_value_trade_ensemble_882.png -------------------------------------------------------------------------------- /results/firstRun/account_value_trade_ensemble_945.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/results/firstRun/account_value_trade_ensemble_945.png -------------------------------------------------------------------------------- /.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /results/firstRun/account_value_trade_ensemble_1008.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/results/firstRun/account_value_trade_ensemble_1008.png -------------------------------------------------------------------------------- /results/firstRun/account_value_trade_ensemble_1071.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/results/firstRun/account_value_trade_ensemble_1071.png -------------------------------------------------------------------------------- /results/firstRun/account_value_trade_ensemble_1134.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/results/firstRun/account_value_trade_ensemble_1134.png -------------------------------------------------------------------------------- /results/firstRun/account_value_trade_ensemble_1197.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/findmyway/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020/master/results/firstRun/account_value_trade_ensemble_1197.png -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | # Model Building Requirements 2 | numpy==1.16.4 3 | pandas==1.0.3 4 | stockstats 5 | scikit-learn==0.21.0 6 | gym==0.15.3 7 | stable-baselines[mpi] 8 | tensorflow==1.15.4 9 | 10 | joblib==0.15.1 11 | 12 | # plot 13 | matplotlib==3.2.1 14 | 15 | # testing requirements 16 | pytest>=5.3.2,<6.0.0 17 | 18 | # packaging 19 | setuptools>=41.4.0,<42.0.0 20 | wheel>=0.33.6,<0.34.0 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 12 | 13 | 15 | -------------------------------------------------------------------------------- /config/config.py: -------------------------------------------------------------------------------- 1 | import pathlib 2 | 3 | #import finrl 4 | 5 | import pandas as pd 6 | import datetime 7 | import os 8 | #pd.options.display.max_rows = 10 9 | #pd.options.display.max_columns = 10 10 | 11 | 12 | #PACKAGE_ROOT = pathlib.Path(finrl.__file__).resolve().parent 13 | #PACKAGE_ROOT = pathlib.Path().resolve().parent 14 | 15 | #TRAINED_MODEL_DIR = PACKAGE_ROOT / "trained_models" 16 | #DATASET_DIR = PACKAGE_ROOT / "data" 17 | 18 | # data 19 | #TRAINING_DATA_FILE = "data/ETF_SPY_2009_2020.csv" 20 | TRAINING_DATA_FILE = "data/dow_30_2009_2020.csv" 21 | 22 | now = datetime.datetime.now() 23 | TRAINED_MODEL_DIR = f"trained_models/{now}" 24 | os.makedirs(TRAINED_MODEL_DIR) 25 | TURBULENCE_DATA = "data/dow30_turbulence_index.csv" 26 | 27 | TESTING_DATA_FILE = "test.csv" 28 | 29 | 30 | -------------------------------------------------------------------------------- /results/firstRun/account_rewards_trade_ensemble_1071.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,-1102.2323358680587 3 | 1,-210.92691941699013 4 | 2,0.0 5 | 3,0.0 6 | 4,0.0 7 | 5,0.0 8 | 6,0.0 9 | 7,0.0 10 | 8,0.0 11 | 9,0.0 12 | 10,0.0 13 | 11,0.0 14 | 12,0.0 15 | 13,0.0 16 | 14,0.0 17 | 15,0.0 18 | 16,0.0 19 | 17,0.0 20 | 18,0.0 21 | 19,0.0 22 | 20,0.0 23 | 21,0.0 24 | 22,0.0 25 | 23,0.0 26 | 24,0.0 27 | 25,0.0 28 | 26,0.0 29 | 27,263.5006546836812 30 | 28,-205.9655572681222 31 | 29,0.0 32 | 30,0.0 33 | 31,0.0 34 | 32,0.0 35 | 33,0.0 36 | 34,0.0 37 | 35,0.0 38 | 36,0.0 39 | 37,0.0 40 | 38,0.0 41 | 39,0.0 42 | 40,0.0 43 | 41,0.0 44 | 42,0.0 45 | 43,0.0 46 | 44,0.0 47 | 45,0.0 48 | 46,0.0 49 | 47,0.0 50 | 48,0.0 51 | 49,0.0 52 | 50,0.0 53 | 51,0.0 54 | 52,0.0 55 | 53,0.0 56 | 54,0.0 57 | 55,0.0 58 | 56,0.0 59 | 57,0.0 60 | 58,0.0 61 | 59,0.0 62 | 60,0.0 63 | 61,0.0 64 | -------------------------------------------------------------------------------- /results/firstRun/account_rewards_trade_ensemble_1197.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,899.141832330497 3 | 1,-140.71912794560194 4 | 2,0.0 5 | 3,0.0 6 | 4,0.0 7 | 5,0.0 8 | 6,0.0 9 | 7,0.0 10 | 8,0.0 11 | 9,0.0 12 | 10,0.0 13 | 11,0.0 14 | 12,0.0 15 | 13,0.0 16 | 14,0.0 17 | 15,0.0 18 | 16,0.0 19 | 17,0.0 20 | 18,0.0 21 | 19,0.0 22 | 20,0.0 23 | 21,0.0 24 | 22,0.0 25 | 23,0.0 26 | 24,0.0 27 | 25,0.0 28 | 26,0.0 29 | 27,0.0 30 | 28,0.0 31 | 29,0.0 32 | 30,0.0 33 | 31,0.0 34 | 32,0.0 35 | 33,0.0 36 | 34,0.0 37 | 35,0.0 38 | 36,-958.1327331648208 39 | 37,2089.1755841614213 40 | 38,-366.9508790411055 41 | 39,0.0 42 | 40,0.0 43 | 41,7614.838580618147 44 | 42,-204.36675214907154 45 | 43,0.0 46 | 44,0.0 47 | 45,0.0 48 | 46,0.0 49 | 47,0.0 50 | 48,0.0 51 | 49,0.0 52 | 50,0.0 53 | 51,0.0 54 | 52,0.0 55 | 53,0.0 56 | 54,0.0 57 | 55,0.0 58 | 56,0.0 59 | 57,0.0 60 | 58,0.0 61 | 59,0.0 62 | 60,0.0 63 | 61,0.0 64 | -------------------------------------------------------------------------------- /results/firstRun/account_rewards_trade_ensemble_945.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,380.00413713091984 3 | 1,-122.80245585483499 4 | 2,0.0 5 | 3,0.0 6 | 4,0.0 7 | 5,0.0 8 | 6,0.0 9 | 7,0.0 10 | 8,0.0 11 | 9,0.0 12 | 10,0.0 13 | 11,0.0 14 | 12,0.0 15 | 13,0.0 16 | 14,0.0 17 | 15,0.0 18 | 16,0.0 19 | 17,0.0 20 | 18,0.0 21 | 19,0.0 22 | 20,0.0 23 | 21,0.0 24 | 22,0.0 25 | 23,0.0 26 | 24,0.0 27 | 25,0.0 28 | 26,0.0 29 | 27,0.0 30 | 28,0.0 31 | 29,0.0 32 | 30,0.0 33 | 31,0.0 34 | 32,0.0 35 | 33,0.0 36 | 34,0.0 37 | 35,0.0 38 | 36,0.0 39 | 37,0.0 40 | 38,0.0 41 | 39,0.0 42 | 40,0.0 43 | 41,0.0 44 | 42,0.0 45 | 43,0.0 46 | 44,0.0 47 | 45,0.0 48 | 46,0.0 49 | 47,0.0 50 | 48,0.0 51 | 49,0.0 52 | 50,0.0 53 | 51,0.0 54 | 52,0.0 55 | 53,0.0 56 | 54,0.0 57 | 55,0.0 58 | 56,286.53788109566085 59 | 57,-32.19681189954281 60 | 58,1880.367174608633 61 | 59,421.25132062565535 62 | 60,2692.677053092979 63 | 61,-1838.7690197203774 64 | -------------------------------------------------------------------------------- /results/firstRun/account_rewards_trade_ensemble_819.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,-1073.2890513991006 3 | 1,-172.7556648729369 4 | 2,0.0 5 | 3,0.0 6 | 4,0.0 7 | 5,0.0 8 | 6,833.8614841748495 9 | 7,-733.7758156992495 10 | 8,6526.732925223187 11 | 9,918.8516076027881 12 | 10,-486.42735013877973 13 | 11,0.0 14 | 12,0.0 15 | 13,0.0 16 | 14,0.0 17 | 15,0.0 18 | 16,0.0 19 | 17,0.0 20 | 18,0.0 21 | 19,0.0 22 | 20,0.0 23 | 21,0.0 24 | 22,0.0 25 | 23,0.0 26 | 24,0.0 27 | 25,0.0 28 | 26,0.0 29 | 27,0.0 30 | 28,0.0 31 | 29,0.0 32 | 30,0.0 33 | 31,0.0 34 | 32,0.0 35 | 33,0.0 36 | 34,0.0 37 | 35,0.0 38 | 36,0.0 39 | 37,0.0 40 | 38,0.0 41 | 39,0.0 42 | 40,0.0 43 | 41,0.0 44 | 42,0.0 45 | 43,0.0 46 | 44,0.0 47 | 45,0.0 48 | 46,0.0 49 | 47,0.0 50 | 48,0.0 51 | 49,0.0 52 | 50,0.0 53 | 51,0.0 54 | 52,0.0 55 | 53,0.0 56 | 54,0.0 57 | 55,0.0 58 | 56,5701.2147615887225 59 | 57,-131.90451373206452 60 | 58,0.0 61 | 59,0.0 62 | 60,0.0 63 | 61,0.0 64 | -------------------------------------------------------------------------------- /results/firstRun/account_rewards_trade_ensemble_1134.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,-1079.9737217917573 3 | 1,812.7134954696521 4 | 2,-321.0894217041787 5 | 3,-1109.412955201231 6 | 4,-163.3510217301082 7 | 5,0.0 8 | 6,0.0 9 | 7,0.0 10 | 8,0.0 11 | 9,0.0 12 | 10,0.0 13 | 11,0.0 14 | 12,0.0 15 | 13,0.0 16 | 14,0.0 17 | 15,0.0 18 | 16,0.0 19 | 17,0.0 20 | 18,0.0 21 | 19,0.0 22 | 20,0.0 23 | 21,0.0 24 | 22,0.0 25 | 23,0.0 26 | 24,0.0 27 | 25,0.0 28 | 26,0.0 29 | 27,0.0 30 | 28,0.0 31 | 29,0.0 32 | 30,0.0 33 | 31,0.0 34 | 32,-4774.1594077134505 35 | 33,-6172.905107898405 36 | 34,-170.88729362515733 37 | 35,0.0 38 | 36,-1473.6549116158858 39 | 37,-107.05947200744413 40 | 38,0.0 41 | 39,0.0 42 | 40,0.0 43 | 41,0.0 44 | 42,0.0 45 | 43,0.0 46 | 44,0.0 47 | 45,0.0 48 | 46,0.0 49 | 47,0.0 50 | 48,0.0 51 | 49,0.0 52 | 50,0.0 53 | 51,0.0 54 | 52,0.0 55 | 53,0.0 56 | 54,0.0 57 | 55,0.0 58 | 56,0.0 59 | 57,0.0 60 | 58,0.0 61 | 59,0.0 62 | 60,0.0 63 | 61,0.0 64 | -------------------------------------------------------------------------------- /results/firstRun/account_rewards_trade_ensemble_630.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,2214.164080999093 3 | 1,12088.888281089952 4 | 2,-1596.8672702759504 5 | 3,0.0 6 | 4,0.0 7 | 5,0.0 8 | 6,0.0 9 | 7,0.0 10 | 8,0.0 11 | 9,0.0 12 | 10,0.0 13 | 11,0.0 14 | 12,0.0 15 | 13,0.0 16 | 14,0.0 17 | 15,0.0 18 | 16,0.0 19 | 17,0.0 20 | 18,0.0 21 | 19,0.0 22 | 20,0.0 23 | 21,0.0 24 | 22,0.0 25 | 23,0.0 26 | 24,0.0 27 | 25,0.0 28 | 26,0.0 29 | 27,0.0 30 | 28,0.0 31 | 29,0.0 32 | 30,0.0 33 | 31,0.0 34 | 32,0.0 35 | 33,0.0 36 | 34,0.0 37 | 35,0.0 38 | 36,0.0 39 | 37,0.0 40 | 38,0.0 41 | 39,0.0 42 | 40,0.0 43 | 41,0.0 44 | 42,0.0 45 | 43,0.0 46 | 44,0.0 47 | 45,0.0 48 | 46,0.0 49 | 47,0.0 50 | 48,0.0 51 | 49,0.0 52 | 50,-2071.0018544015475 53 | 51,289.1081333551556 54 | 52,-1398.779847519705 55 | 53,-9844.565246094717 56 | 54,-7586.0823210510425 57 | 55,14772.305160674267 58 | 56,-10980.727817935403 59 | 57,-2612.805815292988 60 | 58,8818.619716450572 61 | 59,-14857.141614207998 62 | 60,12188.21444996493 63 | 61,10772.593836605549 64 | -------------------------------------------------------------------------------- /results/firstRun/account_rewards_trade_ensemble_1008.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,-1411.6525237583555 3 | 1,2770.9488085361663 4 | 2,2609.6562374681234 5 | 3,-621.7660310070496 6 | 4,0.0 7 | 5,0.0 8 | 6,0.0 9 | 7,952.7678847692441 10 | 8,-1053.6522682902869 11 | 9,-355.95909286732785 12 | 10,1738.544270600425 13 | 11,-3034.854438740993 14 | 12,-640.5249953675084 15 | 13,0.0 16 | 14,0.0 17 | 15,0.0 18 | 16,0.0 19 | 17,-1241.3621666189283 20 | 18,-171.76012742542662 21 | 19,-4160.014545735903 22 | 20,3690.4476207329426 23 | 21,642.7265653437935 24 | 22,-416.7512265238911 25 | 23,0.0 26 | 24,0.0 27 | 25,0.0 28 | 26,0.0 29 | 27,0.0 30 | 28,0.0 31 | 29,0.0 32 | 30,0.0 33 | 31,0.0 34 | 32,0.0 35 | 33,0.0 36 | 34,0.0 37 | 35,0.0 38 | 36,0.0 39 | 37,0.0 40 | 38,0.0 41 | 39,0.0 42 | 40,0.0 43 | 41,0.0 44 | 42,0.0 45 | 43,0.0 46 | 44,0.0 47 | 45,0.0 48 | 46,0.0 49 | 47,0.0 50 | 48,0.0 51 | 49,0.0 52 | 50,0.0 53 | 51,0.0 54 | 52,0.0 55 | 53,0.0 56 | 54,0.0 57 | 55,0.0 58 | 56,0.0 59 | 57,0.0 60 | 58,0.0 61 | 59,0.0 62 | 60,0.0 63 | 61,0.0 64 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2020 Hongyang Yang 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /.devcontainer/Dockerfile: -------------------------------------------------------------------------------- 1 | # See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.145.0/containers/python-3/.devcontainer/base.Dockerfile 2 | 3 | # [Choice] Python version: 3, 3.8, 3.7, 3.6 4 | ARG VARIANT="3" 5 | FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT} 6 | 7 | # [Option] Install Node.js 8 | ARG INSTALL_NODE="true" 9 | ARG NODE_VERSION="lts/*" 10 | RUN if [ "${INSTALL_NODE}" = "true" ]; then su vscode -c "source /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi 11 | 12 | # [Optional] Uncomment this section to install additional OS packages. 13 | RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ 14 | && apt-get -y install --no-install-recommends cmake libopenmpi-dev python3.7-dev zlib1g-dev libgl1-mesa-glx 15 | 16 | # [Optional] If your pip requirements rarely change, uncomment this section to add them to the image. 17 | COPY requirements.txt /tmp/pip-tmp/ 18 | RUN pip3 --disable-pip-version-check --no-cache-dir install -r /tmp/pip-tmp/requirements.txt \ 19 | && rm -rf /tmp/pip-tmp 20 | 21 | # [Optional] Uncomment this line to install global node packages. 22 | # RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g " 2>&1 -------------------------------------------------------------------------------- /results/firstRun/account_rewards_trade_ensemble_756.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,471.4499922124669 3 | 1,4330.540268147597 4 | 2,2372.3771788713057 5 | 3,-3975.1760742464103 6 | 4,5490.350750035839 7 | 5,5006.9508489028085 8 | 6,2419.8246902772225 9 | 7,-2962.943765307078 10 | 8,6715.608614222845 11 | 9,-9256.546850522747 12 | 10,3652.718942236621 13 | 11,-1401.426000953652 14 | 12,6090.608475374524 15 | 13,16238.547509882133 16 | 14,11465.484147982439 17 | 15,-6512.333123510703 18 | 16,-6401.889879748924 19 | 17,6651.163039899431 20 | 18,-8471.816774040693 21 | 19,-1580.4817936816253 22 | 20,0.0 23 | 21,0.0 24 | 22,0.0 25 | 23,0.0 26 | 24,0.0 27 | 25,0.0 28 | 26,0.0 29 | 27,0.0 30 | 28,0.0 31 | 29,0.0 32 | 30,0.0 33 | 31,0.0 34 | 32,0.0 35 | 33,0.0 36 | 34,-987.4528048462234 37 | 35,967.6540714236908 38 | 36,5915.86728755408 39 | 37,-661.0849956732709 40 | 38,-361.05025944067165 41 | 39,-6782.074110458372 42 | 40,-871.1950156434905 43 | 41,0.0 44 | 42,-2.6778914211317897 45 | 43,625.8461952377111 46 | 44,-2210.8444975041784 47 | 45,-2115.395739980275 48 | 46,1257.6086341224145 49 | 47,-945.2496043664869 50 | 48,0.0 51 | 49,0.0 52 | 50,0.0 53 | 51,1272.0024448966142 54 | 52,-181.2242899327539 55 | 53,1979.9393921364099 56 | 54,1657.3586162435822 57 | 55,-4613.417220495176 58 | 56,-1395.2287172228098 59 | 57,-4423.2386459610425 60 | 58,2053.9214680320583 61 | 59,-940.905062392354 62 | 60,0.0 63 | 61,0.0 64 | -------------------------------------------------------------------------------- /results/firstRun/account_rewards_trade_ensemble_693.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,-24599.96293745283 3 | 1,4625.737719927682 4 | 2,20041.5896749096 5 | 3,-8886.674551107455 6 | 4,17710.78977962141 7 | 5,-8358.838960628025 8 | 6,7585.303031879943 9 | 7,8415.3972491608 10 | 8,-12003.623898781836 11 | 9,-11696.541442814283 12 | 10,-1395.0411018561572 13 | 11,0.0 14 | 12,0.0 15 | 13,0.0 16 | 14,0.0 17 | 15,0.0 18 | 16,0.0 19 | 17,0.0 20 | 18,0.0 21 | 19,0.0 22 | 20,0.0 23 | 21,0.0 24 | 22,0.0 25 | 23,0.0 26 | 24,0.0 27 | 25,0.0 28 | 26,0.0 29 | 27,0.0 30 | 28,205.39662706060335 31 | 29,-108.62503073713742 32 | 30,-7.968093160307035 33 | 31,2043.103867138736 34 | 32,-1111.2468036508653 35 | 33,89.17067305766977 36 | 34,-2012.029198168544 37 | 35,-1374.6252692921553 38 | 36,-7068.507318207761 39 | 37,7007.934687710833 40 | 38,-6817.297458125977 41 | 39,6445.106120543554 42 | 40,4856.319646558957 43 | 41,-1263.6860557051841 44 | 42,12938.615855791606 45 | 43,6600.9701952370815 46 | 44,3253.448687844677 47 | 45,-340.0609746237751 48 | 46,-1659.2552692468744 49 | 47,-10221.810317504453 50 | 48,-3492.1299171417486 51 | 49,-5761.449270687997 52 | 50,-6025.617319358513 53 | 51,-17713.18177530053 54 | 52,-3376.048545843456 55 | 53,-8207.696379665751 56 | 54,2670.6331385520753 57 | 55,-21802.591479079565 58 | 56,4261.385925695067 59 | 57,-7783.529143736465 60 | 58,13271.903379701078 61 | 59,-1796.4486316945404 62 | 60,-1550.1124873799272 63 | 61,0.0 64 | -------------------------------------------------------------------------------- /results/firstRun/account_rewards_trade_ensemble_441.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,-4759.431128925178 3 | 1,1961.5821414010134 4 | 2,-755.8568663704209 5 | 3,258.2198723703623 6 | 4,1131.2705408839975 7 | 5,-1144.5752175634261 8 | 6,-8346.411816146923 9 | 7,10850.495346205542 10 | 8,1455.9324883008376 11 | 9,-3247.0314595291857 12 | 10,7975.929933228996 13 | 11,-1459.6444940962829 14 | 12,15598.636084341211 15 | 13,20670.983884700807 16 | 14,-139.75608365493827 17 | 15,-2832.3854120473843 18 | 16,-2839.2736598923802 19 | 17,4180.7890615356155 20 | 18,-1329.5449559073895 21 | 19,-466.5324264068622 22 | 20,-179.5177343362011 23 | 21,726.2359644272365 24 | 22,-85.94147925172001 25 | 23,-354.74428526265547 26 | 24,0.0 27 | 25,0.0 28 | 26,-262.2644658535719 29 | 27,-98.89847411075607 30 | 28,0.0 31 | 29,0.0 32 | 30,0.0 33 | 31,0.0 34 | 32,0.0 35 | 33,-76.33164352970198 36 | 34,300.14169478137046 37 | 35,-156.7101970363874 38 | 36,70.95352170919068 39 | 37,-312.42229177220725 40 | 38,159.96891191392206 41 | 39,705.3189373235218 42 | 40,1580.8518190188333 43 | 41,-674.1057349264156 44 | 42,-1743.5306804487482 45 | 43,419.4638192737475 46 | 44,-727.0099511940498 47 | 45,3746.249622307718 48 | 46,-711.2164518225472 49 | 47,2727.972968422342 50 | 48,-213.4332207927946 51 | 49,-518.4240106022917 52 | 50,-42.40230829641223 53 | 51,7050.738295529038 54 | 52,-2178.039798483718 55 | 53,-1705.9186171039473 56 | 54,-343.4316273047589 57 | 55,2933.2298884142656 58 | 56,507.7209319162648 59 | 57,-6425.231044309679 60 | 58,6076.409874289297 61 | 59,-13413.938075206475 62 | 60,5654.8986971173435 63 | 61,8016.336742357351 64 | -------------------------------------------------------------------------------- /results/firstRun/account_value_validation_1197.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,1000000.0 3 | 1,998896.4655372055 4 | 2,1002147.6275841306 5 | 3,1001781.4498207102 6 | 4,1001083.5380872922 7 | 5,1000907.240868774 8 | 6,1000907.240868774 9 | 7,1000907.240868774 10 | 8,1000907.240868774 11 | 9,1000907.240868774 12 | 10,1000907.240868774 13 | 11,1000907.240868774 14 | 12,1000907.240868774 15 | 13,1000907.240868774 16 | 14,1000907.240868774 17 | 15,1000907.240868774 18 | 16,1000907.240868774 19 | 17,1000907.240868774 20 | 18,1000907.240868774 21 | 19,1000907.240868774 22 | 20,1000907.240868774 23 | 21,1000907.240868774 24 | 22,1000907.240868774 25 | 23,1000907.240868774 26 | 24,1000907.240868774 27 | 25,1000907.240868774 28 | 26,1000907.240868774 29 | 27,1000907.240868774 30 | 28,1000907.240868774 31 | 29,1000907.240868774 32 | 30,1000907.240868774 33 | 31,1000907.240868774 34 | 32,1000907.240868774 35 | 33,993119.1065294795 36 | 34,980013.453811707 37 | 35,979622.7674879864 38 | 36,979622.7674879864 39 | 37,976773.3395174241 40 | 38,976601.564453486 41 | 39,976601.564453486 42 | 40,976601.564453486 43 | 41,976601.564453486 44 | 42,976601.564453486 45 | 43,976601.564453486 46 | 44,976601.564453486 47 | 45,976601.564453486 48 | 46,976601.564453486 49 | 47,976601.564453486 50 | 48,976601.564453486 51 | 49,976601.564453486 52 | 50,976601.564453486 53 | 51,976601.564453486 54 | 52,976601.564453486 55 | 53,976601.564453486 56 | 54,976601.564453486 57 | 55,976601.564453486 58 | 56,976601.564453486 59 | 57,976601.564453486 60 | 58,976601.564453486 61 | 59,976601.564453486 62 | 60,976601.564453486 63 | 61,976601.564453486 64 | 62,976601.564453486 65 | -------------------------------------------------------------------------------- /results/firstRun/account_value_validation_882.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,1000000.0 3 | 1,998492.6595977113 4 | 2,995330.4279602253 5 | 3,996963.9536141509 6 | 4,992224.6000487006 7 | 5,971424.8167620616 8 | 6,951122.6500760543 9 | 7,962652.2213810104 10 | 8,959557.4102401177 11 | 9,976528.9101442901 12 | 10,967966.3576479411 13 | 11,954337.1143866874 14 | 12,956829.2395943874 15 | 13,951853.0123044696 16 | 14,949754.6765244015 17 | 15,948804.9451757607 18 | 16,948804.9451757607 19 | 17,946439.1869441702 20 | 18,944233.858631043 21 | 19,951183.1352253504 22 | 20,950730.3063477747 23 | 21,951940.604684625 24 | 22,951815.6151236258 25 | 23,957403.506255907 26 | 24,961665.8478449238 27 | 25,978443.7051209174 28 | 26,975485.8004393644 29 | 27,970024.977266557 30 | 28,955101.6204536095 31 | 29,953821.4473585144 32 | 30,950549.9267847869 33 | 31,958068.6142450792 34 | 32,963848.1051855659 35 | 33,954825.539716482 36 | 34,933275.9537477776 37 | 35,933563.6778695756 38 | 36,928015.3179164963 39 | 37,941437.4370613937 40 | 38,949578.2016693953 41 | 39,972215.6072466356 42 | 40,968753.5810880356 43 | 41,980595.6502972489 44 | 42,985154.001964424 45 | 43,958055.1687696151 46 | 44,960273.455314415 47 | 45,940397.9963612442 48 | 46,942729.299374855 49 | 47,943865.2941067887 50 | 48,948957.0320158005 51 | 49,953255.5563763047 52 | 50,932436.6457009508 53 | 51,909670.6398345566 54 | 52,908011.4945750046 55 | 53,895985.5128015518 56 | 54,877774.4045029068 57 | 55,863030.8300828172 58 | 56,837509.2087125779 59 | 57,876334.4531726458 60 | 58,885179.5117088701 61 | 59,882484.7636866379 62 | 60,891193.7040420151 63 | 61,890917.0430035782 64 | 62,871330.7656646348 65 | -------------------------------------------------------------------------------- /results/firstRun/account_value_validation_1134.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,1000000.0 3 | 1,998541.7848013577 4 | 2,998327.5892102193 5 | 3,998327.5892102193 6 | 4,998327.5892102193 7 | 5,998327.5892102193 8 | 6,998327.5892102193 9 | 7,998327.5892102193 10 | 8,998327.5892102193 11 | 9,998327.5892102193 12 | 10,998327.5892102193 13 | 11,998327.5892102193 14 | 12,998327.5892102193 15 | 13,998327.5892102193 16 | 14,998327.5892102193 17 | 15,998327.5892102193 18 | 16,998327.5892102193 19 | 17,998327.5892102193 20 | 18,998327.5892102193 21 | 19,998327.5892102193 22 | 20,998327.5892102193 23 | 21,998327.5892102193 24 | 22,998327.5892102193 25 | 23,998327.5892102193 26 | 24,998327.5892102193 27 | 25,998327.5892102193 28 | 26,998327.5892102193 29 | 27,998327.5892102193 30 | 28,998324.4511231934 31 | 29,998112.7093672656 32 | 30,998112.7093672656 33 | 31,998112.7093672656 34 | 32,998112.7093672656 35 | 33,998112.7093672656 36 | 34,998112.7093672656 37 | 35,998112.7093672656 38 | 36,998112.7093672656 39 | 37,998112.7093672656 40 | 38,998112.7093672656 41 | 39,998112.7093672656 42 | 40,998112.7093672656 43 | 41,998112.7093672656 44 | 42,998112.7093672656 45 | 43,998112.7093672656 46 | 44,998112.7093672656 47 | 45,998112.7093672656 48 | 46,998112.7093672656 49 | 47,998112.7093672656 50 | 48,998112.7093672656 51 | 49,998112.7093672656 52 | 50,998112.7093672656 53 | 51,998112.7093672656 54 | 52,998112.7093672656 55 | 53,998112.7093672656 56 | 54,998112.7093672656 57 | 55,998112.7093672656 58 | 56,998112.7093672656 59 | 57,998112.7093672656 60 | 58,998112.7093672656 61 | 59,998112.7093672656 62 | 60,998112.7093672656 63 | 61,998112.7093672656 64 | 62,998112.7093672656 65 | -------------------------------------------------------------------------------- /results/firstRun/account_value_validation_189.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,1000000.0 3 | 1,999521.2868829337 4 | 2,995272.8210647975 5 | 3,983893.9805083529 6 | 4,979070.0305775958 7 | 5,980956.6745536767 8 | 6,985064.9837240604 9 | 7,963162.8423470339 10 | 8,973764.0518045832 11 | 9,952219.2937754275 12 | 10,950587.0978241332 13 | 11,934796.8513828681 14 | 12,944212.6325303217 15 | 13,954105.1532260827 16 | 14,942963.2008534318 17 | 15,957194.3493879723 18 | 16,956237.1681730316 19 | 17,956237.1681730316 20 | 18,956237.1681730316 21 | 19,956237.1681730316 22 | 20,956237.1681730316 23 | 21,956237.1681730316 24 | 22,956237.1681730316 25 | 23,956237.1681730316 26 | 24,956237.1681730316 27 | 25,956237.1681730316 28 | 26,956237.1681730316 29 | 27,956237.1681730316 30 | 28,956237.1681730316 31 | 29,956237.1681730316 32 | 30,956237.1681730316 33 | 31,956237.1681730316 34 | 32,956237.1681730316 35 | 33,956237.1681730316 36 | 34,956237.1681730316 37 | 35,956237.1681730316 38 | 36,956237.1681730316 39 | 37,956237.1681730316 40 | 38,956237.1681730316 41 | 39,958974.7245023707 42 | 40,958613.300504091 43 | 41,960090.120319057 44 | 42,962455.6203825943 45 | 43,964085.1488325254 46 | 44,959917.8132957672 47 | 45,961440.7599381154 48 | 46,962530.1938175916 49 | 47,977618.5833722899 50 | 48,980871.2698058581 51 | 49,982687.9862821474 52 | 50,989957.8266783877 53 | 51,1000391.8417428528 54 | 52,1006565.2971669007 55 | 53,1011894.9994527964 56 | 54,1009576.4442495354 57 | 55,999044.9704749236 58 | 56,999758.4861823943 59 | 57,999392.7662039074 60 | 58,1004747.5482921732 61 | 59,1007900.8096270902 62 | 60,1006668.61935148 63 | 61,1012325.3543934267 64 | 62,1008723.9749544748 65 | -------------------------------------------------------------------------------- /results/firstRun/account_value_validation_1008.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,1000000.0 3 | 1,998263.4333087627 4 | 2,997998.9585000846 5 | 3,997998.9585000846 6 | 4,997998.9585000846 7 | 5,997998.9585000846 8 | 6,997998.9585000846 9 | 7,997998.9585000846 10 | 8,997998.9585000846 11 | 9,997998.9585000846 12 | 10,997998.9585000846 13 | 11,997998.9585000846 14 | 12,997998.9585000846 15 | 13,997998.9585000846 16 | 14,997998.9585000846 17 | 15,997998.9585000846 18 | 16,997998.9585000846 19 | 17,997998.9585000846 20 | 18,997998.9585000846 21 | 19,997998.9585000846 22 | 20,997998.9585000846 23 | 21,997998.9585000846 24 | 22,997998.9585000846 25 | 23,997998.9585000846 26 | 24,997998.9585000846 27 | 25,997998.9585000846 28 | 26,997998.9585000846 29 | 27,997998.9585000846 30 | 28,997998.9585000846 31 | 29,997998.9585000846 32 | 30,997998.9585000846 33 | 31,997998.9585000846 34 | 32,997998.9585000846 35 | 33,997998.9585000846 36 | 34,997998.9585000846 37 | 35,997998.9585000846 38 | 36,997998.9585000846 39 | 37,997998.9585000846 40 | 38,997998.9585000846 41 | 39,997998.9585000846 42 | 40,997998.9585000846 43 | 41,997998.9585000846 44 | 42,997998.9585000846 45 | 43,997998.9585000846 46 | 44,997998.9585000846 47 | 45,997998.9585000846 48 | 46,997998.9585000846 49 | 47,997998.9585000846 50 | 48,997998.9585000846 51 | 49,997998.9585000846 52 | 50,997998.9585000846 53 | 51,997998.9585000846 54 | 52,997998.9585000846 55 | 53,997998.9585000846 56 | 54,997998.9585000846 57 | 55,997998.9585000846 58 | 56,997998.9585000846 59 | 57,998452.1044099336 60 | 58,1000977.6244262271 61 | 59,1004543.5139037054 62 | 60,1007217.1384949413 63 | 61,1015860.4624285195 64 | 62,1012693.6122184822 65 | -------------------------------------------------------------------------------- /results/firstRun/account_value_validation_567.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,1000000.0 3 | 1,998917.667466737 4 | 2,999511.0831068594 5 | 3,999842.8191016905 6 | 4,999051.6770879438 7 | 5,1002408.5990322845 8 | 6,1003962.6601870663 9 | 7,1006378.6369807034 10 | 8,1006499.9602353799 11 | 9,1002975.8316303379 12 | 10,1007007.387577368 13 | 11,1009896.7386202932 14 | 12,1006545.7943027928 15 | 13,1000207.8078234505 16 | 14,994552.0397397702 17 | 15,992352.865467341 18 | 16,992457.4991825112 19 | 17,991465.0772350002 20 | 18,991739.8707095506 21 | 19,993381.4038410246 22 | 20,993401.8720471587 23 | 21,994515.1507709292 24 | 22,999202.6011090907 25 | 23,997796.7987836729 26 | 24,994031.2262476489 27 | 25,993832.1262099696 28 | 26,984620.8620121189 29 | 27,983293.1605433126 30 | 28,992070.1702486565 31 | 29,991910.0622225989 32 | 30,993224.0367992315 33 | 31,980399.4402486874 34 | 32,975231.4587065197 35 | 33,975422.434213444 36 | 34,982688.7017203798 37 | 35,976899.6633115071 38 | 36,975442.002176443 39 | 37,975140.4934242798 40 | 38,971396.756874809 41 | 39,971093.5762142356 42 | 40,973842.3052920625 43 | 41,977241.3883236856 44 | 42,978575.9226656106 45 | 43,958769.3970923141 46 | 44,961478.1161021044 47 | 45,958691.7925870672 48 | 46,960986.262450426 49 | 47,977308.7211300842 50 | 48,987863.5791247108 51 | 49,989222.7070749133 52 | 50,992679.2535129724 53 | 51,993300.5086012417 54 | 52,999801.1101516602 55 | 53,1003438.639926781 56 | 54,999497.17503106 57 | 55,1000755.9005387389 58 | 56,1000531.6932438075 59 | 57,998610.0960603224 60 | 58,999181.4334593569 61 | 59,1006075.3239486397 62 | 60,1007991.7072788799 63 | 61,1011769.6595727145 64 | 62,1023000.6223349463 65 | -------------------------------------------------------------------------------- /results/firstRun/account_rewards_trade_ensemble_882.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,767.6521978008095 3 | 1,3498.5112110269256 4 | 2,1656.1473082872108 5 | 3,1753.4580012524966 6 | 4,-889.8065128130838 7 | 5,-4788.399853554554 8 | 6,1897.1162572507747 9 | 7,-1665.1556186319795 10 | 8,10104.428306629648 11 | 9,20356.328076286474 12 | 10,-19270.56292722444 13 | 11,14207.113566088257 14 | 12,-1638.4578167509753 15 | 13,9099.21984071727 16 | 14,-15341.95593547402 17 | 15,2419.7535046131816 18 | 16,16140.05345646618 19 | 17,-9351.582408322254 20 | 18,284.0160551755689 21 | 19,5106.932668020949 22 | 20,9456.283451809315 23 | 21,-7984.483604311477 24 | 22,-13886.728066050215 25 | 23,-1839.0676261603367 26 | 24,-2455.4140102046076 27 | 25,22037.873056168668 28 | 26,8844.600749613252 29 | 27,-8222.318821602035 30 | 28,28730.02627505758 31 | 29,778.7078594483901 32 | 30,5679.522274349583 33 | 31,-298.769845420029 34 | 32,9142.34681529412 35 | 33,1473.45648726332 36 | 34,-3257.095446385909 37 | 35,-4573.057489955332 38 | 36,-3025.2700694205705 39 | 37,5863.276860642945 40 | 38,-4436.48756624246 41 | 39,-4626.568808087381 42 | 40,-5649.393608868355 43 | 41,-11920.417993416078 44 | 42,-7621.028308300767 45 | 43,20932.358595625265 46 | 44,6073.104957401985 47 | 45,5749.33004853921 48 | 46,-4020.2962056396063 49 | 47,7607.30218151072 50 | 48,4493.707999772392 51 | 49,-1381.238577225944 52 | 50,-2074.8891280652024 53 | 51,16910.78039374668 54 | 52,-24006.63278670935 55 | 53,-2568.6300458230544 56 | 54,12637.742845431436 57 | 55,-6336.19791301107 58 | 56,6970.99760904233 59 | 57,12031.298493349692 60 | 58,18577.849461551523 61 | 59,-39277.282189826015 62 | 60,-1658.383675654186 63 | 61,0.0 64 | -------------------------------------------------------------------------------- /results/firstRun/account_value_trade_ensemble_945.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,1656752.78625876 3 | 1,1657132.7903958908 4 | 2,1657009.987940036 5 | 3,1657009.987940036 6 | 4,1657009.987940036 7 | 5,1657009.987940036 8 | 6,1657009.987940036 9 | 7,1657009.987940036 10 | 8,1657009.987940036 11 | 9,1657009.987940036 12 | 10,1657009.987940036 13 | 11,1657009.987940036 14 | 12,1657009.987940036 15 | 13,1657009.987940036 16 | 14,1657009.987940036 17 | 15,1657009.987940036 18 | 16,1657009.987940036 19 | 17,1657009.987940036 20 | 18,1657009.987940036 21 | 19,1657009.987940036 22 | 20,1657009.987940036 23 | 21,1657009.987940036 24 | 22,1657009.987940036 25 | 23,1657009.987940036 26 | 24,1657009.987940036 27 | 25,1657009.987940036 28 | 26,1657009.987940036 29 | 27,1657009.987940036 30 | 28,1657009.987940036 31 | 29,1657009.987940036 32 | 30,1657009.987940036 33 | 31,1657009.987940036 34 | 32,1657009.987940036 35 | 33,1657009.987940036 36 | 34,1657009.987940036 37 | 35,1657009.987940036 38 | 36,1657009.987940036 39 | 37,1657009.987940036 40 | 38,1657009.987940036 41 | 39,1657009.987940036 42 | 40,1657009.987940036 43 | 41,1657009.987940036 44 | 42,1657009.987940036 45 | 43,1657009.987940036 46 | 44,1657009.987940036 47 | 45,1657009.987940036 48 | 46,1657009.987940036 49 | 47,1657009.987940036 50 | 48,1657009.987940036 51 | 49,1657009.987940036 52 | 50,1657009.987940036 53 | 51,1657009.987940036 54 | 52,1657009.987940036 55 | 53,1657009.987940036 56 | 54,1657009.987940036 57 | 55,1657009.987940036 58 | 56,1657009.987940036 59 | 57,1657296.5258211317 60 | 58,1657264.329009232 61 | 59,1659144.6961838407 62 | 60,1659565.9475044664 63 | 61,1662258.6245575594 64 | 62,1660419.855537839 65 | -------------------------------------------------------------------------------- /results/firstRun/account_rewards_trade_ensemble_567.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,3939.5178632903844 3 | 1,8386.708226820687 4 | 2,315.3034876147285 5 | 3,1987.00977820158 6 | 4,7265.181454677833 7 | 5,2877.8430262098555 8 | 6,4681.642906792462 9 | 7,1896.986483835848 10 | 8,4197.933770100586 11 | 9,-1879.5663441433571 12 | 10,5469.639192302711 13 | 11,3559.3958401591517 14 | 12,8313.821444373578 15 | 13,-2738.6356602255255 16 | 14,16656.94851268828 17 | 15,-8563.194434575504 18 | 16,-1540.7728505362757 19 | 17,4419.16672014934 20 | 18,-4443.793557439465 21 | 19,-543.2754387673922 22 | 20,4977.496571888216 23 | 21,7079.682639403036 24 | 22,-2789.630799267674 25 | 23,-1721.9479334428906 26 | 24,5530.096638439456 27 | 25,-504.60340515594 28 | 26,-7257.379986374406 29 | 27,138.61239344114438 30 | 28,-1362.2557436614297 31 | 29,3608.478707799921 32 | 30,-12929.993082166882 33 | 31,5168.073440252105 34 | 32,-6599.47873571259 35 | 33,3728.8819319268223 36 | 34,10099.305448298808 37 | 35,-2928.540293146856 38 | 36,-1384.5747523303144 39 | 37,2122.866007467732 40 | 38,19790.24169924436 41 | 39,3251.4951002632733 42 | 40,24464.94564038841 43 | 41,-4897.598013031064 44 | 42,212.48033696203493 45 | 43,-10741.79815269541 46 | 44,3590.4665346674155 47 | 45,967.6987111056224 48 | 46,10457.483355154283 49 | 47,4945.217803697335 50 | 48,5409.3243512343615 51 | 49,5964.53088404634 52 | 50,-9215.923997121165 53 | 51,12720.909799673595 54 | 52,6790.103132007644 55 | 53,-992.6427211894188 56 | 54,305.475795913022 57 | 55,6547.410389322089 58 | 56,-1710.8824044014327 59 | 57,4017.442117288243 60 | 58,453.5133390589617 61 | 59,1064.9861621244345 62 | 60,-5580.099956087535 63 | 61,10877.92115859571 64 | -------------------------------------------------------------------------------- /results/firstRun/account_value_validation_252.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,1000000.0 3 | 1,1000568.9494340745 4 | 2,997732.3394086421 5 | 3,997131.951490728 6 | 4,996423.7745849191 7 | 5,1001267.0422830454 8 | 6,1009227.1918859892 9 | 7,1008519.2444364764 10 | 8,1008102.4650020014 11 | 9,1012470.9666431387 12 | 10,1017126.8272550276 13 | 11,1019680.278103495 14 | 12,1011453.1541987181 15 | 13,1009003.1940635188 16 | 14,1007990.3879487575 17 | 15,1004480.6158181259 18 | 16,1005716.7067401218 19 | 17,995778.8141275619 20 | 18,994101.4285958972 21 | 19,1001499.4840081695 22 | 20,995771.054644471 23 | 21,989838.7415210232 24 | 22,990967.9220634545 25 | 23,993666.2367704404 26 | 24,993674.6823288897 27 | 25,1006726.5730357083 28 | 26,996428.6271625145 29 | 27,997725.4810381007 30 | 28,989927.7128742657 31 | 29,996358.0937615643 32 | 30,986140.3680342541 33 | 31,988925.6389915142 34 | 32,980584.5411462842 35 | 33,985086.5368520796 36 | 34,983221.3327022229 37 | 35,997996.1258630811 38 | 36,1006951.617262083 39 | 37,1004234.9309494459 40 | 38,1007848.74752339 41 | 39,1007028.9945560895 42 | 40,1007328.4192049848 43 | 41,1008948.4600908338 44 | 42,1003462.0729871807 45 | 43,1009878.1282386456 46 | 44,1007724.4449468671 47 | 45,1011909.1367909679 48 | 46,1011602.9179879437 49 | 47,1005817.007658125 50 | 48,997399.806271559 51 | 49,993834.4273931562 52 | 50,990727.5729795515 53 | 51,995385.5203196394 54 | 52,991343.3588432751 55 | 53,1000226.2880992566 56 | 54,1003730.8795438062 57 | 55,1000566.8676472914 58 | 56,1014459.1789767896 59 | 57,978453.997841078 60 | 58,967340.1300633679 61 | 59,985207.7641583876 62 | 60,1003677.203580995 63 | 61,1019698.9894238906 64 | 62,1020694.1585452133 65 | -------------------------------------------------------------------------------- /results/firstRun/account_rewards_trade_ensemble_189.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,8657.572376988828 3 | 1,-4997.074136134237 4 | 2,3918.780165476026 5 | 3,-3296.6464386056177 6 | 4,11338.587140815333 7 | 5,5508.88425671123 8 | 6,130.0819224959705 9 | 7,-900.4610215143766 10 | 8,10428.070473037893 11 | 9,8703.828188857762 12 | 10,-652.8150765055325 13 | 11,-6975.1788342781365 14 | 12,3440.388631883776 15 | 13,1560.4062377091032 16 | 14,3530.855437911814 17 | 15,5465.177657384425 18 | 16,-8378.018069859361 19 | 17,-6266.600376866525 20 | 18,8208.76924750721 21 | 19,-8142.346912261099 22 | 20,-4395.192044649273 23 | 21,1709.9998125659768 24 | 22,3738.562450140016 25 | 23,-2407.9296232576016 26 | 24,12812.339120713528 27 | 25,-12094.275248508202 28 | 26,1586.9240932594985 29 | 27,-12892.03063437203 30 | 28,12039.579307590146 31 | 29,-10186.993103524437 32 | 30,-2894.8836656445637 33 | 31,-7308.491670362884 34 | 32,3332.0219981677365 35 | 33,1315.2258425073233 36 | 34,10335.089936716948 37 | 35,9407.275881082984 38 | 36,-3156.385389802046 39 | 37,2821.389993697405 40 | 38,-8838.24567508651 41 | 39,-425.39322742493823 42 | 40,3055.168269380927 43 | 41,865.0019212588668 44 | 42,8268.62300553592 45 | 43,5313.537270791363 46 | 44,1684.247690279968 47 | 45,-291.5184390048962 48 | 46,-3761.1576588612515 49 | 47,-6570.094337372575 50 | 48,-3450.5600200146437 51 | 49,-5228.0078906212 52 | 50,2568.595533713931 53 | 51,-4358.291369853308 54 | 52,7333.2445836348925 55 | 53,3623.7422820304055 56 | 54,-3827.5902715849224 57 | 55,15292.903294873424 58 | 56,-42215.3654961749 59 | 57,-21239.12732096552 60 | 58,10802.818306132918 61 | 59,19682.380458763102 62 | 60,12424.982127257856 63 | 61,205.31414790521376 64 | -------------------------------------------------------------------------------- /results/firstRun/account_rewards_trade_ensemble_315.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,-4884.973066640319 3 | 1,7151.051925634965 4 | 2,-1308.2305231655482 5 | 3,3682.3879440333694 6 | 4,3835.4982992555015 7 | 5,-13168.180156098912 8 | 6,3036.9876373673324 9 | 7,-4250.793742571725 10 | 8,2130.7863039672375 11 | 9,-5129.932963755913 12 | 10,6567.945514173713 13 | 11,-1998.6955265649594 14 | 12,3353.960895687109 15 | 13,3455.377327387687 16 | 14,4595.338605727535 17 | 15,-3279.1091826155316 18 | 16,2539.641281773569 19 | 17,32.7263001978863 20 | 18,-3033.9454423806164 21 | 19,4490.741723775631 22 | 20,-5452.665076820878 23 | 21,-3833.60155210644 24 | 22,-6461.453620751621 25 | 23,-5461.546676299069 26 | 24,25887.230813601054 27 | 25,3138.524191602133 28 | 26,22465.418689935235 29 | 27,9594.963519965298 30 | 28,5765.038620842854 31 | 29,21293.193278983235 32 | 30,9672.7715398164 33 | 31,-9823.972982707666 34 | 32,8494.570472739637 35 | 33,-1246.6533027379774 36 | 34,5984.800996113103 37 | 35,998.4638765524141 38 | 36,1232.3350621031132 39 | 37,3346.4698268701322 40 | 38,2949.3402383613866 41 | 39,-2469.3457608795725 42 | 40,2765.6009735488333 43 | 41,7098.191796531668 44 | 42,-1674.9225442314055 45 | 43,14792.190643596696 46 | 44,5032.862354793586 47 | 45,15815.546799659729 48 | 46,9172.36776315677 49 | 47,12945.578354034573 50 | 48,-7167.064742202871 51 | 49,8255.848321418744 52 | 50,-6040.571660756599 53 | 51,8085.776108288439 54 | 52,-4939.008914068108 55 | 53,1400.7307144997176 56 | 54,8257.577276206343 57 | 55,-4123.292852834333 58 | 56,-4007.188243915327 59 | 57,397.60029790876433 60 | 58,1300.1207674092147 61 | 59,-8097.150504306192 62 | 60,-1291.9425338555593 63 | 61,-4913.273434009636 64 | -------------------------------------------------------------------------------- /results/firstRun/account_rewards_trade_ensemble_504.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,-8734.633923106594 3 | 1,5909.770202384796 4 | 2,4613.941851909505 5 | 3,1068.872880934272 6 | 4,12347.192694063764 7 | 5,-4120.863208597992 8 | 6,9600.967708615819 9 | 7,-1522.767105043633 10 | 8,-3692.674806011142 11 | 9,7867.574979253812 12 | 10,-1816.6430069166236 13 | 11,1334.1351337141823 14 | 12,1114.2383393163327 15 | 13,15034.321864061756 16 | 14,10476.590496339602 17 | 15,8782.518820811529 18 | 16,-1392.3759649314452 19 | 17,-225.88292904896662 20 | 18,380.22492857906036 21 | 19,1855.661554721184 22 | 20,571.3987825720105 23 | 21,-213.27889364794828 24 | 22,709.0156913255341 25 | 23,-2563.4484777157195 26 | 24,-4051.4826566858683 27 | 25,-7024.914225545945 28 | 26,1223.4920797445811 29 | 27,9205.390756835928 30 | 28,978.024475569604 31 | 29,3816.960178557085 32 | 30,-15896.95948281535 33 | 31,-1999.5538773667067 34 | 32,1727.1098735488486 35 | 33,11823.727543213638 36 | 34,-6610.3041887269355 37 | 35,-4504.273720375495 38 | 36,802.9529268089682 39 | 37,-1115.2764874140266 40 | 38,7474.575060138712 41 | 39,3502.21678753593 42 | 40,2467.571098266868 43 | 41,-1072.3676365315914 44 | 42,-15481.120853337226 45 | 43,-2670.240162629867 46 | 44,5367.638164587552 47 | 45,3189.0502745716367 48 | 46,13928.033653253224 49 | 47,2111.4504837840796 50 | 48,2140.221671463456 51 | 49,4903.741389006376 52 | 50,7463.773162384285 53 | 51,6009.038171244087 54 | 52,4675.56777675543 55 | 53,5836.663213958498 56 | 54,-3794.474803456804 57 | 55,1148.4012385569513 58 | 56,-7067.538422795478 59 | 57,-3934.5111297287513 60 | 58,4009.472899623448 61 | 59,3721.4471297033597 62 | 60,-565.6055831110571 63 | 61,5982.3535136610735 64 | -------------------------------------------------------------------------------- /results/firstRun/account_value_validation_378.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,1000000.0 3 | 1,999225.0513079499 4 | 2,1000283.3844172551 5 | 3,1001560.2302289554 6 | 4,999154.5871314832 7 | 5,1002825.9180162759 8 | 6,993135.8849273453 9 | 7,995222.4204873279 10 | 8,993452.8905247455 11 | 9,994407.5607494139 12 | 10,991385.212511591 13 | 11,994692.582127754 14 | 12,996696.1562272906 15 | 13,995365.5542445504 16 | 14,995721.348971125 17 | 15,1001111.1918276321 18 | 16,997605.9884907859 19 | 17,993645.9922180744 20 | 18,994369.7630989889 21 | 19,992976.675962078 22 | 20,995908.8020228688 23 | 21,988302.0095121164 24 | 22,985014.582264619 25 | 23,980503.5436503374 26 | 24,978352.2056685984 27 | 25,997013.9971896828 28 | 26,999184.4630414823 29 | 27,1007655.5734703447 30 | 28,1017538.5568188335 31 | 29,1018665.7687484914 32 | 30,1016708.9035909524 33 | 31,1016668.8331988803 34 | 32,1018192.6517373873 35 | 33,1021536.2929737731 36 | 34,1018489.014761362 37 | 35,1025843.8524377709 38 | 36,1026940.8830740743 39 | 37,1028081.0862093366 40 | 38,1032508.1095250548 41 | 39,1031667.0970480969 42 | 40,1032876.3091279082 43 | 41,1030414.0631982167 44 | 42,1029359.0355785354 45 | 43,1030764.6800335884 46 | 44,1031093.5270422493 47 | 45,1031368.530895024 48 | 46,1046552.1591102232 49 | 47,1047041.5951029019 50 | 48,1057389.8989572003 51 | 49,1060146.6168737991 52 | 50,1067465.7997184277 53 | 51,1060982.1148691706 54 | 52,1063819.4507290472 55 | 53,1064912.757336549 56 | 54,1067628.242087613 57 | 55,1070453.5595697013 58 | 56,1069469.6978378624 59 | 57,1065863.3666395277 60 | 58,1066733.6993249657 61 | 59,1068236.0512568874 62 | 60,1061712.3244741666 63 | 61,1061264.3072717425 64 | 62,1055756.1878245813 65 | -------------------------------------------------------------------------------- /results/firstRun/account_rewards_trade_ensemble_126.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,96.09970256721135 3 | 1,-3727.2810662171105 4 | 2,-8029.963988726726 5 | 3,-3884.4862417886034 6 | 4,-1325.713386616204 7 | 5,3720.038577871397 8 | 6,-12975.90662835876 9 | 7,15590.543184972135 10 | 8,-24508.528634476825 11 | 9,-398.3425803373102 12 | 10,-15365.168982281932 13 | 11,11691.334178046323 14 | 12,16333.012654824299 15 | 13,-14058.371725886362 16 | 14,23994.15536585392 17 | 15,-5663.451690841233 18 | 16,11711.99828896753 19 | 17,18121.25351371325 20 | 18,-1623.7399163104128 21 | 19,-8252.30737953179 22 | 20,19112.042855211184 23 | 21,3938.595338843297 24 | 22,-15451.596702799085 25 | 23,2152.1085050825495 26 | 24,-1820.71803082095 27 | 25,-9318.638123220531 28 | 26,-8802.95990427304 29 | 27,17950.216667199158 30 | 28,8241.141851892695 31 | 29,15026.657888311194 32 | 30,-2741.9424682449317 33 | 31,-4529.426047522575 34 | 32,12186.961484809173 35 | 33,-15495.244215156534 36 | 34,4419.027140438557 37 | 35,10037.573326447746 38 | 36,-4386.684958548867 39 | 37,-6557.105349610676 40 | 38,21841.078253308777 41 | 39,1508.1452629636042 42 | 40,249.6099321935326 43 | 41,3797.0316485073417 44 | 42,7183.512157779653 45 | 43,-10021.141377259977 46 | 44,10203.804143222515 47 | 45,1851.536545299692 48 | 46,11023.770579306176 49 | 47,-165.86518871877342 50 | 48,1046.284995878581 51 | 49,3707.356776630273 52 | 50,8311.941848350689 53 | 51,6739.914682180621 54 | 52,-5386.050629375968 55 | 53,-3581.4165112774353 56 | 54,-3607.109524571104 57 | 55,2258.9638091214 58 | 56,2803.597945840098 59 | 57,1682.6270222999156 60 | 58,5812.7022868404165 61 | 59,-4161.483089702437 62 | 60,3011.20857397723 63 | 61,-4475.085988957202 64 | -------------------------------------------------------------------------------- /results/firstRun/account_rewards_trade_ensemble_252.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,518.479338992387 3 | 1,-2974.0492864362895 4 | 2,13804.321834655711 5 | 3,4300.652713730931 6 | 4,6547.026150074555 7 | 5,1657.890205069445 8 | 6,14861.487769804662 9 | 7,-3240.74658068968 10 | 8,2452.380103434436 11 | 9,-725.8905138177797 12 | 10,3900.909697148716 13 | 11,-6077.458575517405 14 | 12,432.12530084326863 15 | 13,-2522.70838091732 16 | 14,-3752.4174424947705 17 | 15,3462.646505224984 18 | 16,-9.029235383495688 19 | 17,246.95099362544715 20 | 18,3626.1320717902854 21 | 19,-5939.960776248248 22 | 20,1489.0023204113822 23 | 21,72.17372503317893 24 | 22,9936.482686706586 25 | 23,-221.53359033330344 26 | 24,332.1385112465359 27 | 25,-83.34355645324104 28 | 26,9119.520880957367 29 | 27,-2023.6651145922951 30 | 28,1992.2622761831153 31 | 29,-8630.081872445997 32 | 30,2781.9279324125964 33 | 31,417.22134853783064 34 | 32,1591.5808946180623 35 | 33,-3558.744736873312 36 | 34,4438.257352286251 37 | 35,-1637.5768675289582 38 | 36,-1837.8389477224555 39 | 37,-1479.406122438144 40 | 38,5793.059513746062 41 | 39,-2539.7087890158873 42 | 40,-2243.2315824315883 43 | 41,3043.3133455461357 44 | 42,1635.4052128752228 45 | 43,260.2630843662191 46 | 44,-1154.3004850628786 47 | 45,-5375.68845855142 48 | 46,-20676.328348659445 49 | 47,14819.782217917731 50 | 48,-16147.399711261503 51 | 49,-2422.087821799796 52 | 50,9802.623786455952 53 | 51,-4959.924965980463 54 | 52,-1049.421441085171 55 | 53,1806.786886781687 56 | 54,9392.26049091341 57 | 55,4983.009604807943 58 | 56,-10150.361333998386 59 | 57,-13784.956883536419 60 | 58,12190.339572372148 61 | 59,-4890.562946968945 62 | 60,-17181.206312117632 63 | 61,9227.91001656768 64 | -------------------------------------------------------------------------------- /results/firstRun/account_value_trade_ensemble_126.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,1000000.0 3 | 1,1000096.0997025672 4 | 2,996368.8186363501 5 | 3,988338.8546476234 6 | 4,984454.3684058348 7 | 5,983128.6550192186 8 | 6,986848.69359709 9 | 7,973872.7869687312 10 | 8,989463.3301537033 11 | 9,964954.8015192265 12 | 10,964556.4589388892 13 | 11,949191.2899566073 14 | 12,960882.6241346536 15 | 13,977215.6367894779 16 | 14,963157.2650635915 17 | 15,987151.4204294455 18 | 16,981487.9687386042 19 | 17,993199.9670275718 20 | 18,1011321.220541285 21 | 19,1009697.4806249746 22 | 20,1001445.1732454428 23 | 21,1020557.216100654 24 | 22,1024495.8114394973 25 | 23,1009044.2147366982 26 | 24,1011196.3232417807 27 | 25,1009375.6052109598 28 | 26,1000056.9670877393 29 | 27,991254.0071834662 30 | 28,1009204.2238506654 31 | 29,1017445.3657025581 32 | 30,1032472.0235908693 33 | 31,1029730.0811226243 34 | 32,1025200.6550751018 35 | 33,1037387.6165599109 36 | 34,1021892.3723447544 37 | 35,1026311.399485193 38 | 36,1036348.9728116407 39 | 37,1031962.2878530918 40 | 38,1025405.1825034812 41 | 39,1047246.2607567899 42 | 40,1048754.4060197535 43 | 41,1049004.015951947 44 | 42,1052801.0476004544 45 | 43,1059984.559758234 46 | 44,1049963.418380974 47 | 45,1060167.2225241966 48 | 46,1062018.7590694963 49 | 47,1073042.5296488025 50 | 48,1072876.6644600837 51 | 49,1073922.9494559623 52 | 50,1077630.3062325926 53 | 51,1085942.2480809432 54 | 52,1092682.1627631239 55 | 53,1087296.112133748 56 | 54,1083714.6956224705 57 | 55,1080107.5860978994 58 | 56,1082366.5499070208 59 | 57,1085170.1478528609 60 | 58,1086852.7748751608 61 | 59,1092665.4771620012 62 | 60,1088503.9940722988 63 | 61,1091515.202646276 64 | 62,1087040.1166573188 65 | -------------------------------------------------------------------------------- /results/firstRun/account_value_validation_315.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,1000000.0 3 | 1,999984.386447415 4 | 2,999765.3992299105 5 | 3,1002863.9187509838 6 | 4,1004516.6987534116 7 | 5,1008523.5842878977 8 | 6,1009744.7660113224 9 | 7,1015830.3284753341 10 | 8,1014479.2831199863 11 | 9,1014329.7813957641 12 | 10,1016503.8190471565 13 | 11,1016645.9174361017 14 | 12,1012758.7611322546 15 | 13,1017839.3331355468 16 | 14,1011395.638519739 17 | 15,1001880.4189625267 18 | 16,994197.7806492948 19 | 17,993340.0271457689 20 | 18,990148.692433991 21 | 19,987256.8176627296 22 | 20,985339.7465510344 23 | 21,988193.3869894573 24 | 22,991532.614814402 25 | 23,1006699.5119126262 26 | 24,1003977.7605914552 27 | 25,1003859.0480285991 28 | 26,1005894.9368876512 29 | 27,1011323.7721766799 30 | 28,1012418.7840907862 31 | 29,1015159.6403819381 32 | 30,1010960.9890091626 33 | 31,1009490.3379070661 34 | 32,1009429.4785089876 35 | 33,1004707.7715741255 36 | 34,1006463.4236763282 37 | 35,1005056.295128958 38 | 36,1000457.5879611723 39 | 37,997388.6086516902 40 | 38,992824.4061996059 41 | 39,1001194.6197618039 42 | 40,1002192.0421179079 43 | 41,1004511.0034768747 44 | 42,1005865.4534183093 45 | 43,1011332.7352501185 46 | 44,1014998.585716793 47 | 45,1016368.2598224477 48 | 46,1020094.0006507136 49 | 47,1000263.7013364626 50 | 48,1013082.9219826754 51 | 49,998751.4744036732 52 | 50,994763.9924192296 53 | 51,1002858.406477998 54 | 52,1000858.2658509625 55 | 53,997844.3622317202 56 | 54,1002285.6745113262 57 | 55,1006103.1818639772 58 | 56,1016172.7188937013 59 | 57,1012261.6270362489 60 | 58,998509.1233027285 61 | 59,1005545.6283662812 62 | 60,999811.4916157931 63 | 61,990919.0747104638 64 | 62,1001248.6520705979 65 | -------------------------------------------------------------------------------- /results/firstRun/account_value_validation_630.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,1000000.0 3 | 1,999488.3608885735 4 | 2,1001796.3689036483 5 | 3,999775.2250326378 6 | 4,998433.5463819506 7 | 5,1000607.1854771848 8 | 6,1001054.385640388 9 | 7,997882.0848620737 10 | 8,998888.8203056147 11 | 9,1006421.1117087747 12 | 10,1002367.91925924 13 | 11,1006063.9985516638 14 | 12,1003161.1748579693 15 | 13,1007685.2785806558 16 | 14,1006677.6088166522 17 | 15,1006677.6088166522 18 | 16,1006677.6088166522 19 | 17,1006677.6088166522 20 | 18,1006677.6088166522 21 | 19,1006677.6088166522 22 | 20,1006677.6088166522 23 | 21,1006677.6088166522 24 | 22,1006677.6088166522 25 | 23,1006677.6088166522 26 | 24,1006677.6088166522 27 | 25,1006677.6088166522 28 | 26,1006677.6088166522 29 | 27,1006677.6088166522 30 | 28,1006677.6088166522 31 | 29,1006677.6088166522 32 | 30,1006677.6088166522 33 | 31,1006677.6088166522 34 | 32,1008032.5950214829 35 | 33,1007894.987418072 36 | 34,1007894.987418072 37 | 35,1007894.987418072 38 | 36,1007894.987418072 39 | 37,1007894.987418072 40 | 38,1007894.987418072 41 | 39,1007894.987418072 42 | 40,1007894.987418072 43 | 41,1007894.987418072 44 | 42,1007894.987418072 45 | 43,1007894.987418072 46 | 44,1007894.987418072 47 | 45,1007894.987418072 48 | 46,1007777.4253808768 49 | 47,1008614.1281565268 50 | 48,1010058.0108950699 51 | 49,1012326.528917251 52 | 50,1012965.1886725075 53 | 51,1012118.8200793813 54 | 52,1012118.8200793813 55 | 53,1013811.511992024 56 | 54,1012986.5310934857 57 | 55,1013538.8818122996 58 | 56,1012991.6383976982 59 | 57,1012991.6383976982 60 | 58,1012640.6169823009 61 | 59,1012471.6718841469 62 | 60,1012575.6834997876 63 | 61,1010860.0873232031 64 | 62,1012464.8361378228 65 | -------------------------------------------------------------------------------- /results/firstRun/account_value_validation_504.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,1000000.0 3 | 1,999846.0971662 4 | 2,999951.808094888 5 | 3,1000198.7237712767 6 | 4,1000407.4441683462 7 | 5,1000849.9103222385 8 | 6,996927.2677192574 9 | 7,990536.2609680188 10 | 8,999389.3839941563 11 | 9,998877.8974933703 12 | 10,997398.3571946617 13 | 11,1002079.579213895 14 | 12,1003008.6283953239 15 | 13,1012847.537418616 16 | 14,1030064.2887223271 17 | 15,1030704.6344578449 18 | 16,1030399.3192389777 19 | 17,1028407.737602453 20 | 18,1028181.454576202 21 | 19,1031077.3869783707 22 | 20,1035084.4127450677 23 | 21,1033915.1110997316 24 | 22,1037920.0928807945 25 | 23,1038143.7594853966 26 | 24,1036618.6546041501 27 | 25,1035716.212659799 28 | 26,1036217.222041235 29 | 27,1034490.3608422022 30 | 28,1037727.2338579688 31 | 29,1039113.2127014099 32 | 30,1026405.8284491287 33 | 31,1029630.4961275309 34 | 32,1039238.9132051489 35 | 33,1044761.427705309 36 | 34,1048313.3147687739 37 | 35,1053595.8964227696 38 | 36,1059568.9693139095 39 | 37,1059268.0629522535 40 | 38,1059567.2389097044 41 | 39,1062075.7927456303 42 | 40,1066387.7302005596 43 | 41,1071584.8331970808 44 | 42,1069638.2562734433 45 | 43,1062976.8660652372 46 | 44,1061108.3463367864 47 | 45,1061557.8699446507 48 | 46,1064767.7275438327 49 | 47,1061684.9517992802 50 | 48,1063452.5443379804 51 | 49,1065024.7440545338 52 | 50,1068471.0042865006 53 | 51,1068945.220462343 54 | 52,1074286.4359599748 55 | 53,1073077.241852526 56 | 54,1069130.5536721458 57 | 55,1069696.777599987 58 | 56,1073897.8011996162 59 | 57,1071459.7223087524 60 | 58,1066270.3781824417 61 | 59,1074362.1689458957 62 | 60,1062710.4598655067 63 | 61,1065531.8915816725 64 | 62,1064487.6247573441 65 | -------------------------------------------------------------------------------- /results/firstRun/account_value_validation_819.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,1000000.0 3 | 1,1000158.7019366829 4 | 2,1003171.4936776883 5 | 3,1005499.8953511589 6 | 4,1000797.8209492145 7 | 5,1007034.0571029308 8 | 6,1009919.719063187 9 | 7,1009563.221978491 10 | 8,1011953.9626632032 11 | 9,1017973.9099567641 12 | 10,1009640.5195906642 13 | 11,1011178.0824609211 14 | 12,1009276.4866812305 15 | 13,1020473.1228544975 16 | 14,1028657.0203042357 17 | 15,1035473.6585171476 18 | 16,1036505.7174021677 19 | 17,1028811.2617206526 20 | 18,1033991.3887839296 21 | 19,1030402.2807843006 22 | 20,1029371.880738836 23 | 21,1029371.880738836 24 | 22,1029371.880738836 25 | 23,1029371.880738836 26 | 24,1029371.880738836 27 | 25,1029371.880738836 28 | 26,1029371.880738836 29 | 27,1029371.880738836 30 | 28,1029371.880738836 31 | 29,1029371.880738836 32 | 30,1029371.880738836 33 | 31,1029371.880738836 34 | 32,1029371.880738836 35 | 33,1029371.880738836 36 | 34,1029371.880738836 37 | 35,1028956.6527281636 38 | 36,1031019.9040858292 39 | 37,1034527.9074625857 40 | 38,1034769.4827175166 41 | 39,1035880.8356515139 42 | 40,1033167.70967259 43 | 41,1032192.0147205708 44 | 42,1032192.0147205708 45 | 43,1031985.1270525529 46 | 44,1032083.0000668064 47 | 45,1030894.397450574 48 | 46,1028841.2510661406 49 | 47,1031303.093263212 50 | 48,1030579.9940300334 51 | 49,1030579.9940300334 52 | 50,1030579.9940300334 53 | 51,1030579.9940300334 54 | 52,1031334.8767513313 55 | 53,1031160.3917613537 56 | 54,1032419.4237703615 57 | 55,1032850.9220000482 58 | 56,1030824.3133850768 59 | 57,1027159.4634945116 60 | 58,1025297.5510427707 61 | 59,1026742.7667335221 62 | 60,1025852.6801219897 63 | 61,1025852.6801219897 64 | 62,1025852.6801219897 65 | -------------------------------------------------------------------------------- /results/firstRun/account_value_trade_ensemble_882.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,1579537.062252677 3 | 1,1580304.7144504779 4 | 2,1583803.2256615048 5 | 3,1585459.372969792 6 | 4,1587212.8309710445 7 | 5,1586323.0244582314 8 | 6,1581534.6246046769 9 | 7,1583431.7408619276 10 | 8,1581766.5852432956 11 | 9,1591871.0135499253 12 | 10,1612227.3416262118 13 | 11,1592956.7786989873 14 | 12,1607163.8922650756 15 | 13,1605525.4344483246 16 | 14,1614624.6542890419 17 | 15,1599282.6983535679 18 | 16,1601702.451858181 19 | 17,1617842.5053146472 20 | 18,1608490.922906325 21 | 19,1608774.9389615005 22 | 20,1613881.8716295215 23 | 21,1623338.1550813308 24 | 22,1615353.6714770193 25 | 23,1601466.943410969 26 | 24,1599627.8757848088 27 | 25,1597172.4617746042 28 | 26,1619210.3348307728 29 | 27,1628054.935580386 30 | 28,1619832.616758784 31 | 29,1648562.6430338416 32 | 30,1649341.35089329 33 | 31,1655020.8731676396 34 | 32,1654722.1033222196 35 | 33,1663864.4501375137 36 | 34,1665337.906624777 37 | 35,1662080.811178391 38 | 36,1657507.7536884358 39 | 37,1654482.4836190152 40 | 38,1660345.7604796581 41 | 39,1655909.2729134157 42 | 40,1651282.7041053283 43 | 41,1645633.31049646 44 | 42,1633712.8925030439 45 | 43,1626091.864194743 46 | 44,1647024.2227903684 47 | 45,1653097.3277477704 48 | 46,1658846.6577963096 49 | 47,1654826.36159067 50 | 48,1662433.6637721807 51 | 49,1666927.371771953 52 | 50,1665546.1331947271 53 | 51,1663471.244066662 54 | 52,1680382.0244604086 55 | 53,1656375.3916736993 56 | 54,1653806.7616278762 57 | 55,1666444.5044733076 58 | 56,1660108.3065602966 59 | 57,1667079.304169339 60 | 58,1679110.6026626886 61 | 59,1697688.45212424 62 | 60,1658411.169934414 63 | 61,1656752.78625876 64 | 62,1656752.78625876 65 | -------------------------------------------------------------------------------- /results/firstRun/account_value_validation_126.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,1000000.0 3 | 1,1001600.0846795093 4 | 2,1002278.4763759508 5 | 3,1004367.8588151262 6 | 4,1008239.4078901072 7 | 5,1007632.270292778 8 | 6,1008390.1950687836 9 | 7,1005768.659771628 10 | 8,1001245.2776858977 11 | 9,1013288.7388222722 12 | 10,1018852.5873328677 13 | 11,1017674.6261014335 14 | 12,1017615.0705195286 15 | 13,1013852.6433073272 16 | 14,1047234.3001958262 17 | 15,1046187.0788869048 18 | 16,1046187.0788869048 19 | 17,1046187.0788869048 20 | 18,1046474.9369392325 21 | 19,1046396.9186996819 22 | 20,1046356.7616438224 23 | 21,1048579.6290938598 24 | 22,1050874.058061466 25 | 23,1048526.1031242481 26 | 24,1046762.9262586114 27 | 25,1047322.2020833371 28 | 26,1041658.5401407775 29 | 27,1044786.0753081169 30 | 28,1041752.703256125 31 | 29,1025827.7822309894 32 | 30,1019576.94157313 33 | 31,1035773.2181170211 34 | 32,1035177.4988729152 35 | 33,1051086.197843333 36 | 34,1052091.7005134951 37 | 35,1051854.0651817676 38 | 36,1053126.8174870855 39 | 37,1055093.420355374 40 | 38,1050211.5670683165 41 | 39,1045337.424257034 42 | 40,1043032.290773159 43 | 41,1053649.3505658621 44 | 42,1040256.933465243 45 | 43,1029003.6815098355 46 | 44,1049057.837460598 47 | 45,1040436.3216532704 48 | 46,1027986.7741873079 49 | 47,1040989.8361537751 50 | 48,1040728.0189841136 51 | 49,1023579.6516335644 52 | 50,1030314.858654075 53 | 51,1046773.6493289461 54 | 52,1055970.1889042875 55 | 53,1039970.7931596981 56 | 54,1022667.4465536746 57 | 55,1025187.8313936391 58 | 56,1034529.9104361739 59 | 57,1048003.7810139284 60 | 58,1043969.4702818877 61 | 59,1041062.1194994126 62 | 60,1049032.285039175 63 | 61,1041158.2469997044 64 | 62,1032416.9881426676 65 | -------------------------------------------------------------------------------- /results/firstRun/account_value_validation_441.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,1000000.0 3 | 1,1000069.9828469837 4 | 2,999795.9278584316 5 | 3,999836.0027404063 6 | 4,999176.1225505027 7 | 5,998809.402124681 8 | 6,1001240.7248136726 9 | 7,1000799.3183184044 10 | 8,998663.2237362434 11 | 9,997051.8301727618 12 | 10,996505.0715306044 13 | 11,992235.7105827954 14 | 12,998017.7714197149 15 | 13,995070.2139585569 16 | 14,1007388.7359158514 17 | 15,1012475.8315822892 18 | 16,1013624.090202678 19 | 17,1017643.8354545428 20 | 18,1010567.1538292902 21 | 19,1005374.6490392897 22 | 20,1007001.1997269475 23 | 21,1003632.388116761 24 | 22,1012776.9200178642 25 | 23,1010098.1044062348 26 | 24,1010815.1841962473 27 | 25,1010593.9225828095 28 | 26,1015352.5068602734 29 | 27,1022740.9676773231 30 | 28,1028456.6913804414 31 | 29,1029612.7976360812 32 | 30,1035140.4431910568 33 | 31,1036037.4675905785 34 | 32,1037291.9040427316 35 | 33,1039472.7604558892 36 | 34,1047690.5162217631 37 | 35,1045749.0747666991 38 | 36,1047046.2167027183 39 | 37,1045025.4871577588 40 | 38,1041868.4568965192 41 | 39,1057111.1700515726 42 | 40,1045115.4756044192 43 | 41,1044993.9437717706 44 | 42,1045175.7451751074 45 | 43,1042845.2555157158 46 | 44,1037393.9154676222 47 | 45,1037244.7333944296 48 | 46,1041550.5512228735 49 | 47,1042760.2599378303 50 | 48,1040462.8336176699 51 | 49,1047046.7241926882 52 | 50,1045679.2422573327 53 | 51,1045747.6636719257 54 | 52,1049089.8528528595 55 | 53,1035620.2848089266 56 | 54,1034976.1895653547 57 | 55,1038095.6592051706 58 | 56,1036446.0142701388 59 | 57,1036503.6369880091 60 | 58,1045212.4383314233 61 | 59,1041249.7131132156 62 | 60,1043152.1259919093 63 | 61,1038894.2796742605 64 | 62,1036445.4202070388 65 | -------------------------------------------------------------------------------- /results/firstRun/account_value_validation_945.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,1000000.0 3 | 1,1000303.8358812617 4 | 2,1000130.7493292923 5 | 3,1000130.7493292923 6 | 4,1000130.7493292923 7 | 5,1000130.7493292923 8 | 6,999482.0940510579 9 | 7,1000033.0484835203 10 | 8,1000011.8513318668 11 | 9,1003448.3099939692 12 | 10,1015025.7379515554 13 | 11,1002406.994996121 14 | 12,1001404.6379121403 15 | 13,1001404.6379121403 16 | 14,1001404.6379121403 17 | 15,1001404.6379121403 18 | 16,1001404.6379121403 19 | 17,1001404.6379121403 20 | 18,1001404.6379121403 21 | 19,1001404.6379121403 22 | 20,1001404.6379121403 23 | 21,1001404.6379121403 24 | 22,1001404.6379121403 25 | 23,1001404.6379121403 26 | 24,1001404.6379121403 27 | 25,1001404.6379121403 28 | 26,1001404.6379121403 29 | 27,1001404.6379121403 30 | 28,1001404.6379121403 31 | 29,1001404.6379121403 32 | 30,1001404.6379121403 33 | 31,1001404.6379121403 34 | 32,1001404.6379121403 35 | 33,1001404.6379121403 36 | 34,1001404.6379121403 37 | 35,1001404.6379121403 38 | 36,1001404.6379121403 39 | 37,1001404.6379121403 40 | 38,1001404.6379121403 41 | 39,1001404.6379121403 42 | 40,1001404.6379121403 43 | 41,1001404.6379121403 44 | 42,1001404.6379121403 45 | 43,1001404.6379121403 46 | 44,1001404.6379121403 47 | 45,999091.8117378587 48 | 46,1001978.3431609903 49 | 47,1001367.3027330867 50 | 48,1000801.8204558304 51 | 49,1000801.8204558304 52 | 50,1000801.8204558304 53 | 51,999040.5158876983 54 | 52,1000134.1838478623 55 | 53,999769.7190041846 56 | 54,999769.7190041846 57 | 55,999769.7190041846 58 | 56,999769.7190041846 59 | 57,999769.7190041846 60 | 58,999769.7190041846 61 | 59,1002105.9139344833 62 | 60,999624.4908828405 63 | 61,999259.0750951661 64 | 62,999259.0750951661 65 | -------------------------------------------------------------------------------- /results/firstRun/account_rewards_trade_ensemble_378.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,-1180.997915431857 3 | 1,-1315.3236608197913 4 | 2,5194.991446541622 5 | 3,-6265.381189931184 6 | 4,-2190.4471189007163 7 | 5,11398.699103907915 8 | 6,-3904.0057202060707 9 | 7,-452.7986533581279 10 | 8,-5548.481304524932 11 | 9,-611.3787129949778 12 | 10,-7485.800117183011 13 | 11,-264.18697195360437 14 | 12,-1595.755922964774 15 | 13,7443.6270896622445 16 | 14,11193.062967226608 17 | 15,-816.0945520012174 18 | 16,-637.3190014821012 19 | 17,-7567.527890105266 20 | 18,-7319.185102725634 21 | 19,-4812.201251435094 22 | 20,1099.5963213937357 23 | 21,16592.371933066985 24 | 22,-1380.2167002316564 25 | 23,2871.023929961724 26 | 24,-2002.401333362097 27 | 25,959.5357667435892 28 | 26,1355.010239358293 29 | 27,7986.617533285869 30 | 28,5430.141545429593 31 | 29,4802.272949290695 32 | 30,7594.6208964383695 33 | 31,2548.601436103694 34 | 32,6214.874686098425 35 | 33,-135.49682483053766 36 | 34,3424.1343997800723 37 | 35,-641.5042764106765 38 | 36,-2894.4886995928828 39 | 37,-272.5744039581623 40 | 38,15540.15959171229 41 | 39,-4911.071688905358 42 | 40,-226.67458751494996 43 | 41,-5185.269032648532 44 | 42,-1967.1355801522732 45 | 43,-3131.940246620681 46 | 44,2061.4959735122975 47 | 45,2261.6944054355845 48 | 46,-4418.384767507669 49 | 47,-1769.362939416431 50 | 48,3514.8402612050995 51 | 49,351.01318080420606 52 | 50,-1441.6716789009515 53 | 51,-2031.5477902353741 54 | 52,-13108.004520098446 55 | 53,1589.510761309415 56 | 54,-2605.5490963186603 57 | 55,-1924.3422561008483 58 | 56,1572.3566146825906 59 | 57,7165.468706608051 60 | 58,-1764.7021286510862 61 | 59,5278.169968649512 62 | 60,-3970.6006038130727 63 | 61,-1534.912151005352 64 | -------------------------------------------------------------------------------- /results/firstRun/account_value_trade_ensemble_315.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,1114824.2664504736 3 | 1,1108015.1283962645 4 | 2,1115166.1803218995 5 | 3,1113857.949798734 6 | 4,1117540.3377427673 7 | 5,1121375.8360420228 8 | 6,1108207.655885924 9 | 7,1111244.6435232912 10 | 8,1106993.8497807195 11 | 9,1109124.6360846867 12 | 10,1103994.7031209308 13 | 11,1110562.6486351045 14 | 12,1108563.9531085396 15 | 13,1111917.9140042267 16 | 14,1115373.2913316144 17 | 15,1119968.629937342 18 | 16,1116689.5207547264 19 | 17,1119229.1620365 20 | 18,1119261.8883366978 21 | 19,1116227.9428943172 22 | 20,1120718.6846180928 23 | 21,1115266.019541272 24 | 22,1111432.4179891655 25 | 23,1104970.964368414 26 | 24,1099509.4176921148 27 | 25,1125396.648505716 28 | 26,1128535.172697318 29 | 27,1151000.5913872533 30 | 28,1160595.5549072186 31 | 29,1166360.5935280614 32 | 30,1187653.7868070446 33 | 31,1197326.558346861 34 | 32,1187502.5853641534 35 | 33,1195997.155836893 36 | 34,1194750.502534155 37 | 35,1200735.3035302681 38 | 36,1201733.7674068206 39 | 37,1202966.1024689237 40 | 38,1206312.5722957938 41 | 39,1209261.9125341552 42 | 40,1206792.5667732756 43 | 41,1209558.1677468244 44 | 42,1216656.359543356 45 | 43,1214981.4369991247 46 | 44,1229773.6276427214 47 | 45,1234806.489997515 48 | 46,1250622.0367971747 49 | 47,1259794.4045603315 50 | 48,1272739.982914366 51 | 49,1265572.9181721632 52 | 50,1273828.766493582 53 | 51,1267788.1948328253 54 | 52,1275873.9709411138 55 | 53,1270934.9620270457 56 | 54,1272335.6927415454 57 | 55,1280593.2700177517 58 | 56,1276469.9771649174 59 | 57,1272462.788921002 60 | 58,1272860.3892189108 61 | 59,1274160.50998632 62 | 60,1266063.3594820139 63 | 61,1264771.4169481583 64 | 62,1259858.1435141487 65 | -------------------------------------------------------------------------------- /results/firstRun/account_value_trade_ensemble_504.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,1338233.7196536912 3 | 1,1325387.8431219074 4 | 2,1331297.6133242922 5 | 3,1335911.5551762017 6 | 4,1336980.428057136 7 | 5,1349327.6207511998 8 | 6,1345206.7575426018 9 | 7,1354807.7252512176 10 | 8,1353284.958146174 11 | 9,1349592.2833401628 12 | 10,1357459.8583194166 13 | 11,1355643.2153125 14 | 12,1356977.3504462142 15 | 13,1358091.5887855305 16 | 14,1373125.9106495923 17 | 15,1383602.501145932 18 | 16,1392385.0199667434 19 | 17,1390992.644001812 20 | 18,1390766.761072763 21 | 19,1391146.986001342 22 | 20,1393002.6475560633 23 | 21,1393574.0463386353 24 | 22,1393360.7674449873 25 | 23,1394069.7831363128 26 | 24,1391506.3346585971 27 | 25,1387454.8520019113 28 | 26,1380429.9377763653 29 | 27,1381653.42985611 30 | 28,1390858.8206129458 31 | 29,1391836.8450885154 32 | 30,1395653.8052670725 33 | 31,1379756.8457842572 34 | 32,1377757.2919068905 35 | 33,1379484.4017804393 36 | 34,1391308.129323653 37 | 35,1384697.825134926 38 | 36,1380193.5514145505 39 | 37,1380996.5043413595 40 | 38,1379881.2278539455 41 | 39,1387355.8029140842 42 | 40,1390858.01970162 43 | 41,1393325.590799887 44 | 42,1392253.2231633554 45 | 43,1376772.1023100181 46 | 44,1374101.8621473883 47 | 45,1379469.5003119758 48 | 46,1382658.5505865475 49 | 47,1396586.5842398007 50 | 48,1398698.0347235848 51 | 49,1400838.2563950482 52 | 50,1405741.9977840546 53 | 51,1413205.770946439 54 | 52,1419214.809117683 55 | 53,1423890.3768944384 56 | 54,1429727.040108397 57 | 55,1425932.56530494 58 | 56,1427080.966543497 59 | 57,1420013.4281207016 60 | 58,1416078.9169909728 61 | 59,1420088.3898905963 62 | 60,1423809.8370202996 63 | 61,1423244.2314371886 64 | 62,1429226.5849508496 65 | -------------------------------------------------------------------------------- /results/firstRun/account_value_validation_693.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,1000000.0 3 | 1,1000504.1133321441 4 | 2,1006214.3417126111 5 | 3,1005773.7963707637 6 | 4,1005773.7963707637 7 | 5,1005773.7963707637 8 | 6,1005773.7963707637 9 | 7,1005773.7963707637 10 | 8,1005773.7963707637 11 | 9,1005773.7963707637 12 | 10,1005773.7963707637 13 | 11,1005773.7963707637 14 | 12,1005773.7963707637 15 | 13,1005773.7963707637 16 | 14,1005773.7963707637 17 | 15,1005773.7963707637 18 | 16,1005773.7963707637 19 | 17,1005773.7963707637 20 | 18,1005773.7963707637 21 | 19,1005773.7963707637 22 | 20,1005773.7963707637 23 | 21,1005773.7963707637 24 | 22,1005773.7963707637 25 | 23,1005773.7963707637 26 | 24,1005773.7963707637 27 | 25,1005773.7963707637 28 | 26,1005773.7963707637 29 | 27,1005773.7963707637 30 | 28,1005773.7963707637 31 | 29,1005773.7963707637 32 | 30,1005773.7963707637 33 | 31,1005773.7963707637 34 | 32,1005773.7963707637 35 | 33,1005773.7963707637 36 | 34,1005773.7963707637 37 | 35,1005773.7963707637 38 | 36,1005773.7963707637 39 | 37,1005773.7963707637 40 | 38,1005773.7963707637 41 | 39,1005773.7963707637 42 | 40,1005773.7963707637 43 | 41,1005773.7963707637 44 | 42,1005773.7963707637 45 | 43,1005773.7963707637 46 | 44,1005773.7963707637 47 | 45,1005773.7963707637 48 | 46,1005773.7963707637 49 | 47,1005773.7963707637 50 | 48,1005773.7963707637 51 | 49,1005773.7963707637 52 | 50,1005773.7963707637 53 | 51,1003657.3459569192 54 | 52,1005956.7347410211 55 | 53,1006697.3608406794 56 | 54,982377.649868165 57 | 55,968156.2892633694 58 | 56,993497.0260280218 59 | 57,976733.8357266521 60 | 58,971257.2106813217 61 | 59,989095.3250684249 62 | 60,965803.4684389774 63 | 61,983750.8032464382 64 | 62,986755.897798824 65 | -------------------------------------------------------------------------------- /results/firstRun/account_value_validation_756.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,1000000.0 3 | 1,994538.5609446367 4 | 2,994251.9877217798 5 | 3,1005458.7481026341 6 | 4,997080.6477438761 7 | 5,1009965.8202803032 8 | 6,1003135.4021450512 9 | 7,1013832.964018287 10 | 8,1021938.8833049387 11 | 9,1026492.0433717392 12 | 10,1022975.2517709716 13 | 11,1021952.3522940843 14 | 12,1021952.3522940843 15 | 13,1021952.3522940843 16 | 14,1021952.3522940843 17 | 15,1021952.3522940843 18 | 16,1021952.3522940843 19 | 17,1021952.3522940843 20 | 18,1021952.3522940843 21 | 19,1021952.3522940843 22 | 20,1021952.3522940843 23 | 21,1021952.3522940843 24 | 22,1021952.3522940843 25 | 23,1021952.3522940843 26 | 24,1021952.3522940843 27 | 25,1021952.3522940843 28 | 26,1021952.3522940843 29 | 27,1021952.3522940843 30 | 28,1021952.3522940843 31 | 29,1022211.4787278238 32 | 30,1022046.9918438913 33 | 31,1021410.7494343689 34 | 32,1024330.7769651145 35 | 33,1021425.7487999843 36 | 34,1021942.9872003093 37 | 35,1019641.205234878 38 | 36,1019050.4821613352 39 | 37,1000079.3542820617 40 | 38,1012572.8853705846 41 | 39,1001202.6998129233 42 | 40,1009529.7376136398 43 | 41,1019250.0308603337 44 | 42,1016693.9385180987 45 | 43,1030439.2520532719 46 | 44,1032740.2882047903 47 | 45,1036178.2911504996 48 | 46,1037911.0957043834 49 | 47,1036649.4845732916 50 | 48,1035853.6351271474 51 | 49,1038877.9685982078 52 | 50,1039845.8789838054 53 | 51,1034876.9544586351 54 | 52,1028518.4264736517 55 | 53,1034221.3412949713 56 | 54,1029996.6596343572 57 | 55,1032428.7450926166 58 | 56,1016254.1603214605 59 | 57,1016889.4099696781 60 | 58,1008421.0880888132 61 | 59,1000792.3697929722 62 | 60,1008591.2766677327 63 | 61,1007582.720260006 64 | 62,1007582.720260006 65 | -------------------------------------------------------------------------------- /results/firstRun/account_value_trade_ensemble_189.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,1087040.1166573188 3 | 1,1090236.5986041827 4 | 2,1085239.5244680485 5 | 3,1089158.3046335245 6 | 4,1085861.658194919 7 | 5,1097200.2453357342 8 | 6,1102709.1295924454 9 | 7,1102839.2115149414 10 | 8,1101938.750493427 11 | 9,1112366.820966465 12 | 10,1121070.6491553227 13 | 11,1120417.8340788172 14 | 12,1113442.655244539 15 | 13,1116883.0438764228 16 | 14,1118443.450114132 17 | 15,1121974.3055520437 18 | 16,1127439.4832094281 19 | 17,1119061.4651395688 20 | 18,1112794.8647627023 21 | 19,1121003.6340102095 22 | 20,1112861.2870979484 23 | 21,1108466.095053299 24 | 22,1110176.094865865 25 | 23,1113914.657316005 26 | 24,1111506.7276927475 27 | 25,1124319.066813461 28 | 26,1112224.7915649528 29 | 27,1113811.7156582123 30 | 28,1100919.6850238403 31 | 29,1112959.2643314304 32 | 30,1102772.271227906 33 | 31,1099877.3875622614 34 | 32,1092568.8958918985 35 | 33,1095900.9178900663 36 | 34,1097216.1437325736 37 | 35,1107551.2336692906 38 | 36,1116958.5095503735 39 | 37,1113802.1241605715 40 | 38,1116623.514154269 41 | 39,1107785.2684791824 42 | 40,1107359.8752517574 43 | 41,1110415.0435211384 44 | 42,1111280.0454423972 45 | 43,1119548.6684479332 46 | 44,1124862.2057187245 47 | 45,1126546.4534090045 48 | 46,1126254.9349699996 49 | 47,1122493.7773111383 50 | 48,1115923.6829737658 51 | 49,1112473.1229537511 52 | 50,1107245.11506313 53 | 51,1109813.7105968439 54 | 52,1105455.4192269905 55 | 53,1112788.6638106254 56 | 54,1116412.4060926558 57 | 55,1112584.815821071 58 | 56,1127877.7191159443 59 | 57,1085662.3536197694 60 | 58,1064423.226298804 61 | 59,1075226.0446049368 62 | 60,1094908.4250637 63 | 61,1107333.4071909578 64 | 62,1107538.721338863 65 | -------------------------------------------------------------------------------- /results/firstRun/account_value_trade_ensemble_252.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,1107538.721338863 3 | 1,1101696.0521246903 4 | 2,1098722.002838254 5 | 3,1112526.3246729097 6 | 4,1116826.9773866406 7 | 5,1123374.0035367152 8 | 6,1125031.8937417846 9 | 7,1139893.3815115893 10 | 8,1136652.6349308996 11 | 9,1139105.015034334 12 | 10,1138379.1245205163 13 | 11,1142280.034217665 14 | 12,1136202.5756421476 15 | 13,1136634.7009429908 16 | 14,1134111.9925620735 17 | 15,1130359.5751195787 18 | 16,1133822.2216248037 19 | 17,1133813.1923894202 20 | 18,1134060.1433830457 21 | 19,1137686.275454836 22 | 20,1131746.3146785877 23 | 21,1133235.316998999 24 | 22,1133307.4907240323 25 | 23,1143243.9734107389 26 | 24,1143022.4398204056 27 | 25,1143354.578331652 28 | 26,1143271.2347751989 29 | 27,1152390.7556561562 30 | 28,1150367.090541564 31 | 29,1152359.352817747 32 | 30,1143729.270945301 33 | 31,1146511.1988777136 34 | 32,1146928.4202262515 35 | 33,1148520.0011208695 36 | 34,1144961.2563839962 37 | 35,1149399.5137362825 38 | 36,1147761.9368687535 39 | 37,1145924.097921031 40 | 38,1144444.691798593 41 | 39,1150237.751312339 42 | 40,1147698.042523323 43 | 41,1145454.8109408915 44 | 42,1148498.1242864376 45 | 43,1150133.5294993129 46 | 44,1150393.792583679 47 | 45,1149239.4920986162 48 | 46,1143863.8036400648 49 | 47,1123187.4752914053 50 | 48,1138007.257509323 51 | 49,1121859.8577980616 52 | 50,1119437.7699762618 53 | 51,1129240.3937627177 54 | 52,1124280.4687967373 55 | 53,1123231.047355652 56 | 54,1125037.8342424338 57 | 55,1134430.0947333472 58 | 56,1139413.1043381551 59 | 57,1129262.7430041567 60 | 58,1115477.7861206203 61 | 59,1127668.1256929925 62 | 60,1122777.5627460235 63 | 61,1105596.356433906 64 | 62,1114824.2664504736 65 | -------------------------------------------------------------------------------- /results/firstRun/account_value_trade_ensemble_378.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,1259858.1435141487 3 | 1,1262615.2851419451 4 | 2,1261299.9614811253 5 | 3,1266494.952927667 6 | 4,1260229.5717377358 7 | 5,1258039.124618835 8 | 6,1269437.823722743 9 | 7,1265533.818002537 10 | 8,1265081.0193491788 11 | 9,1259532.5380446538 12 | 10,1258921.1593316589 13 | 11,1251435.3592144758 14 | 12,1251171.1722425222 15 | 13,1249575.4163195575 16 | 14,1257019.0434092197 17 | 15,1268212.1063764463 18 | 16,1267396.011824445 19 | 17,1266758.692822963 20 | 18,1259191.1649328577 21 | 19,1251871.979830132 22 | 20,1247059.778578697 23 | 21,1248159.3749000907 24 | 22,1264751.7468331577 25 | 23,1263371.530132926 26 | 24,1266242.5540628878 27 | 25,1264240.1527295257 28 | 26,1265199.6884962693 29 | 27,1266554.6987356276 30 | 28,1274541.3162689134 31 | 29,1279971.457814343 32 | 30,1284773.7307636337 33 | 31,1292368.351660072 34 | 32,1294916.9530961758 35 | 33,1301131.8277822742 36 | 34,1300996.3309574437 37 | 35,1304420.4653572238 38 | 36,1303778.961080813 39 | 37,1300884.4723812202 40 | 38,1300611.897977262 41 | 39,1316152.0575689743 42 | 40,1311240.985880069 43 | 41,1311014.311292554 44 | 42,1305829.0422599055 45 | 43,1303861.9066797532 46 | 44,1300729.9664331325 47 | 45,1302791.4624066448 48 | 46,1305053.1568120804 49 | 47,1300634.7720445727 50 | 48,1298865.4091051563 51 | 49,1302380.2493663614 52 | 50,1302731.2625471656 53 | 51,1301289.5908682647 54 | 52,1299258.0430780293 55 | 53,1286150.0385579308 56 | 54,1287739.5493192403 57 | 55,1285134.0002229216 58 | 56,1283209.6579668208 59 | 57,1284782.0145815033 60 | 58,1291947.4832881114 61 | 59,1290182.7811594603 62 | 60,1295460.9511281098 63 | 61,1291490.3505242968 64 | 62,1289955.4383732914 65 | -------------------------------------------------------------------------------- /results/firstRun/account_value_trade_ensemble_441.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,1289955.4383732914 3 | 1,1286257.9130951816 4 | 2,1288219.4952365826 5 | 3,1287463.6383702122 6 | 4,1287721.8582425825 7 | 5,1288853.1287834665 8 | 6,1287708.553565903 9 | 7,1279362.1417497562 10 | 8,1290212.6370959617 11 | 9,1291668.5695842626 12 | 10,1288421.5381247334 13 | 11,1296397.4680579624 14 | 12,1294937.823563866 15 | 13,1310536.4596482073 16 | 14,1331207.443532908 17 | 15,1331067.6874492532 18 | 16,1328235.3020372058 19 | 17,1325396.0283773134 20 | 18,1329576.817438849 21 | 19,1328247.2724829416 22 | 20,1327780.7400565348 23 | 21,1327601.2223221986 24 | 22,1328327.4582866258 25 | 23,1328241.516807374 26 | 24,1327886.7725221114 27 | 25,1327886.7725221114 28 | 26,1327886.7725221114 29 | 27,1327624.5080562579 30 | 28,1327525.609582147 31 | 29,1327525.609582147 32 | 30,1327525.609582147 33 | 31,1327525.609582147 34 | 32,1327525.609582147 35 | 33,1327525.609582147 36 | 34,1327449.2779386174 37 | 35,1327749.4196333988 38 | 36,1327592.7094363624 39 | 37,1327663.6629580716 40 | 38,1327351.2406662994 41 | 39,1327511.2095782133 42 | 40,1328216.5285155368 43 | 41,1329797.3803345556 44 | 42,1329123.2745996292 45 | 43,1327379.7439191805 46 | 44,1327799.2077384542 47 | 45,1327072.1977872602 48 | 46,1330818.447409568 49 | 47,1330107.2309577453 50 | 48,1332835.2039261677 51 | 49,1332621.770705375 52 | 50,1332103.3466947726 53 | 51,1332060.9443864762 54 | 52,1339111.6826820052 55 | 53,1336933.6428835215 56 | 54,1335227.7242664176 57 | 55,1334884.2926391128 58 | 56,1337817.522527527 59 | 57,1338325.2434594433 60 | 58,1331900.0124151336 61 | 59,1337976.422289423 62 | 60,1324562.4842142165 63 | 61,1330217.3829113338 64 | 62,1338233.7196536912 65 | -------------------------------------------------------------------------------- /results/firstRun/account_value_trade_ensemble_693.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,1592770.372850434 3 | 1,1578384.2148526958 4 | 2,1583009.9525726235 5 | 3,1603051.542247533 6 | 4,1594164.8676964256 7 | 5,1611875.657476047 8 | 6,1603516.818515419 9 | 7,1611102.121547299 10 | 8,1619517.5187964598 11 | 9,1607513.894897678 12 | 10,1595817.3534548637 13 | 11,1594422.3123530075 14 | 12,1594422.3123530075 15 | 13,1594422.3123530075 16 | 14,1594422.3123530075 17 | 15,1594422.3123530075 18 | 16,1594422.3123530075 19 | 17,1594422.3123530075 20 | 18,1594422.3123530075 21 | 19,1594422.3123530075 22 | 20,1594422.3123530075 23 | 21,1594422.3123530075 24 | 22,1594422.3123530075 25 | 23,1594422.3123530075 26 | 24,1594422.3123530075 27 | 25,1594422.3123530075 28 | 26,1594422.3123530075 29 | 27,1594422.3123530075 30 | 28,1594422.3123530075 31 | 29,1594627.708980068 32 | 30,1594519.083949331 33 | 31,1594511.1158561707 34 | 32,1596554.2197233094 35 | 33,1595442.9729196585 36 | 34,1595532.1435927162 37 | 35,1593520.1143945477 38 | 36,1592145.4891252555 39 | 37,1585076.9818070477 40 | 38,1592084.9164947586 41 | 39,1585267.6190366326 42 | 40,1591712.7251571761 43 | 41,1596569.044803735 44 | 42,1595305.35874803 45 | 43,1608243.9746038215 46 | 44,1614844.9447990586 47 | 45,1618098.3934869033 48 | 46,1617758.3325122795 49 | 47,1616099.0772430326 50 | 48,1605877.2669255282 51 | 49,1602385.1370083864 52 | 50,1596623.6877376984 53 | 51,1590598.07041834 54 | 52,1572884.8886430394 55 | 53,1569508.840097196 56 | 54,1561301.1437175302 57 | 55,1563971.7768560823 58 | 56,1542169.1853770027 59 | 57,1546430.5713026978 60 | 58,1538647.0421589613 61 | 59,1551918.9455386624 62 | 60,1550122.4969069678 63 | 61,1548572.384419588 64 | 62,1548572.384419588 65 | -------------------------------------------------------------------------------- /results/firstRun/account_value_trade_ensemble_756.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,1548572.384419588 3 | 1,1549043.8344118004 4 | 2,1553374.374679948 5 | 3,1555746.7518588193 6 | 4,1551771.5757845729 7 | 5,1557261.9265346087 8 | 6,1562268.8773835115 9 | 7,1564688.7020737887 10 | 8,1561725.7583084817 11 | 9,1568441.3669227045 12 | 10,1559184.8200721818 13 | 11,1562837.5390144184 14 | 12,1561436.1130134647 15 | 13,1567526.7214888392 16 | 14,1583765.2689987214 17 | 15,1595230.7531467038 18 | 16,1588718.4200231931 19 | 17,1582316.5301434442 20 | 18,1588967.6931833436 21 | 19,1580495.876409303 22 | 20,1578915.3946156213 23 | 21,1578915.3946156213 24 | 22,1578915.3946156213 25 | 23,1578915.3946156213 26 | 24,1578915.3946156213 27 | 25,1578915.3946156213 28 | 26,1578915.3946156213 29 | 27,1578915.3946156213 30 | 28,1578915.3946156213 31 | 29,1578915.3946156213 32 | 30,1578915.3946156213 33 | 31,1578915.3946156213 34 | 32,1578915.3946156213 35 | 33,1578915.3946156213 36 | 34,1578915.3946156213 37 | 35,1577927.941810775 38 | 36,1578895.5958821988 39 | 37,1584811.4631697529 40 | 38,1584150.3781740796 41 | 39,1583789.327914639 42 | 40,1577007.2538041805 43 | 41,1576136.058788537 44 | 42,1576136.058788537 45 | 43,1576133.380897116 46 | 44,1576759.2270923536 47 | 45,1574548.3825948494 48 | 46,1572432.9868548692 49 | 47,1573690.5954889916 50 | 48,1572745.345884625 51 | 49,1572745.345884625 52 | 50,1572745.345884625 53 | 51,1572745.345884625 54 | 52,1574017.3483295217 55 | 53,1573836.124039589 56 | 54,1575816.0634317254 57 | 55,1577473.422047969 58 | 56,1572860.0048274738 59 | 57,1571464.776110251 60 | 58,1567041.53746429 61 | 59,1569095.458932322 62 | 60,1568154.5538699296 63 | 61,1568154.5538699296 64 | 62,1568154.5538699296 65 | -------------------------------------------------------------------------------- /results/firstRun/account_value_validation_1071.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,1000000.0 3 | 1,999991.1927219962 4 | 2,1000561.8535792081 5 | 3,1004283.071983475 6 | 4,1003691.8680521005 7 | 5,1003691.8680521005 8 | 6,1003691.8680521005 9 | 7,1003691.8680521005 10 | 8,1004833.2931713178 11 | 9,1002179.5065444799 12 | 10,1003610.0687741627 13 | 11,1011148.157019926 14 | 12,1010964.576671814 15 | 13,1009988.9558723215 16 | 14,1009988.9558723215 17 | 15,1009988.9558723215 18 | 16,1009988.9558723215 19 | 17,1009988.9558723215 20 | 18,1007484.3970817223 21 | 19,1007262.7185911405 22 | 20,1000689.7622479644 23 | 21,1005983.2947430671 24 | 22,1007711.1506734575 25 | 23,1007149.5737533653 26 | 24,1007149.5737533653 27 | 25,1007149.5737533653 28 | 26,1007149.5737533653 29 | 27,1007149.5737533653 30 | 28,1007149.5737533653 31 | 29,1007149.5737533653 32 | 30,1007149.5737533653 33 | 31,1007149.5737533653 34 | 32,1007149.5737533653 35 | 33,1007149.5737533653 36 | 34,1007149.5737533653 37 | 35,1007149.5737533653 38 | 36,1007149.5737533653 39 | 37,1007149.5737533653 40 | 38,1007149.5737533653 41 | 39,1007149.5737533653 42 | 40,1007149.5737533653 43 | 41,1007149.5737533653 44 | 42,1007149.5737533653 45 | 43,1007149.5737533653 46 | 44,1007149.5737533653 47 | 45,1007149.5737533653 48 | 46,1007149.5737533653 49 | 47,1007149.5737533653 50 | 48,1007149.5737533653 51 | 49,1007149.5737533653 52 | 50,1007149.5737533653 53 | 51,1007149.5737533653 54 | 52,1007149.5737533653 55 | 53,1007149.5737533653 56 | 54,1007149.5737533653 57 | 55,1007149.5737533653 58 | 56,1007149.5737533653 59 | 57,1007149.5737533653 60 | 58,1007149.5737533653 61 | 59,1007149.5737533653 62 | 60,1007149.5737533653 63 | 61,1007149.5737533653 64 | 62,1007149.5737533653 65 | -------------------------------------------------------------------------------- /results/firstRun/account_value_trade_ensemble_567.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,1429226.5849508496 3 | 1,1436073.9508691977 4 | 2,1444460.6590960184 5 | 3,1444775.9625836331 6 | 4,1446762.9723618347 7 | 5,1454028.1538165126 8 | 6,1456905.9968427224 9 | 7,1461587.6397495149 10 | 8,1463484.6262333507 11 | 9,1467682.5600034513 12 | 10,1465802.993659308 13 | 11,1471272.6328516107 14 | 12,1474832.0286917698 15 | 13,1483145.8501361434 16 | 14,1480407.2144759179 17 | 15,1497064.1629886061 18 | 16,1488500.9685540306 19 | 17,1486960.1957034944 20 | 18,1491379.3624236437 21 | 19,1486935.5688662042 22 | 20,1486392.2934274368 23 | 21,1491369.789999325 24 | 22,1498449.472638728 25 | 23,1495659.8418394604 26 | 24,1493937.8939060175 27 | 25,1499467.990544457 28 | 26,1498963.387139301 29 | 27,1491706.0071529266 30 | 28,1491844.6195463678 31 | 29,1490482.3638027064 32 | 30,1494090.8425105063 33 | 31,1481160.8494283394 34 | 32,1486328.9228685915 35 | 33,1479729.444132879 36 | 34,1483458.3260648057 37 | 35,1493557.6315131045 38 | 36,1490629.0912199577 39 | 37,1489244.5164676274 40 | 38,1491367.382475095 41 | 39,1511157.6241743395 42 | 40,1514409.1192746027 43 | 41,1538874.0649149911 44 | 42,1533976.46690196 45 | 43,1534188.9472389221 46 | 44,1523447.1490862267 47 | 45,1527037.6156208941 48 | 46,1528005.3143319997 49 | 47,1538462.797687154 50 | 48,1543408.0154908514 51 | 49,1548817.3398420857 52 | 50,1554781.870726132 53 | 51,1545565.946729011 54 | 52,1558286.8565286845 55 | 53,1565076.9596606921 56 | 54,1564084.3169395027 57 | 55,1564389.7927354157 58 | 56,1570937.2031247378 59 | 57,1569226.3207203364 60 | 58,1573243.7628376246 61 | 59,1573697.2761766836 62 | 60,1574762.262338808 63 | 61,1569182.1623827205 64 | 62,1580060.0835413162 65 | -------------------------------------------------------------------------------- /results/firstRun/account_value_trade_ensemble_819.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,1568154.5538699296 3 | 1,1567081.2648185305 4 | 2,1566908.5091536576 5 | 3,1566908.5091536576 6 | 4,1566908.5091536576 7 | 5,1566908.5091536576 8 | 6,1566908.5091536576 9 | 7,1567742.3706378324 10 | 8,1567008.5948221332 11 | 9,1573535.3277473564 12 | 10,1574454.1793549592 13 | 11,1573967.7520048204 14 | 12,1573967.7520048204 15 | 13,1573967.7520048204 16 | 14,1573967.7520048204 17 | 15,1573967.7520048204 18 | 16,1573967.7520048204 19 | 17,1573967.7520048204 20 | 18,1573967.7520048204 21 | 19,1573967.7520048204 22 | 20,1573967.7520048204 23 | 21,1573967.7520048204 24 | 22,1573967.7520048204 25 | 23,1573967.7520048204 26 | 24,1573967.7520048204 27 | 25,1573967.7520048204 28 | 26,1573967.7520048204 29 | 27,1573967.7520048204 30 | 28,1573967.7520048204 31 | 29,1573967.7520048204 32 | 30,1573967.7520048204 33 | 31,1573967.7520048204 34 | 32,1573967.7520048204 35 | 33,1573967.7520048204 36 | 34,1573967.7520048204 37 | 35,1573967.7520048204 38 | 36,1573967.7520048204 39 | 37,1573967.7520048204 40 | 38,1573967.7520048204 41 | 39,1573967.7520048204 42 | 40,1573967.7520048204 43 | 41,1573967.7520048204 44 | 42,1573967.7520048204 45 | 43,1573967.7520048204 46 | 44,1573967.7520048204 47 | 45,1573967.7520048204 48 | 46,1573967.7520048204 49 | 47,1573967.7520048204 50 | 48,1573967.7520048204 51 | 49,1573967.7520048204 52 | 50,1573967.7520048204 53 | 51,1573967.7520048204 54 | 52,1573967.7520048204 55 | 53,1573967.7520048204 56 | 54,1573967.7520048204 57 | 55,1573967.7520048204 58 | 56,1573967.7520048204 59 | 57,1579668.966766409 60 | 58,1579537.062252677 61 | 59,1579537.062252677 62 | 60,1579537.062252677 63 | 61,1579537.062252677 64 | 62,1579537.062252677 65 | -------------------------------------------------------------------------------- /results/firstRun/account_value_trade_ensemble_1008.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,1660419.855537839 3 | 1,1657670.7906786085 4 | 2,1660441.7394871446 5 | 3,1663051.3957246128 6 | 4,1662429.6296936057 7 | 5,1662429.6296936057 8 | 6,1662429.6296936057 9 | 7,1662429.6296936057 10 | 8,1663382.397578375 11 | 9,1662328.7453100847 12 | 10,1661972.7862172173 13 | 11,1663711.3304878178 14 | 12,1660676.4760490768 15 | 13,1660035.9510537093 16 | 14,1660035.9510537093 17 | 15,1660035.9510537093 18 | 16,1660035.9510537093 19 | 17,1660035.9510537093 20 | 18,1658794.5888870903 21 | 19,1658622.828759665 22 | 20,1654462.814213929 23 | 21,1658153.261834662 24 | 22,1658795.9884000057 25 | 23,1658379.2371734818 26 | 24,1658379.2371734818 27 | 25,1658379.2371734818 28 | 26,1658379.2371734818 29 | 27,1658379.2371734818 30 | 28,1658379.2371734818 31 | 29,1658379.2371734818 32 | 30,1658379.2371734818 33 | 31,1658379.2371734818 34 | 32,1658379.2371734818 35 | 33,1658379.2371734818 36 | 34,1658379.2371734818 37 | 35,1658379.2371734818 38 | 36,1658379.2371734818 39 | 37,1658379.2371734818 40 | 38,1658379.2371734818 41 | 39,1658379.2371734818 42 | 40,1658379.2371734818 43 | 41,1658379.2371734818 44 | 42,1658379.2371734818 45 | 43,1658379.2371734818 46 | 44,1658379.2371734818 47 | 45,1658379.2371734818 48 | 46,1658379.2371734818 49 | 47,1658379.2371734818 50 | 48,1658379.2371734818 51 | 49,1658379.2371734818 52 | 50,1658379.2371734818 53 | 51,1658379.2371734818 54 | 52,1658379.2371734818 55 | 53,1658379.2371734818 56 | 54,1658379.2371734818 57 | 55,1658379.2371734818 58 | 56,1658379.2371734818 59 | 57,1658379.2371734818 60 | 58,1658379.2371734818 61 | 59,1658379.2371734818 62 | 60,1658379.2371734818 63 | 61,1658379.2371734818 64 | 62,1658379.2371734818 65 | -------------------------------------------------------------------------------- /results/firstRun/account_value_trade_ensemble_1134.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,1657123.6130156124 3 | 1,1656043.6392938206 4 | 2,1656856.3527892902 5 | 3,1656535.263367586 6 | 4,1655425.8504123848 7 | 5,1655262.4993906547 8 | 6,1655262.4993906547 9 | 7,1655262.4993906547 10 | 8,1655262.4993906547 11 | 9,1655262.4993906547 12 | 10,1655262.4993906547 13 | 11,1655262.4993906547 14 | 12,1655262.4993906547 15 | 13,1655262.4993906547 16 | 14,1655262.4993906547 17 | 15,1655262.4993906547 18 | 16,1655262.4993906547 19 | 17,1655262.4993906547 20 | 18,1655262.4993906547 21 | 19,1655262.4993906547 22 | 20,1655262.4993906547 23 | 21,1655262.4993906547 24 | 22,1655262.4993906547 25 | 23,1655262.4993906547 26 | 24,1655262.4993906547 27 | 25,1655262.4993906547 28 | 26,1655262.4993906547 29 | 27,1655262.4993906547 30 | 28,1655262.4993906547 31 | 29,1655262.4993906547 32 | 30,1655262.4993906547 33 | 31,1655262.4993906547 34 | 32,1655262.4993906547 35 | 33,1650488.3399829413 36 | 34,1644315.4348750429 37 | 35,1644144.5475814177 38 | 36,1644144.5475814177 39 | 37,1642670.8926698018 40 | 38,1642563.8331977944 41 | 39,1642563.8331977944 42 | 40,1642563.8331977944 43 | 41,1642563.8331977944 44 | 42,1642563.8331977944 45 | 43,1642563.8331977944 46 | 44,1642563.8331977944 47 | 45,1642563.8331977944 48 | 46,1642563.8331977944 49 | 47,1642563.8331977944 50 | 48,1642563.8331977944 51 | 49,1642563.8331977944 52 | 50,1642563.8331977944 53 | 51,1642563.8331977944 54 | 52,1642563.8331977944 55 | 53,1642563.8331977944 56 | 54,1642563.8331977944 57 | 55,1642563.8331977944 58 | 56,1642563.8331977944 59 | 57,1642563.8331977944 60 | 58,1642563.8331977944 61 | 59,1642563.8331977944 62 | 60,1642563.8331977944 63 | 61,1642563.8331977944 64 | 62,1642563.8331977944 65 | -------------------------------------------------------------------------------- /results/firstRun/account_value_trade_ensemble_1197.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,1642563.8331977944 3 | 1,1643462.975030125 4 | 2,1643322.2559021793 5 | 3,1643322.2559021793 6 | 4,1643322.2559021793 7 | 5,1643322.2559021793 8 | 6,1643322.2559021793 9 | 7,1643322.2559021793 10 | 8,1643322.2559021793 11 | 9,1643322.2559021793 12 | 10,1643322.2559021793 13 | 11,1643322.2559021793 14 | 12,1643322.2559021793 15 | 13,1643322.2559021793 16 | 14,1643322.2559021793 17 | 15,1643322.2559021793 18 | 16,1643322.2559021793 19 | 17,1643322.2559021793 20 | 18,1643322.2559021793 21 | 19,1643322.2559021793 22 | 20,1643322.2559021793 23 | 21,1643322.2559021793 24 | 22,1643322.2559021793 25 | 23,1643322.2559021793 26 | 24,1643322.2559021793 27 | 25,1643322.2559021793 28 | 26,1643322.2559021793 29 | 27,1643322.2559021793 30 | 28,1643322.2559021793 31 | 29,1643322.2559021793 32 | 30,1643322.2559021793 33 | 31,1643322.2559021793 34 | 32,1643322.2559021793 35 | 33,1643322.2559021793 36 | 34,1643322.2559021793 37 | 35,1643322.2559021793 38 | 36,1643322.2559021793 39 | 37,1642364.1231690145 40 | 38,1644453.298753176 41 | 39,1644086.3478741348 42 | 40,1644086.3478741348 43 | 41,1644086.3478741348 44 | 42,1651701.186454753 45 | 43,1651496.8197026039 46 | 44,1651496.8197026039 47 | 45,1651496.8197026039 48 | 46,1651496.8197026039 49 | 47,1651496.8197026039 50 | 48,1651496.8197026039 51 | 49,1651496.8197026039 52 | 50,1651496.8197026039 53 | 51,1651496.8197026039 54 | 52,1651496.8197026039 55 | 53,1651496.8197026039 56 | 54,1651496.8197026039 57 | 55,1651496.8197026039 58 | 56,1651496.8197026039 59 | 57,1651496.8197026039 60 | 58,1651496.8197026039 61 | 59,1651496.8197026039 62 | 60,1651496.8197026039 63 | 61,1651496.8197026039 64 | 62,1651496.8197026039 65 | -------------------------------------------------------------------------------- /results/firstRun/account_value_trade_ensemble_630.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,1580060.0835413162 3 | 1,1584788.6150590729 4 | 2,1596877.5033401628 5 | 3,1595280.6360698869 6 | 4,1595280.6360698869 7 | 5,1595280.6360698869 8 | 6,1595280.6360698869 9 | 7,1595280.6360698869 10 | 8,1595280.6360698869 11 | 9,1595280.6360698869 12 | 10,1595280.6360698869 13 | 11,1595280.6360698869 14 | 12,1595280.6360698869 15 | 13,1595280.6360698869 16 | 14,1595280.6360698869 17 | 15,1595280.6360698869 18 | 16,1595280.6360698869 19 | 17,1595280.6360698869 20 | 18,1595280.6360698869 21 | 19,1595280.6360698869 22 | 20,1595280.6360698869 23 | 21,1595280.6360698869 24 | 22,1595280.6360698869 25 | 23,1595280.6360698869 26 | 24,1595280.6360698869 27 | 25,1595280.6360698869 28 | 26,1595280.6360698869 29 | 27,1595280.6360698869 30 | 28,1595280.6360698869 31 | 29,1595280.6360698869 32 | 30,1595280.6360698869 33 | 31,1595280.6360698869 34 | 32,1595280.6360698869 35 | 33,1595280.6360698869 36 | 34,1595280.6360698869 37 | 35,1595280.6360698869 38 | 36,1595280.6360698869 39 | 37,1595280.6360698869 40 | 38,1595280.6360698869 41 | 39,1595280.6360698869 42 | 40,1595280.6360698869 43 | 41,1595280.6360698869 44 | 42,1595280.6360698869 45 | 43,1595280.6360698869 46 | 44,1595280.6360698869 47 | 45,1595280.6360698869 48 | 46,1595280.6360698869 49 | 47,1595280.6360698869 50 | 48,1595280.6360698869 51 | 49,1595280.6360698869 52 | 50,1595280.6360698869 53 | 51,1593209.6342154853 54 | 52,1593498.7423488405 55 | 53,1592099.9625013208 56 | 54,1582255.397255226 57 | 55,1574669.314934175 58 | 56,1589441.6200948493 59 | 57,1578460.8922769139 60 | 58,1575848.0864616209 61 | 59,1584666.7061780714 62 | 60,1569809.5645638634 63 | 61,1581997.7790138284 64 | 62,1592770.372850434 65 | -------------------------------------------------------------------------------- /results/firstRun/account_value_trade_ensemble_1071.csv: -------------------------------------------------------------------------------- 1 | ,0 2 | 0,1658379.2371734818 3 | 1,1657277.0048376138 4 | 2,1657066.0779181968 5 | 3,1657066.0779181968 6 | 4,1657066.0779181968 7 | 5,1657066.0779181968 8 | 6,1657066.0779181968 9 | 7,1657066.0779181968 10 | 8,1657066.0779181968 11 | 9,1657066.0779181968 12 | 10,1657066.0779181968 13 | 11,1657066.0779181968 14 | 12,1657066.0779181968 15 | 13,1657066.0779181968 16 | 14,1657066.0779181968 17 | 15,1657066.0779181968 18 | 16,1657066.0779181968 19 | 17,1657066.0779181968 20 | 18,1657066.0779181968 21 | 19,1657066.0779181968 22 | 20,1657066.0779181968 23 | 21,1657066.0779181968 24 | 22,1657066.0779181968 25 | 23,1657066.0779181968 26 | 24,1657066.0779181968 27 | 25,1657066.0779181968 28 | 26,1657066.0779181968 29 | 27,1657066.0779181968 30 | 28,1657329.5785728805 31 | 29,1657123.6130156124 32 | 30,1657123.6130156124 33 | 31,1657123.6130156124 34 | 32,1657123.6130156124 35 | 33,1657123.6130156124 36 | 34,1657123.6130156124 37 | 35,1657123.6130156124 38 | 36,1657123.6130156124 39 | 37,1657123.6130156124 40 | 38,1657123.6130156124 41 | 39,1657123.6130156124 42 | 40,1657123.6130156124 43 | 41,1657123.6130156124 44 | 42,1657123.6130156124 45 | 43,1657123.6130156124 46 | 44,1657123.6130156124 47 | 45,1657123.6130156124 48 | 46,1657123.6130156124 49 | 47,1657123.6130156124 50 | 48,1657123.6130156124 51 | 49,1657123.6130156124 52 | 50,1657123.6130156124 53 | 51,1657123.6130156124 54 | 52,1657123.6130156124 55 | 53,1657123.6130156124 56 | 54,1657123.6130156124 57 | 55,1657123.6130156124 58 | 56,1657123.6130156124 59 | 57,1657123.6130156124 60 | 58,1657123.6130156124 61 | 59,1657123.6130156124 62 | 60,1657123.6130156124 63 | 61,1657123.6130156124 64 | 62,1657123.6130156124 65 | -------------------------------------------------------------------------------- /run_DRL.py: -------------------------------------------------------------------------------- 1 | # common library 2 | import pandas as pd 3 | import numpy as np 4 | import time 5 | from stable_baselines.common.vec_env import DummyVecEnv 6 | 7 | # preprocessor 8 | from preprocessing.preprocessors import * 9 | # config 10 | from config.config import * 11 | # model 12 | from model.models import * 13 | import os 14 | 15 | def run_model() -> None: 16 | """Train the model.""" 17 | 18 | # read and preprocess data 19 | preprocessed_path = "done_data.csv" 20 | if os.path.exists(preprocessed_path): 21 | data = pd.read_csv(preprocessed_path, index_col=0) 22 | else: 23 | data = preprocess_data() 24 | data = add_turbulence(data) 25 | data.to_csv(preprocessed_path) 26 | 27 | print(data.head()) 28 | print(data.size) 29 | 30 | # 2015/10/01 is the date that validation starts 31 | # 2016/01/01 is the date that real trading starts 32 | # unique_trade_date needs to start from 2015/10/01 for validation purpose 33 | unique_trade_date = data[(data.datadate > 20151001)&(data.datadate <= 20200707)].datadate.unique() 34 | print(unique_trade_date) 35 | 36 | # rebalance_window is the number of months to retrain the model 37 | # validation_window is the number of months to validation the model and select for trading 38 | rebalance_window = 63 39 | validation_window = 63 40 | 41 | ## Ensemble Strategy 42 | run_ensemble_strategy(df=data, 43 | unique_trade_date= unique_trade_date, 44 | rebalance_window = rebalance_window, 45 | validation_window=validation_window) 46 | 47 | #_logger.info(f"saving model version: {_version}") 48 | 49 | if __name__ == "__main__": 50 | run_model() 51 | -------------------------------------------------------------------------------- /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Python 3", 3 | "build": { 4 | "dockerfile": "Dockerfile", 5 | "context": "..", 6 | "args": { 7 | // Update 'VARIANT' to pick a Python version: 3, 3.6, 3.7, 3.8 8 | "VARIANT": "3.7", 9 | // Options 10 | "INSTALL_NODE": "false", 11 | "NODE_VERSION": "lts/*" 12 | } 13 | }, 14 | 15 | // Set *default* container specific settings.json values on container create. 16 | "settings": { 17 | "terminal.integrated.shell.linux": "/bin/bash", 18 | "python.pythonPath": "/usr/local/bin/python", 19 | "python.linting.enabled": true, 20 | "python.linting.pylintEnabled": true, 21 | "python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8", 22 | "python.formatting.blackPath": "/usr/local/py-utils/bin/black", 23 | "python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf", 24 | "python.linting.banditPath": "/usr/local/py-utils/bin/bandit", 25 | "python.linting.flake8Path": "/usr/local/py-utils/bin/flake8", 26 | "python.linting.mypyPath": "/usr/local/py-utils/bin/mypy", 27 | "python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle", 28 | "python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle", 29 | "python.linting.pylintPath": "/usr/local/py-utils/bin/pylint" 30 | }, 31 | 32 | // Add the IDs of extensions you want installed when the container is created. 33 | "extensions": [ 34 | "ms-python.python" 35 | ] 36 | 37 | // Use 'forwardPorts' to make a list of ports inside the container available locally. 38 | // "forwardPorts": [], 39 | 40 | // Use 'postCreateCommand' to run commands after the container is created. 41 | // "postCreateCommand": "pip3 install --user -r requirements.txt", 42 | 43 | // Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root. 44 | // "remoteUser": "vscode" 45 | } 46 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Custom config 2 | results/ 3 | 4 | 5 | # remove DS_Store 6 | **/.DS_Store 7 | 8 | # Byte-compiled / optimized / DLL files 9 | __pycache__/ 10 | *.py[cod] 11 | *$py.class 12 | 13 | # C extensions 14 | *.so 15 | 16 | # Distribution / packaging 17 | .Python 18 | build/ 19 | develop-eggs/ 20 | dist/ 21 | downloads/ 22 | eggs/ 23 | .eggs/ 24 | lib/ 25 | lib64/ 26 | parts/ 27 | sdist/ 28 | var/ 29 | wheels/ 30 | pip-wheel-metadata/ 31 | share/python-wheels/ 32 | *.egg-info/ 33 | .installed.cfg 34 | *.egg 35 | MANIFEST 36 | 37 | # PyInstaller 38 | # Usually these files are written by a python script from a template 39 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 40 | *.manifest 41 | *.spec 42 | 43 | # Installer logs 44 | pip-log.txt 45 | pip-delete-this-directory.txt 46 | 47 | # Unit test / coverage reports 48 | htmlcov/ 49 | .tox/ 50 | .nox/ 51 | .coverage 52 | .coverage.* 53 | .cache 54 | nosetests.xml 55 | coverage.xml 56 | *.cover 57 | *.py,cover 58 | .hypothesis/ 59 | .pytest_cache/ 60 | 61 | # Translations 62 | *.mo 63 | *.pot 64 | 65 | # Django stuff: 66 | *.log 67 | local_settings.py 68 | db.sqlite3 69 | db.sqlite3-journal 70 | 71 | # Flask stuff: 72 | instance/ 73 | .webassets-cache 74 | 75 | # Scrapy stuff: 76 | .scrapy 77 | 78 | # Sphinx documentation 79 | docs/_build/ 80 | 81 | # PyBuilder 82 | target/ 83 | 84 | # Jupyter Notebook 85 | .ipynb_checkpoints 86 | 87 | # IPython 88 | profile_default/ 89 | ipython_config.py 90 | 91 | # pyenv 92 | .python-version 93 | 94 | # pipenv 95 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 96 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 97 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 98 | # install all needed dependencies. 99 | #Pipfile.lock 100 | 101 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 102 | __pypackages__/ 103 | 104 | # Celery stuff 105 | celerybeat-schedule 106 | celerybeat.pid 107 | 108 | # SageMath parsed files 109 | *.sage.py 110 | 111 | # Environments 112 | .env 113 | .venv 114 | env/ 115 | venv/ 116 | ENV/ 117 | env.bak/ 118 | venv.bak/ 119 | 120 | # Spyder project settings 121 | .spyderproject 122 | .spyproject 123 | 124 | # Rope project settings 125 | .ropeproject 126 | 127 | # mkdocs documentation 128 | /site 129 | 130 | # mypy 131 | .mypy_cache/ 132 | .dmypy.json 133 | dmypy.json 134 | 135 | # Pyre type checker 136 | .pyre/ 137 | -------------------------------------------------------------------------------- /results/firstRun/last_state_ensemble_62.csv: -------------------------------------------------------------------------------- 1 | last_state 2 | 1651496.8197026039 3 | 373.85 4 | 96.58 5 | 187.91 6 | 129.43 7 | 46.42 8 | 88.57 9 | 54.61 10 | 114.43 11 | 207.36 12 | 249.55 13 | 120.19 14 | 59.54 15 | 142.98 16 | 95.0 17 | 45.23 18 | 188.5 19 | 158.1 20 | 79.58 21 | 210.7 22 | 99.95 23 | 34.51 24 | 121.63 25 | 63.32 26 | 114.57 27 | 302.81 28 | 197.76 29 | 55.24 30 | 43.16 31 | 118.89 32 | 44.39 33 | 0.0 34 | 0.0 35 | 0.0 36 | 0.0 37 | 0.0 38 | 0.0 39 | 0.0 40 | 0.0 41 | 0.0 42 | 0.0 43 | 0.0 44 | 0.0 45 | 0.0 46 | 0.0 47 | 0.0 48 | 0.0 49 | 0.0 50 | 0.0 51 | 0.0 52 | 0.0 53 | 0.0 54 | 0.0 55 | 0.0 56 | 0.0 57 | 0.0 58 | 0.0 59 | 0.0 60 | 0.0 61 | 0.0 62 | 0.0 63 | 12.230067802371593 64 | -0.6345341577656143 65 | 4.8747775257054125 66 | 1.5718631306309017 67 | 0.2682890615120783 68 | -1.2548435363914052 69 | 0.9541971335911584 70 | -0.8714755709854671 71 | 0.8537226492965999 72 | 2.090576978322474 73 | -1.2254644728029405 74 | -0.5148422034022389 75 | -1.4057131039860735 76 | -1.263561094873168 77 | -0.494324283410343 78 | -0.6539686382684238 79 | 0.5229186391621852 80 | -0.20628816531942107 81 | 5.76394123661504 82 | 0.6804070677102061 83 | -0.6281821722777892 84 | 0.9961843107986256 85 | -0.953102849582116 86 | 1.2181978396960034 87 | 1.0531338681505529 88 | 1.4070093785051083 89 | -0.4279464533259869 90 | -0.1284222510831583 91 | -0.8722538488321874 92 | -0.7025776748477668 93 | 64.96981653841408 94 | 49.7429949396449 95 | 52.40865956288525 96 | 54.66034646412234 97 | 53.687149522347994 98 | 48.192093249609776 99 | 57.63255434192458 100 | 50.25131054579843 101 | 53.75009522831419 102 | 55.66673173129654 103 | 48.382897503149735 104 | 49.7164298866372 105 | 49.2156078316329 106 | 47.97223759344897 107 | 46.99172450041418 108 | 51.647288200390854 109 | 52.87726648612874 110 | 51.46895218832787 111 | 63.59424196536498 112 | 54.24888567436578 113 | 48.36477884042922 114 | 54.9915273796733 115 | 44.50284507402885 116 | 52.870182213893536 117 | 54.4509839200748 118 | 55.21242538987319 119 | 48.30696896261138 120 | 49.99472997264132 121 | 46.72349180413721 122 | 47.376851192223256 123 | 124.2900884141461 124 | -50.95161274323064 125 | 26.15880492778154 126 | 60.71210428466185 127 | 14.978549887440964 128 | -79.01198305441967 129 | 76.87307747338946 130 | -60.58863457115879 131 | 21.490071305078708 132 | 25.254538568272466 133 | -53.92476533654188 134 | -68.31277932601401 135 | -27.893869312626265 136 | -76.70569025515616 137 | -75.49639905641597 138 | -25.80479240684599 139 | 16.128141340949153 140 | 38.3207671217961 141 | 163.59340363750312 142 | 20.048874509540447 143 | -3.9737915819373937 144 | 176.8223715029767 145 | -52.61253408608978 146 | 16.799635283994505 147 | 47.87875036701872 148 | 92.02968246041769 149 | -40.812325903107144 150 | 26.983715075273533 151 | -75.58870207089822 152 | -81.15403732767167 153 | 39.03987138494863 154 | 0.06844179394895619 155 | 17.29111259580174 156 | 17.236674952788306 157 | 9.678331284527417 158 | 10.461753833045085 159 | 14.413910467343893 160 | 2.514333132770602 161 | 15.523337346826079 162 | 9.892108039048164 163 | 2.945367500347136 164 | 11.580838745545842 165 | 1.7434720109350492 166 | 5.058631433995427 167 | 14.225443795353739 168 | 0.3571456626783647 169 | 13.754288208306342 170 | 16.0092570413889 171 | 41.63846160409889 172 | 4.014144123513757 173 | 2.3803613860573547 174 | 14.823902529271741 175 | 5.024687429396252 176 | 4.649569863747833 177 | 8.954001751136232 178 | 15.937813274266976 179 | 6.503471186844004 180 | 3.8032266886519532 181 | 1.5431673835022983 182 | 5.509959446546415 183 | -------------------------------------------------------------------------------- /preprocessing/preprocessors.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import pandas as pd 3 | from stockstats import StockDataFrame as Sdf 4 | from config import config 5 | 6 | def load_dataset(*, file_name: str) -> pd.DataFrame: 7 | """ 8 | load csv dataset from path 9 | :return: (df) pandas dataframe 10 | """ 11 | #_data = pd.read_csv(f"{config.DATASET_DIR}/{file_name}") 12 | _data = pd.read_csv(file_name) 13 | return _data 14 | 15 | def data_split(df,start,end): 16 | """ 17 | split the dataset into training or testing using date 18 | :param data: (df) pandas dataframe, start, end 19 | :return: (df) pandas dataframe 20 | """ 21 | data = df[(df.datadate >= start) & (df.datadate < end)] 22 | data=data.sort_values(['datadate','tic'],ignore_index=True) 23 | #data = data[final_columns] 24 | data.index = data.datadate.factorize()[0] 25 | return data 26 | 27 | def calcualte_price(df): 28 | """ 29 | calcualte adjusted close price, open-high-low price and volume 30 | :param data: (df) pandas dataframe 31 | :return: (df) pandas dataframe 32 | """ 33 | data = df.copy() 34 | data = data[['datadate', 'tic', 'prccd', 'ajexdi', 'prcod', 'prchd', 'prcld', 'cshtrd']] 35 | data['ajexdi'] = data['ajexdi'].apply(lambda x: 1 if x == 0 else x) 36 | 37 | data['adjcp'] = data['prccd'] / data['ajexdi'] 38 | data['open'] = data['prcod'] / data['ajexdi'] 39 | data['high'] = data['prchd'] / data['ajexdi'] 40 | data['low'] = data['prcld'] / data['ajexdi'] 41 | data['volume'] = data['cshtrd'] 42 | 43 | data = data[['datadate', 'tic', 'adjcp', 'open', 'high', 'low', 'volume']] 44 | data = data.sort_values(['tic', 'datadate'], ignore_index=True) 45 | return data 46 | 47 | def add_technical_indicator(df): 48 | """ 49 | calcualte technical indicators 50 | use stockstats package to add technical inidactors 51 | :param data: (df) pandas dataframe 52 | :return: (df) pandas dataframe 53 | """ 54 | stock = Sdf.retype(df.copy()) 55 | 56 | stock['close'] = stock['adjcp'] 57 | unique_ticker = stock.tic.unique() 58 | 59 | macd = pd.DataFrame() 60 | rsi = pd.DataFrame() 61 | cci = pd.DataFrame() 62 | dx = pd.DataFrame() 63 | 64 | #temp = stock[stock.tic == unique_ticker[0]]['macd'] 65 | for i in range(len(unique_ticker)): 66 | ## macd 67 | temp_macd = stock[stock.tic == unique_ticker[i]]['macd'] 68 | temp_macd = pd.DataFrame(temp_macd) 69 | macd = macd.append(temp_macd, ignore_index=True) 70 | ## rsi 71 | temp_rsi = stock[stock.tic == unique_ticker[i]]['rsi_30'] 72 | temp_rsi = pd.DataFrame(temp_rsi) 73 | rsi = rsi.append(temp_rsi, ignore_index=True) 74 | ## cci 75 | temp_cci = stock[stock.tic == unique_ticker[i]]['cci_30'] 76 | temp_cci = pd.DataFrame(temp_cci) 77 | cci = cci.append(temp_cci, ignore_index=True) 78 | ## adx 79 | temp_dx = stock[stock.tic == unique_ticker[i]]['dx_30'] 80 | temp_dx = pd.DataFrame(temp_dx) 81 | dx = dx.append(temp_dx, ignore_index=True) 82 | 83 | 84 | df['macd'] = macd 85 | df['rsi'] = rsi 86 | df['cci'] = cci 87 | df['adx'] = dx 88 | 89 | return df 90 | 91 | 92 | 93 | def preprocess_data(): 94 | """data preprocessing pipeline""" 95 | 96 | df = load_dataset(file_name=config.TRAINING_DATA_FILE) 97 | # get data after 2009 98 | df = df[df.datadate>=20090000] 99 | # calcualte adjusted price 100 | df_preprocess = calcualte_price(df) 101 | # add technical indicators using stockstats 102 | df_final=add_technical_indicator(df_preprocess) 103 | # fill the missing values at the beginning 104 | df_final.fillna(method='bfill',inplace=True) 105 | return df_final 106 | 107 | def add_turbulence(df): 108 | """ 109 | add turbulence index from a precalcualted dataframe 110 | :param data: (df) pandas dataframe 111 | :return: (df) pandas dataframe 112 | """ 113 | turbulence_index = calcualte_turbulence(df) 114 | df = df.merge(turbulence_index, on='datadate') 115 | df = df.sort_values(['datadate','tic']).reset_index(drop=True) 116 | return df 117 | 118 | 119 | 120 | def calcualte_turbulence(df): 121 | """calculate turbulence index based on dow 30""" 122 | # can add other market assets 123 | 124 | df_price_pivot=df.pivot(index='datadate', columns='tic', values='adjcp') 125 | unique_date = df.datadate.unique() 126 | # start after a year 127 | start = 252 128 | turbulence_index = [0]*start 129 | #turbulence_index = [0] 130 | count=0 131 | for i in range(start,len(unique_date)): 132 | current_price = df_price_pivot[df_price_pivot.index == unique_date[i]] 133 | hist_price = df_price_pivot[[n in unique_date[0:i] for n in df_price_pivot.index ]] 134 | cov_temp = hist_price.cov() 135 | current_temp=(current_price - np.mean(hist_price,axis=0)) 136 | temp = current_temp.values.dot(np.linalg.inv(cov_temp)).dot(current_temp.values.T) 137 | if temp>0: 138 | count+=1 139 | if count>2: 140 | turbulence_temp = temp[0][0] 141 | else: 142 | #avoid large outlier because of the calculation just begins 143 | turbulence_temp=0 144 | else: 145 | turbulence_temp=0 146 | turbulence_index.append(turbulence_temp) 147 | 148 | 149 | turbulence_index = pd.DataFrame({'datadate':df_price_pivot.index, 150 | 'turbulence':turbulence_index}) 151 | return turbulence_index 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Deep Reinforcement Learning for Automated Stock Trading: An Ensemble Strategy 2 | This repository provides codes for [ICAIF 2020 paper](https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3690996) 3 | 4 | This ensemble strategy is reimplemented in a Jupiter Notebook at [FinRL](https://github.com/AI4Finance-LLC/FinRL-Library). 5 | 6 | 7 | ## Abstract 8 | Stock trading strategies play a critical role in investment. However, it is challenging to design a profitable strategy in a complex and dynamic stock market. In this paper, we propose a deep ensemble reinforcement learning scheme that automatically learns a stock trading strategy by maximizing investment return. We train a deep reinforcement learning agent and obtain an ensemble trading strategy using the three actor-critic based algorithms: Proximal Policy Optimization (PPO), Advantage Actor Critic (A2C), and Deep Deterministic Policy Gradient (DDPG). The ensemble strategy inherits and integrates the best features of the three algorithms, thereby robustly adjusting to different market conditions. In order to avoid the large memory consumption in training networks with continuous action space, we employ a load-on-demand approach for processing very large data. We test our algorithms on the 30 Dow Jones stocks which have adequate liquidity. The performance of the trading agent with different reinforcement learning algorithms is evaluated and compared with both the Dow Jones Industrial Average index and the traditional min-variance portfolio allocation strategy. The proposed deep ensemble scheme is shown to outperform the three individual algorithms and the two baselines in terms of the risk-adjusted return measured by the Sharpe ratio. 9 | 10 | 11 | 12 | ## Reference 13 | Hongyang Yang, Xiao-Yang Liu, Shan Zhong, and Anwar Walid. 2020. Deep Reinforcement Learning for Automated Stock Trading: An Ensemble Strategy. In ICAIF ’20: ACM International Conference on AI in Finance, Oct. 15–16, 2020, Manhattan, NY. ACM, New York, NY, USA. 14 | 15 | ## [Our Medium Blog](https://medium.com/@ai4finance/deep-reinforcement-learning-for-automated-stock-trading-f1dad0126a02) 16 | ## Installation: 17 | ```shell 18 | git clone https://github.com/AI4Finance-LLC/Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020.git 19 | ``` 20 | 21 | 22 | 23 | ### Prerequisites 24 | For [OpenAI Baselines](https://github.com/openai/baselines), you'll need system packages CMake, OpenMPI and zlib. Those can be installed as follows 25 | 26 | #### Ubuntu 27 | 28 | ```bash 29 | sudo apt-get update && sudo apt-get install cmake libopenmpi-dev python3-dev zlib1g-dev libgl1-mesa-glx 30 | ``` 31 | 32 | #### Mac OS X 33 | Installation of system packages on Mac requires [Homebrew](https://brew.sh). With Homebrew installed, run the following: 34 | ```bash 35 | brew install cmake openmpi 36 | ``` 37 | 38 | #### Windows 10 39 | 40 | To install stable-baselines on Windows, please look at the [documentation](https://stable-baselines.readthedocs.io/en/master/guide/install.html#prerequisites). 41 | 42 | ### Create and Activate Virtual Environment (Optional but highly recommended) 43 | cd into this repository 44 | ```bash 45 | cd Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020 46 | ``` 47 | Under folder /Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020, create a virtual environment 48 | ```bash 49 | pip install virtualenv 50 | ``` 51 | Virtualenvs are essentially folders that have copies of python executable and all python packages. 52 | 53 | **Virtualenvs can also avoid packages conflicts.** 54 | 55 | Create a virtualenv **venv** under folder /Deep-Reinforcement-Learning-for-Automated-Stock-Trading-Ensemble-Strategy-ICAIF-2020 56 | ```bash 57 | virtualenv -p python3 venv 58 | ``` 59 | To activate a virtualenv: 60 | ``` 61 | source venv/bin/activate 62 | ``` 63 | 64 | ## Dependencies 65 | 66 | The script has been tested running under **Python >= 3.6.0**, with the folowing packages installed: 67 | 68 | ```shell 69 | pip install -r requirements.txt 70 | ``` 71 | 72 | ### Questions 73 | 74 | ### About Tensorflow 2.0: https://github.com/hill-a/stable-baselines/issues/366 75 | 76 | If you have questions regarding TensorFlow, note that tensorflow 2.0 is not compatible now, you may use 77 | 78 | ```bash 79 | pip install tensorflow==1.15.4 80 | ``` 81 | 82 | If you have questions regarding Stable-baselines package, please refer to [Stable-baselines installation guide](https://github.com/hill-a/stable-baselines). Install the Stable Baselines package using pip: 83 | ``` 84 | pip install stable-baselines[mpi] 85 | ``` 86 | 87 | This includes an optional dependency on MPI, enabling algorithms DDPG, GAIL, PPO1 and TRPO. If you do not need these algorithms, you can install without MPI: 88 | ``` 89 | pip install stable-baselines 90 | ``` 91 | 92 | Please read the [documentation](https://stable-baselines.readthedocs.io/) for more details and alternatives (from source, using docker). 93 | 94 | 95 | ## Run DRL Ensemble Strategy 96 | ```shell 97 | python run_DRL.py 98 | ``` 99 | ## Backtesting 100 | 101 | Use Quantopian's [pyfolio package](https://github.com/quantopian/pyfolio) to do the backtesting. 102 | 103 | [Backtesting script](backtesting.ipynb) 104 | 105 | ## Status 106 | 107 |
Version History [click to expand] 108 |
109 | 110 | * 1.0.1 111 | Changes: added ensemble strategy 112 | * 0.0.1 113 | Simple version 114 |
115 |
116 | 117 | ## Data 118 | The stock data we use is pulled from [Compustat database via Wharton Research Data Services](https://wrds-web.wharton.upenn.edu/wrds/ds/compd/fundq). 119 | 120 | 121 | ### Ensemble Strategy 122 | Our purpose is to create a highly robust trading strategy. So we use an ensemble method to automatically select the best performing agent among PPO, A2C, and DDPG to trade based on the Sharpe ratio. The ensemble process is described as follows: 123 | * __Step 1__. We use a growing window of 𝑛 months to retrain our three agents concurrently. In this paper we retrain our three agents at every 3 months. 124 | * __Step 2__. We validate all 3 agents by using a 12-month validation- rolling window followed by the growing window we used for train- ing to pick the best performing agent which has the highest Sharpe ratio. We also adjust risk-aversion by using turbulence index in our validation stage. 125 | * __Step 3__. After validation, we only use the best model which has the highest Sharpe ratio to predict and trade for the next quarter. 126 | 127 | ## Performance 128 | 129 | -------------------------------------------------------------------------------- /env/EnvMultipleStock_train.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import pandas as pd 3 | from gym.utils import seeding 4 | import gym 5 | from gym import spaces 6 | import matplotlib 7 | matplotlib.use('Agg') 8 | import matplotlib.pyplot as plt 9 | import pickle 10 | 11 | # shares normalization factor 12 | # 100 shares per trade 13 | HMAX_NORMALIZE = 100 14 | # initial amount of money we have in our account 15 | INITIAL_ACCOUNT_BALANCE=1000000 16 | # total number of stocks in our portfolio 17 | STOCK_DIM = 30 18 | # transaction fee: 1/1000 reasonable percentage 19 | TRANSACTION_FEE_PERCENT = 0.001 20 | REWARD_SCALING = 1e-4 21 | 22 | class StockEnvTrain(gym.Env): 23 | """A stock trading environment for OpenAI gym""" 24 | metadata = {'render.modes': ['human']} 25 | 26 | def __init__(self, df,day = 0): 27 | #super(StockEnv, self).__init__() 28 | #money = 10 , scope = 1 29 | self.day = day 30 | self.df = df 31 | 32 | # action_space normalization and shape is STOCK_DIM 33 | self.action_space = spaces.Box(low = -1, high = 1,shape = (STOCK_DIM,)) 34 | # Shape = 181: [Current Balance]+[prices 1-30]+[owned shares 1-30] 35 | # +[macd 1-30]+ [rsi 1-30] + [cci 1-30] + [adx 1-30] 36 | self.observation_space = spaces.Box(low=0, high=np.inf, shape = (181,)) 37 | # load data from a pandas dataframe 38 | self.data = self.df.loc[self.day,:] 39 | self.terminal = False 40 | # initalize state 41 | self.state = [INITIAL_ACCOUNT_BALANCE] + \ 42 | self.data.adjcp.values.tolist() + \ 43 | [0]*STOCK_DIM + \ 44 | self.data.macd.values.tolist() + \ 45 | self.data.rsi.values.tolist() + \ 46 | self.data.cci.values.tolist() + \ 47 | self.data.adx.values.tolist() 48 | # initialize reward 49 | self.reward = 0 50 | self.cost = 0 51 | # memorize all the total balance change 52 | self.asset_memory = [INITIAL_ACCOUNT_BALANCE] 53 | self.rewards_memory = [] 54 | self.trades = 0 55 | #self.reset() 56 | self._seed() 57 | 58 | 59 | def _sell_stock(self, index, action): 60 | # perform sell action based on the sign of the action 61 | if self.state[index+STOCK_DIM+1] > 0: 62 | #update balance 63 | self.state[0] += \ 64 | self.state[index+1]*min(abs(action),self.state[index+STOCK_DIM+1]) * \ 65 | (1- TRANSACTION_FEE_PERCENT) 66 | 67 | self.state[index+STOCK_DIM+1] -= min(abs(action), self.state[index+STOCK_DIM+1]) 68 | self.cost +=self.state[index+1]*min(abs(action),self.state[index+STOCK_DIM+1]) * \ 69 | TRANSACTION_FEE_PERCENT 70 | self.trades+=1 71 | else: 72 | pass 73 | 74 | 75 | def _buy_stock(self, index, action): 76 | # perform buy action based on the sign of the action 77 | available_amount = self.state[0] // self.state[index+1] 78 | # print('available_amount:{}'.format(available_amount)) 79 | 80 | #update balance 81 | self.state[0] -= self.state[index+1]*min(available_amount, action)* \ 82 | (1+ TRANSACTION_FEE_PERCENT) 83 | 84 | self.state[index+STOCK_DIM+1] += min(available_amount, action) 85 | 86 | self.cost+=self.state[index+1]*min(available_amount, action)* \ 87 | TRANSACTION_FEE_PERCENT 88 | self.trades+=1 89 | 90 | def step(self, actions): 91 | # print(self.day) 92 | self.terminal = self.day >= len(self.df.index.unique())-1 93 | # print(actions) 94 | 95 | if self.terminal: 96 | plt.plot(self.asset_memory,'r') 97 | plt.savefig('results/account_value_train.png') 98 | plt.close() 99 | end_total_asset = self.state[0]+ \ 100 | sum(np.array(self.state[1:(STOCK_DIM+1)])*np.array(self.state[(STOCK_DIM+1):(STOCK_DIM*2+1)])) 101 | 102 | #print("end_total_asset:{}".format(end_total_asset)) 103 | df_total_value = pd.DataFrame(self.asset_memory) 104 | df_total_value.to_csv('results/account_value_train.csv') 105 | #print("total_reward:{}".format(self.state[0]+sum(np.array(self.state[1:(STOCK_DIM+1)])*np.array(self.state[(STOCK_DIM+1):61]))- INITIAL_ACCOUNT_BALANCE )) 106 | #print("total_cost: ", self.cost) 107 | #print("total_trades: ", self.trades) 108 | df_total_value.columns = ['account_value'] 109 | df_total_value['daily_return']=df_total_value.pct_change(1) 110 | sharpe = (252**0.5)*df_total_value['daily_return'].mean()/ \ 111 | df_total_value['daily_return'].std() 112 | #print("Sharpe: ",sharpe) 113 | #print("=================================") 114 | df_rewards = pd.DataFrame(self.rewards_memory) 115 | #df_rewards.to_csv('results/account_rewards_train.csv') 116 | 117 | # print('total asset: {}'.format(self.state[0]+ sum(np.array(self.state[1:29])*np.array(self.state[29:])))) 118 | #with open('obs.pkl', 'wb') as f: 119 | # pickle.dump(self.state, f) 120 | 121 | return self.state, self.reward, self.terminal,{} 122 | 123 | else: 124 | # print(np.array(self.state[1:29])) 125 | 126 | actions = actions * HMAX_NORMALIZE 127 | #actions = (actions.astype(int)) 128 | 129 | begin_total_asset = self.state[0]+ \ 130 | sum(np.array(self.state[1:(STOCK_DIM+1)])*np.array(self.state[(STOCK_DIM+1):(STOCK_DIM*2+1)])) 131 | #print("begin_total_asset:{}".format(begin_total_asset)) 132 | 133 | argsort_actions = np.argsort(actions) 134 | 135 | sell_index = argsort_actions[:np.where(actions < 0)[0].shape[0]] 136 | buy_index = argsort_actions[::-1][:np.where(actions > 0)[0].shape[0]] 137 | 138 | for index in sell_index: 139 | # print('take sell action'.format(actions[index])) 140 | self._sell_stock(index, actions[index]) 141 | 142 | for index in buy_index: 143 | # print('take buy action: {}'.format(actions[index])) 144 | self._buy_stock(index, actions[index]) 145 | 146 | self.day += 1 147 | self.data = self.df.loc[self.day,:] 148 | #load next state 149 | # print("stock_shares:{}".format(self.state[29:])) 150 | self.state = [self.state[0]] + \ 151 | self.data.adjcp.values.tolist() + \ 152 | list(self.state[(STOCK_DIM+1):(STOCK_DIM*2+1)]) + \ 153 | self.data.macd.values.tolist() + \ 154 | self.data.rsi.values.tolist() + \ 155 | self.data.cci.values.tolist() + \ 156 | self.data.adx.values.tolist() 157 | 158 | end_total_asset = self.state[0]+ \ 159 | sum(np.array(self.state[1:(STOCK_DIM+1)])*np.array(self.state[(STOCK_DIM+1):(STOCK_DIM*2+1)])) 160 | self.asset_memory.append(end_total_asset) 161 | #print("end_total_asset:{}".format(end_total_asset)) 162 | 163 | self.reward = end_total_asset - begin_total_asset 164 | # print("step_reward:{}".format(self.reward)) 165 | self.rewards_memory.append(self.reward) 166 | 167 | self.reward = self.reward*REWARD_SCALING 168 | 169 | 170 | 171 | return self.state, self.reward, self.terminal, {} 172 | 173 | def reset(self): 174 | self.asset_memory = [INITIAL_ACCOUNT_BALANCE] 175 | self.day = 0 176 | self.data = self.df.loc[self.day,:] 177 | self.cost = 0 178 | self.trades = 0 179 | self.terminal = False 180 | self.rewards_memory = [] 181 | #initiate state 182 | self.state = [INITIAL_ACCOUNT_BALANCE] + \ 183 | self.data.adjcp.values.tolist() + \ 184 | [0]*STOCK_DIM + \ 185 | self.data.macd.values.tolist() + \ 186 | self.data.rsi.values.tolist() + \ 187 | self.data.cci.values.tolist() + \ 188 | self.data.adx.values.tolist() 189 | # iteration += 1 190 | return self.state 191 | 192 | def render(self, mode='human'): 193 | return self.state 194 | 195 | def _seed(self, seed=None): 196 | self.np_random, seed = seeding.np_random(seed) 197 | return [seed] -------------------------------------------------------------------------------- /env/EnvMultipleStock_validation.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import pandas as pd 3 | from gym.utils import seeding 4 | import gym 5 | from gym import spaces 6 | import matplotlib 7 | matplotlib.use('Agg') 8 | import matplotlib.pyplot as plt 9 | import pickle 10 | 11 | # shares normalization factor 12 | # 100 shares per trade 13 | HMAX_NORMALIZE = 100 14 | # initial amount of money we have in our account 15 | INITIAL_ACCOUNT_BALANCE=1000000 16 | # total number of stocks in our portfolio 17 | STOCK_DIM = 30 18 | # transaction fee: 1/1000 reasonable percentage 19 | TRANSACTION_FEE_PERCENT = 0.001 20 | 21 | # turbulence index: 90-150 reasonable threshold 22 | #TURBULENCE_THRESHOLD = 140 23 | REWARD_SCALING = 1e-4 24 | 25 | class StockEnvValidation(gym.Env): 26 | """A stock trading environment for OpenAI gym""" 27 | metadata = {'render.modes': ['human']} 28 | 29 | def __init__(self, df, day = 0, turbulence_threshold=140, iteration=''): 30 | #super(StockEnv, self).__init__() 31 | #money = 10 , scope = 1 32 | self.day = day 33 | self.df = df 34 | # action_space normalization and shape is STOCK_DIM 35 | self.action_space = spaces.Box(low = -1, high = 1,shape = (STOCK_DIM,)) 36 | # Shape = 181: [Current Balance]+[prices 1-30]+[owned shares 1-30] 37 | # +[macd 1-30]+ [rsi 1-30] + [cci 1-30] + [adx 1-30] 38 | self.observation_space = spaces.Box(low=0, high=np.inf, shape = (181,)) 39 | # load data from a pandas dataframe 40 | self.data = self.df.loc[self.day,:] 41 | self.terminal = False 42 | self.turbulence_threshold = turbulence_threshold 43 | # initalize state 44 | self.state = [INITIAL_ACCOUNT_BALANCE] + \ 45 | self.data.adjcp.values.tolist() + \ 46 | [0]*STOCK_DIM + \ 47 | self.data.macd.values.tolist() + \ 48 | self.data.rsi.values.tolist() + \ 49 | self.data.cci.values.tolist() + \ 50 | self.data.adx.values.tolist() 51 | # initialize reward 52 | self.reward = 0 53 | self.turbulence = 0 54 | self.cost = 0 55 | self.trades = 0 56 | # memorize all the total balance change 57 | self.asset_memory = [INITIAL_ACCOUNT_BALANCE] 58 | self.rewards_memory = [] 59 | #self.reset() 60 | self._seed() 61 | 62 | self.iteration=iteration 63 | 64 | 65 | def _sell_stock(self, index, action): 66 | # perform sell action based on the sign of the action 67 | if self.turbulence 0: 69 | #update balance 70 | self.state[0] += \ 71 | self.state[index+1]*min(abs(action),self.state[index+STOCK_DIM+1]) * \ 72 | (1- TRANSACTION_FEE_PERCENT) 73 | 74 | self.state[index+STOCK_DIM+1] -= min(abs(action), self.state[index+STOCK_DIM+1]) 75 | self.cost +=self.state[index+1]*min(abs(action),self.state[index+STOCK_DIM+1]) * \ 76 | TRANSACTION_FEE_PERCENT 77 | self.trades+=1 78 | else: 79 | pass 80 | else: 81 | # if turbulence goes over threshold, just clear out all positions 82 | if self.state[index+STOCK_DIM+1] > 0: 83 | #update balance 84 | self.state[0] += self.state[index+1]*self.state[index+STOCK_DIM+1]* \ 85 | (1- TRANSACTION_FEE_PERCENT) 86 | self.state[index+STOCK_DIM+1] =0 87 | self.cost += self.state[index+1]*self.state[index+STOCK_DIM+1]* \ 88 | TRANSACTION_FEE_PERCENT 89 | self.trades+=1 90 | else: 91 | pass 92 | 93 | def _buy_stock(self, index, action): 94 | # perform buy action based on the sign of the action 95 | if self.turbulence< self.turbulence_threshold: 96 | available_amount = self.state[0] // self.state[index+1] 97 | # print('available_amount:{}'.format(available_amount)) 98 | 99 | #update balance 100 | self.state[0] -= self.state[index+1]*min(available_amount, action)* \ 101 | (1+ TRANSACTION_FEE_PERCENT) 102 | 103 | self.state[index+STOCK_DIM+1] += min(available_amount, action) 104 | 105 | self.cost+=self.state[index+1]*min(available_amount, action)* \ 106 | TRANSACTION_FEE_PERCENT 107 | self.trades+=1 108 | else: 109 | # if turbulence goes over threshold, just stop buying 110 | pass 111 | 112 | def step(self, actions): 113 | # print(self.day) 114 | self.terminal = self.day >= len(self.df.index.unique())-1 115 | # print(actions) 116 | 117 | if self.terminal: 118 | plt.plot(self.asset_memory,'r') 119 | plt.savefig('results/account_value_validation_{}.png'.format(self.iteration)) 120 | plt.close() 121 | df_total_value = pd.DataFrame(self.asset_memory) 122 | df_total_value.to_csv('results/account_value_validation_{}.csv'.format(self.iteration)) 123 | end_total_asset = self.state[0]+ \ 124 | sum(np.array(self.state[1:(STOCK_DIM+1)])*np.array(self.state[(STOCK_DIM+1):(STOCK_DIM*2+1)])) 125 | #print("previous_total_asset:{}".format(self.asset_memory[0])) 126 | 127 | #print("end_total_asset:{}".format(end_total_asset)) 128 | #print("total_reward:{}".format(self.state[0]+sum(np.array(self.state[1:(STOCK_DIM+1)])*np.array(self.state[(STOCK_DIM+1):61]))- self.asset_memory[0] )) 129 | #print("total_cost: ", self.cost) 130 | #print("total trades: ", self.trades) 131 | 132 | df_total_value.columns = ['account_value'] 133 | df_total_value['daily_return']=df_total_value.pct_change(1) 134 | sharpe = (4**0.5)*df_total_value['daily_return'].mean()/ \ 135 | df_total_value['daily_return'].std() 136 | #print("Sharpe: ",sharpe) 137 | 138 | #df_rewards = pd.DataFrame(self.rewards_memory) 139 | #df_rewards.to_csv('results/account_rewards_trade_{}.csv'.format(self.iteration)) 140 | 141 | # print('total asset: {}'.format(self.state[0]+ sum(np.array(self.state[1:29])*np.array(self.state[29:])))) 142 | #with open('obs.pkl', 'wb') as f: 143 | # pickle.dump(self.state, f) 144 | 145 | return self.state, self.reward, self.terminal,{} 146 | 147 | else: 148 | # print(np.array(self.state[1:29])) 149 | 150 | actions = actions * HMAX_NORMALIZE 151 | #actions = (actions.astype(int)) 152 | if self.turbulence>=self.turbulence_threshold: 153 | actions=np.array([-HMAX_NORMALIZE]*STOCK_DIM) 154 | begin_total_asset = self.state[0]+ \ 155 | sum(np.array(self.state[1:(STOCK_DIM+1)])*np.array(self.state[(STOCK_DIM+1):(STOCK_DIM*2+1)])) 156 | #print("begin_total_asset:{}".format(begin_total_asset)) 157 | 158 | argsort_actions = np.argsort(actions) 159 | 160 | sell_index = argsort_actions[:np.where(actions < 0)[0].shape[0]] 161 | buy_index = argsort_actions[::-1][:np.where(actions > 0)[0].shape[0]] 162 | 163 | for index in sell_index: 164 | # print('take sell action'.format(actions[index])) 165 | self._sell_stock(index, actions[index]) 166 | 167 | for index in buy_index: 168 | # print('take buy action: {}'.format(actions[index])) 169 | self._buy_stock(index, actions[index]) 170 | 171 | self.day += 1 172 | self.data = self.df.loc[self.day,:] 173 | self.turbulence = self.data['turbulence'].values[0] 174 | #print(self.turbulence) 175 | #load next state 176 | # print("stock_shares:{}".format(self.state[29:])) 177 | self.state = [self.state[0]] + \ 178 | self.data.adjcp.values.tolist() + \ 179 | list(self.state[(STOCK_DIM+1):(STOCK_DIM*2+1)]) + \ 180 | self.data.macd.values.tolist() + \ 181 | self.data.rsi.values.tolist() + \ 182 | self.data.cci.values.tolist() + \ 183 | self.data.adx.values.tolist() 184 | 185 | end_total_asset = self.state[0]+ \ 186 | sum(np.array(self.state[1:(STOCK_DIM+1)])*np.array(self.state[(STOCK_DIM+1):(STOCK_DIM*2+1)])) 187 | self.asset_memory.append(end_total_asset) 188 | #print("end_total_asset:{}".format(end_total_asset)) 189 | 190 | self.reward = end_total_asset - begin_total_asset 191 | # print("step_reward:{}".format(self.reward)) 192 | self.rewards_memory.append(self.reward) 193 | 194 | self.reward = self.reward*REWARD_SCALING 195 | 196 | return self.state, self.reward, self.terminal, {} 197 | 198 | def reset(self): 199 | self.asset_memory = [INITIAL_ACCOUNT_BALANCE] 200 | self.day = 0 201 | self.data = self.df.loc[self.day,:] 202 | self.turbulence = 0 203 | self.cost = 0 204 | self.trades = 0 205 | self.terminal = False 206 | #self.iteration=self.iteration 207 | self.rewards_memory = [] 208 | #initiate state 209 | self.state = [INITIAL_ACCOUNT_BALANCE] + \ 210 | self.data.adjcp.values.tolist() + \ 211 | [0]*STOCK_DIM + \ 212 | self.data.macd.values.tolist() + \ 213 | self.data.rsi.values.tolist() + \ 214 | self.data.cci.values.tolist() + \ 215 | self.data.adx.values.tolist() 216 | 217 | return self.state 218 | 219 | def render(self, mode='human',close=False): 220 | return self.state 221 | 222 | 223 | def _seed(self, seed=None): 224 | self.np_random, seed = seeding.np_random(seed) 225 | return [seed] -------------------------------------------------------------------------------- /env/EnvMultipleStock_trade.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import pandas as pd 3 | from gym.utils import seeding 4 | import gym 5 | from gym import spaces 6 | import matplotlib 7 | matplotlib.use('Agg') 8 | import matplotlib.pyplot as plt 9 | import pickle 10 | 11 | # shares normalization factor 12 | # 100 shares per trade 13 | HMAX_NORMALIZE = 100 14 | # initial amount of money we have in our account 15 | INITIAL_ACCOUNT_BALANCE=1000000 16 | # total number of stocks in our portfolio 17 | STOCK_DIM = 30 18 | # transaction fee: 1/1000 reasonable percentage 19 | TRANSACTION_FEE_PERCENT = 0.001 20 | 21 | # turbulence index: 90-150 reasonable threshold 22 | #TURBULENCE_THRESHOLD = 140 23 | REWARD_SCALING = 1e-4 24 | 25 | class StockEnvTrade(gym.Env): 26 | """A stock trading environment for OpenAI gym""" 27 | metadata = {'render.modes': ['human']} 28 | 29 | def __init__(self, df,day = 0,turbulence_threshold=140 30 | ,initial=True, previous_state=[], model_name='', iteration=''): 31 | #super(StockEnv, self).__init__() 32 | #money = 10 , scope = 1 33 | self.day = day 34 | self.df = df 35 | self.initial = initial 36 | self.previous_state = previous_state 37 | # action_space normalization and shape is STOCK_DIM 38 | self.action_space = spaces.Box(low = -1, high = 1,shape = (STOCK_DIM,)) 39 | # Shape = 181: [Current Balance]+[prices 1-30]+[owned shares 1-30] 40 | # +[macd 1-30]+ [rsi 1-30] + [cci 1-30] + [adx 1-30] 41 | self.observation_space = spaces.Box(low=0, high=np.inf, shape = (181,)) 42 | # load data from a pandas dataframe 43 | self.data = self.df.loc[self.day,:] 44 | self.terminal = False 45 | self.turbulence_threshold = turbulence_threshold 46 | # initalize state 47 | self.state = [INITIAL_ACCOUNT_BALANCE] + \ 48 | self.data.adjcp.values.tolist() + \ 49 | [0]*STOCK_DIM + \ 50 | self.data.macd.values.tolist() + \ 51 | self.data.rsi.values.tolist() + \ 52 | self.data.cci.values.tolist() + \ 53 | self.data.adx.values.tolist() 54 | # initialize reward 55 | self.reward = 0 56 | self.turbulence = 0 57 | self.cost = 0 58 | self.trades = 0 59 | # memorize all the total balance change 60 | self.asset_memory = [INITIAL_ACCOUNT_BALANCE] 61 | self.rewards_memory = [] 62 | #self.reset() 63 | self._seed() 64 | self.model_name=model_name 65 | self.iteration=iteration 66 | 67 | 68 | def _sell_stock(self, index, action): 69 | # perform sell action based on the sign of the action 70 | if self.turbulence 0: 72 | #update balance 73 | self.state[0] += \ 74 | self.state[index+1]*min(abs(action),self.state[index+STOCK_DIM+1]) * \ 75 | (1- TRANSACTION_FEE_PERCENT) 76 | 77 | self.state[index+STOCK_DIM+1] -= min(abs(action), self.state[index+STOCK_DIM+1]) 78 | self.cost +=self.state[index+1]*min(abs(action),self.state[index+STOCK_DIM+1]) * \ 79 | TRANSACTION_FEE_PERCENT 80 | self.trades+=1 81 | else: 82 | pass 83 | else: 84 | # if turbulence goes over threshold, just clear out all positions 85 | if self.state[index+STOCK_DIM+1] > 0: 86 | #update balance 87 | self.state[0] += self.state[index+1]*self.state[index+STOCK_DIM+1]* \ 88 | (1- TRANSACTION_FEE_PERCENT) 89 | self.state[index+STOCK_DIM+1] =0 90 | self.cost += self.state[index+1]*self.state[index+STOCK_DIM+1]* \ 91 | TRANSACTION_FEE_PERCENT 92 | self.trades+=1 93 | else: 94 | pass 95 | 96 | def _buy_stock(self, index, action): 97 | # perform buy action based on the sign of the action 98 | if self.turbulence< self.turbulence_threshold: 99 | available_amount = self.state[0] // self.state[index+1] 100 | # print('available_amount:{}'.format(available_amount)) 101 | 102 | #update balance 103 | self.state[0] -= self.state[index+1]*min(available_amount, action)* \ 104 | (1+ TRANSACTION_FEE_PERCENT) 105 | 106 | self.state[index+STOCK_DIM+1] += min(available_amount, action) 107 | 108 | self.cost+=self.state[index+1]*min(available_amount, action)* \ 109 | TRANSACTION_FEE_PERCENT 110 | self.trades+=1 111 | else: 112 | # if turbulence goes over threshold, just stop buying 113 | pass 114 | 115 | def step(self, actions): 116 | # print(self.day) 117 | self.terminal = self.day >= len(self.df.index.unique())-1 118 | # print(actions) 119 | 120 | if self.terminal: 121 | plt.plot(self.asset_memory,'r') 122 | plt.savefig('results/account_value_trade_{}_{}.png'.format(self.model_name, self.iteration)) 123 | plt.close() 124 | df_total_value = pd.DataFrame(self.asset_memory) 125 | df_total_value.to_csv('results/account_value_trade_{}_{}.csv'.format(self.model_name, self.iteration)) 126 | end_total_asset = self.state[0]+ \ 127 | sum(np.array(self.state[1:(STOCK_DIM+1)])*np.array(self.state[(STOCK_DIM+1):(STOCK_DIM*2+1)])) 128 | print("previous_total_asset:{}".format(self.asset_memory[0])) 129 | 130 | print("end_total_asset:{}".format(end_total_asset)) 131 | print("total_reward:{}".format(self.state[0]+sum(np.array(self.state[1:(STOCK_DIM+1)])*np.array(self.state[(STOCK_DIM+1):(STOCK_DIM*2+1)]))- self.asset_memory[0] )) 132 | print("total_cost: ", self.cost) 133 | print("total trades: ", self.trades) 134 | 135 | df_total_value.columns = ['account_value'] 136 | df_total_value['daily_return']=df_total_value.pct_change(1) 137 | sharpe = (4**0.5)*df_total_value['daily_return'].mean()/ \ 138 | df_total_value['daily_return'].std() 139 | print("Sharpe: ",sharpe) 140 | 141 | df_rewards = pd.DataFrame(self.rewards_memory) 142 | df_rewards.to_csv('results/account_rewards_trade_{}_{}.csv'.format(self.model_name, self.iteration)) 143 | 144 | # print('total asset: {}'.format(self.state[0]+ sum(np.array(self.state[1:29])*np.array(self.state[29:])))) 145 | #with open('obs.pkl', 'wb') as f: 146 | # pickle.dump(self.state, f) 147 | 148 | return self.state, self.reward, self.terminal,{} 149 | 150 | else: 151 | # print(np.array(self.state[1:29])) 152 | 153 | actions = actions * HMAX_NORMALIZE 154 | #actions = (actions.astype(int)) 155 | if self.turbulence>=self.turbulence_threshold: 156 | actions=np.array([-HMAX_NORMALIZE]*STOCK_DIM) 157 | 158 | begin_total_asset = self.state[0]+ \ 159 | sum(np.array(self.state[1:(STOCK_DIM+1)])*np.array(self.state[(STOCK_DIM+1):(STOCK_DIM*2+1)])) 160 | #print("begin_total_asset:{}".format(begin_total_asset)) 161 | 162 | argsort_actions = np.argsort(actions) 163 | 164 | sell_index = argsort_actions[:np.where(actions < 0)[0].shape[0]] 165 | buy_index = argsort_actions[::-1][:np.where(actions > 0)[0].shape[0]] 166 | 167 | for index in sell_index: 168 | # print('take sell action'.format(actions[index])) 169 | self._sell_stock(index, actions[index]) 170 | 171 | for index in buy_index: 172 | # print('take buy action: {}'.format(actions[index])) 173 | self._buy_stock(index, actions[index]) 174 | 175 | self.day += 1 176 | self.data = self.df.loc[self.day,:] 177 | self.turbulence = self.data['turbulence'].values[0] 178 | #print(self.turbulence) 179 | #load next state 180 | # print("stock_shares:{}".format(self.state[29:])) 181 | self.state = [self.state[0]] + \ 182 | self.data.adjcp.values.tolist() + \ 183 | list(self.state[(STOCK_DIM+1):(STOCK_DIM*2+1)]) + \ 184 | self.data.macd.values.tolist() + \ 185 | self.data.rsi.values.tolist() + \ 186 | self.data.cci.values.tolist() + \ 187 | self.data.adx.values.tolist() 188 | 189 | end_total_asset = self.state[0]+ \ 190 | sum(np.array(self.state[1:(STOCK_DIM+1)])*np.array(self.state[(STOCK_DIM+1):(STOCK_DIM*2+1)])) 191 | self.asset_memory.append(end_total_asset) 192 | #print("end_total_asset:{}".format(end_total_asset)) 193 | 194 | self.reward = end_total_asset - begin_total_asset 195 | # print("step_reward:{}".format(self.reward)) 196 | self.rewards_memory.append(self.reward) 197 | 198 | self.reward = self.reward*REWARD_SCALING 199 | 200 | 201 | return self.state, self.reward, self.terminal, {} 202 | 203 | def reset(self): 204 | if self.initial: 205 | self.asset_memory = [INITIAL_ACCOUNT_BALANCE] 206 | self.day = 0 207 | self.data = self.df.loc[self.day,:] 208 | self.turbulence = 0 209 | self.cost = 0 210 | self.trades = 0 211 | self.terminal = False 212 | #self.iteration=self.iteration 213 | self.rewards_memory = [] 214 | #initiate state 215 | self.state = [INITIAL_ACCOUNT_BALANCE] + \ 216 | self.data.adjcp.values.tolist() + \ 217 | [0]*STOCK_DIM + \ 218 | self.data.macd.values.tolist() + \ 219 | self.data.rsi.values.tolist() + \ 220 | self.data.cci.values.tolist() + \ 221 | self.data.adx.values.tolist() 222 | else: 223 | previous_total_asset = self.previous_state[0]+ \ 224 | sum(np.array(self.previous_state[1:(STOCK_DIM+1)])*np.array(self.previous_state[(STOCK_DIM+1):(STOCK_DIM*2+1)])) 225 | self.asset_memory = [previous_total_asset] 226 | #self.asset_memory = [self.previous_state[0]] 227 | self.day = 0 228 | self.data = self.df.loc[self.day,:] 229 | self.turbulence = 0 230 | self.cost = 0 231 | self.trades = 0 232 | self.terminal = False 233 | #self.iteration=iteration 234 | self.rewards_memory = [] 235 | #initiate state 236 | #self.previous_state[(STOCK_DIM+1):(STOCK_DIM*2+1)] 237 | #[0]*STOCK_DIM + \ 238 | 239 | self.state = [ self.previous_state[0]] + \ 240 | self.data.adjcp.values.tolist() + \ 241 | self.previous_state[(STOCK_DIM+1):(STOCK_DIM*2+1)]+ \ 242 | self.data.macd.values.tolist() + \ 243 | self.data.rsi.values.tolist() + \ 244 | self.data.cci.values.tolist() + \ 245 | self.data.adx.values.tolist() 246 | 247 | return self.state 248 | 249 | def render(self, mode='human',close=False): 250 | return self.state 251 | 252 | 253 | def _seed(self, seed=None): 254 | self.np_random, seed = seeding.np_random(seed) 255 | return [seed] -------------------------------------------------------------------------------- /model/models.py: -------------------------------------------------------------------------------- 1 | # common library 2 | import pandas as pd 3 | import numpy as np 4 | import time 5 | import gym 6 | 7 | # RL models from stable-baselines 8 | from stable_baselines import GAIL, SAC 9 | from stable_baselines import ACER 10 | from stable_baselines import PPO2 11 | from stable_baselines import A2C 12 | from stable_baselines import DDPG 13 | from stable_baselines import TD3 14 | 15 | from stable_baselines.ddpg.policies import DDPGPolicy 16 | from stable_baselines.common.policies import MlpPolicy, MlpLstmPolicy, MlpLnLstmPolicy 17 | from stable_baselines.common.noise import NormalActionNoise, OrnsteinUhlenbeckActionNoise, AdaptiveParamNoiseSpec 18 | from stable_baselines.common.vec_env import DummyVecEnv 19 | from preprocessing.preprocessors import * 20 | from config import config 21 | 22 | # customized env 23 | from env.EnvMultipleStock_train import StockEnvTrain 24 | from env.EnvMultipleStock_validation import StockEnvValidation 25 | from env.EnvMultipleStock_trade import StockEnvTrade 26 | 27 | 28 | def train_A2C(env_train, model_name, timesteps=25000): 29 | """A2C model""" 30 | 31 | start = time.time() 32 | model = A2C('MlpPolicy', env_train, verbose=0) 33 | model.learn(total_timesteps=timesteps) 34 | end = time.time() 35 | 36 | model.save(f"{config.TRAINED_MODEL_DIR}/{model_name}") 37 | print('Training time (A2C): ', (end - start) / 60, ' minutes') 38 | return model 39 | 40 | def train_ACER(env_train, model_name, timesteps=25000): 41 | start = time.time() 42 | model = ACER('MlpPolicy', env_train, verbose=0) 43 | model.learn(total_timesteps=timesteps) 44 | end = time.time() 45 | 46 | model.save(f"{config.TRAINED_MODEL_DIR}/{model_name}") 47 | print('Training time (A2C): ', (end - start) / 60, ' minutes') 48 | return model 49 | 50 | 51 | def train_DDPG(env_train, model_name, timesteps=10000): 52 | """DDPG model""" 53 | 54 | # add the noise objects for DDPG 55 | n_actions = env_train.action_space.shape[-1] 56 | param_noise = None 57 | action_noise = OrnsteinUhlenbeckActionNoise(mean=np.zeros(n_actions), sigma=float(0.5) * np.ones(n_actions)) 58 | 59 | start = time.time() 60 | model = DDPG('MlpPolicy', env_train, param_noise=param_noise, action_noise=action_noise) 61 | model.learn(total_timesteps=timesteps) 62 | end = time.time() 63 | 64 | model.save(f"{config.TRAINED_MODEL_DIR}/{model_name}") 65 | print('Training time (DDPG): ', (end-start)/60,' minutes') 66 | return model 67 | 68 | def train_PPO(env_train, model_name, timesteps=50000): 69 | """PPO model""" 70 | 71 | start = time.time() 72 | model = PPO2('MlpPolicy', env_train, ent_coef = 0.005, nminibatches = 8) 73 | #model = PPO2('MlpPolicy', env_train, ent_coef = 0.005) 74 | 75 | model.learn(total_timesteps=timesteps) 76 | end = time.time() 77 | 78 | model.save(f"{config.TRAINED_MODEL_DIR}/{model_name}") 79 | print('Training time (PPO): ', (end - start) / 60, ' minutes') 80 | return model 81 | 82 | def train_GAIL(env_train, model_name, timesteps=1000): 83 | """GAIL Model""" 84 | #from stable_baselines.gail import ExportDataset, generate_expert_traj 85 | start = time.time() 86 | # generate expert trajectories 87 | model = SAC('MLpPolicy', env_train, verbose=1) 88 | generate_expert_traj(model, 'expert_model_gail', n_timesteps=100, n_episodes=10) 89 | 90 | # Load dataset 91 | dataset = ExpertDataset(expert_path='expert_model_gail.npz', traj_limitation=10, verbose=1) 92 | model = GAIL('MLpPolicy', env_train, dataset, verbose=1) 93 | 94 | model.learn(total_timesteps=1000) 95 | end = time.time() 96 | 97 | model.save(f"{config.TRAINED_MODEL_DIR}/{model_name}") 98 | print('Training time (PPO): ', (end - start) / 60, ' minutes') 99 | return model 100 | 101 | 102 | def DRL_prediction(df, 103 | model, 104 | name, 105 | last_state, 106 | iter_num, 107 | unique_trade_date, 108 | rebalance_window, 109 | turbulence_threshold, 110 | initial): 111 | ### make a prediction based on trained model### 112 | 113 | ## trading env 114 | trade_data = data_split(df, start=unique_trade_date[iter_num - rebalance_window], end=unique_trade_date[iter_num]) 115 | env_trade = DummyVecEnv([lambda: StockEnvTrade(trade_data, 116 | turbulence_threshold=turbulence_threshold, 117 | initial=initial, 118 | previous_state=last_state, 119 | model_name=name, 120 | iteration=iter_num)]) 121 | obs_trade = env_trade.reset() 122 | 123 | for i in range(len(trade_data.index.unique())): 124 | action, _states = model.predict(obs_trade) 125 | obs_trade, rewards, dones, info = env_trade.step(action) 126 | if i == (len(trade_data.index.unique()) - 2): 127 | # print(env_test.render()) 128 | last_state = env_trade.render() 129 | 130 | df_last_state = pd.DataFrame({'last_state': last_state}) 131 | df_last_state.to_csv('results/last_state_{}_{}.csv'.format(name, i), index=False) 132 | return last_state 133 | 134 | 135 | def DRL_validation(model, test_data, test_env, test_obs) -> None: 136 | ###validation process### 137 | for i in range(len(test_data.index.unique())): 138 | action, _states = model.predict(test_obs) 139 | test_obs, rewards, dones, info = test_env.step(action) 140 | 141 | 142 | def get_validation_sharpe(iteration): 143 | ###Calculate Sharpe ratio based on validation results### 144 | df_total_value = pd.read_csv('results/account_value_validation_{}.csv'.format(iteration), index_col=0) 145 | df_total_value.columns = ['account_value_train'] 146 | df_total_value['daily_return'] = df_total_value.pct_change(1) 147 | sharpe = (4 ** 0.5) * df_total_value['daily_return'].mean() / \ 148 | df_total_value['daily_return'].std() 149 | return sharpe 150 | 151 | 152 | def run_ensemble_strategy(df, unique_trade_date, rebalance_window, validation_window) -> None: 153 | """Ensemble Strategy that combines PPO, A2C and DDPG""" 154 | print("============Start Ensemble Strategy============") 155 | # for ensemble model, it's necessary to feed the last state 156 | # of the previous model to the current model as the initial state 157 | last_state_ensemble = [] 158 | 159 | ppo_sharpe_list = [] 160 | ddpg_sharpe_list = [] 161 | a2c_sharpe_list = [] 162 | 163 | model_use = [] 164 | 165 | # based on the analysis of the in-sample data 166 | #turbulence_threshold = 140 167 | insample_turbulence = df[(df.datadate<20151000) & (df.datadate>=20090000)] 168 | insample_turbulence = insample_turbulence.drop_duplicates(subset=['datadate']) 169 | insample_turbulence_threshold = np.quantile(insample_turbulence.turbulence.values, .90) 170 | 171 | start = time.time() 172 | for i in range(rebalance_window + validation_window, len(unique_trade_date), rebalance_window): 173 | print("============================================") 174 | ## initial state is empty 175 | if i - rebalance_window - validation_window == 0: 176 | # inital state 177 | initial = True 178 | else: 179 | # previous state 180 | initial = False 181 | 182 | # Tuning trubulence index based on historical data 183 | # Turbulence lookback window is one quarter 184 | end_date_index = df.index[df["datadate"] == unique_trade_date[i - rebalance_window - validation_window]].to_list()[-1] 185 | start_date_index = end_date_index - validation_window*30 + 1 186 | 187 | historical_turbulence = df.iloc[start_date_index:(end_date_index + 1), :] 188 | #historical_turbulence = df[(df.datadate=(unique_trade_date[i - rebalance_window - validation_window - 63]))] 189 | 190 | 191 | historical_turbulence = historical_turbulence.drop_duplicates(subset=['datadate']) 192 | 193 | historical_turbulence_mean = np.mean(historical_turbulence.turbulence.values) 194 | 195 | if historical_turbulence_mean > insample_turbulence_threshold: 196 | # if the mean of the historical data is greater than the 90% quantile of insample turbulence data 197 | # then we assume that the current market is volatile, 198 | # therefore we set the 90% quantile of insample turbulence data as the turbulence threshold 199 | # meaning the current turbulence can't exceed the 90% quantile of insample turbulence data 200 | turbulence_threshold = insample_turbulence_threshold 201 | else: 202 | # if the mean of the historical data is less than the 90% quantile of insample turbulence data 203 | # then we tune up the turbulence_threshold, meaning we lower the risk 204 | turbulence_threshold = np.quantile(insample_turbulence.turbulence.values, 1) 205 | print("turbulence_threshold: ", turbulence_threshold) 206 | 207 | ############## Environment Setup starts ############## 208 | ## training env 209 | train = data_split(df, start=20090000, end=unique_trade_date[i - rebalance_window - validation_window]) 210 | env_train = DummyVecEnv([lambda: StockEnvTrain(train)]) 211 | 212 | ## validation env 213 | validation = data_split(df, start=unique_trade_date[i - rebalance_window - validation_window], 214 | end=unique_trade_date[i - rebalance_window]) 215 | env_val = DummyVecEnv([lambda: StockEnvValidation(validation, 216 | turbulence_threshold=turbulence_threshold, 217 | iteration=i)]) 218 | obs_val = env_val.reset() 219 | ############## Environment Setup ends ############## 220 | 221 | ############## Training and Validation starts ############## 222 | print("======Model training from: ", 20090000, "to ", 223 | unique_trade_date[i - rebalance_window - validation_window]) 224 | # print("training: ",len(data_split(df, start=20090000, end=test.datadate.unique()[i-rebalance_window]) )) 225 | # print("==============Model Training===========") 226 | print("======A2C Training========") 227 | model_a2c = train_A2C(env_train, model_name="A2C_30k_dow_{}".format(i), timesteps=30000) 228 | print("======A2C Validation from: ", unique_trade_date[i - rebalance_window - validation_window], "to ", 229 | unique_trade_date[i - rebalance_window]) 230 | DRL_validation(model=model_a2c, test_data=validation, test_env=env_val, test_obs=obs_val) 231 | sharpe_a2c = get_validation_sharpe(i) 232 | print("A2C Sharpe Ratio: ", sharpe_a2c) 233 | 234 | print("======PPO Training========") 235 | model_ppo = train_PPO(env_train, model_name="PPO_100k_dow_{}".format(i), timesteps=100000) 236 | print("======PPO Validation from: ", unique_trade_date[i - rebalance_window - validation_window], "to ", 237 | unique_trade_date[i - rebalance_window]) 238 | DRL_validation(model=model_ppo, test_data=validation, test_env=env_val, test_obs=obs_val) 239 | sharpe_ppo = get_validation_sharpe(i) 240 | print("PPO Sharpe Ratio: ", sharpe_ppo) 241 | 242 | print("======DDPG Training========") 243 | model_ddpg = train_DDPG(env_train, model_name="DDPG_10k_dow_{}".format(i), timesteps=10000) 244 | #model_ddpg = train_TD3(env_train, model_name="DDPG_10k_dow_{}".format(i), timesteps=20000) 245 | print("======DDPG Validation from: ", unique_trade_date[i - rebalance_window - validation_window], "to ", 246 | unique_trade_date[i - rebalance_window]) 247 | DRL_validation(model=model_ddpg, test_data=validation, test_env=env_val, test_obs=obs_val) 248 | sharpe_ddpg = get_validation_sharpe(i) 249 | 250 | ppo_sharpe_list.append(sharpe_ppo) 251 | a2c_sharpe_list.append(sharpe_a2c) 252 | ddpg_sharpe_list.append(sharpe_ddpg) 253 | 254 | # Model Selection based on sharpe ratio 255 | if (sharpe_ppo >= sharpe_a2c) & (sharpe_ppo >= sharpe_ddpg): 256 | model_ensemble = model_ppo 257 | model_use.append('PPO') 258 | elif (sharpe_a2c > sharpe_ppo) & (sharpe_a2c > sharpe_ddpg): 259 | model_ensemble = model_a2c 260 | model_use.append('A2C') 261 | else: 262 | model_ensemble = model_ddpg 263 | model_use.append('DDPG') 264 | ############## Training and Validation ends ############## 265 | 266 | ############## Trading starts ############## 267 | print("======Trading from: ", unique_trade_date[i - rebalance_window], "to ", unique_trade_date[i]) 268 | #print("Used Model: ", model_ensemble) 269 | last_state_ensemble = DRL_prediction(df=df, model=model_ensemble, name="ensemble", 270 | last_state=last_state_ensemble, iter_num=i, 271 | unique_trade_date=unique_trade_date, 272 | rebalance_window=rebalance_window, 273 | turbulence_threshold=turbulence_threshold, 274 | initial=initial) 275 | # print("============Trading Done============") 276 | ############## Trading ends ############## 277 | 278 | end = time.time() 279 | print("Ensemble Strategy took: ", (end - start) / 60, " minutes") 280 | -------------------------------------------------------------------------------- /trained_models/firstRun/firstRun.txt: -------------------------------------------------------------------------------- 1 | Training time (DDPG): 1.4032043019930522 minutes 2 | ======DDPG Validation from: 20151002 to 20160104 3 | ======Trading from: 20160104 to 20160405 4 | previous_total_asset:1000000 5 | end_total_asset:1087040.1166573188 6 | total_reward:87040.11665731878 7 | total_cost: 1439.0989384654793 8 | total trades: 833 9 | Sharpe: 0.2785129754677719 10 | ============================================ 11 | turbulence_threshold: 96.08032158358223 12 | ======Model training from: 20090000 to 20160104 13 | ======A2C Training======== 14 | Training time (A2C): 1.3370689153671265 minutes 15 | ======A2C Validation from: 20160104 to 20160405 16 | A2C Sharpe Ratio: 0.12895179187541986 17 | ======PPO Training======== 18 | Training time (PPO): 6.474345183372497 minutes 19 | ======PPO Validation from: 20160104 to 20160405 20 | PPO Sharpe Ratio: 0.0812727656807347 21 | ======DDPG Training======== 22 | Training time (DDPG): 1.4149103999137878 minutes 23 | ======DDPG Validation from: 20160104 to 20160405 24 | ======Trading from: 20160405 to 20160705 25 | previous_total_asset:1087040.1166573188 26 | end_total_asset:1107538.721338863 27 | total_reward:20498.60468154424 28 | total_cost: 4803.413129340217 29 | total trades: 1435 30 | Sharpe: 0.07994694604375531 31 | ============================================ 32 | turbulence_threshold: 171.0940715631016 33 | ======Model training from: 20090000 to 20160405 34 | ======A2C Training======== 35 | Training time (A2C): 1.3414838035901389 minutes 36 | ======A2C Validation from: 20160405 to 20160705 37 | A2C Sharpe Ratio: -0.05926157827654362 38 | ======PPO Training======== 39 | Training time (PPO): 6.25040078163147 minutes 40 | ======PPO Validation from: 20160405 to 20160705 41 | PPO Sharpe Ratio: -0.010994220220921459 42 | ======DDPG Training======== 43 | Training time (DDPG): 1.3305055856704713 minutes 44 | ======DDPG Validation from: 20160405 to 20160705 45 | ======Trading from: 20160705 to 20161003 46 | previous_total_asset:1107538.721338863 47 | end_total_asset:1114824.2664504736 48 | total_reward:7285.545111610554 49 | total_cost: 2305.015114624265 50 | total trades: 1061 51 | Sharpe: 0.03984671529809446 52 | ============================================ 53 | turbulence_threshold: 171.0940715631016 54 | ======Model training from: 20090000 to 20160705 55 | ======A2C Training======== 56 | Training time (A2C): 1.2364217480023703 minutes 57 | ======A2C Validation from: 20160705 to 20161003 58 | A2C Sharpe Ratio: -0.11174422866829195 59 | ======PPO Training======== 60 | Training time (PPO): 6.124137282371521 minutes 61 | ======PPO Validation from: 20160705 to 20161003 62 | PPO Sharpe Ratio: -0.030634831149552927 63 | ======DDPG Training======== 64 | Training time (DDPG): 1.3925907293955484 minutes 65 | ======DDPG Validation from: 20160705 to 20161003 66 | ======Trading from: 20161003 to 20170103 67 | previous_total_asset:1114824.2664504736 68 | end_total_asset:1259858.1435141487 69 | total_reward:145033.87706367509 70 | total_cost: 2119.10902904338 71 | total trades: 758 72 | Sharpe: 0.6037497031945733 73 | ============================================ 74 | turbulence_threshold: 171.0940715631016 75 | ======Model training from: 20090000 to 20161003 76 | ======A2C Training======== 77 | Training time (A2C): 1.2790143211682639 minutes 78 | ======A2C Validation from: 20161003 to 20170103 79 | A2C Sharpe Ratio: 0.4708577655672649 80 | ======PPO Training======== 81 | Training time (PPO): 6.374260282516479 minutes 82 | ======PPO Validation from: 20161003 to 20170103 83 | PPO Sharpe Ratio: 0.5613694454755151 84 | ======DDPG Training======== 85 | Training time (DDPG): 1.3775984485944113 minutes 86 | ======DDPG Validation from: 20161003 to 20170103 87 | ======Trading from: 20170103 to 20170404 88 | previous_total_asset:1259858.1435141487 89 | end_total_asset:1289955.4383732914 90 | total_reward:30097.29485914274 91 | total_cost: 4173.957754834233 92 | total trades: 1350 93 | Sharpe: 0.18315847870402202 94 | ============================================ 95 | turbulence_threshold: 96.08032158358223 96 | ======Model training from: 20090000 to 20170103 97 | ======A2C Training======== 98 | Training time (A2C): 1.2784758011500041 minutes 99 | ======A2C Validation from: 20170103 to 20170404 100 | A2C Sharpe Ratio: 0.46846512971262966 101 | ======PPO Training======== 102 | Training time (PPO): 5.576504488786061 minutes 103 | ======PPO Validation from: 20170103 to 20170404 104 | PPO Sharpe Ratio: 0.24519956141364704 105 | ======DDPG Training======== 106 | Training time (DDPG): 1.1557793339093527 minutes 107 | ======DDPG Validation from: 20170103 to 20170404 108 | ======Trading from: 20170404 to 20170705 109 | previous_total_asset:1289955.4383732914 110 | end_total_asset:1338233.7196536912 111 | total_reward:48278.281280399766 112 | total_cost: 4987.029038903721 113 | total trades: 1105 114 | Sharpe: 0.3271680505839383 115 | ============================================ 116 | turbulence_threshold: 171.0940715631016 117 | ======Model training from: 20090000 to 20170404 118 | ======A2C Training======== 119 | Training time (A2C): 1.2281196355819701 minutes 120 | ======A2C Validation from: 20170404 to 20170705 121 | A2C Sharpe Ratio: 0.05734458965878208 122 | ======PPO Training======== 123 | Training time (PPO): 5.5209480166435245 minutes 124 | ======PPO Validation from: 20170404 to 20170705 125 | PPO Sharpe Ratio: 0.24033301087086795 126 | ======DDPG Training======== 127 | Training time (DDPG): 1.182106081644694 minutes 128 | ======DDPG Validation from: 20170404 to 20170705 129 | ======Trading from: 20170705 to 20171003 130 | previous_total_asset:1338233.7196536912 131 | end_total_asset:1429226.5849508496 132 | total_reward:90992.86529715848 133 | total_cost: 3136.2469879290484 134 | total trades: 1113 135 | Sharpe: 0.47280844768554725 136 | ============================================ 137 | turbulence_threshold: 171.0940715631016 138 | ======Model training from: 20090000 to 20170705 139 | ======A2C Training======== 140 | Training time (A2C): 1.254574751853943 minutes 141 | ======A2C Validation from: 20170705 to 20171003 142 | A2C Sharpe Ratio: 0.358854343300452 143 | ======PPO Training======== 144 | Training time (PPO): 5.621578629811605 minutes 145 | ======PPO Validation from: 20170705 to 20171003 146 | PPO Sharpe Ratio: 0.07527103972941204 147 | ======DDPG Training======== 148 | Training time (DDPG): 1.164457364877065 minutes 149 | ======DDPG Validation from: 20170705 to 20171003 150 | ======Trading from: 20171003 to 20180103 151 | previous_total_asset:1429226.5849508496 152 | end_total_asset:1580060.0835413162 153 | total_reward:150833.49859046657 154 | total_cost: 6358.177911895167 155 | total trades: 1496 156 | Sharpe: 0.7265612875701101 157 | ============================================ 158 | turbulence_threshold: 96.08032158358223 159 | ======Model training from: 20090000 to 20171003 160 | ======A2C Training======== 161 | Training time (A2C): 1.2428059816360473 minutes 162 | ======A2C Validation from: 20171003 to 20180103 163 | A2C Sharpe Ratio: 0.3243888784752679 164 | ======PPO Training======== 165 | Training time (PPO): 5.614072314898173 minutes 166 | ======PPO Validation from: 20171003 to 20180103 167 | PPO Sharpe Ratio: 0.16682260319739153 168 | ======DDPG Training======== 169 | Training time (DDPG): 1.1649869322776794 minutes 170 | ======DDPG Validation from: 20171003 to 20180103 171 | ======Trading from: 20180103 to 20180405 172 | previous_total_asset:1580060.0835413162 173 | end_total_asset:1592770.372850434 174 | total_reward:12710.28930911771 175 | total_cost: 2018.6782290415374 176 | total trades: 336 177 | Sharpe: 0.09352565174550506 178 | ============================================ 179 | turbulence_threshold: 96.08032158358223 180 | ======Model training from: 20090000 to 20180103 181 | ======A2C Training======== 182 | Training time (A2C): 1.226614816983541 minutes 183 | ======A2C Validation from: 20180103 to 20180405 184 | A2C Sharpe Ratio: -0.02634661861492801 185 | ======PPO Training======== 186 | Training time (PPO): 5.589087669054667 minutes 187 | ======PPO Validation from: 20180103 to 20180405 188 | PPO Sharpe Ratio: 0.010585382678203449 189 | ======DDPG Training======== 190 | Training time (DDPG): 1.1731446345647176 minutes 191 | ======DDPG Validation from: 20180103 to 20180405 192 | ======Trading from: 20180405 to 20180705 193 | previous_total_asset:1592770.372850434 194 | end_total_asset:1548572.384419588 195 | total_reward:-44197.98843084602 196 | total_cost: 6378.9182177302255 197 | total trades: 1023 198 | Sharpe: -0.1929265581355395 199 | ============================================ 200 | turbulence_threshold: 96.08032158358223 201 | ======Model training from: 20090000 to 20180405 202 | ======A2C Training======== 203 | Training time (A2C): 1.2613045692443847 minutes 204 | ======A2C Validation from: 20180405 to 20180705 205 | A2C Sharpe Ratio: -0.08649508862120636 206 | ======PPO Training======== 207 | Training time (PPO): 5.598826432228089 minutes 208 | ======PPO Validation from: 20180405 to 20180705 209 | PPO Sharpe Ratio: -0.18505771686222383 210 | ======DDPG Training======== 211 | Training time (DDPG): 1.1778120477994283 minutes 212 | ======DDPG Validation from: 20180405 to 20180705 213 | ======Trading from: 20180705 to 20181003 214 | previous_total_asset:1548572.384419588 215 | end_total_asset:1568154.5538699296 216 | total_reward:19582.169450341724 217 | total_cost: 5695.778781719215 218 | total trades: 706 219 | Sharpe: 0.1572863698225405 220 | ============================================ 221 | turbulence_threshold: 96.08032158358223 222 | ======Model training from: 20090000 to 20180705 223 | ======A2C Training======== 224 | Training time (A2C): 1.2604529023170472 minutes 225 | ======A2C Validation from: 20180705 to 20181003 226 | A2C Sharpe Ratio: 0.07752581504400194 227 | ======PPO Training======== 228 | Training time (PPO): 5.657333815097809 minutes 229 | ======PPO Validation from: 20180705 to 20181003 230 | PPO Sharpe Ratio: 0.10829398926629066 231 | ======DDPG Training======== 232 | Training time (DDPG): 1.1671661814053853 minutes 233 | ======DDPG Validation from: 20180705 to 20181003 234 | ======Trading from: 20181003 to 20190104 235 | previous_total_asset:1568154.5538699296 236 | end_total_asset:1579537.062252677 237 | total_reward:11382.508382747415 238 | total_cost: 788.7012862089922 239 | total trades: 127 240 | Sharpe: 0.3277359532036335 241 | ============================================ 242 | turbulence_threshold: 171.0940715631016 243 | ======Model training from: 20090000 to 20181003 244 | ======A2C Training======== 245 | Training time (A2C): 1.2557534178098042 minutes 246 | ======A2C Validation from: 20181003 to 20190104 247 | A2C Sharpe Ratio: -0.43175318608162894 248 | ======PPO Training======== 249 | Training time (PPO): 5.634672184785207 minutes 250 | ======PPO Validation from: 20181003 to 20190104 251 | PPO Sharpe Ratio: -0.3488417042967779 252 | ======DDPG Training======== 253 | Training time (DDPG): 1.1688021858533224 minutes 254 | ======DDPG Validation from: 20181003 to 20190104 255 | ======Trading from: 20190104 to 20190405 256 | previous_total_asset:1579537.062252677 257 | end_total_asset:1656752.78625876 258 | total_reward:77215.72400608286 259 | total_cost: 2044.955819485111 260 | total trades: 986 261 | Sharpe: 0.23073277429630382 262 | ============================================ 263 | turbulence_threshold: 96.08032158358223 264 | ======Model training from: 20090000 to 20190104 265 | ======A2C Training======== 266 | Training time (A2C): 1.236687688032786 minutes 267 | ======A2C Validation from: 20190104 to 20190405 268 | A2C Sharpe Ratio: 0.17932743503642423 269 | ======PPO Training======== 270 | Training time (PPO): 5.659159135818482 minutes 271 | ======PPO Validation from: 20190104 to 20190405 272 | PPO Sharpe Ratio: -0.036801331523006825 273 | ======DDPG Training======== 274 | Training time (DDPG): 1.183470646540324 minutes 275 | ======DDPG Validation from: 20190104 to 20190405 276 | ======Trading from: 20190405 to 20190708 277 | previous_total_asset:1656752.78625876 278 | end_total_asset:1660419.855537839 279 | total_reward:3667.0692790790927 280 | total_cost: 983.9327993170203 281 | total trades: 154 282 | Sharpe: 0.24416151340920061 283 | ============================================ 284 | turbulence_threshold: 96.08032158358223 285 | ======Model training from: 20090000 to 20190405 286 | ======A2C Training======== 287 | Training time (A2C): 1.2380893667538961 minutes 288 | ======A2C Validation from: 20190405 to 20190708 289 | A2C Sharpe Ratio: 0.36807824354502466 290 | ======PPO Training======== 291 | Training time (PPO): 5.665936847527822 minutes 292 | ======PPO Validation from: 20190405 to 20190708 293 | PPO Sharpe Ratio: 0.20924173006181554 294 | ======DDPG Training======== 295 | Training time (DDPG): 1.1706735849380494 minutes 296 | ======DDPG Validation from: 20190405 to 20190708 297 | ======Trading from: 20190708 to 20191004 298 | previous_total_asset:1660419.855537839 299 | end_total_asset:1658379.2371734818 300 | total_reward:-2040.6183643571567 301 | total_cost: 2144.20246176936 302 | total trades: 369 303 | Sharpe: -0.060696674597802404 304 | ============================================ 305 | turbulence_threshold: 96.08032158358223 306 | ======Model training from: 20090000 to 20190708 307 | ======A2C Training======== 308 | Training time (A2C): 1.247508200009664 minutes 309 | ======A2C Validation from: 20190708 to 20191004 310 | A2C Sharpe Ratio: 0.0893561118794478 311 | ======PPO Training======== 312 | Training time (PPO): 5.715412080287933 minutes 313 | ======PPO Validation from: 20190708 to 20191004 314 | PPO Sharpe Ratio: -0.03477201917565103 315 | ======DDPG Training======== 316 | Training time (DDPG): 1.1805522680282592 minutes 317 | ======DDPG Validation from: 20190708 to 20191004 318 | ======Trading from: 20191004 to 20200106 319 | previous_total_asset:1658379.2371734818 320 | end_total_asset:1657123.6130156124 321 | total_reward:-1255.6241578694899 322 | total_cost: 417.3138944718934 323 | total trades: 62 324 | Sharpe: -0.272680028830182 325 | ============================================ 326 | turbulence_threshold: 96.08032158358223 327 | ======Model training from: 20090000 to 20191004 328 | ======A2C Training======== 329 | Training time (A2C): 1.3008950789769491 minutes 330 | ======A2C Validation from: 20191004 to 20200106 331 | A2C Sharpe Ratio: -0.3774060936793665 332 | ======PPO Training======== 333 | Training time (PPO): 5.689193399747213 minutes 334 | ======PPO Validation from: 20191004 to 20200106 335 | PPO Sharpe Ratio: -0.18946722707878694 336 | ======DDPG Training======== 337 | Training time (DDPG): 1.1852190653483072 minutes 338 | ======DDPG Validation from: 20191004 to 20200106 339 | ======Trading from: 20200106 to 20200406 340 | previous_total_asset:1657123.6130156124 341 | end_total_asset:1642563.8331977944 342 | total_reward:-14559.779817817966 343 | total_cost: 924.9804922587181 344 | total trades: 180 345 | Sharpe: -0.46263161184974727 346 | ============================================ 347 | turbulence_threshold: 96.08032158358223 348 | ======Model training from: 20090000 to 20200106 349 | ======A2C Training======== 350 | Training time (A2C): 1.2720686356226603 minutes 351 | ======A2C Validation from: 20200106 to 20200406 352 | A2C Sharpe Ratio: -0.42998996453475236 353 | ======PPO Training======== 354 | Training time (PPO): 5.73396958510081 minutes 355 | ======PPO Validation from: 20200106 to 20200406 356 | PPO Sharpe Ratio: -0.3857694824087389 357 | ======DDPG Training======== 358 | Training time (DDPG): 1.2296231349309286 minutes 359 | ======DDPG Validation from: 20200106 to 20200406 360 | ======Trading from: 20200406 to 20200707 361 | previous_total_asset:1642563.8331977944 362 | end_total_asset:1651496.8197026039 363 | total_reward:8932.986504809465 364 | total_cost: 707.3734225074006 365 | total trades: 93 366 | Sharpe: 0.2836714121593213 367 | Ensemble Strategy took: 150.1863147139549 minutes 368 | (cs238) kyledsouza@C02D35L6MD6R CS238FinalProject % 369 | --------------------------------------------------------------------------------