Files
trading/handoffs/HANDOFF-2026-11-27.md
T
2026-11-27 06:07:57 -06:00

485 lines
42 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Handoff: Prop-firm fee mispricing project (Lucid Trading, LucidPro 50K)
Snapshot v3.2: 27 Nov 2026. **v3.2: lock-day overshoot dropped (aim exactly at the lock), and all book figures redone with 15 seeds; the earlier 3-seed book numbers were badly understated (8.4, 8.9b).** v3.1 added the closed indicator idea (8.9a), `ind_*.py`, and roll-adjusted pre-2015 files. New in v3.0 (replacing v2.9):
- **First user strategy tested** (opening "Drive" rule, section 8.8): the only direction rule so far to pass a pre-registered test. It replicates on CL/GC 2015–24 but is not confirmed in 2010–14 or the 2025–26 holdout. Holdout now **spent** (section 5).
- Cost model: **2.0 ticks on 09:30 entries**, 1.5 elsewhere (section 3). Measured from the user's trade prints.
- Dealer-gamma / DIX test (8.6), pre-2015 data (6), new instruments in the sim, per-session instrument support, all scripts honour `LUCID_DATA` (7).
How to start the next session:
- Give it this file, `RUN_PERSIST.md`, `RUN_OVERSHOOT.md`, the `code/` folder and the `scripts/` folder.
- `book_overshoot.py` (#192) was run on the user's machine: 16 cores, 0.6 min.
- Upload the data separately (section 6), then run `python -I code/build_sessions.py` (~30 s) and the checks in section 7.
---
## 1. Project and how to work with this user
**Goal.** Find out whether Lucid's $150 evaluation fee is mispriced. That is, does it produce more than $150 of expected value across the account lifecycle (evaluation → funded → payouts → live/buyout)? Then find how to play it best. **Current focus (user, 27 Nov): finding strategies that raise value per account.** Book-level tests are deferred.
**User.**
- An aspiring algorithmic trader with a background in programming and finance.
- Wants objective, concise answers with no flattery.
- Has a lot of local compute and can run heavy jobs.
- This environment had **2 cores and 7 GB RAM**. **Give a runtime estimate before any run over ~1 minute.**
- Trades Lucid accounts live now, without much luck so far.
- Open to trading any instrument and adopting any strategy.
- Plans to research **dozens of strategies**, so multiple testing is the main statistical risk (section 5).
**Why the fresh-start rule still applies.** Earlier chats kept "reaffirming" an edge the user doubted.
- Treat every edge claim as a hypothesis to test against a random-direction (coin) baseline.
- Only what's in this document carries over.
**User's strategies so far.**
- 27 Nov: four opening rules from a screenshot. R1 is discretionary and was left out on purpose. R2–R4 were tested (section 8.8).
- They're not all mean-reversion. All use the full drawdown as the stop and aim for the whole target ("bold play").
- The user designed R2–R4 using **every NQ year available, 2015–2026**. The user had **never looked at CL, GC or the other markets** with these rules.
- Whether the user looked at 2010–14 while designing: not confirmed. The user warns that pre-2015 markets were very different, so weigh that period lightly.
- Earlier, 26 Nov: an NQ long-overnight / short-day idea, rejected (8.5).
**Prior research the user has already done** (don't repeat it):
- **LucidPro 50K is the best plan.** They compared other sizes, plans and firms.
- **DLL on vs off:** DLL-on gives more value per account; DLL-off gives more value over time because accounts cycle faster. They use **DLL off**.
- **NG and currencies don't have enough volatility to close brackets reliably.** Confirmed here: NG and 6E leave 51–59% of brackets unresolved (8.8).
- **Rule changes are out of scope.** If Lucid penalises the approach, the user will move to another firm.
---
## 2. Account rules: LucidPro 50K, daily loss limit OFF
Sources: Lucid's help pages (articles 12890029 evaluation, 12890069 funded, 12890092 payouts, 12890109 consistency, 12890136 drawdown, 11508978 commissions), plus points the user confirmed directly with Lucid.
| Item | Rule |
|---|---|
| Fee | About $150. **Resets cost the same as a new account**, so a fail means a new purchase. |
| Start | $50,000, floor $48,000. The evaluation and the funded account both start fresh this way. |
| Evaluation target | Balance reaches $53,000. No minimum days, no consistency rule. Passing becomes funded the next session. |
| Drawdown | $2,000 end-of-day trailing: floor = max(floor, EOD balance − $2,000). **Locks at $50,100 for good once an EOD close is above $52,100**; it stays locked after payouts. |
| Intraday enforcement | Breach if the balance (including open P&L) touches the floor intraday. The floor used is the previous evening's (user confirmed). |
| Max size | 4 minis or 40 micros. |
| Flat time | 16:45 ET (auto-close, not a breach). On holiday early closes, flat before the market's actual close. |
| Payout conditions (checked per cycle; all reset after each payout) | Cycle profit ≥ $500; largest day ≤ 40% of cycle profit; withdrawal only from above the $52,100 buffer. |
| Caps | Payout 1: $2,000 (needs balance $54,100). Payouts 2–5: $2,500 (needs $54,600). Minimum request $500. 90/10 split. Paid 2 business days after approval. |
| **Payout 5 → move to live** | See below. |
| **Hedging (user-confirmed)** | You may not be long and short at the same time **within an instrument group**: equities, metals, energies, currencies. Long GC + short NQ is allowed. Long ES + short NQ is not, and long GC + short SI is not. So all NQ accounts share one direction, all GC accounts one, and **CL and NG share one** (same group). One account may trade different markets on different days. |
| Other prohibitions | Copying trades between different people; microscalping (>50% of profit from trades held ≤5 s); HFT. Copiers across your own accounts are allowed. |
| Limits | 10 accounts per household (evaluations + funded + passed-in-reserve), at most 5 funded. |
**What happens at payout 5 (from Lucid's FAQ and the user):**
- Hitting payout 5 on **any** funded account moves the trader to live, or offers a buyout.
- Every funded account with **at least 1 payout** gets one live account or a buyout. The buyout is 50% of the drawdown = $1,000, at 90/10 = **$900** to the trader.
- **All evaluations are closed** (forfeited). **Passed accounts waiting in reserve for a funded slot are also forfeited** (user-confirmed 27 Nov; the sim already does this).
- Funded accounts with 0 payouts close. Their fee is refunded only if ≥50% of the drawdown remains (from the user's notes).
- **Then a 14-day lock with no evaluation purchases.** Modelled as 10 trading sessions.
- The trader chooses when to request a payout. **Requesting payout 5 is the trigger**, so its timing is a decision, not something automatic.
Unverified, not modelled: the live account rules themselves (start $0, $2k EOD drawdown, daily payouts, live bonus), LucidMaxx, and the 14-day cooldown after blowing a live account.
---
## 3. Cost model (user-specified)
Market orders only (limit fills on the sim are poor), plus Lucid's per-side commissions. Slippage:
- **2.0 ticks on any entry at 09:30 ET** (user's decision, 27 Nov);
- **1.5 ticks on every other entry and every exit.**
In code: `sim/bracket.py` `entry_slip()` reads the session's `entry_min`. The table below uses 1.5 ticks; a 09:30 NQ round trip costs $2.50 more per contract.
| Instrument | Tick (value per contract) | Commission per side | Round trip, 1 contract | Round trip, 4 contracts |
|---|---|---|---|---|
| NQ | 0.25 ($5) | $1.75 | $18.50 | $74 |
| GC | 0.10 ($10) | $2.30 | $34.60 | $138 |
| CL | 0.01 ($10) | $2.00 | $34.00 | $136 |
| NG | 0.001 ($10) | $2.00 | $34.00 | $136 |
| ES | 0.25 ($12.50) | $1.75 *assumed* | $44.00 | $176 |
| SI / PL | 0.005 ($25) / 0.10 ($5) | $2.30 *assumed* | – | – |
| BZ / 6E | 0.01 ($10) / 0.00005 ($6.25) | $2.00 *assumed* | – | – |
| MNQ (×10 = one NQ) | 0.25 ($0.50) | $0.50 | – | $25 per NQ-equivalent, so worse than NQ |
ES/SI/PL/BZ/6E commissions are not verified with Lucid. Uplift-vs-coin tests are insensitive to cost, because both directions pay it; absolute account values are not.
When the floor is the stop, slippage past the floor costs nothing: the account is gone and Lucid absorbs the loss.
**Measured and user-confirmed (27 Nov):**
- The user's real market-order slippage averages about **1.2–1.3 ticks** per side. 1.5 is kept deliberately conservative ("rather assume harsh").
- **09:30 open, measured from the user's NQ trade prints:**
- first-second half-spread plus the cost of sweeping several levels with a 4-lot;
- about 0.9–1.6 ticks per side in 2022–25 and about **2.5 in 2026** (high volatility);
- from 5 to 60 seconds after the open, the half-spread is 0.5–0.9 ticks (1.3 in 2026).
- The user chose 2.0 at 09:30 as the compromise.
- Effect of the 09:30 change: NQ net per funded $535 → $522 (2020–24) and $328 → $312 (2015–19). Book profit is unchanged in 2020–24 and about −$3k/yr in 2015–19. **Results in 8.1–8.5 predate it** (1.5 everywhere); from 8.6 on, the new rule applies.
- Opens of CL (09:00) and GC (08:20) are also market opens, but weren't measured and stay at 1.5.
- **Unrealised P&L never counts** for the evaluation target or the lock; the trade must be closed. The sim already requires this.
- **Liquidations do fill past the floor.** Undershoot is real and absorbed by Lucid. The sim books stops at exactly −room, which is conservative.
- Other firms: later, once there's more startup capital. Live-account valuation: later; for now the goal is reaching live consistently.
---
## 4. Theory established
1. **Martingale identity** (zero edge, no costs): E[total withdrawals] = starting balance − E[balance when the account ends].
- Payout size and the consistency rule change variance and the number of trading days, not expected value.
- Example: from the locked state, $500 withdrawals and $2,500 withdrawals both give $2,000 expected.
- **Corollary used in 8.8:** with zero edge, any direction rule costs nothing against a coin flip, and skipping days changes time but not expected value per account. A direction rule with a plausible prior is therefore a free option.
2. **Evaluation: bold, one-day play is right because of the trailing floor, not because the game is unfavourable.** Costs are only about 1 percentage point of pass rate.
- P(pass) = (50,000 − E[balance at failure]) / (53,000 − E[balance at failure]).
- Fair-game P(pass) is 40%; about 39% after costs.
3. **Funded, before the lock:** fair-game P(lock) = 2,000/4,100 = 48.8%.
- The $2,100 gap between the $48k floor and the $50,100 lock is the "price of locking".
- Aiming above the lock level on lock day dilutes that price: +$100 per funded account (8.2). **But at book level aiming exactly at the lock is better** (more payouts, faster slot turnover; 8.9b), so the overshoot is dropped.
4. **Costs make bold play right after the lock too.** With zero edge, total cost scales with 1/size, and the consistency rule needs at least 3 days per payout.
- **With a real edge this reverses:** smaller sizing and more trades.
- So validate the edge before choosing a sizing policy.
5. **Break-even edge** for a bracket with target T, stop R and round-trip cost c: a win-rate uplift greater than c/(T+R).
- On 4 NQ: about 1.5 percentage points for a $5,000 bracket, about 4.4 for $1,700, about 18.5 for $400.
- **Measure edges as pass-rate and lock-rate uplift against a random-direction baseline, not Sharpe.**
- 10 years ≈ 2,500 sessions, so a 95% CI is about ±2.5 points; about ±3–4 points for a rule that fires on 35–40% of days. Two years of data gives about ±6 points, so short samples can't confirm a 2–4 point edge.
6. **Jumps and gaps help.** If the account ends with an undershoot u past the floor and an overshoot o past the target: P(pass) = (2,000 + u)/(5,000 + o + u).
- Big jumps push P(pass) towards 50%, because the 3:2 target/stop imbalance stops mattering.
- In the funded phase, loss past the floor adds to the trader's expected value dollar for dollar. Lucid is effectively short a put at the floor.
- Entries just before scheduled releases showed no pass-rate gain (8.5). The funded-phase undershoot gain on news is still untested.
7. **Fewer contracts mean lower costs**, because the same dollar bracket becomes wider in points. The limit is resolving the bracket within the day.
- In the evaluation and before the lock, an unresolved day lets the floor ratchet, so high resolution matters there.
- After the lock, an unresolved day only costs time and one round trip.
8. **Skew:** NQ's negative skew should favour long-only, since down-jumps past the floor are free. **Tested 26 Nov and rejected:** always long +0.6 / −0.2 pts (log #46–60).
---
## 5. Research protocol
- **Samples:** development 2020–2024; stress 2015–2019 (low NQ volatility); **extra 2010–14** (NQ, CL, GC, SI only; regime caveat).
- **Holdout 2025–26: SPENT 27 Nov** on the Drive rule (8.8). The user decided holding out made little sense with dozens of strategies to come. NQ 2025–26 had already been seen by the user while designing.
- **Validation now rests on:**
1. Pre-registering each test (spec and pass criteria in the script docstring and a log row) **before** running.
2. **Logging every variant** in `code/RESEARCH_LOG.md` (rows #1–192 as of 27 Nov). Direction rules tested: 5 on 26 Nov (#46–61), the user's overnight idea (#62–65), 9 flow rules (#107–115), 2 gamma/DIX rules (#116–120), and the user's R2–R4 across 9 markets and 3 periods (#122–156).
3. **Replication on markets the rule wasn't designed on**, and on 2010–14.
4. **A higher bar for anything chosen out of many tries:** z ≥ 3 pooled, or a significant replication in an untouched market.
5. **Forward data from December 2026 onward is the new holdout.** Ask the user for monthly data updates and a log of live fills per signal.
- **Don't tune a rule after seeing its results** (thresholds, market order, entry minute). Any tweak is a new variant: log it and count it.
- **Re-test top results on fresh random seeds; compare variants only on shared, date-keyed coins.** Coins indexed by position in a session list are not paired across lists (log #66).
- **Book-level tests need ≥ 15 coin seeds.** One seed fixes the direction sequence for a whole period and the 12-month windows overlap, so per-seed ruin ranges from 4% to 69% (2015–19, $5k). Three seeds understated ruin by up to 3–4×.
- **Confidence intervals must respect overlapping accounts.**
- Use a moving-block bootstrap (≥21 sessions), month clusters (bracket tests) or year clusters, and always show a by-year breakdown.
- Pool markets with **joint calendar-month clusters**, because CL and GC share macro days.
- **Score direction signals per bracket first, then over the full lifecycle.** Report net per funded account **and** net per session (including skipped days), against both the coin-every-day baseline and a coin on the same days (to separate direction from day selection).
- **Check every feature's "known at" time against every entry time** (log #106: a daily forecast leaked into pre-open entries).
---
## 6. Data
Set `LUCID_DATA` to the data root (default `/home/claude/data`; **every script honours it now**). Layout:
```
<DATA>/nq_raw/NQ/{2015..2026}_1min_bars_data0.parquet (NQ.tar)
<DATA>/raw_<SYM>/<SYM>/{year}_1min_bars_data*.parquet CL GC NG ES BZ SI PL 6E (<SYM>.tar)
<DATA>/vix/VIX.csv VIX9D.csv VXN.csv (DATE,OPEN,HIGH,LOW,CLOSE; MM/DD/YYYY) <- vix_data.tar *_History.csv, renamed
<DATA>/vix/OVX.csv GVZ.csv (DATE,<NAME>) (latest files run to 25 Nov 2026)
<DATA>/extra/gex/option_gex_dix_data/DIX.csv date,price,dix,gex (SqueezeMetrics; 2011-05-02..2026-11-19, clean)
<DATA>/extra/of/order_flow_data/NQ_trades_0929-0932_2010-2014.csv.gz, NQ_trades_0930-0931_2022-2026.csv.gz
trade prints: price,size,side (B/A aggressor),instrument_id,ts_et
<DATA>/pre/{NQ,CL,GC,SI}/{2010..2014}_1min_bars_data0.parquet from pre-2015_raw_tar.lz4 via scripts/convert_pre2015.py
```
Run `python -I code/build_sessions.py` once (~30 s). It builds `sessions_multi.pkl` (NQ/CL/GC/NG, 2015–24, with forecasts and `entry_min`). **Rebuild after updating the code**: old caches lack `entry_min`, and the resolvers raise without it.
**Environment used 27 Nov:** Python 3.13, pandas 3.0.5, numpy 2.5, pyarrow 26 (install it), scikit-learn 1.9. All regression checks reproduce on these versions.
**Parquet columns:** `ts` (UTC), `ts_et` (naive ET, correct across daylight saving), `session_date` (Python `date`; bars from 18:00 ET belong to the next day's session), OHLC, `volume`, `instrument_id`, `is_roll`, `roll_gap`, `adj_add`, `adj_mult`. Prices are raw contract prices. **Bars are start-labelled:** the 09:30 bar covers 09:30:00–09:30:59, verified against trade prints.
**Data quality:** all instruments and years, 2010–2026: no NaNs, no duplicates, no malformed bars, every price on its tick grid.
**Quirks the loader handles:**
- Files aren't sorted, so the loader sorts by `ts`.
- Rolls happen mid-session on Sundays; the loader keeps only the new contract's bars.
- Holiday early closes: the loader exits one bar early.
- Exit is at the close of the 16:43 bar.
- Sessions with no US cash-session hours are skipped.
- Truncated final sessions are dropped (NQ and GC 2026 end 12 Nov 04:17 ET; data otherwise runs to mid-Nov 2026).
- CL never goes negative in April 2020, because the series rolled before the May contract expired.
- **Split years:** PL and SI split some years into `{y}_1min_bars_data0/1/2.parquet`. Always load with `sim.data.year_files(root, years)`.
**Pre-2015 files (June 2010 – Dec 2014):** converted from the user's CSVs. Additive roll adjustment computed from the price jump at each contract switch (`adjusted = raw + adj_add`, as in the 2015+ files; GC switches are about 12 minutes apart, so its gaps include a little market move). NQ's median session range then was 31–42 points, so a $5,000 bracket at 4 NQ leaves about 68% of brackets unresolved.
**Market opens** (volume spikes in the data; used as the "open" for opening rules):
| Market | Open (ET) | Prior "cash close" used by R4 |
|---|---|---|
| NQ, ES | 09:30 | 16:00 |
| GC | 08:20 | 13:30 |
| CL, NG, BZ | 09:00 | 14:30 |
| SI | 08:25 | 13:25 |
| PL | 08:20 | 13:05 |
| 6E | 08:20 (US open; London 03:00 is larger) | 15:00 |
**Instrument notes:**
- Hedging groups: ES with NQ (equities); SI and PL with GC (metals); BZ with CL (energies); 6E is its own group (currencies).
- **BZ and PL are thin on CME.** 7–8% of 09:30–16:00 minutes have no trade, so 1.5 ticks is doubtful at 4 lots.
- **BZ's continuous series flips between two contracts** (gaps up to about $6). Any cross-session price feature must use `adj_add` / `adj_mult`, or a same-contract check as `strat_test.py` does.
- NQ/ES miss about 15 minutes between 16:00 and 16:43: the 16:15–16:30 equity halt. Expected.
**Volatility indices:** daily CBOE data. Only the previous day's close is used, to avoid look-ahead. VIX9D starts January 2011 and is missing 33 US holidays after 2022; the code uses the latest date where both indices exist. GEX/DIX likewise: the latest date strictly before the session.
**Price level:** NQ was about 1,800 in mid-2010, 4,400 in 2015 and about 28,000 in 2026. Its median session range in 2020–24 was 210–340 points (60 points in 2015).
---
## 7. Code
### `code/`
**Core simulator (`sim/`)**
| File | Purpose |
|---|---|
| `sim/data.py` | Loads and cleans bars. `year_files(root, years)` loads all chunks per year. `session_list(df, entry_min)` returns bars from the entry bar, plus `entry_min`. |
| `sim/bracket.py` | `Instrument` specs (`slip_ticks` 1.5, `open_slip_ticks` 2.0). `INST` holds NQ, GC, CL, NG, ES, SI, PL, BZ, 6E, with a tick-value guard. `entry_slip(inst, s)` charges 2.0 at 09:30 and 1.5 otherwise, and raises if `entry_min` is missing. The reference bar-loop `resolve()` needs bars starting at the entry bar. |
| `sim/fast.py` | `resolve_fast()` (**verified identical to `resolve()`** on 40k cases at 09:30 and on 10k at 09:30/10:00). `n_contracts`, and the parametric `run_eval` / `run_funded`. **A session dict may carry `inst`, overriding the instrument per day** (multi-market accounts). `prep()` copies `entry_min`. |
| `sim/lucid.py` | Rule constants, `eod_floor`, and the original reference lifecycle. |
| `sim/forecast.py` | Session-range forecast known at entry. Walk-forward (each year fitted on the previous 3) or a single fixed fit. `INST_COLS`; `REAL` = realised-range features only. |
| `sim/portfolio.py` | Book simulator: `Eval` / `Funded` classes and `run_book` / `run_book_multi`, with purchase rules, lock days, payout-5 closure and gating. Single instrument per slot. |
| `sim/volsize.py` | Resolution-target sizer (rejected, 8.5). Uses `entry_slip`. |
**Checks (all pass as of 27 Nov)**
| File | What it checks |
|---|---|
| `t_base.py` | NQ baselines: **+$337 / +$419** at the 2.0-tick 09:30 cost (+$343 / +$430 before). |
| `verify_fast.py`, `check_multi.py`, `verify_book.py`, `diag_book.py` | Consistency checks: 0 mismatches; the book example still burns $10k in 21 days. |
**Sessions, policy and book scripts (zero-edge work, 26 Nov)**
| File | Purpose |
|---|---|
| `build_sessions.py` | Builds the multi-instrument cache. Entries: NQ 09:30, CL/NG 09:00, GC 08:20 ET. |
| `policy_lib.py` | NQ single-account helpers. |
| `search.py`, `confirm.py` | Policy search and fresh-seed re-test. |
| `per_instrument.py`, `book_*.py`, `funded_cap.py` | Zero-edge per-instrument and book work. `funded_cap.py dev\|stress` (~30 s) is the quickest final-model book run. |
| `vol_*.py`, `event_probe.py`, `probe_*.py`, `path_*.py`, `persist.py` (+ `RUN_PERSIST.md`), `night_size.py` | Earlier tests (8.1, 8.5). The closed path/persist/event scripts compute bracket distances by hand at 1.5 ticks and were not updated to the 09:30 rule. |
**New, 27 Nov (all pre-registered in their docstrings)**
| File | Purpose |
|---|---|
| `probe_gamma.py`, `gex_forecast.py` | Dealer-gamma / DIX tests and GEX as a range-forecast feature (8.6). ~35 s and ~10 s. |
| **`strat_test.py`** | **Strategy harness, NQ.** `features(df, open_min, cash_close)` builds bars at open−1..open+2, ATR14 and the prior cash close. `rules(F)` computes R1 (placeholder) to R4 and the cascade. `test_A` gives bracket uplift vs coin with month-cluster CIs. `test_B` runs the lifecycle against 30 date-keyed coin seeds with block CIs. `date_coins` makes coins paired by date. ~50 s. |
| `strat_cross.py` | R2–R4 on ES, CL, GC at their own opens (~50 s). |
| `strat_life.py` | Per-account lifecycle "trade only on R2 days" vs coin every day vs coin on R2 days. `runs()` handles skipped days and calendar time. ~90 s. |
| `strat_multi.py` | Multi-market Drive account M, plus confidence checks (joint-cluster pool, delayed entries). ~60 s. |
| `strat_more.py` | R2–R4 on SI, PL, BZ, NG, 6E (~50 s). |
| `strat_pre2015.py`, `strat_holdout.py` | 2010–14 test and the 2025–26 holdout test. ~20 s each. |
| `ind_lib.py` | Clock-aligned tf-minute bars on roll-adjusted prices; EMA ribbon, Stoch RSI, confirmed divergence, TTM squeeze; `grid()` gives the indicator state at each candidate entry minute. Reusable for any bar-indicator idea. |
| `dp_eval.py` | Evaluation-phase DP with simulation check (#184; `--restricted` = contracts and target only). ~4 min full, ~20 s restricted. |
| `book_recheck.py` | Book-level re-check of play settings across 2015–19 / 2020–24 / 2025–26 (#186–191; builds `sessions_recent.pkl`). ~4 min. |
| `book_overshoot.py` + `RUN_OVERSHOOT.md` | 15-seed overshoot decision run with paired block-bootstrap CIs (#192). User's machine; `--quick` smoke test. |
| `event_drive.py`, `jump_bound.py` | Drive at London open / releases / EIA (#180–182) and the release-jump feasibility bound (#183). |
| `ind_test.py`, `ind_cross.py` | Indicator-rule test (NQ/GC, 15/30/60 min, dev + replication, step-0 volatility check; ~1 min) and cross-market replication (~40 s). `ind_test.score_grid()` scores coin vs rule at arbitrary entry minutes. |
| `RESEARCH_LOG.md` | Every variant tested, with results. |
**To test a new strategy:** add its signal to `strat_test.rules()`, or write a direction array per session. Run `test_A` per market, then the lifecycle with `strat_life.runs()` (a skipped day means the session is absent from the list). For multi-market accounts, set `s['inst']` per session, as in `strat_multi.py`.
### `scripts/` (helpers outside `code/`; they find `code/` relative to themselves and read `LUCID_DATA`)
| File | Purpose |
|---|---|
| `convert_pre2015.py <csv_dir> <out_root>` | Converts the user's pre-2015 CSVs to the project's parquet layout. |
| `open_slip.py`, `open_slip2.py <trades.csv.gz>` | 09:30 spread and 4-lot sweep cost from trade prints (`open_slip2` is the final 10 ms method). |
| `slip_sens.py`, `per_acct.py`, `with_old_slip.py <script> <args>` | Slippage sensitivity, old vs new cost per account, and running any script at the pre-27-Nov cost. |
| `strat_robust.py` | R2/R3 delayed entries and long vs short split on NQ. |
**Policy parameters** (dict): `n_eval/k_eval`, `n_pre/k_pre`, `n_post/k_post`, `overshoot`, `f_post`.
- `n_*` = fixed contract count.
- `k_*` = volatility rule: use the fewest contracts with bracket width (points) ≤ k × forecast range, clipped to 1–4.
- **Recommended policy (from 27 Nov):** `dict(k_eval=0.7, k_pre=0.7, k_post=0.7, overshoot=0)` (`book_multi.NEW`). Results logged before #192 used `overshoot=1000`.
- Optional hooks (backward compatible): `sizer` (run_eval/run_funded), `sizers` (book classes), `n_pre_key` (per-session pre-lock count).
**Fills:**
- Entry at the open of the entry bar, plus slippage against you (2.0 ticks at 09:30 ET, otherwise 1.5).
- Target: market exit at the trigger price − 1.5 ticks; if the bar gaps through the target, fill at the open.
- Stop = account floor, with P&L = −room.
- If stop and target hit in the same bar, the stop is assumed first (never occurred at these bracket sizes).
- End of day: flat at the 16:43 bar's close, minus 1.5 ticks.
- One trade per day.
**Funded-account target logic:**
- Before the lock: target = $52,101 + overshoot − balance.
- After the lock: target balance B* = max(cycle start + largest day/0.4, $52,100 + cap). Daily target = max(min(B* − balance, f × 0.4 × (B* − cycle start)), $50).
- Withdraw the full cap as soon as eligible.
---
## 8. Results (zero edge unless stated; 8.1–8.5 at 1.5 ticks everywhere)
### 8.1 Range forecasting (session range from entry to 16:44)
- Walk-forward 2018–24. Improvement in squared error over realised ranges alone (recent 1/5/22-day ranges + overnight range), with significance tests:
- **NQ:** + VXN + VIX9D/VIX ratio: +4.6% (t = 3.5). + weekday: +2.0% (t = 2.5). **+ GEX rank: +2.3% (t = 3.1), see 8.6.**
- **GC:** weekday +5.9% (t = 5.1; Mondays about 18% quieter). GVZ +3.4% (t = 2.0).
- **NG:** weekday +4.1% (t = 3.4; Thursday storage report). OVX useless.
- **CL:** nothing significant.
- **Implied volatility never substitutes for realised ranges.** VXN alone is worse than VIX9D alone (horizon matters more than the index).
- Typical forecast error is 0.38–0.45 in log terms, so the 95% floor is about half the forecast. Forecast refinements barely change contract counts.
- **CVOL data isn't worth buying.** An event calendar is the most promising next feature.
### 8.2 Single-account policy (NQ, net per funded account; fresh seeds)
| Policy | 2020–24 | 2015–19 |
|---|---|---|
| 4 NQ, no overshoot | +$342 | +$267 |
| Fixed 2 NQ, no overshoot | +$405 | +$191 (pass rate 32.6%, 16 days) |
| Fixed 2 NQ, overshoot $1,000 | +$509 (+$103 vs fixed 2 NQ, CI +63 to +145) | +$237 |
| Volatility k = 0.7, overshoot $1,000 (previous recommendation) | +$507 | +$312 |
| **Volatility k = 0.7, no overshoot (adopted 27 Nov: better at book level, 8.9b)** | **+$413** | **+$294** |
- Overshoots of $1,000–2,000 perform about the same.
- Smaller post-lock targets (f < 1) are worse.
- Volatility sizing matches fixed 2 NQ in 2020–24 and is clearly best in quiet regimes.
- Seed sets move this by ±$50–60; with the 2.0-tick 09:30 cost and K=30 seeds: $522 dev, $312 stress.
### 8.3 Per instrument (net per funded account; old policy vs recommended)
| | NQ | CL | GC | NG |
|---|---|---|---|---|
| 2020–24 | $323 → **$485** | $280 → $388 | $212 → $271 | $157 → $204 |
| 2015–19 | $287 → $328 | $240 → $331 | $191 → $161 | −$52 → **−$60** |
**NG has been dropped.**
### 8.4 Book-level results
Setup: 12-month windows, 208 windows × 3 seeds, 10 slots, ≤5 funded, $150 fees upfront, payouts arrive 2 sessions after approval, ruin = cash + pending < $150 with no open accounts.
- **NQ-only books are highly correlated.** Fresh evaluations with the same direction pass or fail together. One sample run burned $10k in 21 days.
- **The user's earlier setup** (10 slots: 4 NQ, 3 GC, 2 CL, 1 NG; buys into every empty slot):
- 2020–24 P(ruin): 66% / 42% / 25% / 16% at $5k / 10k / 15k / 20k.
- The same rule with 10 NQ: 76% / 55% / 42% / 31%.
- **Cash-scaled buying** (`fill='cash', m_cash=20`): one evaluation is always allowed while cash ≥ $150; each additional concurrent evaluation needs cash ≥ 20 × $150 × (running evaluations + 1). Slots are filled alternately across instruments.
- This cuts ruin sharply **and** raises mean profit.
- Allocation 4 NQ / 3 GC / 3 CL (CL replaces NG; slightly better than 4/3/2/1 in both periods).
- **Final realistic model** (cash rule m = 20, 14-day lock, payout 5 closes the whole book, $900 buyouts, payout 5 requested at once), **15 seeds, no overshoot** (log #192):
| Bankroll | 2015–19: P(ruin), mean $/yr | 2020–24: P(ruin), mean $/yr | 2025–26: P(ruin), mean $/yr |
|---|---|---|---|
| $5k | 36%, $26k | 28%, $62k | 30%, $53k |
| $10k | 17%, $38k | 11%, $82k | 6%, $81k |
| $20k | 7%, $52k | 2.5%, $100k | 0.1%, $98k |
- With the old $1,000 overshoot (15 seeds): 43% / 21% / 8% ruin and $24k / $36k / $48k (2015–19); 29% / 11% / 3% and $53k / $73k / $92k (2020–24).
- **All other book figures in this document and in log rows before #192 used 3 seeds and are unreliable as levels** (the earlier '2015–19 $5k ruin 11%' was 43% with 15 seeds). Directional conclusions from paired comparisons below are probably right but not re-verified.
- Compared with "other accounts keep trading at payout 5", the whole-book closure costs about 20% of yearly profit, with ruin almost unchanged.
- The 14-day lock alone costs about 10%.
- **Gating the payout-5 request** (stop buying once any account has 4 payouts; request payout 5 only when no evaluations are open) adds only about $1–2k/yr. It's nearly break-even.
- m = 40 cuts ruin further (4.2% → 1.1% at $20k) but lowers profit by about $12–16k/yr.
- **Outcomes are bimodal:** P(loss) ≈ P(ruin).
### 8.5 Structural ideas tested 26–27 Nov (zero edge)
Framing: with zero edge, each account's value is largely fixed by the martingale identity. What remains is structure: price jumps, losses past the floor (Lucid is short a put struck at the floor), fixed terminal amounts at book closure ($900 buyout, refunds, forfeitures), and whichever book constraint binds.
- **Entries just before scheduled releases:** no pass-rate gain (log #1–8).
- **The 5-funded cap binds above about $20k.** At $20k: 5 funded on 52% of days, a pass waiting in reserve on 45%. Profit/yr levels off at about $88–89k. Above $20k the scarce resource is funded-slot-days, not cash.
- **Pausing evaluation purchases while passes wait (rejected)** (log #9–11).
- **Resolution-target sizing (user's idea; rejected).** Slightly better per account, worse per day and at book level. **Lesson: with the funded cap binding, judge sizing by book profit (or net per day), not net per funded account.** k=0.7 stays.
- **Pre-registered direction/timing rules (26 Nov; none adopted):** always long, fade gap, fade prior session, fade 5-session move, follow the first 30 min (log #46–61).
- **User's NQ long-overnight / short-day strategy (rejected).** It loses as a market strategy, and the bracket uplift isn't significant (log #62–65).
- **18:00 entry: regime-dependent, not adopted** (log #66–79).
- **Path shape instead of direction: closed, no signal** once look-ahead was fixed (log #80–106).
- **Calendar/flow rules (idea #5):** 1 of 9 passed (pre-holiday long at 18:00), and it fails multiple-testing correction. Usable only as a free tiebreaker (log #107–115).
### 8.6 Dealer gamma and DIX (27 Nov; log #116–121)
Pre-registered: NQ 09:30, regime = trailing-252 percentile rank of GEX or DIX from the prior day, fixed terciles; 2015–24.
- **Direction and path-shape tests all fail, though all lean the predicted way:**
- trend vs chop, low vs high GEX: +1.55 [−0.31, +3.38];
- GEX<0 vs GEX≥0: +1.33;
- fade the gap in high GEX, follow it in low: +1.51 [−0.49, +3.62];
- DIX high long / low short: +0.91.
- **GEX carries range information (PASS):** high-GEX days realise about 8% less range than forecast (+7.9 [+2.9, +13.0], 8/10 years); unresolved brackets are 23% vs 9%.
- As a forecast feature: +2.3% squared error (t = 3.1), mostly from 2020. It changes k=0.7 counts on only 6% of sessions, so it is **not wired in** (expected value too small to measure).
- Not pre-registered and not tested: long-minus-coin is +1.6 in low GEX and −1.2 in high.
### 8.7 Execution at the 09:30 open
See section 3. Measured with `scripts/open_slip2.py`; the 2025–26 prints were used for cost only.
### 8.8 User strategy: opening rules (27 Nov; log #122–156)
**Rules** (`strat_test.py`), at each market's open (09:30 for NQ), entry at the **open of the bar 3 minutes after the open** (09:33 on NQ), bold bracket, k=0.7:
- **R2 "Drive":** move = close(open+2) − close(open−1). It fires if |move| ≥ 5% of ATR14 and give-back ≤ 25%, where give-back = (extreme − close(open+2)) ÷ (extreme − close(open−1)) and the extreme is taken over bars open..open+2. Trade in the direction of the move. ATR14 = mean true range of the previous 14 full sessions; the prior close is used only if the contract is unchanged.
- **R3:** the three bars open..open+2 all close the same way; follow them.
- **R4:** the open bar's close vs the prior cash close: above → short, below → long.
- The user's sheet chains them R1 → R2 → R3 → R4. R1 is discretionary and not tested.
**Per-bracket uplift of R2 vs a coin flip on the same days** (implied P(pass) points, 95% month-cluster CI):
| Market | 2010–14 | 2015–24 | 2025–26 (holdout) |
|---|---|---|---|
| NQ | +1.1 [−1.1, +3.5] (68% of brackets unresolved) | **+3.86 [+1.43, +6.38]** (design period) | +2.5 [−2.7, +7.8] (seen by user) |
| CL | +4.8 [−0.4, +9.8] | **+3.75 [+0.63, +6.90]** | +2.7 [−4.7, +10.0] |
| GC | −0.1 [−4.8, +4.6] | **+4.52 [+1.34, +7.75]** | −4.9 [−12.9, +3.6] |
| ES | – | +1.42 [−0.79, +3.62] | – |
| SI / PL / BZ / NG / 6E | SI +0.85 | +1.13 / +1.30 / +1.47 / +0.30 / −0.94 (pooled +0.81 [−0.32, +1.96]) | – |
| **Pooled (pre-registered primary)** | NQ+CL+GC **+1.90 [−0.14, +3.98]**: inconclusive | CL+GC **+4.09 [+1.91, +6.26], z = 3.6** | CL+GC **−0.28 [−6.25, +5.94]**: not confirmed |
- **R2 robustness (2015–24):**
- NQ keeps its edge with the entry delayed to 09:34 / 09:35 (+3.6 / +4.0).
- CL and GC lose about a third with a 1–2 minute delay, so enter promptly.
- Longs are stronger than shorts (NQ +4.5 vs +3.1).
- **R3:** +3.6 on NQ, but 510 of its 651 days are R2 days and the two never disagree. Weaker with a delayed entry; positive but not significant elsewhere.
- **R4:** nothing on any market. On NQ in the lifecycle it costs −$136 per funded (2020–24). **Drop it.** The R2→R3→R4 cascade fails because R4 dilutes it.
**Per account (2015–24, full lifecycle, k=0.7 + $1,000 overshoot, same purchase dates)**
| | Coin every day | Trade only on R2 days | Difference [block CI] | Sessions per funded |
|---|---|---|---|---|
| NQ | $384 | $797 | +$413 [+83, +725] | 7.2 → 19.0 |
| CL | $325 | $1,018 | +$693 [+338, +1,046] | 6.6 → 21.5 |
| GC | $219 | $743 | +$524 [+209, +902] | 7.1 → 26.2 |
| ES | $144 | $293 | +$149 [−52, +391] | 7.9 → 18.8 |
- The gain comes from direction (vs a coin on the same days: NQ +308, CL +738, GC +433), not day selection.
- **Net per session is flat**, because accounts take about 3× longer.
**Multi-market Drive account M** (one account; the first R2 to fire of GC 08:23 → CL 09:03 → NQ 09:33; at most one trade per day; trades on 64–72% of sessions):
| Period | Net per funded: NQ coin → M | M − base [CI] | M − coin on same days | Net per session |
|---|---|---|---|---|
| 2015–24 | $384 → $674 | +$289 [+65, +516] | +$343 [+120, +561] | $53 → $64 |
| 2010–14 | $29 → $510 | +$481 [+156, +797] (mostly from trading CL/GC at all) | +$259 [−32, +546] | $2 → $41 |
| 2025–26 | $478 → $715 | +$237 [−372, +661] | +$194 [−300, +535] | $80 → $77 |
**Assessment given to the user (27 Nov):**
- About **60–65%** that R2 has any real edge. If real, expect about **+2–3 points** per bracket, not the 4 measured.
- **CL is the most consistent market** (positive in all three periods; picking it out post hoc is itself a selection). GC looks unreliable. NQ evidence is mostly from the design period.
- **Practical use: a free option.** Under zero edge, replacing the coin with R2 costs nothing, and skipping non-signal days costs only time. Using R2 for direction on CL and NQ is reasonable; don't count on the simulated +$300–700 per account.
### 8.9a User idea: EMA ribbon / Stoch RSI divergence / TTM squeeze (27 Nov; log #157–179; CLOSED by the user)
- Structure A (indicators pick the time and direction of the one daily bold bracket), NQ and GC. The user had never looked at these on charts, so every period was clean. Definitions in `ind_lib.py`; look-ahead check passed.
- **Primary 30-min: all 10 direction tests failed.** Divergence and ribbon-at-open showed nothing at any timeframe.
- One robustness pass: **NQ 15-min squeeze fire agreeing with ribbon** (+4.5 dev, +3.5 replication). Cross-market replication passed barely (ES+CL+SI +1.8 [+0.08, +3.52]), carried by ES (+3.9); nothing in commodities (CL +0.5, SI +1.7, GC +0.8). Inconsistent across timeframes on NQ. Assessed at 45–55% real for equity index futures.
- The user judged it not promising and moved on. If revisited, test it as a second signal source in the multi-market Drive account (NQ only, since NQ and ES share a hedging group).
- Squeeze as a volatility signal: on GC, about 11–15% more range than forecast after a fire; no change in resolution rate. Too small to matter for sizing.
### 8.9b Play settings re-checked at book level (27 Nov; log #184–191)
- **Evaluation DP (#184):** the current rule is effectively optimal. Simulated gains −1.4 to +0.3 pts. Unrestricted DP optima above the 40% ceiling were model exploits; verify any DP optimum by simulation on real sessions.
- **Overshoot (#185–192): DROPPED.** Per account it adds about $100 but cuts P(first payout) from 18% to 15% (the user's concern). At book level with 15 seeds, aiming exactly at the lock earned more in all 9 period × bank cells: 2020–24 +$8.2–8.7k/yr (CIs above 0), 2015–19 +$1.7–3.4k, 2025–26 +$3.0–9.5k (CIs include 0, 46 windows); ruin equal or lower; payouts/yr +15–20%. The strict pre-registered criterion was not met (2025–26 CIs), so it was the user's call, and the user adopted it.
- **Post-lock pace f=0.5: rejected at book level in all three samples.** k=0.5 / 1.0: mixed, no change.
### 8.9 Recommendations given to the user
1. Use the volatility-sized policy (k = 0.7) and aim exactly at the lock on lock day (no overshoot; adopted 27 Nov, 8.9b).
2. Allocate 4 NQ / 3 GC / 3 CL (no NG) for books.
3. Use cash-scaled evaluation buying (about $3,000 of cash per concurrent evaluation, never fewer than one).
4. Hold a bankroll of at least $10k ($20k comfortable). $5k goes broke 28–36% of the time in every regime (15 seeds).
5. When to request payout 5 depends on whether a live account is worth more than $900. If it is, request at once; if the user would take the buyout anyway, gating helps slightly.
6. Test with 1.5 ticks (2.0 at 09:30); keep logging real fills.
7. Use R2 (Drive) as the direction rule where it fires, especially on CL and NQ, as a free option. Drop R4. Log live R2 trades for forward validation.
---
## 9. Open items / next steps
- **Closed ideas, don't retest:** everything in 8.5, GEX/DIX direction (8.6), and the indicator idea (8.9a), apart from the noted 15-min equity lead.
- **Next: the user's further strategies** (dozens planned). Use the harness and protocol in sections 5 and 7: pre-register, per-bracket uplift, replicate in untouched markets and 2010–14, then per-account lifecycle (net per funded and per session).
- **Forward validation:** monthly data updates from December 2026 (the new holdout) and the user's live-fill log per signal.
- **R2 follow-ups (each a new, logged variant; don't tune on seen data):**
- CL-first ordering of the multi-market account;
- 6E at the London 03:00 open (untested);
- book-level test of the multi-market account (deferred by the user).
- **Value-per-slot-day table** (explained to the user 27 Nov; deferred). It matters only when the 5-funded cap binds (bankroll ≳ $20k). It would drive a queue-aware funded policy (maximise value − ~$170 × days while a pass is queued) and the payout-5 timing option.
- **Value a live account** (start $0, $2k EOD drawdown, daily payouts, bonus) to settle the payout-5 timing decision.
- **Add an event calendar** (CPI, jobs reports, Fed, EIA, storage) for forecasting and for the funded-phase undershoot idea (section 4.6).
- **Verify with Lucid:** ES/SI/PL/BZ/6E commissions; whether staggered entry times within an instrument count as hedging (decorrelation).
- **Not modelled:** the 30-day inactivity rule (matters for skip-day strategies and parked accounts), microscalping/HFT checks, live-phase trading, taxes, the operational load of about 800 evaluations a year, correlation between the user's strategy directions across groups, and the value of accounts still open at the end of a window (conservative).
- **Parked by the user: payout-5 eligibility as an option** (needs the slot-day table).
- **Possible heavy runs on the user's hardware:** a full DP or wider policy search, a bootstrap by year, and slippage sweeps.