skillZs
★ LIVE SKILL TAGS ★
>>> LIVE SKILLS INDEX <<<
* OPEN SOURCE *
NO LOGIN, NO TRACKING
※ REAL INSTALL DATA ※
← back to all skills
marketcalls/openalgo-execution-skills51 installs

algo-strategy

Generate a single-file dual-mode trading strategy. Asks for indicator library and execution type. The same file runs `--mode backtest` (VectorBT) and `--mode live` (OpenAlgo). Upload-ready for OpenAlgo /python self-hosted.

How do I install this agent skill?

npx skills add https://github.com/marketcalls/openalgo-execution-skills --skill algo-strategy
view source ↗

Is this agent skill safe to install?

  • Gen Agent Trust Hubpass

    This skill generates algorithmic trading strategies by populating local Python templates with user-specified parameters. It follows best practices for strategy generation and does not contain malicious code, data exfiltration patterns, or obfuscation.

  • Socketpass

    No alerts

  • Snykpass

    Risk: LOW · No issues

What does this agent skill do?

Create a complete dual-mode strategy file from a template.

Arguments

Parse $ARGUMENTS as: template symbol exchange interval

  • $0 = template (e.g. ema-crossover, rsi, supertrend, donchian, macd, opening-range, atr-breakout, bb-squeeze, ml-logistic, ml-xgb, pairs-trading, regime-trend, event-driven)
  • $1 = symbol (e.g. SBIN, RELIANCE, NIFTY). Default: template's catalog default
  • $2 = exchange (e.g. NSE, NSE_INDEX, NFO). Default: template's catalog default
  • $3 = interval (e.g. 1m, 5m, 15m, D). Default: template's default

If no arguments, ask the user which template they want. See algo-expert/rules/strategy-catalog.md.

Required prompts before generation

After parsing arguments, ASK the user (do not assume defaults silently):

  1. Indicator library: (1) openalgo [default] (2) talib

    • Default openalgo. talib's user must confirm explicitly.
    • Specialty indicators (Supertrend, Donchian, Ichimoku, HMA, KAMA) always use openalgo regardless.
  2. Execution type - default depends on template (see strategy-catalog.md):

    • (1) end-of-candle (eoc) - signal at bar close, MARKET on next bar (default for most)
    • (2) real-time limit (limit) - tick-driven LIMIT placement (default for atr-breakout)
    • (3) stop-trigger (stop) - broker-side SL/SL-M (default for opening-range)

    Tell the user the recommended default for their template and let them override.

Instructions

  1. Read algo-expert/rules/unified-strategy-pattern.md, mode-toggle.md, and execution-types.md.
  2. Read the matching template at algo-expert/rules/assets/<template>/strategy.py as the starting point.
  3. Create strategies/<template>_<symbol>/ directory if not present.
  4. Copy the template into strategies/<template>_<symbol>/strategy.py and:
    • Replace SYMBOL, EXCHANGE, INTERVAL constants with user values
    • Set INDICATOR_LIB to user's choice ("openalgo" or "talib")
    • Set EXECUTION_TYPE to user's choice ("eoc", "limit", "stop")
    • Update STRATEGY_NAME to <template>_<symbol> (default; can be overridden by env)
    • Adjust PRODUCT to match the asset class (NSE equity → MIS or CNC; NFO → NRML)
    • Adjust QUANTITY to a reasonable starting value (1 for equity, lot size for futures)
  5. For ML templates (ml-logistic, ml-xgb), also copy train.py and remind the user to run it BEFORE running the strategy:
    python strategies/ml_logistic_RELIANCE/train.py
    
  6. The file must be host-compatible per self-hosted-strategies.md:
    • Reads HOST_SERVER first, then OPENALGO_HOST fallback
    • Reads OPENALGO_STRATEGY_EXCHANGE for exchange
    • SIGTERM/SIGINT handlers installed
    • stdout-only logging
    • dispatcher reads env MODE if no --mode CLI arg
  7. Print:
    • File location
    • Next steps:
      • Backtest: python strategies/<name>/strategy.py --mode backtest
      • Live: python strategies/<name>/strategy.py --mode live
      • Upload to /python: /algo-host <name> to validate and generate upload guide

Available templates

TemplateDefault symbolDefault exchangeDefault intervalDefault execution
ema-crossoverSBINNSE5meoc
rsiRELIANCENSE15meoc
supertrendNIFTYNSE_INDEX5meoc
donchianNIFTYNSE_INDEXDeoc
macdINFYNSEDeoc
opening-rangeSBINNSE5mstop
atr-breakoutRELIANCENSE5mlimit
bb-squeezeTCSNSE15meoc
ml-logisticRELIANCENSE15meoc
ml-xgbRELIANCENSE15meoc
pairs-tradingSBIN/PNBNSEDeoc (two-leg)
regime-trendRELIANCENSEDeoc (ADX+VIX+volume gates)
event-drivenRELIANCENSEDscheduled-time

For options templates (short-straddle, iron-condor), use /algo-options instead.

Costs

The file's COSTS = cost_lookup(PRODUCT, EXCHANGE) auto-resolves:

  • MIS + NSE → 0.0225% + Rs 20 + 5 bps slippage
  • CNC + NSE → 0.111% + Rs 20 + 3 bps slippage
  • NRML + NFO → 0.018% + Rs 20 + 2 bps slippage (futures)
  • NRML + NFO with options → 0.098% + Rs 20 + 10 bps slippage

If the user wants different broker rates, point them to algo-expert/rules/transaction-costs.md to override the constants.

Risk defaults

The template comes with reasonable RISK values (see strategy-catalog.md). Tell the user these are starting points, not optimal - tune via backtest before live.

Avoid

  • Do not use icons/emojis in code, logger output, or skill text
  • Do not generate files in arbitrary paths - always under strategies/<name>/
  • Do not auto-flip MODE=live without the user explicitly running it

Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.

<a href="https://skillzs.dev/skills/marketcalls/openalgo-execution-skills/algo-strategy">View algo-strategy on skillZs</a>