Skip to content

pixie-muon/human-rl-trading

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Human-in-the-Loop Reinforcement Learning for Trading

"AI doesn't trade for you. AI learns from your trades."

human-rl-trading is a conceptual framework and reference architecture for a semi-autonomous trading system where:

  • 🧠 You make the final call — leveraging human intuition + implicit chain-of-thought
  • 🤖 AI Experts collect, filter, analyze, and structure market data
  • 🔄 Reinforcement Learning learns from your actual trade outcomes to improve AI recommendations

Philosophy

This project rejects two common extremes:

❌ Pure Quant ❌ Pure AI Agent ✅ Our Approach
Black-box models make decisions AI agents trade autonomously AI assists, human decides
Human intuition is noise Human intuition is obsolete Human intuition is irreplaceable
Model learns from historical data Model learns from simulation Model learns from your real decisions

The Core Insight

A human trader's implicit chain-of-thought — the fusion of logic and intuition that happens below conscious awareness — cannot be replicated by any current LLM or RL model. But it can be fed better raw material by an AI expert team. And that team can learn, over time, which signals align with your decision patterns.

Architecture Overview

Market Data ──┐
               ├──→ [AI Expert Team] ──→ Signal Pool ──→ [You] Implicit CoT ──→ Trade Execution
AI Analysis ──┘                                                                    │
                                                                                    ▼
                                                                          [Trade Outcome]
                                                                                │
                                        ┌─────────────────────────────────────┘
                                        ▼
                                [RL: Reward Signal]
                                        │
                                        ▼
                              [AI Expert Weight Update]
                                        │
                                        ▼
                              Better Recommendations Next Time

Three Feedback Loops

Loop Timescale What It Does
L1: Per-Trade Days Immediate PnL signal → adjust recommendation parameters
L2: Strategy Cycle Weeks/Month Trade pattern analysis → adjust expert weights
L3: Human-AI Alignment Quarterly Decision deviation analysis → calibrate system to your style

The AI Expert Team

Four specialized experts, each outputting structured signal cards — not buy/sell recommendations.

Expert Role Output
📈 Technical Analyst Pattern recognition, indicator signals {direction, confidence, timeframe}
📰 Sentiment Analyst News sentiment, social media heat {score[-1,1], event_type}
📊 Fundamental Scanner Earnings changes, valuation, sector rotation {delta, relative_value}
Risk Officer Volatility, position sizing, drawdown alerts {market_risk, stock_risk, suggested_size}

Full Expert System Design →

Reinforcement Learning Design

This is a Contextual Bandit problem, not a full MDP:

State S = {market context, technical signals, sentiment, fundamentals}
Action A = {recommendation strength [0,1], direction [long/short/hold]}
Reward R = Quality score of your actual trade

The model doesn't learn "which stocks go up". It learns:

"Given this state, your decision pattern has a 72% historical win rate when you follow the technical analyst's high-confidence signal."

Full RL Design →

Your Role: The Implicit Chain-of-Thought

AI Signal Pool → You scan → Two layers:
    │
    ├── Logical (conscious):
    │   ├── "RSI is high but volume isn't confirming"
    │   └── "Market in a key resistance zone"
    │
    └── Intuitive (unconscious pattern matching):
        ├── "I've seen this pattern 3x before, lost 2x"
        └── "Something doesn't feel right" (non-verbalizable)
    
    └── Fusion → Final Decision

The system doesn't attempt to replace your intuition. It learns from the gap between its recommendation and your decision.

Getting Started (MVP)

Phase 1: Trade Recording (1-2 weeks)

Record every trade in a structured format. The system starts with zero — it learns from your data.

Phase 2: Expert Signal Feed (2-4 weeks)

AI experts scan your watchlist daily, output signal cards. You review and decide.

Phase 3: RL Loop (1-2 months)

After 50+ trades, train a simple Contextual Bandit that adjusts recommendation confidence based on your historical decisions.

Detailed Implementation Plan →

Project Structure

human-rl-trading/
├── README.md                    # This file
├── LICENSE                      # MIT
├── docs/
│   ├── ARCHITECTURE.md          # Full system design
│   ├── REINFORCEMENT_LEARNING.md # RL & reward design
│   ├── AI_EXPERTS.md            # Expert system specification
│   └── TRADE_RECORD.md          # Data schema design
└── examples/
    ├── trade_card.json          # Sample trade record
    └── signal_card.json         # Sample expert signal

License

MIT — free to use, adapt, and build upon.

About

Human-in-the-Loop Reinforcement Learning for Trading — semi-autonomous system where your trading decisions drive RL signals, AI experts provide analysis, and human intuition stays in command.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors