AI-Powered Market Manipulation Detection
Phase 1: Pattern detection, paper trading, and backtesting before going live.
A trading tool that detects market manipulation patterns (pump & dumps, whale accumulation, coordinated behavior) and generates trade signals.
Phase 1 Goal: Test predictions with paper trading until we hit 60%+ accuracy, THEN consider real money.
cd src
python3 dashboard.py AAPLpython3 dashboard.py --watch AAPL GME TSLApython3 dashboard.py --portfoliopython3 dashboard.py --update1. Pump & Dump
- Sudden volume spike (>3x average)
- Rapid price movement (>5%)
- High social media activity
- No news catalyst
- Signal: AVOID or SHORT
2. Whale Accumulation
- Steady elevated volume
- Price stable or slow rise
- Gradual accumulation pattern
- Signal: BUY (early entry)
3. Unusual Activity
- Moderate anomalies
- Requires monitoring
- Signal: WATCH
- Market Data: Yahoo Finance API (OHLCV, volume)
- Social Sentiment: Reddit r/wallstreetbets (mentions, scores)
- Crypto: CoinGecko API
- Track predictions without real money
- Automatic entry/exit simulation
- Win rate tracking
- Performance metrics
======================================================================
π¦
PREDATOR-PREY TRADE ANALYZER
Phase 1: Pattern Detection & Paper Trading
======================================================================
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π Analyzing AAPL...
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π° Current Price: $182.45
π
Time: 2026-02-20 22:30:15
π Volume Profile:
Average: 45,234,567
Recent: 98,543,210
Ratio: 2.18x
β οΈ VOLUME SPIKE DETECTED
π Price Velocity:
Avg Change: +3.45%
Direction: UP
β οΈ RAPID MOVEMENT DETECTED
π¬ Social Sentiment (Reddit r/wallstreetbets):
Mentions: 45
Total Score: 1,234
Avg Upvote Ratio: 0.87
π PATTERN DETECTION
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π¨ Pattern: PUMP_AND_DUMP
π Confidence: 82.0%
β οΈ Risk Level: CRITICAL
π‘ Recommendation: AVOID
β° Timeframe: 30-60 minutes until dump
π Signals Detected:
β’ Volume spike: 2.2x average
β’ Rapid price movement: +3.5%
β’ High social activity: 45 mentions
π― TRADE SIGNAL
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Action: AVOID
Reason: Pump & dump detected - high risk
from data_fetcher import DataFetcher
fetcher = DataFetcher()
analysis = fetcher.fetch_and_analyze("AAPL")Fetches:
- OHLCV data (5-minute candles, last 24 hours)
- Volume profile
- Price velocity
- Social sentiment
from pattern_detector import PatternDetector
detector = PatternDetector()
detection = detector.analyze_pattern(analysis)Detects:
- Coordinated pumps
- Whale accumulation
- Unusual activity
Returns:
- Pattern type
- Confidence score (0-100%)
- Risk level
- Trade recommendation
trade_signal = detector.calculate_trade_signal(detection, current_price)Generates:
- Entry price
- Stop loss
- Take profit
- Risk/reward ratio
from paper_trader import PaperTrader
trader = PaperTrader()
trade = trader.add_trade(
symbol="AAPL",
action="BUY",
entry_price=150.00,
stop_loss=142.50,
take_profit=172.50,
confidence=75.0,
pattern="WHALE_ACCUMULATION",
signals=["Steady volume", "Gradual uptrend"]
)Tracks:
- Entry/exit prices
- Win/loss status
- Profit/loss percentage
- Pattern accuracy
Goal: Achieve 60%+ win rate
Actions:
- Monitor watchlist continuously
- Log all predictions
- Track which patterns work best
- Iterate on detection algorithms
- Analyze false positives/negatives
Duration: 1-2 weeks minimum
Prerequisites:
- 60%+ win rate over 100+ paper trades
- Understand why predictions succeed/fail
- Risk management rules defined
Actions:
- Start with $100-500 positions
- Strict stop losses
- Track real-world slippage
- Compare to paper trading results
Prerequisites:
- Profitable over 3+ months
- Risk management working
- Emotional control proven
When: Pump & dump detected
Action: Wait for dump, buy the dip
Risk/Reward: 2:1 to 3:1
Win Rate Target: 55-65%
When: Whale accumulation detected
Action: Buy alongside whale, exit when distribution starts
Risk/Reward: 2:1 to 4:1
Win Rate Target: 60-70%
When: High-risk patterns detected
Action: Stay out (prevention = profit)
Value: Saves capital for better opportunities
predator-prey-trader/
βββ src/
β βββ data_fetcher.py # Market data collection
β βββ pattern_detector.py # Manipulation detection
β βββ paper_trader.py # Paper trading system
β βββ dashboard.py # CLI interface
βββ data/
β βββ paper_trades.json # Paper trading history
βββ tests/ # Unit tests (TODO)
βββ docs/ # Documentation
βββ README.md
Pump & Dump:
- Volume spike: >3x average
- Price velocity: >5% in <1 hour
- Social mentions: >20 in last 24h
- Confidence: Need 2+ signals, 50%+ confidence
Whale Accumulation:
- Volume: 1.2-2.0x average (elevated but not spiking)
- Price stability: <1% average change
- Gradual trend: 0.5-3% upward over period
- Confidence: Need 2+ signals, 50%+ confidence
- Stock data: Every 5 minutes
- Social sentiment: Every 30 minutes (to avoid rate limits)
- Trade updates: Real-time on each watchlist check
- Entry: Confirmed at specified price
- Stop loss: Automatic exit if price hits
- Take profit: Automatic exit if price hits
- Time limit: 7 days (close any open trades)
Track:
- Win rate: % of trades that hit take profit
- Avg profit: Average % gain per trade
- Risk/reward: Average R:R ratio
- Pattern accuracy: Which patterns work best
- False positives: Detections that don't play out
- Missed opportunities: Real patterns we didn't catch
Phase 1 (Paper Trading):
- No real money at risk
- Test aggressive and conservative strategies
- Learn from mistakes without cost
Phase 2 (Real Trading - Future):
- Max 1-2% of capital per trade
- Always use stop losses
- Never revenge trade
- Track emotional state
Legal:
- Using public data = legal
- Pattern detection = legal
- Trading on your analysis = legal
- This is NOT insider trading
- This is NOT market manipulation
To move to Phase 2 (Real Money):
β
100+ paper trades logged
β
60%+ overall win rate
β
Positive total profit %
β
Understand why trades win/lose
β
Risk management rules defined
β
Emotional control demonstrated
Current Status: Phase 1 - Paper Trading
- Stock data fetcher
- Social sentiment scraper
- Volume/price analyzers
- More data sources (Twitter, news)
- Pump & dump detector
- Whale accumulation detector
- Unusual activity detector
- Insider trading patterns
- Coordinated buying detection
- Trade tracking system
- Entry/exit simulation
- Performance metrics
- Backtesting historical data
- CLI dashboard
- Charts (price, volume, patterns)
- Web dashboard (optional)
- Mobile alerts (Telegram)
- Broker API integration (Robinhood, etc.)
- Real-time order execution
- Slippage tracking
- Tax reporting
This is a personal trading tool. Phase 1 is about learning and iteration.
Not financial advice. Trade at your own risk.
MIT License
Concept: VS7
Implementation: LG2 (OpenClaw agent)
Inspired by: Predator-prey dynamics, whale watching, and avoiding getting rekt
Ready to hunt? π¦
Run: python3 src/dashboard.py AAPL