├── .gitignore ├── LICENSE ├── README.md ├── assets └── images │ ├── benchmark.png │ └── cumulative_factor_returns.png ├── examples ├── benchmark_strategy_for_portfolio_management │ ├── buy_and_hold.py │ ├── risk_parity_strategy.py │ └── weight_rebalance.py ├── envs │ ├── add_costs.py │ ├── best_practice_in_feature_engineering.py │ └── workflow_for_portfolio_gym.py ├── linear_regression │ ├── 01_linear_regression.md │ └── 01_linear_regression.py ├── neural_network │ └── mlp │ │ ├── mlp_multi_output_view.py │ │ └── mlp_single_output_view.py └── reinforcement_learning │ └── ddpg │ ├── main.py │ └── models.py ├── requirements.txt ├── setup.py ├── test ├── test_add_cost.py └── test_envs │ ├── portfolio_env_sanity_check.py │ ├── test_mul_realnumber.py │ ├── test_multiple.py │ ├── test_pytorch_wrapper.py │ ├── test_single_realnumber.py │ ├── test_single_stock.py │ ├── test_single_subject.py │ └── test_wrapper.py └── trading_gym ├── VERSION.txt ├── __init__.py ├── envs ├── __init__.py └── portfolio_gym │ ├── __init__.py │ ├── costs.py │ ├── data_generator.py │ ├── market_simulator.py │ └── portfolio_gym.py ├── interface.py ├── utils ├── __init__.py └── data │ ├── __init__.py │ └── toy.py └── wrapper ├── __init__.py ├── normalizer_wrapper.py ├── numpy_wrapper.py └── torch_wrapper.py /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StateOfTheArt-quant/trading_gym/HEAD/.gitignore -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StateOfTheArt-quant/trading_gym/HEAD/LICENSE -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StateOfTheArt-quant/trading_gym/HEAD/README.md -------------------------------------------------------------------------------- /assets/images/benchmark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StateOfTheArt-quant/trading_gym/HEAD/assets/images/benchmark.png -------------------------------------------------------------------------------- /assets/images/cumulative_factor_returns.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StateOfTheArt-quant/trading_gym/HEAD/assets/images/cumulative_factor_returns.png -------------------------------------------------------------------------------- /examples/benchmark_strategy_for_portfolio_management/buy_and_hold.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StateOfTheArt-quant/trading_gym/HEAD/examples/benchmark_strategy_for_portfolio_management/buy_and_hold.py -------------------------------------------------------------------------------- /examples/benchmark_strategy_for_portfolio_management/risk_parity_strategy.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StateOfTheArt-quant/trading_gym/HEAD/examples/benchmark_strategy_for_portfolio_management/risk_parity_strategy.py -------------------------------------------------------------------------------- /examples/benchmark_strategy_for_portfolio_management/weight_rebalance.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StateOfTheArt-quant/trading_gym/HEAD/examples/benchmark_strategy_for_portfolio_management/weight_rebalance.py -------------------------------------------------------------------------------- /examples/envs/add_costs.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | -------------------------------------------------------------------------------- /examples/envs/best_practice_in_feature_engineering.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StateOfTheArt-quant/trading_gym/HEAD/examples/envs/best_practice_in_feature_engineering.py -------------------------------------------------------------------------------- /examples/envs/workflow_for_portfolio_gym.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StateOfTheArt-quant/trading_gym/HEAD/examples/envs/workflow_for_portfolio_gym.py -------------------------------------------------------------------------------- /examples/linear_regression/01_linear_regression.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StateOfTheArt-quant/trading_gym/HEAD/examples/linear_regression/01_linear_regression.md -------------------------------------------------------------------------------- /examples/linear_regression/01_linear_regression.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StateOfTheArt-quant/trading_gym/HEAD/examples/linear_regression/01_linear_regression.py -------------------------------------------------------------------------------- /examples/neural_network/mlp/mlp_multi_output_view.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StateOfTheArt-quant/trading_gym/HEAD/examples/neural_network/mlp/mlp_multi_output_view.py -------------------------------------------------------------------------------- /examples/neural_network/mlp/mlp_single_output_view.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | -------------------------------------------------------------------------------- /examples/reinforcement_learning/ddpg/main.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StateOfTheArt-quant/trading_gym/HEAD/examples/reinforcement_learning/ddpg/main.py -------------------------------------------------------------------------------- /examples/reinforcement_learning/ddpg/models.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StateOfTheArt-quant/trading_gym/HEAD/examples/reinforcement_learning/ddpg/models.py -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StateOfTheArt-quant/trading_gym/HEAD/setup.py -------------------------------------------------------------------------------- /test/test_add_cost.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StateOfTheArt-quant/trading_gym/HEAD/test/test_add_cost.py -------------------------------------------------------------------------------- /test/test_envs/portfolio_env_sanity_check.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StateOfTheArt-quant/trading_gym/HEAD/test/test_envs/portfolio_env_sanity_check.py -------------------------------------------------------------------------------- /test/test_envs/test_mul_realnumber.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StateOfTheArt-quant/trading_gym/HEAD/test/test_envs/test_mul_realnumber.py -------------------------------------------------------------------------------- /test/test_envs/test_multiple.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StateOfTheArt-quant/trading_gym/HEAD/test/test_envs/test_multiple.py -------------------------------------------------------------------------------- /test/test_envs/test_pytorch_wrapper.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StateOfTheArt-quant/trading_gym/HEAD/test/test_envs/test_pytorch_wrapper.py -------------------------------------------------------------------------------- /test/test_envs/test_single_realnumber.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StateOfTheArt-quant/trading_gym/HEAD/test/test_envs/test_single_realnumber.py -------------------------------------------------------------------------------- /test/test_envs/test_single_stock.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StateOfTheArt-quant/trading_gym/HEAD/test/test_envs/test_single_stock.py -------------------------------------------------------------------------------- /test/test_envs/test_single_subject.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StateOfTheArt-quant/trading_gym/HEAD/test/test_envs/test_single_subject.py -------------------------------------------------------------------------------- /test/test_envs/test_wrapper.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StateOfTheArt-quant/trading_gym/HEAD/test/test_envs/test_wrapper.py -------------------------------------------------------------------------------- /trading_gym/VERSION.txt: -------------------------------------------------------------------------------- 1 | 0.0.1 -------------------------------------------------------------------------------- /trading_gym/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | -------------------------------------------------------------------------------- /trading_gym/envs/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StateOfTheArt-quant/trading_gym/HEAD/trading_gym/envs/__init__.py -------------------------------------------------------------------------------- /trading_gym/envs/portfolio_gym/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | -------------------------------------------------------------------------------- /trading_gym/envs/portfolio_gym/costs.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StateOfTheArt-quant/trading_gym/HEAD/trading_gym/envs/portfolio_gym/costs.py -------------------------------------------------------------------------------- /trading_gym/envs/portfolio_gym/data_generator.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StateOfTheArt-quant/trading_gym/HEAD/trading_gym/envs/portfolio_gym/data_generator.py -------------------------------------------------------------------------------- /trading_gym/envs/portfolio_gym/market_simulator.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StateOfTheArt-quant/trading_gym/HEAD/trading_gym/envs/portfolio_gym/market_simulator.py -------------------------------------------------------------------------------- /trading_gym/envs/portfolio_gym/portfolio_gym.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StateOfTheArt-quant/trading_gym/HEAD/trading_gym/envs/portfolio_gym/portfolio_gym.py -------------------------------------------------------------------------------- /trading_gym/interface.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StateOfTheArt-quant/trading_gym/HEAD/trading_gym/interface.py -------------------------------------------------------------------------------- /trading_gym/utils/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | -------------------------------------------------------------------------------- /trading_gym/utils/data/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | -------------------------------------------------------------------------------- /trading_gym/utils/data/toy.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StateOfTheArt-quant/trading_gym/HEAD/trading_gym/utils/data/toy.py -------------------------------------------------------------------------------- /trading_gym/wrapper/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StateOfTheArt-quant/trading_gym/HEAD/trading_gym/wrapper/__init__.py -------------------------------------------------------------------------------- /trading_gym/wrapper/normalizer_wrapper.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StateOfTheArt-quant/trading_gym/HEAD/trading_gym/wrapper/normalizer_wrapper.py -------------------------------------------------------------------------------- /trading_gym/wrapper/numpy_wrapper.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StateOfTheArt-quant/trading_gym/HEAD/trading_gym/wrapper/numpy_wrapper.py -------------------------------------------------------------------------------- /trading_gym/wrapper/torch_wrapper.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StateOfTheArt-quant/trading_gym/HEAD/trading_gym/wrapper/torch_wrapper.py --------------------------------------------------------------------------------