Options Trading Suite & Analytics
Relevant source files
The following files were used as context for generating this wiki page:
The Options Trading Suite & Analytics module is a specialized surface within OpenAlgo (accessible via /tools) designed to provide professional-grade analytical capabilities for options traders. It leverages unified broker APIs to stream real-time data for Greek calculations, strategy building, and market volatility analysis. The suite is built to bridge the gap between raw broker data and actionable trading insights, supporting advanced features like payoff diagrams and synthetic future calculations.
Sources: okf/tools/options-suite.md:1-17, README.md:38-51
Core Analytics Tools
The suite consists of twelve primary analytical tools that utilize the active broker connection for streaming market data and executing orders.
| Tool | Route | Primary Function |
|---|---|---|
| Strategy Builder | /strategybuilder | Multi-leg strategy construction with live Greeks, payoff diagrams, and basket execution. |
| Option Chain | /optionchain | Real-time chain data including Greeks, OI, and rapid order placement. |
| Option Greeks | /ivchart | Historical tracking of IV, Delta, Theta, Vega, and Gamma for ATM options. |
| OI Tracker | /oitracker | Open Interest analysis with Put-Call Ratio (PCR) overlays. |
| Max Pain | /maxpain | Calculation and visualization of the Max Pain strike. |
| Straddle Chart | /straddle | Dynamic ATM straddle tracking with spot and synthetic futures overlays. |
| Vol Surface | /volsurface | 3D visualization of Implied Volatility across expiries and strikes. |
| GEX Dashboard | /gex | Gamma Exposure analysis and identifying OI Walls. |
Sources: README.md:108-125, okf/viz.html:268-285
Data Flow for Options Analytics
The following diagram illustrates how market data flows from the broker through the OpenAlgo service layer to the analytics frontend.
The analytics suite relies on a normalized data structure where broker-specific formats are converted into a standard OpenAlgo schema before being processed by calculation engines like the Greeks service.
Sources: README.md:92-106, okf/viz.html:12-42
Options Greeks Engine
The Greeks engine is a critical component that calculates theoretical values and risk sensitivities using the Black-76 or Black-Scholes models. It requires the mibian library for underlying calculations.
Greek Definitions and Impact
The system tracks five primary Greeks to assist in risk management:
- Delta: Measures the rate of change of the option price relative to the underlying asset. (Call: 0 to 1, Put: -1 to 0).
- Gamma: Measures the rate of change in Delta. Highest for ATM options near expiry.
- Theta: Represents time decay (always negative for long options).
- Vega: Measures sensitivity to implied volatility.
- Rho: Measures sensitivity to interest rates (defaulted to 6.5% in the system).
Sources: test/README_OPTION_GREEKS_TESTS.md:96-125, okf/viz.html:270-272
API Integration Example
The Greeks are accessible via the /api/v1/optiongreeks endpoint.
{
"status": "success",
"symbol": "NIFTY28NOV2424000CE",
"days_to_expiry": 5.42,
"implied_volatility": 15.25,
"greeks": {
"delta": 0.5234,
"gamma": 0.000125,
"theta": -12.5678,
"vega": 18.7654,
"rho": 0.001234
}
}
Sources: test/README_OPTION_GREEKS_TESTS.md:80-94, okf/viz.html:270-271
Strategy Builder and Execution
The Strategy Builder allows users to model complex multi-leg positions and simulate P&L outcomes before committing capital.
Multi-Leg Order Flow
When a strategy is executed from the suite, it often utilizes the OptionsMultiOrder or BasketOrder APIs to ensure atomic or synchronized execution.
Exchange-Aware Calculation Logic
The suite accounts for differing expiry times across exchanges, which significantly impacts Days to Expiry (DTE) and Theta calculations.
| Exchange | Standard Expiry Time | Impact on Analytics |
|---|---|---|
| NFO / BFO | 15:30 IST | Standard afternoon expiry. |
| CDS | 12:30 IST | Early expiry; faster intra-day Theta decay. |
| MCX | 23:30 IST | Late night expiry; higher time value retention. |
Sources: test/README_OPTION_GREEKS_TESTS.md:183-205, frontend/src/pages/python-strategy/PythonStrategyGuide.tsx:470-490
Synthetic Futures & Arbitrage
OpenAlgo provides specialized endpoints for detecting price discrepancies between options and their underlying assets.
- Synthetic Future API: Calculates the theoretical future price based on Put-Call parity (
/api/v1/syntheticfuture). - Arbitrage Logic: Tools within the suite monitor the spread between synthetic and actual future prices to identify arbitrage opportunities.
Sources: okf/viz.html:276-278, README.md:92-106
The Options Trading Suite & Analytics provides a robust environment for both modeling and executing complex derivatives strategies. By integrating real-time Greeks, multi-leg order management, and exchange-specific calendar awareness, it serves as a high-performance terminal for professional options traders.