Optimize
Analyzes market data to suggest portfolio adjustments maximizing returns based on user-defined risk tolerance.
Install on your platform
We auto-selected Claude Code based on this skill’s supported platforms.
Run in terminal (recommended)
claude mcp add optimize npx -- -y @trustedskills/optimize
Or manually add to ~/.claude/settings.json
{
"mcpServers": {
"optimize": {
"command": "npx",
"args": [
"-y",
"@trustedskills/optimize"
]
}
}
}Requires Claude Code (claude CLI). Run claude --version to verify your install.
About This Skill
What it does
This skill enables AI agents to optimize trading strategy parameters using VectorBT and backtesting techniques. It automatically generates Python scripts that test various parameter combinations for a given trading strategy, symbol, exchange, and interval. The skill leverages OpenAlgo for market data retrieval (or DuckDB as an alternative) and TA-Lib for indicator calculations, providing performance heatmaps and comparisons against benchmark indices like NIFTY.
When to use it
- You want to improve the performance of a VectorBT trading strategy by finding optimal parameter settings.
- You need to quickly evaluate different parameter combinations for a specific stock or index.
- You're looking for a way to compare your strategy’s performance against a market benchmark.
Key capabilities
- Automated Script Generation: Creates Python scripts for VectorBT backtesting optimization based on user input.
- Parameter Optimization: Tests parameter ranges (e.g., EMA periods) to maximize returns and Sharpe ratio.
- Data Integration: Loads market data from OpenAlgo or DuckDB.
- Indicator Calculation: Uses TA-Lib for standard indicators and
openalgo.tafor specialized ones like Supertrend and Donchian. - Performance Visualization: Generates Plotly heatmaps of total return and Sharpe ratio.
- Benchmark Comparison: Compares strategy performance against a NIFTY benchmark, providing plain-language results.
- Cost Awareness: Accounts for Indian delivery fees and futures lot sizes.
Example prompts
- "Optimize the 'ema-crossover' strategy for SBIN on NSE with a daily interval."
- "Create an optimization script for the 'rsi' strategy using RELIANCE on NFO, hourly data."
- "Generate a backtesting script to optimize a Donchian channel strategy for NIFTY."
Tips & gotchas
- Familiarity with VectorBT and Python is helpful. Refer to the
vectorbt-expertskill rules for reference patterns. - The skill relies on OpenAlgo or DuckDB for data; ensure you have appropriate configuration set up (e.g.,
.envfile). - TA-Lib must be installed for indicator calculations.
Tags
TrustedSkills Verification
Unlike other registries that point to live repositories, TrustedSkills pins every skill to a verified commit hash. This protects you from malicious updates — what you install today is exactly what was reviewed and verified.
Security Audits
| Gen Agent Trust Hub | Pass |
| Socket | Pass |
| Snyk | Pass |
🌐 Community
Passed automated security scans.