Skill: tanjinlimkelvin-dot/ai-hedge-fund (version 1.2.0)

--- name: ai-hedge-fund description: Run an AI-powered hedge fund simulation with 16+ legendary investor agents. Each agent analyzes stocks from their unique investment philosophy. Auto-detects model from current OpenClaw session, no hardcoding. Uses yfinance for free financial data. Based on github.com/virattt/ai-hedge-fund. --- # AI Hedge Fund Skill Multi-agent investment analysis using legendary investor personas. **Project:** https://github.com/virattt/ai-hedge-fund ## Setup (first time) ```bash # Clone project git clone https://github.com/virattt/ai-hedge-fund /data/workspace/ai-hedge-fund # Install pip install -e /data/workspace/ai-hedge-fund --break-system-packages --quiet pip install yfinance --break-system-packages --quiet ``` ## Run Via skill script (auto-detects model): ```bash python3 /data/workspace/skills/skills/ai-hedge-fund/scripts/run.py \ --tickers NVDA \ --analysts-all \ --show-reasoning ``` Or direct CLI: ```bash cd /data/workspace/ai-hedge-fund python3 src/main.py \ --tickers NVDA \ --start-date 2026-01-01 \ --end-date 2026-04-12 \ --model "minimax/minimax-m2.5:free" \ --analysts-all \ --show-reasoning ``` ## Model Auto-Detection **Not hardcoded.** The run.py script auto-detects from: 1. `$OPENCLAW_LLM_MODEL` environment variable 2. OpenClaw config (`/root/.openclaw/openclaw.json`) 3. Default: `minimax/minimax-m2.5:free` You can also specify manually via `--model` flag. ## Available Models Any model from `src/llm/api_models.json`, e.g.: - `minimax/minimax-m2.5:free` (default, free) - `qwen/qwen3.6-plus:free` (free) - `gpt-4.1` (OpenAI) - `claude-sonnet-4-6` (Anthropic) ## All 16+ Agents | Agent | Philosophy | |-------|------------| | Warren Buffett | Wonderful business at fair price | | Charlie Munger | Only wonderful businesses | | Ben Graham | Margin of safety | | Michael Burry | Contrarian deep value | | Cathie Wood | Innovation & disruption | | Bill Ackman | Activist investor | | Peter Lynch | Ten-baggers | | Phil Fisher | Scuttlebutt | | Stanley Druckenmiller | Macro asymmetric | | Nassim Taleb | Antifragility | | Mohnish Pabrai | Dhandho | | Rakesh Jhunjhunwala | Big Bull | | Aswath Damodaran | Valuation | | + Quant agents | Fundamentals, Technical, Valuation, Sentiment | ## Output Each agent outputs: signal (bullish/bearish/neutral), confidence %, reasoning. Portfolio Manager aggregates into final BUY/SELL/HOLD. ## Data Source yfinance (free, no API key needed)

path: scripts/run.py
content: #!/usr/bin/env python3
"""
AI Hedge Fund - Run multi-agent stock analysis
Auto-detects model from current OpenClaw session, NOT hardcoded.
"""
import os
import sys
import json
import subprocess

def get_current_model():
    """Get primary model from current OpenClaw session only."""
    cfg_path = "/root/.openclaw/openclaw.json"
    if os.path.exists(cfg_path):
        try:
            cfg = json.load(open(cfg_path))
            # Get primary model from main agent
            agents = cfg.get("agents", {})
            primary = agents.get("main", {}).get("model", {}).get("primary")
            if primary:
                return primary
            # Fallback to default primary
            default = agents.get("defaults", {}).get("model", {}).get("primary")
            if default:
                return default
        except Exception as e:
            print(f"Config error: {e}")
    
    print("Error: No model detected from OpenClaw session.")
    print("Specify --model manually: python3 run.py --tickers NVDA --model 'minimax/minimax-m2.5:free'")
    sys.exit(1)

def main():
    import argparse
    parser = argparse.ArgumentParser(description="AI Hedge Fund")
    parser.add_argument("--tickers", required=True, help="Comma-separated tickers")
    parser.add_argument("--start-date", default="2026-01-01")
    parser.add_argument("--end-date", default="2026-04-12")
    parser.add_argument("--model", help="Model (auto-detected from session if not specified)")
    parser.add_argument("--analysts", help="Comma-separated analysts")
    parser.add_argument("--analysts-all", action="store_true")
    parser.add_argument("--show-reasoning", action="store_true")
    parser.add_argument("--initial-cash", default="100000")
    
    args = parser.parse_args()
    
    if not args.model:
        args.model = get_current_model()
        print(f"Session model: {args.model}")
    
    # Build command
    cmd = [
        "python3", "/data/workspace/ai-hedge-fund/src/main.py",
        "--tickers", args.tickers,
        "--start-date", args.start_date,
        "--end-date", args.end_date,
        "--model", args.model,
    ]
    
    if args.analysts_all:
        cmd.append("--analysts-all")
    elif args.analysts:
        cmd.extend(["--analysts", args.analysts])
    
    if args.show_reasoning:
        cmd.append("--show-reasoning")
    
    cmd.extend(["--initial-cash", args.initial_cash])
    
    result = subprocess.run(cmd)
    sys.exit(result.returncode)

if __name__ == "__main__":
    main()

Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector:  ()