惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

www.infosecurity-magazine.com
www.infosecurity-magazine.com
D
DataBreaches.Net
T
Tailwind CSS Blog
M
MIT News - Artificial intelligence
Stack Overflow Blog
Stack Overflow Blog
F
Full Disclosure
V2EX - 技术
V2EX - 技术
N
News and Events Feed by Topic
Help Net Security
Help Net Security
L
LangChain Blog
Y
Y Combinator Blog
宝玉的分享
宝玉的分享
Google Online Security Blog
Google Online Security Blog
P
Proofpoint News Feed
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
T
The Blog of Author Tim Ferriss
Google DeepMind News
Google DeepMind News
The Register - Security
The Register - Security
B
Blog RSS Feed
N
Netflix TechBlog - Medium
N
News | PayPal Newsroom
TaoSecurity Blog
TaoSecurity Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
V
Vulnerabilities – Threatpost
B
Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
I
Intezer
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园_首页
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
AI
AI
aimingoo的专栏
aimingoo的专栏
大猫的无限游戏
大猫的无限游戏
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Cyberwarzone
Cyberwarzone
P
Proofpoint News Feed
Google DeepMind News
Google DeepMind News
G
GRAHAM CLULEY
Vercel News
Vercel News
罗磊的独立博客
MyScale Blog
MyScale Blog
Last Week in AI
Last Week in AI
博客园 - 司徒正美
C
CERT Recently Published Vulnerability Notes
GbyAI
GbyAI
Scott Helme
Scott Helme
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
T
Troy Hunt's Blog
A
About on SuperTechFans
P
Privacy International News Feed

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
I Backtested 96 SPY Put Credit Spread Strategies - Here's the Bug Log
tomasz dobro · 2026-04-29 · via DEV Community

tomasz dobrowolski

I built a backtest engine for SPY put credit spreads. 7 years of 1-minute option chains. 96 grid cells across (delta, DTE, profit-target, stop-loss). 16,024 trades that survived validation.

This post is the part most quant tutorials skip: the bugs, the lying simulators, and the one-line feature that humiliated my 3-layer composite signal. If you've ever shipped a backtest with great-looking numbers, you might want to read the bug log section.

The first lesson: mid-fill backtests are lying to you

The naive engine filled at the bid-ask mid. Numbers looked great. Then I implemented what an actual desk does - post a limit at combo_ask + $0.04, wait for someone to cross it, accept rejection - and CAGR dropped 30–60% across the entire grid. Several cells flipped from positive to negative.

Real fill stats from one run:

Run Posted Filled Fill rate Avg wait Edge captured
45Δ 30 DTE PT 50% No stop 479 112 23.4% 12.4 min −$0.04 to −$0.07
45Δ 30 DTE PT 50% SL 100% 633 155 24.5% 12.2 min −$0.04 to −$0.07
45Δ 30 DTE PT 50% SL 200% 383 64 16.7% 13.3 min −$0.04 to −$0.07

You fill ~20–25% of orders, after a ~12-minute wait, at 4–7 cents worse than mid. The MM doesn't make money at the fill - they make it over the hold, when theta beats realized vol. Any backtest filling at mid is silently gifting your strategy that 4–7 cents per trade.

If you remember nothing else from this post: build a real fill model.

The single biggest finding: SL=100% IS the strategy

Same cell. Same fills. Same period. Toggle the stop loss:

Configuration Trades Return CAGR MaxDD Calmar
10Δ 7 DTE PT 50% No stop - −100% wipeout breaker -
10Δ 7 DTE PT 50% SL 100% 460 +5,439% +66.0% 30.1% 2.19
10Δ 7 DTE PT 75% SL 100% 360 +2,947% +53.9% 31.1% 1.73
10Δ 7 DTE PT 25% SL 100% 649 +1,752% +44.6% 30.2% 1.48

+5,439% with a stop. −100% without. Same cell.

A single bad Monday on a no-stop short-vol position takes the account to zero. The stop loss isn't a parameter you sweep - at short DTE it's the entire risk model.

The trap nobody warns you about: SL=200%

I expected SL=200% to be the sensible compromise. Looser than 100% so I don't get noise-stopped, tighter than no-SL so a tail doesn't kill me. Wrong:

SL setting Trades Return CAGR Sharpe MaxDD
No stop 112 +30.6% +3.8% +0.23 30.1%
SL 100% 155 +28.0% +3.5% +0.22 29.3%
SL 200% ← trap 64 −16.5% −2.5% −0.17 31.2%

Both no-stop and SL=100% made money. SL=200% lost.

Mechanics: by the time the loss has grown to 200% of credit, you're deep ITM and gamma is doing the marking, not theta. You stop out at the worst possible price, on the worst possible day, after letting the position breathe past the point of recovery. SL=100% stops you before gamma takes over. No SL at least gives you the chance to be bailed out by a recovery.

Pick tight or pick none. Never the middle.

My fancy signal got beaten by a one-liner

I built a 3-layer composite - Premium / Danger / Stabilization scores, z-scored macro inputs, continuous Kelly multiplier. Then I ran t-tests across all 16,024 trades.

The strongest predictor in the entire feature set wasn't my composite. It was a single boolean flag on a free macro series - the kind of thing you write in three lines of pandas:

# pseudocode - the actual flag stays with me
signal_on = (macro_series.diff(5) < 0) & (macro_series < macro_series.rolling(20).mean())

Enter fullscreen mode Exit fullscreen mode

t-stat over 8, on 5,000+ trades. Bonferroni-correct it across the entire feature space and it still wins.

The lesson generalizes: if your "edge" is a 47-feature gradient-boosted model, replace it with the most economically obvious single flag and check how much you actually lose. Often that flag does 80% of the work and your model is overfitting the residual.

Two related findings worth knowing:

  1. The market pays the most right before it bites. Top-quintile VRP days had 66% winrate vs 74% baseline. By the time premium is that rich, something is actually wrong.
  2. Don't sell into rising fear with an inverted term curve. Wait for the curve to normalize OR for the fear to fade. Either is fine. Both being wrong is the worst regime in the data.

Multi-DTE pooling cost me 9pp of CAGR

Seemed obvious: instead of committing to one tenor, rank candidates across 30/45/60-DTE chains every entry, pick the best EV-per-dollar-at-risk:

Tenor selection Trades Return CAGR Sharpe MaxDD
Pool 30/45/60 DTE No stop 112 +30.6% +3.8% +0.23 30.1%
Pool 30/45/60 DTE SL 100% 155 +28.0% +3.5% +0.22 29.3%
Focused 30 DTE No stop 82 +70% +12.5% +0.72 27.5%

The ranker correctly picked 30-DTE ~68% of the time. The other ~32% it picked 45-DTE specifically because the 30-DTE chain looked worse than usual that bar - which is the textbook definition of adverse selection.

More degrees of freedom = more ways for the optimizer to be wrong, not more ways to be right.

The bug log

This is the part most quant blogs skip. Every one of these bugs would have inflated the headline numbers. Most were caught only after a code review:

Bug What it did Damage
Mid-fill assumption Filled at bid-ask average always Flipped multiple losing strategies positive
Look-ahead in signal Day-D signal used end-of-D data at 10:05 AM entry Inflated CAGR ~5–10pp on most cells
Stale-quote acceptance "Fills" at quotes that were no longer real liquidity ~30% of fills had negative edge captured
EV-sorted tiebreak Higher-EV candidate "filled" first when two crossed same bar Subtle but real per-trade lift
Warmup sizing bug Full Kelly applied before signal had any history Cratered 2018 results
Validation walk-back mismatch Validator used exact-date lookup, engine walked back 7 days Bogus regression stats on weekend dates
Walk-the-limit (rejected) Drop limit a penny each minute if unfilled Caught before merge - adverse selection

The pre-fix engine on the same data returned −1% to −8% CAGR across every cell. So when post-fix numbers turned positive, that wasn't simulator noise - it was what the bias was masking.

If your backtest looks great on the first run, you have a bug. Find it.

The sizing layer

SIZING = {
    "kelly_default": 0.05,         # half-Kelly, conservative on purpose
    "kelly_max": 0.25,
    "kelly_f_hard_cap": 1.0,       # leveraged math can multiply to 1.25 without it
    "drawdown_breaker_pct": 0.30,  # halts the run, not the position
    "absolute_floor_pct": 0.50,    # secondary backstop
    "warmup_multiplier": 0.0,      # cratered 2018 when this was 1.0
    "vrp_on_mult": 1.0,            # 2.5 in the leveraged stress test
}

Enter fullscreen mode Exit fullscreen mode

Half-Kelly is conservative on purpose. Mean-variance Kelly assumes Gaussian returns; short-vol returns are skewed left with fat tails. The "true" Kelly under fat tails is below the mean-variance Kelly, so half-Kelly isn't lazy - it's roughly correct.

The 30% drawdown breaker doesn't reduce position size or pause for a day. It halts the entire run. If your strategy needs 30% drawdown to work, you don't have a strategy, you have a martingale.

TL;DR

  • Mid-fill backtests overstate CAGR by 30–60%. Build a real fill model.
  • Stop loss at 100% of credit IS the game at short DTE. +5,400% with, −100% without.
  • SL=200% is worse than no stop. Pick tight or pick none.
  • The strongest signal in 16k trades was a one-line boolean flag.
  • Multi-DTE pooling cost 9pp of CAGR. Adverse selection.
  • Higher delta moves equity vol, not alpha.
  • The market pays the most right before it bites.
  • If your backtest looks great on the first run, find the bug.

The full write-up with all 96 cells, the leveraged stress preset, and where the Calmar-leader cell sits in the grid is on FlashAlpha: original article.

The actual constraint on reproducing this isn't the engine (the engine is bookkeeping) - it's having minute-resolution SPY chains going back to 2018 with surface-consistent IVs. That's what FlashAlpha's Alpha tier historical API is for.