JerryLiu369/awesome-quant-skills / skills/portfolio-risk/openquant-trading
openquant-trading
Verifiedname: openquant-trading version: 1.0.0 description: Analyze stocks, generate trading signals, manage risk, and execute paper trades using the OpenQuant MCP server triggers:
- stock analysis
- ticker analysis
- trading signal
- insider trading
- risk assessment
- portfolio
- backtest strategy
- paper trade
- buy stock
- sell stock
- position size
- market data
OpenQuant Trading Skill
When This Skill Activates
Activate this skill when the user:
- Asks about a stock or ticker (e.g., "What do you think of AAPL?")
- Wants trading signals or strategy recommendations
- Mentions insider trading, risk, VaR, or position sizing
- Wants to check their portfolio or execute a trade
- Asks about backtesting or strategy validation
- Uses terms like "analyze", "signal", "backtest", "Kelly", "insider buy"
Prerequisites
The OpenQuant MCP server must be running. Start it:
pip install openquant-cli[mcp]
openquant-mcp
MCP endpoint: http://localhost:8000/sse (SSE transport)
Server name: openquant
Common Workflows
Workflow 1: Analyze a Stock
Use when: User asks about a ticker or wants a stock opinion.
- Call
openquant_analyze(ticker="SYMBOL", days=90) - Review the result: current_price, insider score/label, risk level, VaR, max drawdown
- If insider score is interesting (|score| > 25), call
openquant_insider_scan(ticker="SYMBOL")for detail - Summarize for the user: price, insider sentiment, risk level, and whether it's worth deeper investigation
- Do NOT execute any trades — this is research mode
Workflow 2: Get a Trading Signal
Use when: User wants a buy/sell recommendation for a ticker.
- Call
openquant_strategy_list()if user doesn't specify a strategy - Call
openquant_strategy_run(strategy_name="STRATEGY", ticker="SYMBOL") - Review: action (BUY/SELL/HOLD), confidence (0-100), entry_price, stop_loss, take_profit, position_size_pct, reasoning
- If confidence < 40: tell the user the signal is weak, suggest monitoring
- If confidence >= 40: present the signal with all details but do NOT execute without confirmation
Workflow 3: Validate a Strategy
Use when: User wants to know if a strategy works before using it.
- Call
openquant_backtest(strategy_name="STRATEGY", ticker="SYMBOL", days=252) - Review: total_trades, win_rate, total_return, max_drawdown, sharpe_ratio, avg_holding_days
- Flag concerns: win_rate < 50%, max_drawdown > 20%, sharpe < 0.5
- Present the backtest results with interpretation
Workflow 4: Execute a Trade
Use when: User explicitly wants to place a trade.
- Call
openquant_portfolio_status()to check current balance and positions - Call
openquant_analyze(ticker="SYMBOL")for the current price - Call
openquant_strategy_run(strategy_name="STRATEGY", ticker="SYMBOL")for a signal - Call
openquant_risk_assessment(tickers="SYMBOL", days=252)— MANDATORY before execution - Present full trade plan to user: action, shares, price, total cost, risk metrics
- Get explicit user confirmation (e.g., "Should I execute this trade?")
- Only if confirmed: call
openquant_trade_execute(action="BUY", ticker="SYMBOL", shares=N, price=X) - Call
openquant_portfolio_status()to confirm the trade went through
Workflow 5: Portfolio Review
Use when: User wants to check their portfolio or recent trades.
- Call
openquant_portfolio_status()for current state - Call
openquant_trade_history(limit=20)for recent trades - Summarize: total value, P&L, position breakdown, recent activity
Tool Reference
| Tool | Params | Returns | Mutates State |
|---|---|---|---|
openquant_analyze | ticker, days=90 | Price, insider, risk | No |
openquant_insider_scan | ticker, days=90 | Score, patterns, alerts, trade counts | No |
openquant_risk_assessment | tickers (csv), days=252 | Risk level, VaR, drawdown, Kelly, sizes | No |
openquant_strategy_list | — | 4 strategies with descriptions | No |
openquant_strategy_run | strategy_name, ticker | Action, confidence, prices, size, reasoning | No |
openquant_backtest | strategy_name, ticker, days=252 | Trades, win rate, return, drawdown, Sharpe | No |
openquant_portfolio_status | — | Balance, positions, P&L, achievements | No |
openquant_trade_execute | action, ticker, shares, price | Success, cost, new balance | YES |
openquant_trade_history | limit=20 | Trade list | No |
openquant_game_status | — | Leaderboard, stats | No |
Signal Interpretation
Strategy Results
- action: BUY / SELL / HOLD
- confidence: 0-100. Only trade if >= 40.
- position_size_pct: Already 0.25x Kelly, capped at 10%. Trust this value.
Agent Signals (-1.0 to +1.0)
-
+0.3: BULLISH | -0.3 to +0.3: NEUTRAL | < -0.3: BEARISH
Insider Scores (-100 to +100)
-
= +60: STRONG BUY | >= +25: BUY | -24 to +24: NEUTRAL | <= -25: SELL | <= -60: STRONG SELL
Risk Rules
- 0.25x Kelly only — position_size_pct from tools is already quarter-Kelly. Do not scale up.
- 10% max position — never exceed 10% of portfolio in one ticker. System enforces this.
- Confidence >= 40 — do not trade on weak signals.
- Risk assessment required — always call
openquant_risk_assessmentbeforeopenquant_trade_execute. - Multi-factor alignment — prefer when 2+ agents agree on direction.
QuantFetch Data Units
When reading data from QuantFetch (optional, requires QUANTFETCH_API_KEY):
| Data | Unit | Example | Convert |
|---|---|---|---|
| EPS | Cents | 250 | Divide by 100 → $2.50 |
| Revenue | Thousands | 50000 | Divide by 1000 → $50M |
| Trade amounts | Dollars | 500000 | Use as-is → $500K |
Common Pitfalls
-
Forgetting risk assessment before trades — This is the #1 mistake. Always run
openquant_risk_assessmentbeforeopenquant_trade_execute. No exceptions. -
Overriding Kelly sizing — The
position_size_pctfrom strategy results is already 0.25x Kelly. Do not multiply it by 4 or use full Kelly. Quarter-Kelly is deliberate to reduce drawdowns. -
Trading on low confidence — Confidence < 40 means HOLD. Don't execute just because the user is enthusiastic. Explain that the signal is weak and suggest monitoring.
-
Ignoring risk level — If
openquant_risk_assessmentreturns risk_level = "HIGH", flag this clearly to the user before proceeding. Consider reducing position size further. -
Mixing up data units — QuantFetch reports EPS in cents and revenue in thousands. Always divide: EPS/100, revenue/1000 before presenting to users.
-
Executing without confirmation — Even in paper mode, always show the trade plan and get explicit confirmation before calling
openquant_trade_execute. -
Treating agent signals as strategy signals — Agent signals are -1.0 to +1.0 (5 agents). Strategy confidence is 0-100 (combined result). They are different scales. Don't compare them directly.
-
Forgetting to check existing positions — Before buying, call
openquant_portfolio_statusto see if you already hold the ticker. Avoid doubling up unintentionally. -
Using the wrong strategy for the situation —
earnings-surgeis for earnings season, not random entry.value-deepis for long-term holds, not quick trades. Match strategy to the user's intent. -
Not backtesting — Before trusting a strategy's signals, run
openquant_backtestto verify it has a positive expected return. A strategy that generates lots of BUY signals with a 30% win rate will lose money.
Strategies
| Name | Style | Time Horizon | Key Trigger |
|---|---|---|---|
insider-momentum | Momentum | Short-term (30 days) | 3+ insider buys/week or CEO purchase |
value-deep | Value | Long-term | P/E < 15, ROE > 15%, D/E < 0.5, insider buy |
earnings-surge | Event | Short-term (10 days) | Earnings estimate revisions + insider buy |
technical-breakout | Trend | Medium-term | 50-day SMA breakout + 2x volume + insider buy |
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |