Gym environments for RL-based trading algorithms (FOREX, Stocks)
Top 20.1% on sourcepulse
This repository provides a collection of OpenAI Gym environments for reinforcement learning-based trading algorithms, specifically targeting FOREX and stock markets. It aims to simplify the development and testing of RL trading strategies by offering flexible and comprehensive environments, suitable for researchers and developers in quantitative finance and algorithmic trading.
How It Works
The core of the project is the TradingEnv
abstract class, which inherits from gym.Env
. It processes historical market data (prices and signal features) using a specified window_size
to create observations. Concrete environments like ForexEnv
and StocksEnv
extend TradingEnv
, implementing market-specific data processing, reward calculation, and fee structures. The environments simplify trading actions to discrete 'Buy' (1) and 'Sell' (0) and support 'Long' (1) and 'Short' (0) positions, reducing complexity for RL agents.
Quick Start & Requirements
pip install gym-anytrading
git clone https://github.com/AminHP/gym-anytrading && cd gym-anytrading && pip install -e .
gymnasium
(formerly OpenAI Gym).Highlighted Details
window_size
, frame_bound
, unit_side
, trade_fee
).render
and render_all
methods for visualizing trading activity and positions.Maintenance & Community
The project appears to be maintained by AminHP. There are no explicit mentions of community channels (like Discord/Slack) or a public roadmap in the README.
Licensing & Compatibility
The repository does not explicitly state a license in the provided README. This absence of a clear license may pose compatibility issues for commercial use or integration into closed-source projects.
Limitations & Caveats
The README does not specify a license, which is a significant limitation for adoption. The project is described as a simplified environment, and a more complex version is available in the DI-engine project for users requiring more advanced features.
1 year ago
1 week