More screenshots

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    Python Trading Toolkit Pro

    3

    Build institutional-quality trading infrastructure: walk-forward backtests, real-time risk monitoring, broker API integration, and portfolio optimization in Python.

    $9.99

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    1 useSecurity scanned
    python-trading-toolkit-pro

    python-trading-toolkit-pro

    Example session with this skill installed

    Build a max-Sharpe portfolio for SPY, QQQ, TLT, GLD, IWM over 2 years, then run a walk-forward backtest.

    • Read your context and instructions
    • Compiled the python-trading-toolkit-pro

    > **Max Sharpe Allocation:** SPY 35.1%, QQQ 28.5%, TLT 18.9%, GLD 10.2%, IWM 7.3% > **Walk-Forward Backtest (4 folds):** Avg OOS Sharpe: 0.42. Win Rate: 60%. Total OOS Return: 28.5%. > **Risk Profile:** 95% VaR: -1.4%/day. 95% CVaR: -2.1%/day. Max Drawdown: -14.2% (Q3 2022). Recovery: 38 trading days. > **Correlation Alert:** SPY-QQQ correlation 0.92 — consider reducing one. Monte Carlo P(drawdown > 20%) = 18%. > **Verdict:** Strategy valid OOS at 42% of IS Sharpe. SPY-QQQ pair is the main concentration risk.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    **Build institutional-quality trading infrastructure: walk-forward backtests, real-time risk monitoring, broker API integration, and portfolio optimization in Python.** ### Free vs Pro The free toolkit covers quote pulls, portfolio snapshots, and basic metrics for US, HK, and A-share tickers. **Pro adds the strategy layer**: walk-forward backtesting with transaction costs and slippage modeling, Sharpe/max-drawdown/alpha attribution reports, position-sizing calculators with risk parity, multi-factor screening, and scheduled portfolio rebalancing workflows. Free answers "what does my portfolio look like" — Pro answers "what should I do about it, and what would have happened if I had." ### Upgrade Path Install the free version first to verify data coverage for your markets. When you start making position decisions from the output, the Pro backtesting and sizing layer is the upgrade — every Pro report includes the free version's data pipeline, so nothing you've set up is wasted. ### The Problem You've written a Sharpe-maximizing portfolio optimizer using scipy that returns weights for 5 ETFs. It runs in 0.3 seconds and the output looks clean. But you have no idea if the optimizer is overfitting to historical data, what happens to your portfolio when the market drops 20%, whether your backtest includes transaction costs, or if your broker API will actually accept the orders your optimizer recommends. You're one step away from the most dangerous thing in finance: a strategy you trust without validation. ### What You Get - **4 optimization methods** — Max Sharpe, Min Variance, Risk Parity, and Black-Litterman, all implemented with scipy SLSQP and constraint vectors that enforce weights sum to 1 and each weight is in [0,1] - **Transaction-cost-adjusted optimization** — penalizes turnover in the optimizer objective with a configurable cost model (default 10bps), reporting cost impact side by side with unconstrained weights - **Walk-forward backtesting engine** — rolling train/test windows (252/63 days), grid search over parameter space, reports in-sample and out-of-sample Sharpe separately with automatic overfitting detection (flag if OOS < 50% of IS) - **Real-time RiskMonitor class** — computes VaR (historical and parametric), CVaR (expected shortfall), max drawdown, leverage ratio, position concentration, and correlation matrix, with configurable alert thresholds - **Abstract BrokerInterface** — plug-and-play implementations for MT5 (MetaTrader5) and Binance (python-binance) with connect, get_positions, place_order, cancel_order, and get_price methods - **Position sizing methods** — Kelly Criterion (quarter-Kelly for safety) and Fixed Fractional (risk X% of account per trade with stop-loss distance sizing) ### Why This Beats Prompting It Yourself When you ask an agent to "build a backtest in Python," it produces a single-pass backtest using full-sample statistics to set parameters — the textbook definition of overfitting. The walk-forward engine enforces out-of-sample separation. When you ask for "risk analysis," it reports VaR only, which understates tail risk. This skill requires CVaR alongside VaR and runs Monte Carlo simulations (2,000 forward paths) to estimate terminal wealth distribution. The BrokerInterface abstraction means your strategy can switch from paper to live trading without rewriting optimization code. ### Example Session > **You:** Build a max-Sharpe portfolio for SPY, QQQ, TLT, GLD, IWM over 2 years, then run a walk-forward backtest. > **Agent:** > **Max Sharpe Allocation:** SPY 35.1%, QQQ 28.5%, TLT 18.9%, GLD 10.2%, IWM 7.3% > **Walk-Forward Backtest (4 folds):** Avg OOS Sharpe: 0.42. Win Rate: 60%. Total OOS Return: 28.5%. > **Risk Profile:** 95% VaR: -1.4%/day. 95% CVaR: -2.1%/day. Max Drawdown: -14.2% (Q3 2022). Recovery: 38 trading days. > **Correlation Alert:** SPY-QQQ correlation 0.92 — consider reducing one. Monte Carlo P(drawdown > 20%) = 18%. > **Verdict:** Strategy valid OOS at 42% of IS Sharpe. SPY-QQQ pair is the main concentration risk. ### Use Cases - Building a multi-asset portfolio optimizer with risk parity or Black-Litterman views - Running walk-forward backtests to validate trading strategies before live deployment - Implementing a real-time risk monitor that fires alerts when drawdown, leverage, or VaR thresholds are breached - Connecting a Python strategy to MT5 or Binance for paper trading and live order execution - Computing Kelly Criterion position sizes for a portfolio with known win rate and payoff ratio ### Known Limitations The BrokerInterface requires the MetaTrader5 package (Windows only) or python-binance (testnet mode available). Walk-forward backtests on 50+ tickers may take 5+ minutes depending on parameter grid size. yfinance data has survivorship bias — delisted securities are not included unless explicitly added to the ticker list. --- **Tags:** `trading` `python` `finance` `backtesting` `portfolio-optimization` `risk-management` `broker-api` **Version:** 2.0.0

    The BrokerInterface requires the MetaTrader5 package (Windows only) or python-binance (testnet mode available). Walk-forward backtests on 50+ tickers may take 5+ minutes depending on parameter grid size. yfinance data has survivorship bias — delisted securities are not included unless explicitly added to the ticker list. --- **Tags:** `trading` `python` `finance` `backtesting` `portfolio-optimizat

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before any payment.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    1 use

    Times used to date

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 3 months ago

    Permissions

    No special permissions declared or detected

    Listed3 months ago
    Updated1 day ago

    What's inside

    Frequently Asked Questions

    This skill enables your AI coding agent to architect end-to-end quantitative systems, including vectorised backtesting, Modern Portfolio Theory (MPT) optimization, and production-ready risk monitoring modules. It solves the common 'hallucination' problem where agents suggest mathematically incorrect financial formulas or deprecated API calls.

    This Pro toolkit is designed for high-reasoning LLMs used in coding environments, such as Claude 3.5 Sonnet, GPT-4o, and specialized developer agents like GitHub Copilot or Replit Agent. It provides the structured logic needed for these agents to handle complex financial data structures.

    The Pro version includes advanced features like walk-forward optimization for backtesting, real-time risk parity monitoring, and secure boilerplate for integrating with major broker APIs like Interactive Brokers or Alpaca. It is specifically built for traders moving from script-based research to live clinical execution.

    Upon purchase, you receive the skill integration package which contains the logic, schema definitions, and constraints your AI agent needs to follow. It also includes documentation on recommended Python libraries (such as Pandas, NumPy, and QuantStats) to ensure the agent uses the most efficient stack.

    Yes, the toolkit is built on top of standard Python financial libraries that support a wide range of assets. While it is pre-tuned for equities and FX, the portfolio rebalancing and risk metric modules are easily adaptable for crypto-assets and futures.

    We provide periodic updates to ensure the skill remains compatible with evolving broker APIs and the latest versions of major quantitative libraries. Purchasers get lifetime access to any version updates for the Python Trading Toolkit Pro.