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

algo-expert

OpenAlgo execution expert. Auto-loaded knowledge base for building algorithmic trading strategies that toggle between VectorBT backtest and OpenAlgo live execution. Triggers when user mentions OpenAlgo trading strategies, dual-mode strategies, /python self-hosted strategies, options execution (short straddle, iron condor), portfolio risk caps, or live execution with stop loss / target / trailing stop / risk management.

How do I install this agent skill?

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

Is this agent skill safe to install?

  • Gen Agent Trust Hubwarn

    This skill provides a trading strategy framework that uses dynamic execution and potentially unsafe deserialization to manage models and multi-strategy setups.

  • Socketwarn

    4 alerts: gptSecurity, gptAnomaly

  • Snykwarn

    Risk: MEDIUM · 1 issue

What does this agent skill do?

OpenAlgo Execution Expert

Knowledge base for building production-grade algorithmic trading strategies on OpenAlgo. Every strategy is a single Python file that toggles between backtest mode (VectorBT) and live execution mode (OpenAlgo SDK + WebSocket) via one CLI flag (--mode backtest|live) or env var (MODE=...).

Strategies are also upload-ready for OpenAlgo's self-hosted /python strategy host.

Core principles

  1. One file, two modes. The same signals(df) function feeds both VectorBT (backtest) and the live event loop. Risk thresholds and cost assumptions are honored on both sides.
  2. OpenAlgo for everything broker-side. Data via client.history() and WebSocket. Orders via client.placeorder() / placesmartorder() / optionsmultiorder(). Live vs sandbox is decided in OpenAlgo's UI analyzer toggle - the strategy code never knows.
  3. Indicator library is user's choice - openalgo.ta (default) or talib. Specialty indicators (Supertrend, Donchian, Ichimoku, HMA, KAMA) always come from openalgo. See rules/indicator-libraries.md.
  4. Three execution types - eoc (end-of-candle MARKET), limit (real-time pegged LIMIT), stop (broker-side SL-M trigger). User picks at strategy creation. See rules/execution-types.md.
  5. Real-world costs and slippage baked into every backtest (matches vectorbt-backtesting-skills 4-segment Indian model). See rules/transaction-costs.md and rules/slippage-handling.md.
  6. Self-hosted /python compatible - every strategy reads env vars in the canonical priority, traps SIGTERM, logs to stdout. See rules/self-hosted-strategies.md.

When to read which rule

Reading the user wants...Load these rule files
The big-picture strategy templateunified-strategy-pattern.md, mode-toggle.md, execution-types.md
Indicator selectionindicator-libraries.md
Position sizing (the most important fix)position-sizing.md
Preflight checks at startuppreflight-checks.md
Risk on a single positionrisk-management.md
Portfolio-level risk and daily capsportfolio-risk.md
Cost / slippage modelingtransaction-costs.md, slippage-handling.md
Data sources (DuckDB, Historify, API)duckdb-data.md
WebSocket and bar-close patternswebsocket-feeds.md, event-loop.md
Order placement idiomsexecution-patterns.md, order-constants.md
Options strategiesoptions-execution.md
Volatility strategiesvolatility-strategies.md
ML strategiesml-strategies.md
Persistent state between restartsstate-persistence.md
Logging and Telegram alertslogging-and-alerts.md
Common production mistakespitfalls.md
Strategy catalog / template selectionstrategy-catalog.md
OpenAlgo /python self-hostingself-hosted-strategies.md
Symbol formats and lot sizessymbol-format.md, lot-sizes.md, order-constants.md
Full SDK referencesdk-reference.md

Production patterns (lifted from OpenAlgo examples)

  • Two-thread live model: signal poll thread + WS callback thread (from examples/python/emacrossover_strategy_python.py). The WS callback NEVER places orders directly - it spawns a worker thread.
  • Bar-close logic uses iloc[-2] not iloc[-1] - the last bar in client.history() is forming and would cause repaint.
  • Risk exits use client.placesmartorder(position_size=0) to flatten cleanly (from examples/python/stoploss_target_example.py).
  • Multi-leg options entry via client.optionsmultiorder() - BUY legs go first for margin efficiency. Per-leg SL via client.placeorder(price_type="SL") (from examples/python/straddle_with_stops.py).
  • Time-based entries via apscheduler.schedulers.background.BackgroundScheduler with IST cron (from examples/python/straddle_scheduler.py).
  • Always fetch spot quote before any options order - client.quotes() first, then client.optionsorder() with offset="ATM".

Anti-patterns (always avoid)

  • asyncio - the OpenAlgo SDK is synchronous; use threading instead
  • df.iloc[-1] on live data - that's the forming bar; use iloc[-2]
  • Calling client.history(start_date=end_date) - returns 1 candle; always use multi-day lookback
  • Placing exit orders directly inside the WS callback - spawn a worker thread
  • Hardcoding exchange="NSE" when self-hosted - read OPENALGO_STRATEGY_EXCHANGE env var instead
  • Backtests with fees=0 and slippage=0 - the result is fantasy; use the segment-appropriate constants
  • Polling client.get_ltp() faster than 0.5s - use WS callbacks for real-time

Reference docs (in OpenAlgo repo)

  • SDK: D:/openalgo-python/openalgo/docs/prompt/openalgo python sdk.md
  • Services: D:/openalgo-python/openalgo/docs/prompt/services_documentation.md
  • WebSocket protocol: D:/openalgo-python/openalgo/docs/prompt/websockets-format.md
  • Self-hosted /python: D:/openalgo-python/openalgo/strategies/README.md
  • Production examples: D:/openalgo-python/openalgo/examples/python/

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-expert">View algo-expert on skillZs</a>