All projects

QQQ Options Research

From contract forecasts to cash-constrained trading simulations.

Net simulated profit / loss (USD)

+$3,909
Fold 1$10,000 starting cash
−$1,097
Fold 2$10,000 starting cash
−$423
Fold 3$10,000 starting cash

Independent accounts; common scale ±$6,000. No compounding. Predeclared selection: CASH.

Overview

Overview

An independent research project exploring whether machine learning can identify useful QQQ option opportunities. I built the workflow around historical data qualification, chronological model comparisons, and an account simulator that tracks execution, fees, cash, and settlement.

RIDGE produced the highest combined simulated profit: $2,389 across three separate $10,000 accounts. Two periods lost money, and the predeclared forecast-selection rule chose CASH. The result is a completed research record with explicit limits on what the evidence supports.

Context

Research context and goals

Context

The project began with a broader investigation of financial prediction, including stock forecasts, public insider disclosures, and company screening. The final QQQ study brought the central question into focus: could a model identify attractive option opportunities under a consistent historical trading protocol?

I developed the Python research workflow, compared models with scikit-learn and PyTorch, and connected their forecasts to a separate account engine. That separation made it possible to inspect both predictive behavior and the consequences of turning predictions into trades.

The Problem

Forecast accuracy and trading constraints

The Problem

Options introduce decisions about contracts, timing, available capital, and execution. Several contracts can look attractive at the same moment, but an account cannot spend the same cash twice. Proceeds also pass through settlement before they become available again.

Evaluation must also account for leakage and unstable outcomes. Future information can leak into features or training labels, and a profitable total can conceal unstable periods. I designed the experiment to preserve those distinctions instead of reducing the entire project to one return figure.

Data & targets

Input features and prediction targets

Data & targets

The prediction target is an option opportunity’s net cash outcome divided by its initial debit. It measures the contract-level outcome relevant to the experiment. Retained feature rows, source identities, and original outcome records connect each forecast to the opportunity it describes.

Features must be available at least one second before the decision. Original missing-value masks are restored, and preprocessing is learned within each fitting partition. If a required feature is unavailable, the entire contemporaneous choice clock is blocked, avoiding selective removal of individual alternatives.

Contract-opportunity pipeline

  1. 01Contract opportunity

    Build features available before the decision.

  2. 02Forecast

    Estimate net cash outcome divided by initial debit.

  3. 03Nominate

    Choose a unique highest positive forecast.

  4. 04Simulate

    Apply execution, capital, fees, and settlement rules.

Each stage preserves the link between an opportunity, its features, its forecast, and its simulated outcome.
Evaluation design

Chronological fitting, calibration, and evaluation

Evaluation design

Three chronological folds evaluate successive historical periods. Each fold fits a model on earlier data, reserves a separate calibration partition, and resets the simulated account to $10,000 before evaluation.

The last 20% of prior sessions, rounded up, are reserved for calibration. Fitting labels must mature before calibration begins, and calibration labels must mature before the next evaluation decision. Calibration rows are excluded from refitting. Empirical residual intervals describe observed coverage; they do not guarantee future uncertainty bounds.

Chronological evaluation partitions

Fold 01
Prior historyInitial fitting history

Fit → reserve final 20% of prior sessions for calibration

EvaluateEvaluation period 1

New $10,000 simulated account

Fold 02
Prior historyExpanded fitting history

Fit → reserve final 20% of prior sessions for calibration

EvaluateEvaluation period 2

New $10,000 simulated account

Fold 03
Prior historyFurther expanded history

Fit → reserve final 20% of prior sessions for calibration

EvaluateEvaluation period 3

New $10,000 simulated account

Calibration rows are not refitted. This is examined historical data, not a new untouched holdout.

Chronological partitions control model fitting and calibration. All historical periods had already been examined; these are not untouched validation results.
Model comparison

Candidate models and controls

Model comparison

The final campaign fixes the candidate architectures and hyperparameters before comparison. Three candidates across three folds produce nine fits. Adding zero, earlier-mean, and retained frozen-model controls produces eighteen funded account comparisons.

01

Regularized linear regression

RIDGE uses a weighted linear relationship with an L2 penalty, providing a controlled baseline with limited flexibility.

02

Shallow boosted trees

Histogram gradient boosting captures nonlinear interactions with 100 iterations, depth three, and at most seven leaves per tree.

03

Two-part neural model

A 16-unit hidden layer estimates positive-outcome probability and conditional gain/loss magnitudes. Its expected outcome combines all three: p × gain − (1 − p) × loss.

01 / Linear

Ridge

Regularized weighted regression

features → weighted sum
02 / Nonlinear

Shallow trees

Histogram gradient boosting

features → depth-3 trees
03 / Decomposed

Two-part network

Probability, gain, and loss heads

p × gain − (1 − p) × loss
All candidates predict the same contract-opportunity target; model complexity is the experimental variable.

Two-part neural network

Fold-preprocessed feature vector

Numeric inputs with the original missing-value treatment

16-unit hidden layer · ReLU
p = sigmoid(z)Positive-outcome probability
g = softplus(z)Conditional gain
l = softplus(z)Conditional loss magnitude
p × g − (1 − p) × lExpected opportunity outcome

Forecast net cash outcome relative to the initial debit

Gain if positive: +25%Loss magnitude: 15%Expected outcome: +9.0%

The slider demonstrates the output calculation with illustrative values. It does not run the trained model or predict a real contract.

The two-part network estimates a probability and two conditional magnitudes, then combines them into the expected opportunity outcome.
Account simulation

Account simulation and settlement

Account simulation

At each decision clock, the account nominates the uniquely highest positive forecast. Ties and nonpositive forecasts produce no nomination. A separate engine then applies position restrictions, available cash, execution windows, modeled fees, exits, and settlement constraints.

The simulator records nominations, rejected decisions, trade paths, and cash journals. All eighteen final ledgers end in settled cash with no open contracts or pending obligations. These records make account outcomes inspectable while retaining the historical execution assumptions behind them.

Account simulation stages

  1. 01Available cash

    Check buying power and nomination restrictions.

  2. 02Reserve & execute

    Apply the modeled entry window and fees.

  3. 03Hold & exit

    Follow original position and exit rules.

  4. 04Settle

    Release settled proceeds back to available cash.

A rejected nomination does not become a trade. Simulated execution is not a verified historical fill.

Cash availability, reservations, execution, and settlement determine which nominated opportunities an account can actually simulate.

Example: contract nomination at a decision point

Contract A

+8% forecast outcome

Contract B

+3% forecast outcome

Contract C

-2% forecast outcome

Nominate contract A

A has the unique highest positive forecast. The account engine still checks cash, execution, and position constraints.

Illustrative forecasts. A nominated contract is not an executed or profitable trade.

The nomination examples demonstrate how ties and nonpositive forecasts prevent a contract from reaching the account checks.
Results

Simulated profit and loss by evaluation fold

Results

RIDGE earned $3,909 in Fold 1, lost $1,097 in Fold 2, and lost $423 in Fold 3, across 55 closed trades. Its $2,389 total adds dollars from three independently funded accounts. It is neither a continuous-account return nor a compounded return.

The shallow tree totaled −$1,350 and the neural model −$2,633. Returns were concentrated: removing RIDGE’s three largest winning trades in Fold 1 changes that period’s profit to a $543 loss. This retrospective diagnostic exposes dependence on a few outcomes; it is not an executable trading filter.

Net simulated profit / loss (USD)

+$3,909
Fold 1$10,000 starting cash
−$1,097
Fold 2$10,000 starting cash
−$423
Fold 3$10,000 starting cash

Independent accounts; common scale ±$6,000. No compounding. Predeclared selection: CASH.

View all account outcomes
Net simulated USD; each fold starts with $10,000
ModelFold 1Fold 2Fold 3
Ridge3,909-1,097-423
Shallow tree1,396-676-2,070
Two-part network2,677-180-5,130
Frozen L18561-312521
Zero / Earlier mean000
Simulated net P&L by fold. Each account starts with $10,000; the bars must not be read as a continuous equity curve.
Account paths

Account value after each closed trade

Account paths

The closing total hides the path an account took to get there. These curves reconstruct account value from the saved net outcomes of closed trades, with each model and evaluation fold beginning at $10,000.

Switch between folds to see the changes in direction and the number of trades behind each result. The horizontal axis counts each model’s own closed trades; it does not align the models by clock time or show losses inside an open position.

Account paths

Equity after each closed trade

$10,000 per account
  • Ridge
  • Shallow tree
  • Two-part network
Fold 1 closed-trade equity. Account equity (USD) by Closed trade number. Exact values follow in the data table.Account equity (USD)$4,000$7,000$10,000$13,000$16,00007142128Closed trade numberRidge: Closed trade number 0, $10,000 Account equity (USD)Ridge: Closed trade number 1, $9,740 Account equity (USD)Ridge: Closed trade number 2, $9,875 Account equity (USD)Ridge: Closed trade number 3, $9,854 Account equity (USD)Ridge: Closed trade number 4, $12,112 Account equity (USD)Ridge: Closed trade number 5, $13,018 Account equity (USD)Ridge: Closed trade number 6, $12,866 Account equity (USD)Ridge: Closed trade number 7, $13,364 Account equity (USD)Ridge: Closed trade number 8, $13,198 Account equity (USD)Ridge: Closed trade number 9, $12,654 Account equity (USD)Ridge: Closed trade number 10, $13,942 Account equity (USD)Ridge: Closed trade number 11, $13,909 Account equity (USD)Shallow tree: Closed trade number 0, $10,000 Account equity (USD)Shallow tree: Closed trade number 1, $9,703 Account equity (USD)Shallow tree: Closed trade number 2, $9,539 Account equity (USD)Shallow tree: Closed trade number 3, $9,845 Account equity (USD)Shallow tree: Closed trade number 4, $10,344 Account equity (USD)Shallow tree: Closed trade number 5, $10,649 Account equity (USD)Shallow tree: Closed trade number 6, $11,396 Account equity (USD)Two-part network: Closed trade number 0, $10,000 Account equity (USD)Two-part network: Closed trade number 1, $9,703 Account equity (USD)Two-part network: Closed trade number 2, $9,635 Account equity (USD)Two-part network: Closed trade number 3, $9,990 Account equity (USD)Two-part network: Closed trade number 4, $10,619 Account equity (USD)Two-part network: Closed trade number 5, $10,656 Account equity (USD)Two-part network: Closed trade number 6, $11,695 Account equity (USD)Two-part network: Closed trade number 7, $11,786 Account equity (USD)Two-part network: Closed trade number 8, $11,634 Account equity (USD)Two-part network: Closed trade number 9, $12,132 Account equity (USD)Two-part network: Closed trade number 10, $11,966 Account equity (USD)Two-part network: Closed trade number 11, $11,422 Account equity (USD)Two-part network: Closed trade number 12, $12,710 Account equity (USD)Two-part network: Closed trade number 13, $12,677 Account equity (USD)
Ridge$13,90911 closed trades · Fold 1
Shallow tree$11,3966 closed trades · Fold 1
Two-part network$12,67713 closed trades · Fold 1

Each fold uses separate $10,000 accounts. Curves share the same scale and stop at each model’s final trade. Trade number is not shared calendar time; equity is recorded at trade close, not marked continuously to market. The predeclared rule selected CASH.

View selected fold’s equity values
Fold 1: simulated account equity in USD after trade close
TradeRidgeShallow treeTwo-part network
Starting cash$10,000$10,000$10,000
1$9,740$9,703$9,703
2$9,875$9,539$9,635
3$9,854$9,845$9,990
4$12,112$10,344$10,619
5$13,018$10,649$10,656
6$12,866$11,396$11,695
7$13,364—$11,786
8$13,198—$11,634
9$12,654—$12,132
10$13,942—$11,966
11$13,909—$11,422
12——$12,710
13——$12,677
Source data
Separate simulated accounts for each fold. Closed-trade value includes realized outcomes; it is not a continuously marked portfolio valuation.
Risk & concentration

Drawdown and dependence on large wins

Risk & concentration

Drawdown measures the largest decline from an earlier account high. The saved closed-trade records also let us inspect how much of each total depends on the largest winning trades.

For RIDGE, removing the three largest wins in Fold 1 changes +$3,909 into −$543. This sensitivity calculation helps explain the positive total, but does not simulate an alternative trading strategy: it removes outcomes after the fact without replaying capital allocation.

Risk and concentration

What the final profit number conceals

Maximum closed-trade drawdownFold 1 · USD
Ridge
$710
Shallow tree
$461
Two-part network
$710
$0$3,000$6,000

Peak-to-trough decline in closed-trade equity; this excludes unrealized movements while trades are open. Every account starts at $10,000, and folds are independent.

View risk and concentration values
Fold 1: independent simulated accounts, USD
ModelNet P&LDrawdownWithout top 3 winsWins / trades
Ridge$3,909$710−$5435 / 11
Shallow tree$1,396$461−$1564 / 6
Two-part network$2,677$710−$2797 / 13
Source data
Drawdowns use closed-trade values. Removing the largest wins is a retrospective sensitivity calculation on the recorded trades.
What the evidence supports

Model selection and limitations

What the evidence supports

The predeclared rule required a candidate to beat both constant forecasts under the session/contract-day mean-squared-error criterion in each of the first two folds. None passed, so the rule selected CASH. RIDGE’s retrospective designation as the best historical model family preserves that original decision.

The study does not establish a deployable strategy. Of 53,550 original opportunity rows, 14,179 retain unresolved unit labels, and historical source-arrival evidence remains conditional. With every period already examined, new promotion evidence would require genuinely untouched chronology. The public repository preserves the code and results, including losses and limitations.

Highest retrospective totalRidge

+$2,389 across three separate accounts

Predeclared forecast ruleCASH

No candidate passed both early-fold gates

Highest historical simulated profit: RIDGE. Predeclared forecast-selection decision: CASH. No model was promoted to live trading.
Next projectStack Society HUD