- Home
- Skills
- Trading & Investing
- python-trading-toolkit-pro
More screenshots
Works with the AI tools you already use
Python Trading Toolkit Pro
Build institutional-quality trading infrastructure: walk-forward backtests, real-time risk monitoring, broker API...
$5
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.
What you get
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
How to install
Works the same in every agent - Claude, Cursor, Codex, Copilot and 20+ more.
- 1
Download the ZIP
Free skills download straight away. Paid skills unlock right after purchase.
- 2
Unzip into your skills folder
Every agent reads skills from one folder on your machine. Drop the unzipped folder in there.
- 3
Ask your agent to use it
Restart the agent if it was already running. It picks the skill up automatically - no config needed.
Skills folder by agent
Click the path to copy it. Create the folder if it does not exist yet.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill passes our trust checks below.
Security scanned
Passed our 8-point scan before listing
1 install
Downloaded by developers to date
30-day refund
Not a fit? Get your money back
Trust & safety
Security scanned
Verified clean 2 months ago
- Passed all security checks, Safe to install