algo-expert
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
- 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. - OpenAlgo for everything broker-side. Data via
client.history()and WebSocket. Orders viaclient.placeorder()/placesmartorder()/optionsmultiorder(). Live vs sandbox is decided in OpenAlgo's UI analyzer toggle - the strategy code never knows. - Indicator library is user's choice -
openalgo.ta(default) ortalib. Specialty indicators (Supertrend, Donchian, Ichimoku, HMA, KAMA) always come from openalgo. Seerules/indicator-libraries.md. - Three execution types -
eoc(end-of-candle MARKET),limit(real-time pegged LIMIT),stop(broker-side SL-M trigger). User picks at strategy creation. Seerules/execution-types.md. - Real-world costs and slippage baked into every backtest (matches
vectorbt-backtesting-skills4-segment Indian model). Seerules/transaction-costs.mdandrules/slippage-handling.md. - Self-hosted
/pythoncompatible - every strategy reads env vars in the canonical priority, traps SIGTERM, logs to stdout. Seerules/self-hosted-strategies.md.
When to read which rule
More from marketcalls/openalgo-execution-skills
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.
7algo-options
Generate options-only execution strategies (short straddle, iron condor). Backtest mode is intentionally disabled. Live mode uses optionsmultiorder + per-leg SL.
7algo-host
Validate a generated strategy and produce an upload guide for OpenAlgo's /python self-hosted strategy page. Confirms env-var reads, SIGTERM, stdout-only logging.
6algo-portfolio
Run multiple strategies under one supervisor with portfolio-level risk caps (portfolio SL/TP, daily PnL limits, max concurrent positions). YAML-driven.
6algo-risk-test
Verify a strategy's SL / TP / trailing stop / portfolio caps fire correctly. Uses OpenAlgo sandbox + synthetic price moves. Run this before going live.
6algo-setup
Set up the Python environment for OpenAlgo execution skills - venv, openalgo[indicators], vectorbt, talib, scikit-learn, xgboost. Scaffolds strategies/ folder and .env.
6