trading-gym-rl-env — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited trading-gym-rl-env (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
USE FOR:
tags: [RL, gym, trading-environment, tick-data, OHLC, backtesting, reinforcement-learning] kind: framework category: quant-ml-trading
OpenAI Gym-inspired RL trading environment toolkit.
0 → Hold (do nothing)
1 → Buy one unit
2 → Sell one unitState = selected features over window of N steps
Features: price, volume, bid/ask, custom columns
Window size: configurable (default: 30 ticks)Reward = price_delta × position - transaction_feeimport trading_gym
import pandas as pd
# Load your market data (any asset, any timeframe)
data = pd.read_hdf("market_data.h5")
# Create environment
env = trading_gym.TradingEnv(
data=data,
obs_len=30, # Observation window
step_len=1, # Steps per action
fee=0.001, # Transaction fee (0.1%)
deal_col_name="close",# Column for P&L calculation
)obs = env.reset()
done = False
while not done:
action = env.action_space.sample() # Random: 0, 1, or 2
obs, reward, done, info = env.step(action)class MyAgent:
def predict(self, obs):
# Your RL policy here (DQN, PPO, etc.)
return action # 0, 1, or 2
agent = MyAgent()
obs = env.reset()
done = False
while not done:
action = agent.predict(obs)
obs, reward, done, info = env.step(action)class MACrossoverAgent:
def predict(self, obs):
fast_ma = obs[-5:, price_col].mean()
slow_ma = obs[-20:, price_col].mean()
if fast_ma > slow_ma:
return 1 # Buy
elif fast_ma < slow_ma:
return 2 # Sell
return 0 # Hold| Feature | TradingGym | TensorTrade |
|---|---|---|
| Data focus | Tick-level primary | OHLCV + feeds |
| Action space | Simple discrete (3) | Configurable |
| Reward | Price delta - fee | Multiple schemes |
| RL integration | Any gym-compatible | Ray RLlib built-in |
| Portfolio management | Basic | Full wallets/positions |
| Complexity | Lightweight | Full framework |
| Best for | Quick RL experiments | Production RL systems |
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.