optimize▌
marketcalls/vectorbt-backtesting-skills · updated Apr 8, 2026
MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.
Backtesting strategy parameter optimization with VectorBT, generating performance heatmaps and benchmark comparisons.
- ›Accepts strategy name, symbol, exchange, and interval; creates optimization script in backtesting/{strategy}/ directory
- ›Loads market data from OpenAlgo via .env configuration or directly from DuckDB; uses TA-Lib for all indicators with OpenAlgo ta for specialty indicators like Supertrend and Donchian
- ›Tests parameter combinations across sensible ranges (e.g., EMA 5-50
Create a parameter optimization script for a VectorBT strategy.
Arguments
Parse $ARGUMENTS as: strategy symbol exchange interval
$0= strategy name (e.g., ema-crossover, rsi, donchian). Default: ema-crossover$1= symbol (e.g., SBIN, RELIANCE, NIFTY). Default: SBIN$2= exchange (e.g., NSE, NFO). Default: NSE$3= interval (e.g., D, 1h, 5m). Default: D
If no arguments, ask the user which strategy to optimize.
Instructions
- Read the vectorbt-expert skill rules for reference patterns
- Create
backtesting/{strategy_name}/directory if it doesn't exist (on-demand) - Create a
.pyfile inbacktesting/{strategy_name}/named{symbol}_{strategy}_optimize.py - The script must:
- Load
.envfrom project root usingfind_dotenv()and fetch data via OpenAlgoclient.history() - If user provides a DuckDB path, load data directly via
duckdb.connect(path, read_only=True). See vectorbt-expertrules/duckdb-data.md. - If
openalgo.tais not importable (standalone DuckDB), use inlineexrem()fallback. - Use TA-Lib for ALL indicators (never VectorBT built-in)
- Use OpenAlgo ta for specialty indicators (Supertrend, Donchian, etc.)
- Use
ta.exrem()to clean signals (always.fillna(False)before exrem) - Define sensible parameter ranges for the chosen strategy
- Use loop-based optimization to collect multiple metrics per combo
- Track: total_return, sharpe_ratio, max_drawdown, trade_count for each combination
- Use
tqdmfor progress bars - Indian delivery fees:
fees=0.00111, fixed_fees=20for delivery equity - Find best parameters by total return AND by Sharpe ratio
- Print top 10 results for both criteria
- Generate Plotly heatmap of total return across parameter grid (
template="plotly_dark") - Generate Plotly heatmap of Sharpe ratio across parameter grid
- Fetch NIFTY benchmark and compare best parameters vs benchmark
- Print Strategy vs Benchmark comparison table
- Explain results in plain language for normal traders
- Save results to CSV
- Load
- Never use icons/emojis in code or logger output
- For futures symbols, use lot-size-aware sizing:
- NIFTY:
min_size=65, size_granularity=65 - BANKNIFTY:
min_size=30, size_granularity=30
- NIFTY:
Default Parameter Ranges
| Strategy | Parameter 1 | Parameter 2 |
|---|---|---|
| ema-crossover | fast EMA: 5-50 | slow EMA: 10-60 |
| rsi | window: 5-30 | oversold: 20-40 |
| donchian | period: 5-50 | - |
| supertrend | period: 5-30 | multiplier: 1.0-5.0 |
Example Usage
/optimize ema-crossover RELIANCE NSE D
/optimize rsi SBIN
How to use optimize on Cursor
AI-first code editor with Composer
Prerequisites
Before installing skills in Cursor, ensure your development environment meets these requirements:
- ›Cursor installed and configured on your development machine
- ›Node.js version 16.0+ with npm package manager (verify with
node --version) - ›Active project directory or workspace where you want to add optimize
Execute installation command
Execute the skills CLI command in your project's root directory to begin installation:
The skills CLI fetches optimize from GitHub repository marketcalls/vectorbt-backtesting-skills and configures it for Cursor.
Select Cursor when prompted
The CLI will show a list of available agents. Use arrow keys to navigate and space to select Cursor:
Verify installation
Confirm successful installation by checking the skill directory location:
Reload or restart Cursor to activate optimize. Access the skill through slash commands (e.g., /optimize) or your agent's skill management interface.
Security & Verification Notice
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your development environment. Always verify the publisher's identity, review recent commits, and test in isolated environments before production deployment.
List & Monetize Your Skill
Submit your Claude Code skill and start earning
Use Cases▌
User Story & Requirements Generation
Create detailed user stories, acceptance criteria, and feature specs
Example
Generate user stories for 'password reset feature' with acceptance criteria, edge cases, and test scenarios
Reduce spec writing time by 50%, ensure comprehensive coverage
Competitive Analysis
Research competitors, compare features, identify gaps
Example
Analyze 5 competitor products, create feature comparison matrix, suggest differentiation opportunities
Complete competitive research in 2 hours instead of 2 days
Roadmap Prioritization
Evaluate features using frameworks (RICE, ICE, Kano) and create prioritized backlogs
Example
Score 20 feature ideas using RICE framework, generate prioritized roadmap with rationale
Make data-driven prioritization decisions faster
Stakeholder Communication
Draft PRDs, status updates, and stakeholder presentations
Example
Create executive summary of Q3 roadmap, monthly progress report, feature launch announcement
Save 3-5 hours/week on communication overhead
Implementation Guide▌
Prerequisites
- ›Claude Desktop or compatible AI client
- ›Access to product documentation and roadmap tools (Jira, Notion, etc.)
- ›Understanding of product management frameworks (RICE, Jobs-to-be-Done, etc.)
- ›Stakeholder contact information and communication channels
Time Estimate
30-60 minutes to see productivity improvements
Installation Steps
- 1.Install product management skill
- 2.Start with user story generation for known feature
- 3.Progress to competitive analysis: research 2-3 competitors
- 4.Use for roadmap prioritization: apply RICE/ICE scoring
- 5.Draft stakeholder communications and refine based on feedback
- 6.Build template library for recurring PM tasks
- 7.Share effective prompts with product team
Common Pitfalls
- ⚠Not validating competitive research—verify facts before sharing
- ⚠Accepting user stories without involving engineering team
- ⚠Over-relying on frameworks without qualitative judgment
- ⚠Not customizing outputs to company culture and communication style
- ⚠Skipping stakeholder validation of generated requirements
Best Practices▌
✓ Do
- +Validate research and competitive analysis with real data
- +Collaborate with engineering when generating technical requirements
- +Customize frameworks and templates to your company context
- +Use skill for first drafts, refine with stakeholder input
- +Document successful prompt patterns for PM tasks
- +Combine AI efficiency with human judgment and intuition
✗ Don't
- −Don't publish competitive analysis without fact-checking
- −Don't finalize user stories without engineering review
- −Don't make prioritization decisions solely on AI scoring
- −Don't skip customer validation of generated requirements
- −Don't ignore company-specific context and culture
💡 Pro Tips
- ★Provide context: company goals, constraints, customer feedback
- ★Ask for alternatives: 'Show 3 ways to prioritize this roadmap'
- ★Request stakeholder-specific formatting: 'Executive summary vs. engineering spec'
- ★Use skill for 70% generation + 30% customization to company needs
When to Use This▌
✓ Use When
Use for user story writing, competitive research, roadmap prioritization, stakeholder communication, and PRD drafting. Best for reducing repetitive documentation and research work.
✗ Avoid When
Avoid for strategic product vision (requires deep customer empathy), pricing decisions (needs market and financial expertise), or when face-to-face customer discovery is more valuable than speed.
Learning Path▌
- 1Basic: user stories, feature specs, status updates
- 2Intermediate: competitive analysis, prioritization frameworks, PRDs
- 3Advanced: product strategy, go-to-market planning, OKR setting
- 4Expert: product vision, market positioning, business model innovation
Discussion
Product Hunt–style comments (not star reviews)- No comments yet — start the thread.
Ratings
4.7★★★★★29 reviews- ★★★★★Fatima Lopez· Dec 20, 2024
Registry listing for optimize matched our evaluation — installs cleanly and behaves as described in the markdown.
- ★★★★★Shikha Mishra· Dec 16, 2024
I recommend optimize for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
- ★★★★★Harper Liu· Nov 27, 2024
We added optimize from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
- ★★★★★Arya Ramirez· Nov 11, 2024
optimize fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
- ★★★★★Yash Thakker· Nov 7, 2024
Useful defaults in optimize — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
- ★★★★★Dhruvi Jain· Oct 26, 2024
optimize has been reliable in day-to-day use. Documentation quality is above average for community skills.
- ★★★★★Harper Yang· Oct 18, 2024
Solid pick for teams standardizing on skills: optimize is focused, and the summary matches what you get after install.
- ★★★★★Dev Martin· Oct 2, 2024
optimize is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
- ★★★★★Oshnikdeep· Sep 5, 2024
Solid pick for teams standardizing on skills: optimize is focused, and the summary matches what you get after install.
- ★★★★★Ganesh Mohane· Aug 24, 2024
We added optimize from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
showing 1-10 of 29