/tradecraft:trading-gym-rl-envfrom tradecraft
OpenAI Gym-style RL trading environment for tick and OHLC data. Supports training, backtesting, and discrete action spaces (hold/buy/sell) with configurable observation windows and fee-adjusted rewards.
Ships in tradecraft. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
USE FOR:
OpenAI Gym-inspired RL trading environment toolkit.
0 → Hold (do nothing)
1 → Buy one unit
2 → Sell one unit
State = 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_fee
import 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 |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub mahmoud20138/tradecraft --plugin tradecraft169 skills in this plugin
/agent-developmentThis skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins./agentic-storageAgentic storage architecture — persistent memory for AI agents using MCP, immutable versioning, sandboxing, and intent validation. Covers the stateless problem in LLM agents, RAG limitations (read-only), MCP protocol (JSON-RPC, resources, tools), storage safety layers, and agent file system design. Source: IBM Technology (Martin Keen), March 2026. Use this skill for "agentic storage", "agent memory", "persistent agent state", "MCP storage", "agent file system", "agent hard drive", "stateless agent problem", "agent work product", "immutable versioning", "agent sandboxing", "intent validation", "agent safety layers", "agent context window limits", "storage for AI agents", "agent persistence", "autonomous agent storage", "agent audit trail". Works with mcp-integration, trading-brain, agents, trade-psychology-coach.
Other plugins' skills for the same job