Skip to content

Options Analysis Platform Architecture v0.1

Version: 2026-10-14
Language: English

Part of the DawnLuma Options research area — see also DawnLuma — Options and the platform overview.

This document describes the Options Analysis Platform within DawnLuma: an options research, analytics, and backtesting architecture.

The initial goals are to:

  • ingest options market data from multiple providers and markets;
  • preserve raw market data separately from calculated analytics;
  • normalise provider-specific data into a common internal data model;
  • calculate option analytics such as IV, Greeks, OI, volume, liquidity, skew, and term structure;
  • backtest options strategies using historical market data;
  • present results through APIs, charts, reports, and a future web interface;
  • keep the core analysis and backtesting logic independent from a specific market-data vendor.

The first prototype is intended to use US options data because it is easier and cheaper to access for development.
The architecture should later support HKEX options data through a separate data adapter, without rewriting the analysis or backtest engines.

Within DawnLuma, the Options area remains logically separate from Stocks research (including MarketLens-style equity work).

A future Strategies layer may combine stock-side and options-side outputs. See DawnLuma Platform, Website & SEO Design, Stocks, and Strategies.


The application is divided into four main areas:

  1. Data Layer
  2. Analysis Engine
  3. Backtest Engine
  4. Output Layer

Each part should be independently testable and replaceable.

The analysis and backtesting engines should not know whether data came from:

  • ThetaData
  • Massive
  • Cboe
  • HKEX
  • another future provider

Provider-specific formats must be converted into a canonical internal model before reaching the analysis layer.

US and Hong Kong markets have different:

  • contract multipliers;
  • trading calendars;
  • fee structures;
  • settlement rules;
  • exercise conventions;
  • market-data formats;
  • liquidity characteristics.

These differences should be isolated behind market-specific components.

Raw market data should be stored unchanged whenever licensing permits.

Derived values such as:

  • implied volatility;
  • Delta;
  • Gamma;
  • Theta;
  • Vega;
  • IV Rank;
  • IV Percentile;
  • liquidity score;

should be reproducible from the original data.

Backtesting is not simply another analytics calculation.

The backtest engine must independently handle:

  • strategy definitions;
  • entry rules;
  • exit rules;
  • contract selection;
  • fill assumptions;
  • bid/ask spread;
  • slippage;
  • commissions and fees;
  • exercise and assignment;
  • position tracking;
  • realised and unrealised P&L;
  • performance metrics.

flowchart TD
A[External Data Sources<br/>ThetaData / Massive / Cboe / HKEX<br/>Underlying Prices / Rates / Dividends]
subgraph DL[1. Data Layer]
B[Provider Adapters]
C["Validation & Normalisation"]
D[Canonical Data Model]
E[(Raw Data Storage)]
F[(Normalised Data Storage)]
end
subgraph AE[2. Analysis Engine]
G["IV & Greeks"]
H["OI & Volume Analysis"]
I[Liquidity Analysis]
J[IV Rank / Percentile]
K["Skew & Term Structure"]
L[Unusual Activity / Signals]
end
subgraph BE[3. Backtest Engine]
M[Strategy Definition]
N[Entry / Exit Rules]
O[Contract Selector]
P[Execution / Fill Model]
Q[Fees / Slippage]
R["Position & P&L Engine"]
S[Performance Metrics]
end
subgraph OL[4. Output Layer]
T[REST API]
U[Web UI]
V[Charts]
W[Reports / Export]
end
A --> B
B --> C
C --> D
B --> E
D --> F
F --> G
F --> H
F --> I
F --> J
F --> K
F --> L
F --> M
G --> M
H --> M
I --> M
J --> M
K --> M
L --> M
M --> N
N --> O
O --> P
P --> Q
Q --> R
R --> S
G --> T
H --> T
I --> T
J --> T
K --> T
L --> T
S --> T
T --> U
T --> V
T --> W

Responsible for:

  • downloading or querying market data;
  • reading provider-specific files or APIs;
  • data validation;
  • timestamp normalisation;
  • symbol normalisation;
  • contract mapping;
  • duplicate handling;
  • preserving raw data;
  • producing canonical internal objects.

The Data Layer should not:

  • calculate strategy profitability;
  • decide which strategy is best;
  • generate trading recommendations;
  • contain UI logic.

Responsible for:

  • implied volatility;
  • Greeks;
  • IV Rank;
  • IV Percentile;
  • open interest analysis;
  • option volume analysis;
  • abnormal-volume detection;
  • liquidity analysis;
  • bid/ask spread analysis;
  • volatility skew;
  • term structure;
  • option-chain analytics;
  • research signals.

The Analysis Engine should consume only the canonical internal model.

It should not know whether the source was HKEX, ThetaData, Massive, Cboe, or another vendor.

Responsible for replaying historical data under a defined strategy.

The engine should support:

  • single-leg strategies;
  • multi-leg strategies;
  • long and short options;
  • entry filters;
  • exit conditions;
  • DTE selection;
  • Delta-based contract selection;
  • strike-based contract selection;
  • bid/ask-aware execution;
  • realistic fill models;
  • slippage;
  • commissions;
  • exercise;
  • assignment;
  • expiry;
  • capital usage;
  • portfolio-level performance;
  • drawdown;
  • expectancy;
  • win/loss statistics;
  • profit factor.

The engine should be strategy-agnostic.

Avoid creating a separate engine for every strategy.

Bad design:

LongCallBacktester
BullCallSpreadBacktester
BullPutSpreadBacktester
IronCondorBacktester

Preferred design:

BacktestEngine
+
StrategyDefinition

Responsible for:

  • REST API;
  • option chain presentation;
  • analysis dashboard;
  • backtest reports;
  • charts;
  • CSV / JSON exports;
  • future web UI.

The Output Layer should not contain financial calculations.


The canonical data model is one of the most important architectural decisions.

The same model should be usable for US and Hong Kong data.

public record OptionContract
{
public required string Market { get; init; }
public required string Underlying { get; init; }
public required DateOnly Expiry { get; init; }
public required decimal Strike { get; init; }
public required OptionRight Right { get; init; }
public required int Multiplier { get; init; }
public required string Currency { get; init; }
public string? ExerciseStyle { get; init; }
public string? SettlementType { get; init; }
}
public record OptionQuote
{
public required OptionContract Contract { get; init; }
public required DateTimeOffset Timestamp { get; init; }
public decimal? Bid { get; init; }
public decimal? Ask { get; init; }
public int? BidSize { get; init; }
public int? AskSize { get; init; }
}
public record OptionTrade
{
public required OptionContract Contract { get; init; }
public required DateTimeOffset Timestamp { get; init; }
public required decimal Price { get; init; }
public required int Size { get; init; }
}
public record UnderlyingPrice
{
public required string Market { get; init; }
public required string Symbol { get; init; }
public required DateTimeOffset Timestamp { get; init; }
public required decimal Price { get; init; }
}
public record OpenInterest
{
public required OptionContract Contract { get; init; }
public required DateOnly Date { get; init; }
public required long Value { get; init; }
}

The data provider should be abstracted behind a common interface.

public interface IOptionsDataProvider
{
Task<IReadOnlyList<OptionContract>> GetContractsAsync(
string underlying,
DateOnly date);
Task<IReadOnlyList<OptionQuote>> GetQuotesAsync(
OptionContract contract,
DateTimeOffset from,
DateTimeOffset to);
Task<IReadOnlyList<OptionTrade>> GetTradesAsync(
OptionContract contract,
DateTimeOffset from,
DateTimeOffset to);
}

Possible implementations:

ThetaDataProvider
MassiveOptionsProvider
CboeOptionsProvider
HKEXOptionsProvider

flowchart LR
A[Vendor Data]
B[Provider Adapter]
C[Validation]
D[Normalisation]
E[Canonical Model]
F[(Raw Storage)]
G[(Normalised Storage)]
H[Analysis Engine]
I[Backtest Engine]
J[API / Reports / UI]
A --> B
B --> F
B --> C
C --> D
D --> E
E --> G
G --> H
G --> I
H --> I
H --> J
I --> J

The first prototype can use US data.

flowchart TD
A[ThetaData / Massive]
B[US Adapter]
C[Canonical Option Data]
D[Analysis Engine]
E[Backtest Engine]
F[Output]
A --> B
B --> C
C --> D
C --> E
D --> E
D --> F
E --> F

Later, Hong Kong support should be added without changing the core engines.

flowchart TD
A1[US Vendor]
A2[HKEX]
B1[US Adapter]
B2[HKEX Adapter]
C[Canonical Option Data]
D[Analysis Engine]
E[Backtest Engine]
F[Output]
A1 --> B1
A2 --> B2
B1 --> C
B2 --> C
C --> D
C --> E
D --> E
D --> F
E --> F

Market-specific behaviour should not be hard-coded into the core engine.

Examples:

TradingCalendar
CommissionModel
SlippageModel
ContractMultiplier
ExerciseModel
SettlementModel
Currency
MarketHours
FeeModel

For example, do not write:

var contractSize = 100;

Use:

var contractSize = contract.Multiplier;

This is especially important because Hong Kong stock-option contract sizes vary by underlying.


flowchart TD
A[Canonical Options Data]
A --> B[Implied Volatility]
A --> C[Greeks]
A --> D[Open Interest]
A --> E[Volume]
A --> F["Bid / Ask & Liquidity"]
B --> G[IV Rank]
B --> H[IV Percentile]
B --> I[Volatility Skew]
B --> J[Term Structure]
D --> K[OI Change]
E --> L[Abnormal Volume]
F --> M[Liquidity Score]
G --> N[Signals]
H --> N
I --> N
J --> N
K --> N
L --> N
M --> N

flowchart TD
A[Historical Data]
B[Analysis Signals]
C[Strategy Definition]
A --> D[Contract Selector]
B --> D
C --> D
D --> E[Entry Rules]
E --> F[Execution / Fill Model]
F --> G[Open Position]
G --> H[Position Monitoring]
H --> I{Exit Rule Triggered?}
I -- No --> H
I -- Yes --> J[Exit Execution]
J --> K["P&L"]
K --> L[Performance Metrics]

The backtest engine should not hard-code strategy names.

Strategy: Long Call
Leg 1
- Action: BUY
- Type: CALL
- DTE: 30-45
- Delta Target: 0.50
Strategy: Bull Call Spread
Leg 1
- Action: BUY
- Type: CALL
- Delta Target: 0.50
Leg 2
- Action: SELL
- Type: CALL
- Higher Strike
Strategy: Bull Put Spread
Leg 1
- Action: SELL
- Type: PUT
- Delta Target: 0.25
Leg 2
- Action: BUY
- Type: PUT
- Lower Strike

A backtest requires more than just an option strategy.

Examples:

  • bullish signal;
  • VCP breakout;
  • abnormal option volume;
  • IV percentile threshold;
  • DTE range;
  • Delta range;
  • minimum OI;
  • maximum bid/ask spread;
  • minimum liquidity score.

Examples:

  • nearest Delta to 0.50;
  • 30–45 DTE;
  • specific strike distance;
  • ATM / ITM / OTM;
  • minimum volume / OI.

Examples:

  • buy at ask;
  • sell at bid;
  • mid-price fill;
  • configurable slippage;
  • partial-fill assumptions.

Examples:

  • +50% profit;
  • -30% stop loss;
  • 21 DTE;
  • technical signal invalidation;
  • expiry;
  • assignment / exercise.

A strategy should not be judged only by win rate.

Important metrics include:

Number of Trades
Win Rate
Average Winner
Average Loser
Expectancy
Total Return
Annualised Return
Maximum Drawdown
Profit Factor
Sharpe Ratio
Capital Usage
Average Holding Period
Exposure

Basic expectancy:

Expectancy
=
Win Rate × Average Win
-
Loss Rate × Average Loss

15. Signal Backtesting vs Strategy Backtesting

Section titled “15. Signal Backtesting vs Strategy Backtesting”
flowchart TD
A[Options Analysis Platform]
A --> B[Signal Backtesting]
A --> C[Strategy Backtesting]
B --> D[IV]
B --> E[OI]
B --> F[Volume]
B --> G[Liquidity]
C --> H[Long Call]
C --> I[Bull Call Spread]
C --> J[Bull Put Spread]
C --> K[Cash-Secured Put]
D --> L[Does the signal have predictive value?]
E --> L
F --> L
G --> L
H --> M[Can the signal be traded profitably?]
I --> M
J --> M
K --> M

Example signal research:

Today's option volume > 5 × 20-day average
Then measure underlying return after:
+1 day
+3 days
+5 days
+10 days

Another example:

IV Percentile > 90
Then measure:
5-day IV change
10-day IV change
20-day IV change

Preferred sequence:

  1. determine whether a signal has predictive value;
  2. then determine which option strategy best expresses that signal.

This helps reduce overfitting.


Do not tune parameters using the entire historical dataset.

Example:

2020–2024
Development / Parameter Research
2025–2026
Out-of-Sample Validation

Once parameters are chosen on the development period, they should remain unchanged when testing the out-of-sample period.


  • Select US options data provider.
  • Implement one provider adapter.
  • Download historical data for a small set of highly liquid underlyings.
  • Convert provider data into canonical models.
  • Display parsed data in a console application.

Suggested initial underlyings:

SPY
QQQ
AAPL
MSFT
NVDA

Implement:

  • bid/ask spread;
  • mid price;
  • simple liquidity measures;
  • IV;
  • Delta;
  • Gamma;
  • Theta;
  • Vega.

First research question:

When a bullish signal occurs, does buying a 30–45 DTE call with approximately 0.50 Delta produce positive expectancy after realistic bid/ask spread, slippage, and fees?

The purpose of this first backtest is mainly to validate the engine.

Add:

  1. Bull Call Spread
  2. Bull Put Spread
  3. Cash-Secured Put

Iron Condor and more complex strategies should come later.

Add historical research for:

  • abnormal option volume;
  • OI change;
  • IV Rank;
  • IV Percentile;
  • skew;
  • liquidity.

For large historical datasets, do not immediately load everything into PostgreSQL.

flowchart TD
A[Raw Vendor Files]
B[Object / File Storage]
C[Parquet]
D[DuckDB / Polars / Python]
E[Analysis Results]
F[(PostgreSQL)]
A --> B
B --> C
C --> D
D --> E
E --> F

Suggested approach:

  • raw vendor files remain immutable;
  • transform raw files into Parquet;
  • use DuckDB / Polars for large analytical queries;
  • store final metadata, runs, users, strategy definitions, and results in PostgreSQL.

dawnluma-options/
│
├── docs/
│ ├── architecture-overview.md
│ ├── data-model.md
│ ├── data-providers.md
│ ├── analysis-engine.md
│ ├── backtest-engine.md
│ ├── storage.md
│ └── roadmap.md
│
├── src/
│ ├── DawnLuma.Options.Domain/
│ ├── DawnLuma.Options.Data/
│ ├── DawnLuma.Options.Analytics/
│ ├── DawnLuma.Options.Backtesting/
│ ├── DawnLuma.Options.Api/
│ └── DawnLuma.Options.Web/
│
├── tests/
│ ├── DawnLuma.Options.Domain.Tests/
│ ├── DawnLuma.Options.Data.Tests/
│ ├── DawnLuma.Options.Analytics.Tests/
│ └── DawnLuma.Options.Backtesting.Tests/
│
└── README.md

Within DawnLuma, Stocks and Options research should remain independent systems.

A future Strategies layer may combine their outputs.

flowchart LR
A[Stocks<br/>MarketLens research]
B[Strategies layer]
C[Options Analysis Platform]
A -->|Stock signals| B
C -->|Options analytics| B
B --> D[Combined Research]
D --> E[Stock + Option + Strategy Analysis]
  • trend;
  • VCP;
  • relative strength;
  • breakout;
  • volume;
  • stock scoring.
  • IV;
  • OI;
  • option volume;
  • Greeks;
  • liquidity;
  • skew;
  • term structure;
  • backtesting.
  • combine stock signals with option analytics;
  • rank opportunities;
  • compare strategy structures;
  • perform cross-system research.

The Strategies layer should access data through APIs, events, or exported analytical datasets rather than directly querying private internal database schemas of the Stocks or Options systems.


Create this architecture document.

Define canonical domain models:

OptionContract
OptionQuote
OptionTrade
UnderlyingPrice
OpenInterest

Define:

IOptionsDataProvider

Implement one US provider adapter.

Example:

ThetaData
→ ThetaDataProvider
→ Canonical Models
→ Console Output

Do not build the UI yet.

Add raw / Parquet storage.

Implement basic option analytics.

Build the generic Backtest Engine.

Create the first Long Call StrategyDefinition.

Add Bull Call Spread and Bull Put Spread.

Add HKEX support through:

HKEX Data
→ HKEXOptionsProvider
→ Canonical Models
→ Existing Analysis Engine
→ Existing Backtest Engine

The goal is that HKEX support should require a new adapter and market-specific configuration, not a rewrite of the system.


flowchart TD
A[Market Data Providers]
A --> B[Provider Adapters]
B --> C[Canonical Data Model]
C --> D[(Storage)]
D --> E[Analysis Engine]
D --> F[Backtest Engine]
E --> F
E --> G[API / UI / Reports]
F --> G
H[Stocks research] -. Future Integration .-> I[Strategies layer]
G -. Options Analytics .-> I

The core architectural rule is:

Data source, analytics, backtesting, and presentation must remain separate.

This separation allows the system to:

  • start with US data;
  • later support HKEX data;
  • change data vendors;
  • add new strategies;
  • add new analytics;
  • reuse the same backtest engine;
  • exchange signals with DawnLuma Stocks research without tightly coupling the two systems.