Documentation

Option Pilot Docs

Complete reference for installing, configuring, and operating Option Pilot โ€” sourced from the application code.

Introduction

What is Option Pilot?

Option Pilot is a fully autonomous desktop trading assistant for Indian equity options. It runs a rule-based Dynamic Signal Engine v2.9 that evaluates 94 technical indicators, resolves one of 6 signal types using confidence voting, and executes orders through your broker's official API โ€” all locally on your machine with zero cloud dependency.

๐Ÿ“„ Paper โ€” Free Forever
๐Ÿ“ˆ Live โ€” Real Orders
๐Ÿ” Backtest โ€” Free Forever

Architecture Overview

Dynamic Signal Engine v2.9Evaluates 94 indicators using confidence voting. Produces BUY_CALL/PUT, EXIT_CALL/PUT, HOLD, or WAIT.
Risk Manager (QObject)Daily loss limit, max trades, kill switch. Emits risk_breach pyqtSignal on breach.
Order ExecutorThread-safe per-order state machine. Handles PENDING โ†’ SUBMITTED โ†’ FILLED / CANCELLED / REJECTED.
Position MonitorWatches open positions. Applies STOP/TRAILING/FIXED exit logic on every tick.
Trend DetectorEvaluates strategy signals with confidence threshold filtering and state_manager integration.
MTF FilterEMA(9/21) crossover alignment check across 1m/5m/15m derived from 1-minute candles.
CandleStoreManagerPer-symbol OHLCV store with multi-timeframe resampling. Separated from TradeState.
WebSocketManagerManages real-time broker data feed with auto-reconnect.
TradeState (Singleton)Thread-safe RLock-protected central state. All property access via getter/setter pairs.
SQLite via SQLAlchemy 2.0Local database: settings, orders, strategies, re-entry counts, config KV store.
Installation

Installing Option Pilot

System Requirements

OSWindows 10+ (64-bit) ยท macOS 11 Big Sur+ (Intel + Apple Silicon) ยท Ubuntu 20.04+ (64-bit)
RAM4 GB minimum ยท 8 GB recommended
Disk500 MB installation + trade log storage
InternetRequired during market hours for data feed
BrokerAPI developer access enabled at your broker
Architecture64-bit only. macOS universal2 (arm64 + x86_64) supported.

Platform Notes

Windows

Run the .exe installer. If Windows SmartScreen appears, click "More info โ†’ Run anyway". Start Menu shortcut created automatically.

macOS

Open the .dmg, drag to Applications. On first launch: right-click the app icon โ†’ Open to bypass Gatekeeper. Not notarised by default.

Linux (Ubuntu)

Install libxcb-xinerama0 and libqt5gui5 first: sudo apt install libxcb-xinerama0 libqt5gui5. Then: chmod +x option-pilot-linux && ./option-pilot-linux

Broker Setup

Connecting Your Broker

All brokers use OAuth2 โ€” you authenticate on your broker's website, never inside Option Pilot. The app stores only the access token locally.

Setup Steps (All Brokers)

  1. Log in to your broker's developer portal and create a new API app.
  2. Set the Redirect URL to: http://127.0.0.1:8000/broker/fyers (or as shown in the app)
  3. Copy your App ID / Client ID and Secret Key.
  4. In Option Pilot: Settings โ†’ Brokerage Settings โ†’ Broker tab
  5. Select your broker, enter App ID and Secret Key, set Redirect URI, click Save Settings.
  6. Click Open Login URL โ€” your browser opens your broker's OAuth login page.
  7. Log in on your broker's page. After success, copy the redirected URL.
  8. Paste the URL or auth code into the popup. Click Complete Login.
Broker tokens expire daily. Option Pilot prompts re-authentication on startup if expired. The renewal flow takes under 30 seconds via the BrokerLoginPopup.

Supported Brokers

Fyers
Zerodha
Dhan
Angel One
Upstox
Shoonya
AliceBlue
Flattrade
Strategy Editor

Building a Strategy

Open the Strategy Editor from Tools โ†’ Strategy Editor or the main toolbar. Tabs: Info, Signal Rules, Indicators, Help.

Engine Settings (Info tab)

min_confidence0.60 (60%)Minimum confidence to fire a signal. 0.0โ€“1.0 scale.
conflict_resolutionWAITWhat to do when BUY_CALL and BUY_PUT both fire. Options: WAIT, BUY_CALL, BUY_PUT.
Timeframe1m defaultCandle interval for strategy evaluation.

Signal Groups (Signal Rules tab)

5 signal groups per strategy. Each group can be independently enabled/disabled and uses AND or OR logic:

BUY_CALL โ†’ open CALL position
BUY_PUT โ†’ open PUT position
EXIT_CALL โ†’ close CALL position
EXIT_PUT โ†’ close PUT position
HOLD โ†’ maintain, suppress entry signals

Adding a Rule

  1. Select the signal group tab (e.g. BUY_CALL).
  2. Click + Add Rule.
  3. In the LEFT SIDE: choose indicator type โ†’ select indicator (e.g. MACD) โ†’ select sub-column (e.g. Histogram) โ†’ set lookback bars.
  4. Set OPERATOR: >, <, >=, <=, ==, !=.
  5. Set RIGHT SIDE: choose scalar value (e.g. 0.0) or another indicator.
  6. Set WEIGHT (the confidence contribution of this rule, e.g. 1.5).
  7. Click Save. Activate the strategy with Activate This Strategy.
Indicators

94 Indicators โ€” Quick Reference

All indicators are from pandas_ta. Browse the full library in Strategy Editor โ†’ Indicators tab. Use the filter box to search by name.

RSI MACD Stoch StochRSI CCI TSI UO AO KAMA ROC RVI TRIX WillR DM PSL EMA SMA WMA HMA DEMA TEMA TRIMA VIDYA ADX Aroon AMAT CHOP CKSP PSAR Supertrend BBands ATR KC NATR Donchian MassI HWC True_Range OBV CMF MFI AD ADOSC EFI EOM KVO NVI PVI PVT ZScore Entropy Kurtosis MAD StDev Variance Skew Fisher Squeeze LinReg PPO Slope HA HWMA + 35 moreโ€ฆ

See the Features page โ†’ Indicator Library for the complete table with default parameters and suggested weights.

Risk Controls

Profit & Stoploss โ€” All Parameters

Configure via Settings โ†’ Profit & Stoploss. Settings applied immediately to running TradeState.

ParameterDefaultDescription
profit_type STOP Exit mode: STOP, TRAILING, or FIXED
tp_percentage 15.0% Take-profit threshold above entry
stoploss_percentage 7.0% Stop-loss threshold below entry (stored positive)
trailing_activation_pct 10.0% TRAILING: price must rise this % before trailing engages
trailing_sl_at_activation 5.0% TRAILING: SL jumps to this % above entry on activation
trailing_first_profit 3.0% Legacy compatibility parameter
max_profit 30.0% FIXED: maximum profit cap per trade
profit_step 2.0% FIXED: profit step size per bar
loss_step 2.0% FIXED: loss step size per bar
Re-Entry Guard

Re-Entry Guard โ€” All Parameters

Configure via Settings โ†’ Re-Entry Settings. All state persists in SQLite across app restarts.

ParameterDefaultDescription
allow_reentry True Master on/off switch for re-entry logic
min_candles_after_sl 3 Candles to wait after stop-loss exit
min_candles_after_tp 1 Candles to wait after take-profit exit
min_candles_after_signal 2 Candles to wait after signal exit
min_candles_default 2 Fallback cooldown for unknown exit reason
same_direction_only False If True: only block re-entry in same direction. Opposite direction always allowed.
require_new_signal True Must see a fresh BUY signal after cooldown. Old signal still active is insufficient.
price_filter_enabled True Block re-entry if current price diverged too far from entry
price_filter_pct 5.0% Max allowed price divergence from entry price
max_reentries_per_day 0 (unlimited) Hard cap on re-entries per trading day. Persisted across restarts.
MTF Filter

Multi-Timeframe Filter

Optional filter that checks EMA trend alignment across multiple timeframes before allowing a signal to fire. Enable in Daily Trade Settings โ†’ MTF tab.

ParameterDefaultDescription
use_mtf_filter False Enable/disable the MTF filter
mtf_timeframes 1,5,15 Comma-separated timeframe minutes to check
mtf_ema_fast 9 Fast EMA period for crossover check
mtf_ema_slow 21 Slow EMA period for crossover check
mtf_agreement_required 2 Minimum timeframes that must agree on direction
Higher-timeframe data is derived from the 1-minute OHLCV data already loaded โ€” no additional broker API calls are made for the MTF check.
Trading Modes

Paper, Live & Backtest Modes

Paper (Simulation)

Virtual money. Default balance โ‚น1,00,000. Optional slippage simulation (default 0.05%). Identical signal engine and risk controls to live. Free forever. No subscription required.

Live

Real orders placed through broker API. Must be explicitly enabled (safety toggle is OFF by default). Optional per-trade confirmation dialog. Requires Live Pro subscription.

Backtest

Bar-by-bar replay of historical 1-minute candles. Black-Scholes option pricing with VIX cache. Same signal engine and all risk controls. 5 tabs: Overview, Trade Log, Strategy Analysis, Equity Curve, Candle Debug. Free forever.

Backtesting

Running a Backtest

Open from Tools โ†’ Strategy Backtester. Configure strategy, timeframes, instrument, and date range on the right panel. Click โ–ถ Run Backtest.

Backtest Result Metrics

Net P&L Total Trades Win Rate % Winners Losers Best Trade Worst Trade Avg Net P&L/Trade Max Drawdown Profit Factor Sharpe Ratio Data Source

5 Analysis Tabs

Overview10 performance metrics in a grid. Net P&L, Win Rate, Profit Factor, Sharpe Ratio, Drawdown, and more.
Trade LogEvery trade: entry time/price, exit time/price/reason, hold bars, P&L, option symbol.
Strategy AnalysisRule contribution analysis. Which rules fired most, confidence distribution.
Equity CurvePortfolio value over time. Visualises drawdown periods and recovery.
Candle DebugInspect exact indicator values and signal evaluations for any individual candle.
Notifications

Setting Up Telegram Alerts

  1. Open Telegram, search @BotFather, send /newbot. Follow prompts. Copy the Bot Token.
  2. Send any message to your new bot. Then open: https://api.telegram.org/bot<YOUR_TOKEN>/getUpdates in your browser.
  3. Find your Chat ID in the JSON response (e.g. "id": 123456789).
  4. In Option Pilot: Settings โ†’ Brokerage Settings โ†’ Telegram tab
  5. Enter Bot Token and Chat ID. Toggle Enable. Click Send Test to verify.

Alert Events

Trade entry Trade exit (TP hit) Trade exit (SL hit) Kill switch activated Daily loss limit reached Token expired โ€” renewal needed Broker disconnected Daily target reached
Quick Reference

Common Actions

Start tradingClick green Start button in main toolbar
Stop tradingClick Stop button (manual kill switch)
Switch modeMode selector dropdown (Paper/Live/Backtest)
Open Strategy EditorTools โ†’ Strategy Editor
View signal evaluation liveTools โ†’ Signal Intelligence Console
View trade historyHistory tab or Tools โ†’ Trade History
Update broker tokenSettings โ†’ Brokerage Settings โ†’ Open Login URL
Change risk limitsSettings โ†’ Profit & Stoploss
Change re-entry settingsSettings โ†’ Re-Entry Settings
Enable MTF FilterSettings โ†’ Daily Trade Settings โ†’ MTF tab
Test TelegramSettings โ†’ Brokerage Settings โ†’ Telegram tab โ†’ Send Test
View system resourcesTools โ†’ System Monitor
View connection statusTools โ†’ Connection Monitor
View app logsTools โ†’ Log Viewer
Run backtestTools โ†’ Strategy Backtester โ†’ Run Backtest
Can't find something? Check the FAQ, Tutorials, or contact support.