tradingenv


Nametradingenv JSON
Version 0.1.2 PyPI version JSON
download
home_pagehttps://github.com/xaiassetmanagement/tradingenv
SummaryBacktest trading strategies or train reinforcement learning agents with and event-driven market simulator.
upload_time2023-10-03 16:24:11
maintainer
docs_urlNone
authorFederico Fontana
requires_python>=3.7
licenseApache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
keywords trading investment finance backtest reinforcement-learning gym
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![Logo](https://tradingenv.blob.core.windows.net/images/logo-background-cropped.png)

[![Documentation](https://github.com/xaiassetmanagement/tradingenv/actions/workflows/build-docs.yml/badge.svg)](https://github.com/xaiassetmanagement/tradingenv/actions/workflows/software-tests.yml)
[![Software tests](https://github.com/xaiassetmanagement/tradingenv/actions/workflows/software-tests.yml/badge.svg)](https://github.com/xaiassetmanagement/tradingenv/actions/workflows/software-tests.yml)
[![Coverage](https://raw.githubusercontent.com/xaiassetmanagement/tradingenv/coverage-badge/coverage.svg)](https://github.com/xaiassetmanagement/tradingenv/actions)

[![python](https://img.shields.io/pypi/pyversions/shap)](https://www.python.org)
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)


# Introduction

Backtest trading strategies or train reinforcement learning agents with
`tradingenv`, an event-driven market simulator that implements the
OpenAI/gym protocol.

# Installation

tradingenv supports Python 3.7 or newer versions. The following command
line will install the latest software version.

``` console
pip install tradingenv
```

Notebooks, software tests and building the documentation require extra
dependencies that can be installed with

``` console
pip install tradingenv[extra]
```

# Examples

## Reinforcement Learning - Lazy Initialisation

The package is built upon the industry-standard
[gym](https://github.com/openai/gym) and therefore can be used in
conjunction with popular reinforcement learning frameworks including
[rllib](https://docs.ray.io/en/latest/rllib/) and
[stable-baselines3](https://github.com/hill-a/stable-baselines).

``` python
from tradingenv.env import TradingEnvXY
import yfinance

# Load data from Yahoo Finance.
tickers = yfinance.Tickers(['SPY', 'TLT', 'TBIL', '^IRX'])
data = tickers.history(period="12mo", progress=False)['Close'].tz_localize(None)
Y = data[['SPY', 'TLT']]
X = Y.rolling(12).mean() - Y.rolling(26).mean()

# Lazy initialization of the trading environment.
env = TradingEnvXY(X, Y)

# OpenAI/gym protocol. Run an episode in the environment.
# env can be passed to RL agents of ray/rllib, stable-baselines3 or ElegantRL for training.
obs = env.reset()
done = False
while not done:
    action = env.action_space.sample()
    obs, reward, done, info = env.step(action)
```

## Reinforcement Learning - Custom Initialisation
Use custom initialisation to personalise the design of the environment, 
including the reward function, transaction costs, observation window and leverage.


``` python
env = TradingEnvXY(
    X=X,                      # Use moving averages crossover as features
    Y=Y,                      # to trade SPY and TLT ETFs.
    transformer='z-score',    # Features are standardised to N(0, 1).
    reward='logret',          # Reward is the log return of the portfolio at each step,
    cash=1000000,             # starting with $1M.
    spread=0.0002,            # Transaction costs include a 0.02% spread,
    markup=0.005,             # a 0.5% broker markup on deposit rate,
    fee=0.0002,               # a 0.02% dealing fee of traded notional
    fixed=1,                  # and a $1 fixed fee per trade.
    margin=0.02,              # Do not trade if trade size is smaller than 2% of the portfolio.
    rate=data['^IRX'] / 100,  # Rate used to compute the yield on idle cash and cost of leverage.
    latency=0,                # Trades are implemented with no latency
    steps_delay=1,            # but a delay of one day.
    window=1,                 # The observation is the current state of the market,
    clip=5.,                  # clipped between -5 and +5 standard deviations.
    max_long=1.5,             # The maximum long position is 150% of the portfolio,
    max_short=-1.,            # the maximum short position is 100% of the portfolio.
    calendar='NYSE',          # Use the NYSE calendar to schedule trading days.
)
```

## Backtesting

Thanks to the event-driven design, tradingenv is agnostic with respect
to the type and time-frequency of the events. This means that you can
run simulations either using irregularly sampled trade and quotes data,
daily closing prices, monthly economic data or alternative data.
Financial instruments supported include stocks, ETF and futures.

``` python
class Portfolio6040(AbstractPolicy):
    """Implement logic of your investment strategy or RL agent here."""

    def act(self, state):
        """Invest 60% of the portfolio in SPY ETF and 40% in TLT ETF."""
        return [0.6, 0.4]

# Run the backtest.
track_record = env.backtest(
    policy=Portfolio6040(),
    risk_free=prices['TBIL'],
    benchmark=prices['SPY'],
)

# The track_record object stores the results of your backtest.
track_record.tearsheet()
```

![](https://tradingenv.blob.core.windows.net/images/tearsheet.png)

``` python
track_record.fig_net_liquidation_value()
```

![](https://tradingenv.blob.core.windows.net/images/fig_net_liquidation_value.png)

# Relevant projects

-   [btgym](https://github.com/Kismuz/btgym): is an OpenAI
    Gym-compatible environment for
-   [backtrader](https://github.com/backtrader/backtrader)
    backtesting/trading library, designed to provide gym-integrated
    framework for running reinforcement learning experiments in \[close
    to\] real world algorithmic trading environments.
-   [gym](https://github.com/openai/gym): A toolkit for developing and
    comparing reinforcement learning algorithms.
-   [qlib](https://github.com/microsoft/qlib): Qlib provides a strong
    infrastructure to support quant research.
-   [rllib](https://docs.ray.io/en/latest/rllib/): open-source library
    for reinforcement learning.
-   [stable-baselines3](https://github.com/hill-a/stable-baselines): is
    a set of reliable implementations of reinforcement learning
    algorithms in PyTorch.

# Developers

You are welcome to contribute features, examples and documentation or
issues.

You can run the software tests typing `pytest` in the command line,
assuming that the folder `\tests` is in the current working directory.

To refresh and build the documentation:

``` 
pytest tests/notebooks
sphinx-apidoc -f -o docs/source tradingenv
cd docs
make clean
make html
```

<!---
On README.md vs README.rst.
While .rst is clearly a better format for Sphinx documentation, not all 
blocks are rendered correctly on GitHub. The rst block literalinclude in 
particular is important, as it's the only way to have code in the /tests folder 
and extract it from functions and class methods. While GitHub supports .rst,
it does not render with Sphinx and therefore .rst is overpowered for GitHub as 
of 2024-09-26 (or at least, I haven't found a solution in hours of research).
Therefore, I switch to .md as it's rendered correctly.
-->

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/xaiassetmanagement/tradingenv",
    "name": "tradingenv",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "trading,investment,finance,backtest,reinforcement-learning,gym",
    "author": "Federico Fontana",
    "author_email": "Federico Fontana <federico.fontana@xai-am.com>",
    "download_url": "https://files.pythonhosted.org/packages/52/14/cbbbadbed1f5fa2de48a9adbb3b8615c2f509501f1e075a573b412a16587/tradingenv-0.1.2.tar.gz",
    "platform": null,
    "description": "![Logo](https://tradingenv.blob.core.windows.net/images/logo-background-cropped.png)\n\n[![Documentation](https://github.com/xaiassetmanagement/tradingenv/actions/workflows/build-docs.yml/badge.svg)](https://github.com/xaiassetmanagement/tradingenv/actions/workflows/software-tests.yml)\n[![Software tests](https://github.com/xaiassetmanagement/tradingenv/actions/workflows/software-tests.yml/badge.svg)](https://github.com/xaiassetmanagement/tradingenv/actions/workflows/software-tests.yml)\n[![Coverage](https://raw.githubusercontent.com/xaiassetmanagement/tradingenv/coverage-badge/coverage.svg)](https://github.com/xaiassetmanagement/tradingenv/actions)\n\n[![python](https://img.shields.io/pypi/pyversions/shap)](https://www.python.org)\n[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n\n# Introduction\n\nBacktest trading strategies or train reinforcement learning agents with\n`tradingenv`, an event-driven market simulator that implements the\nOpenAI/gym protocol.\n\n# Installation\n\ntradingenv supports Python 3.7 or newer versions. The following command\nline will install the latest software version.\n\n``` console\npip install tradingenv\n```\n\nNotebooks, software tests and building the documentation require extra\ndependencies that can be installed with\n\n``` console\npip install tradingenv[extra]\n```\n\n# Examples\n\n## Reinforcement Learning - Lazy Initialisation\n\nThe package is built upon the industry-standard\n[gym](https://github.com/openai/gym) and therefore can be used in\nconjunction with popular reinforcement learning frameworks including\n[rllib](https://docs.ray.io/en/latest/rllib/) and\n[stable-baselines3](https://github.com/hill-a/stable-baselines).\n\n``` python\nfrom tradingenv.env import TradingEnvXY\nimport yfinance\n\n# Load data from Yahoo Finance.\ntickers = yfinance.Tickers(['SPY', 'TLT', 'TBIL', '^IRX'])\ndata = tickers.history(period=\"12mo\", progress=False)['Close'].tz_localize(None)\nY = data[['SPY', 'TLT']]\nX = Y.rolling(12).mean() - Y.rolling(26).mean()\n\n# Lazy initialization of the trading environment.\nenv = TradingEnvXY(X, Y)\n\n# OpenAI/gym protocol. Run an episode in the environment.\n# env can be passed to RL agents of ray/rllib, stable-baselines3 or ElegantRL for training.\nobs = env.reset()\ndone = False\nwhile not done:\n    action = env.action_space.sample()\n    obs, reward, done, info = env.step(action)\n```\n\n## Reinforcement Learning - Custom Initialisation\nUse custom initialisation to personalise the design of the environment, \nincluding the reward function, transaction costs, observation window and leverage.\n\n\n``` python\nenv = TradingEnvXY(\n    X=X,                      # Use moving averages crossover as features\n    Y=Y,                      # to trade SPY and TLT ETFs.\n    transformer='z-score',    # Features are standardised to N(0, 1).\n    reward='logret',          # Reward is the log return of the portfolio at each step,\n    cash=1000000,             # starting with $1M.\n    spread=0.0002,            # Transaction costs include a 0.02% spread,\n    markup=0.005,             # a 0.5% broker markup on deposit rate,\n    fee=0.0002,               # a 0.02% dealing fee of traded notional\n    fixed=1,                  # and a $1 fixed fee per trade.\n    margin=0.02,              # Do not trade if trade size is smaller than 2% of the portfolio.\n    rate=data['^IRX'] / 100,  # Rate used to compute the yield on idle cash and cost of leverage.\n    latency=0,                # Trades are implemented with no latency\n    steps_delay=1,            # but a delay of one day.\n    window=1,                 # The observation is the current state of the market,\n    clip=5.,                  # clipped between -5 and +5 standard deviations.\n    max_long=1.5,             # The maximum long position is 150% of the portfolio,\n    max_short=-1.,            # the maximum short position is 100% of the portfolio.\n    calendar='NYSE',          # Use the NYSE calendar to schedule trading days.\n)\n```\n\n## Backtesting\n\nThanks to the event-driven design, tradingenv is agnostic with respect\nto the type and time-frequency of the events. This means that you can\nrun simulations either using irregularly sampled trade and quotes data,\ndaily closing prices, monthly economic data or alternative data.\nFinancial instruments supported include stocks, ETF and futures.\n\n``` python\nclass Portfolio6040(AbstractPolicy):\n    \"\"\"Implement logic of your investment strategy or RL agent here.\"\"\"\n\n    def act(self, state):\n        \"\"\"Invest 60% of the portfolio in SPY ETF and 40% in TLT ETF.\"\"\"\n        return [0.6, 0.4]\n\n# Run the backtest.\ntrack_record = env.backtest(\n    policy=Portfolio6040(),\n    risk_free=prices['TBIL'],\n    benchmark=prices['SPY'],\n)\n\n# The track_record object stores the results of your backtest.\ntrack_record.tearsheet()\n```\n\n![](https://tradingenv.blob.core.windows.net/images/tearsheet.png)\n\n``` python\ntrack_record.fig_net_liquidation_value()\n```\n\n![](https://tradingenv.blob.core.windows.net/images/fig_net_liquidation_value.png)\n\n# Relevant projects\n\n-   [btgym](https://github.com/Kismuz/btgym): is an OpenAI\n    Gym-compatible environment for\n-   [backtrader](https://github.com/backtrader/backtrader)\n    backtesting/trading library, designed to provide gym-integrated\n    framework for running reinforcement learning experiments in \\[close\n    to\\] real world algorithmic trading environments.\n-   [gym](https://github.com/openai/gym): A toolkit for developing and\n    comparing reinforcement learning algorithms.\n-   [qlib](https://github.com/microsoft/qlib): Qlib provides a strong\n    infrastructure to support quant research.\n-   [rllib](https://docs.ray.io/en/latest/rllib/): open-source library\n    for reinforcement learning.\n-   [stable-baselines3](https://github.com/hill-a/stable-baselines): is\n    a set of reliable implementations of reinforcement learning\n    algorithms in PyTorch.\n\n# Developers\n\nYou are welcome to contribute features, examples and documentation or\nissues.\n\nYou can run the software tests typing `pytest` in the command line,\nassuming that the folder `\\tests` is in the current working directory.\n\nTo refresh and build the documentation:\n\n``` \npytest tests/notebooks\nsphinx-apidoc -f -o docs/source tradingenv\ncd docs\nmake clean\nmake html\n```\n\n<!---\nOn README.md vs README.rst.\nWhile .rst is clearly a better format for Sphinx documentation, not all \nblocks are rendered correctly on GitHub. The rst block literalinclude in \nparticular is important, as it's the only way to have code in the /tests folder \nand extract it from functions and class methods. While GitHub supports .rst,\nit does not render with Sphinx and therefore .rst is overpowered for GitHub as \nof 2024-09-26 (or at least, I haven't found a solution in hours of research).\nTherefore, I switch to .md as it's rendered correctly.\n-->\n",
    "bugtrack_url": null,
    "license": "Apache License Version 2.0, January 2004 http://www.apache.org/licenses/  TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION  1. Definitions.  \"License\" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.  \"Licensor\" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.  \"Legal Entity\" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, \"control\" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.  \"You\" (or \"Your\") shall mean an individual or Legal Entity exercising permissions granted by this License.  \"Source\" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.  \"Object\" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.  \"Work\" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).  \"Derivative Works\" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.  \"Contribution\" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, \"submitted\" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as \"Not a Contribution.\"  \"Contributor\" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.  2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.  3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.  4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:  (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and  (b) You must cause any modified files to carry prominent notices stating that You changed the files; and  (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and  (d) If the Work includes a \"NOTICE\" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.  You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.  5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.  6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.  7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.  8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.  9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.  END OF TERMS AND CONDITIONS  APPENDIX: How to apply the Apache License to your work.  To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets \"[]\" replaced with your own identifying information. (Don't include the brackets!)  The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same \"printed page\" as the copyright notice for easier identification within third-party archives.  Copyright [yyyy] [name of copyright owner]  Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at  http://www.apache.org/licenses/LICENSE-2.0  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.",
    "summary": "Backtest trading strategies or train reinforcement learning agents with and event-driven market simulator.",
    "version": "0.1.2",
    "project_urls": {
        "Bug Tracker": "https://github.com/xaiassetmanagement/tradingenv/issues",
        "Documentation": "https://xaiassetmanagement.github.io/tradingenv",
        "Homepage": "https://github.com/xaiassetmanagement/tradingenv"
    },
    "split_keywords": [
        "trading",
        "investment",
        "finance",
        "backtest",
        "reinforcement-learning",
        "gym"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "21a9c8a0a6af6f1eee37c901339aa1e10107c6c5a96ea45e30b4acd97bb15fe5",
                "md5": "d6df740b1a9e002367c91ee18bcaafd6",
                "sha256": "e5e71f5c1fbbdc4384bc567f2a3aa73c72cf36cc231e1a55af7d352e6235f5de"
            },
            "downloads": -1,
            "filename": "tradingenv-0.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d6df740b1a9e002367c91ee18bcaafd6",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 78220,
            "upload_time": "2023-10-03T16:24:09",
            "upload_time_iso_8601": "2023-10-03T16:24:09.501521Z",
            "url": "https://files.pythonhosted.org/packages/21/a9/c8a0a6af6f1eee37c901339aa1e10107c6c5a96ea45e30b4acd97bb15fe5/tradingenv-0.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5214cbbbadbed1f5fa2de48a9adbb3b8615c2f509501f1e075a573b412a16587",
                "md5": "ac772b5294085667c0dfa776ad0cd50c",
                "sha256": "edbfaf2a42be9fcb82ffec7fdb4f4ef53bea1d668211f3a5211ef0546543b2a0"
            },
            "downloads": -1,
            "filename": "tradingenv-0.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "ac772b5294085667c0dfa776ad0cd50c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 118091,
            "upload_time": "2023-10-03T16:24:11",
            "upload_time_iso_8601": "2023-10-03T16:24:11.650969Z",
            "url": "https://files.pythonhosted.org/packages/52/14/cbbbadbed1f5fa2de48a9adbb3b8615c2f509501f1e075a573b412a16587/tradingenv-0.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-03 16:24:11",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "xaiassetmanagement",
    "github_project": "tradingenv",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "tradingenv"
}
        
Elapsed time: 0.16936s