# AminHP/gym-anytrading

The most simple, flexible, and comprehensive OpenAI Gym trading environment (Approved by OpenAI Gym)

Repository: https://github.com/AminHP/gym-anytrading
Canonical: https://ross.abutalabs.com/products/gym-anytrading
Language: Python
License: MIT
License Family: permissive
Topics: openai-gym, reinforcement-learning, q-learning, dqn, trading, trading-environments, forex, stocks, gym-environments, trading-algorithms
Last push: 2024-03-14T04:33:05+00:00

## Health v2 (maintenance only)
Score: 23/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 2543, "days_push": 902, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2386, forks 479 (observed 2026-08-28T04:06:42.641403+00:00)

## What it is
gym-anytrading is a collection of OpenAI Gym environments for developing and testing reinforcement learning-based trading algorithms in FOREX and stock markets. It provides an abstract TradingEnv plus concrete ForexEnv and StocksEnv with simplified buy/sell actions and positions.

## Use cases
- train an RL agent to trade stocks
- backtest a DQN trading strategy
- build a q-learning forex trading bot
- gym environment for algorithmic trading research
- simulate trading positions and rewards for reinforcement learning
- benchmark RL trading algorithms

## When to choose
- you want a simple, ready-made Gym environment for RL trading experiments
- you are prototyping DQN or Q-learning agents on stock or forex price data
- you need a flexible base class to extend with custom trading environments

## When to avoid
- you need a full production trading system with money management and multiple markets
- you require realistic broker execution, fees, and order types
- you expect an RL agent to handle all trading decisions like hold, budget, and portfolio allocation

## Facets
- artifact type: library
- maturity: stable
- function: reinforcement-learning, simulation, machine-learning
- domain: reinforcement-learning, fintech, machine-learning
- platform: python, cross-platform
- tags: openai-gym, trading-environment, forex, stocks, q-learning, dqn, rl-environments, algorithms

## Member repositories
- AminHP/gym-anytrading (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:42.641403+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:34:35.811672+00:00, confidence not recorded.
  - readme: https://github.com/AminHP/gym-anytrading (fetched 2026-08-28T04:06:42.641403+00:00, sha f153f19895a1)
- Data as of 2026-08-30T08:39:29.467469+00:00.
