Receber por email
← Voltar para o catálogo

strategy-compare

Compara múltiplas estratégias ou direções (compra vs venda vs ambas) para o mesmo símbolo. Gera uma tabela de estatísticas lado a lado.

196estrelas
Atualizado há 3 meses

Ver no GitHub ↗

Como adicionar

/plugin marketplace add marketcalls/vectorbt-backtesting-skills

O comando exato pode variar conforme o repositório. Confira o README no GitHub.

Para o autor da skill

Cole no README do seu repo

Mostra que sua skill está catalogada na Skillteca, gera backlink e tráfego rastreável.

[![Skillteca](https://www.skillteca.com.br/api/badge/strategy-compare/svg)](https://www.skillteca.com.br/skills/strategy-compare)

Skills relacionadas

Ver todas de Desenvolvimento →

Alerta por categoria

Receba novas skills de Desenvolvimento toda segunda

1 email curto, só com as skills novas de Desenvolvimento. 4 minutos de leitura, sem spam, cancela com 1 clique.

Você confirma o email no primeiro envio. Sem spam. Cancela com 1 clique.

Ler descrição completa

Create a strategy comparison script.

Arguments

Parse $ARGUMENTS as: symbol followed by strategy names

  • $0 = symbol (e.g., SBIN, RELIANCE, NIFTY)
  • Remaining args = strategies to compare (e.g., ema-crossover rsi donchian)

If only a symbol is given with no strategies, compare: ema-crossover, rsi, donchian, supertrend. If "long-vs-short" is one of the strategies, compare longonly vs shortonly vs both for the first real strategy.

Instructions

  1. Read the vectorbt-expert skill rules for reference patterns
  2. Create backtesting/strategy_comparison/ directory if it doesn't exist (on-demand)
  3. Create a .py file in backtesting/strategy_comparison/ named {symbol}_strategy_comparison.py
  4. The script must:
  5. Fetch data once via OpenAlgo
  6. If user provides a DuckDB path, load data directly via duckdb.connect(path, read_only=True). See vectorbt-expert rules/duckdb-data.md.
  7. If openalgo.ta is not importable (standalone DuckDB), use inline exrem() fallback.
  8. Use TA-Lib for ALL indicators (never VectorBT built-in)
  9. Use OpenAlgo ta for specialty indicators (Supertrend, Donchian, etc.)
  10. Clean signals with ta.exrem() (always .fillna(False) before exrem)
  11. Run each strategy on the same data
  12. Indian delivery fees: fees=0.00111, fixed_fees=20 for delivery equity
  13. Collect key metrics from each into a side-by-side DataFrame
  14. Include NIFTY benchmark in the comparison table (via OpenAlgo NSE_INDEX)
  15. Print Strategy vs Benchmark comparison table: Total Return, Sharpe, Sortino, Max DD, Win Rate, Trades, Profit Factor
  16. Explain results in plain language - which strategy performed best and why
  17. Plot overlaid equity curves for all strategies using Plotly (template="plotly_dark")
  18. Save comparison to CSV
  19. Never use icons/emojis in code or logger output

Example Usage

/strategy-compare RELIANCE ema-crossover rsi donchian /strategy-compare SBIN long-vs-short ema-crossover

Compartilhar X LinkedIn