All skills
marketcalls avatar

/vectorbt-expert

@3a8c2a3

VectorBT backtesting expert. Use when user asks to backtest strategies, create entry/exit signals, analyze portfolio performance, optimize parameters, fetch historical data, use VectorBT/vectorbt, compare strategies, position sizing, equity curves, drawdown charts, or trade analysis. Also triggers for openalgo.ta helpers (exrem, crossover, crossunder, flip, donchian, supertrend).

Use this Skill: https://skilld.dev/gh/marketcalls/vectorbt-backtesting-skills/vectorbt-expert

This session only. Nothing lands on disk.

rulesstop-loss-take-profit.md

≈455 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Stop Loss & Take Profit

Fixed Stop Loss + Take Profit

pf = vbt.Portfolio.from_signals(
    close, entries, exits,
    sl_stop=0.05,     # Exit if price drops 5% from entry
    tp_stop=0.10,     # Exit if price rises 10% from entry
    init_cash=1_000_000,
    fees=0.00111, fixed_fees=20,
    freq="1D"
)

Trailing Stop Loss

Follows price up, exits on pullback from the highest price since entry:

pf = vbt.Portfolio.from_signals(
    close, entries, exits,
    sl_trail=0.05,    # 5% trailing stop from peak
    init_cash=1_000_000,
    fees=0.00111, fixed_fees=20,
    freq="1D",
)

Combined: Trailing Stop + Take Profit

pf = vbt.Portfolio.from_signals(
    close, entries, exits,
    sl_trail=0.03,    # 3% trailing stop
    tp_stop=0.10,     # 10% take profit
    init_cash=1_000_000,
    fees=0.00111, fixed_fees=20,
    freq="1D",
)

Stop Loss Variations Summary

Parameter Behavior
sl_stop=0.05 Fixed 5% stop from entry price
tp_stop=0.10 Fixed 10% target from entry price
sl_trail=0.03 3% trailing from highest price since entry

Best Practices

  • Start with no stops, then add them to see impact on strategy performance
  • Trailing stops work best in trending markets; fixed SL works better in mean-reverting markets
  • Always test stop-loss levels via parameter optimization (see parameter-optimization)
  • For intraday strategies, use tighter stops (1-2%); for positional, wider (5-10%)
  • Stops are evaluated on close prices by default, not intrabar highs/lows

Source: SKILL.md on GitHub

1 alert16d5 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    The skill provides comprehensive instructions and production-ready templates for financial strategy backtesting using the VectorBT library. It emphasizes security best practices such as environment-variable-based secret management, read-only database connections, and robustness testing. The analysis found no evidence of malicious patterns, data exfiltration, or obfuscation.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer7mo

    19/33 files flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 3a8c2a3. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Steadyupdated 3 months ago
user-invocable
false

README badge

README badge for marketcalls/vectorbt-backtesting-skills/vectorbt-expert