EN

The DHCS bot (Delta-Hedged Convexity Selling)#

If the TRPS bot lives on fifteen-minute windows, the DHCS bot has a single appointment a day — but the numbers have to balance to the decimal. The strategy from the DHCS page — front-month ATM/−1σ put, daily delta-hedging with Micro futures, monthly roll — translates into an architecture shorter and more relaxed than the one described in The TRPS bot, and the difference between the two bots is itself instructive: it replicates, at the software level, the comparison between the two strategies on the TRPS vs DHCS page. Here too, all times are in America/New_York.

The 15:45 ritual#

The heart of the bot is a single evening job, between 15:45 and 16:00, when options and futures are both liquid and closing prices are by then representative. The sequence, in the non-negotiable order learned in The TRPS bot: reconciliation (positions and orders against the journal, fresh data, margin), then the decision, then the execution, then the write-up.

Computing the delta. This is the mathematically delicate step, and it deserves detail. The delta of the options position can come from two sources: the model greeks the IBKR API provides with quotes, or an in-house calculation (Black-Scholes with the current IV of the strike). The bot does both and compares them: the primary source is the broker’s greeks — consistent with what the margin system sees — but the independent calculation serves as a sanity check, because greeks via API have their fragile moments (missing or plainly stale values in the frantic minutes). If the two estimates diverge beyond a tolerance, or if one of them is missing, the bot does not rebalance and notifies: better one evening of a slightly dirty hedge than an adjustment based on a made-up number. This is also where the refinement from the DHCS page returns: the nominal hedge can be topped up with the correction for the implied beta (vega·∂IV/∂S) — in my case a simple configurable multiplicative factor, modest by default, because decimal precision on an estimated residual is wasted elegance.

The rebalancing band. Once the delta of the options position is computed and the delta of the existing hedge subtracted (number of short MES × their unit delta), what remains is the uncovered delta. The bot doesn’t zero it at any cost: it rebalances only if the exposure exceeds a band — in delta (e.g. ±0.05 per equivalent SPX contract) or, equivalently, in notional. The band is the trade-off from the DHCS page between precision and costs made explicit: inside the band, the exposure is zero-mean noise not worth an order’s spread; outside, you adjust. The granularity of the MES ($5 per point, Futures page) makes the arithmetic gentle: the number of corrective contracts is the dollar exposure divided by (5 × index level), rounded — and the maximum rounding error, half a Micro, is by construction smaller than the band. With the ES at $50 per point the same arithmetic would produce coarse, stair-step adjustments: that’s why the Micro isn’t a fallback for small accounts but the right tool for the job.

The rebalancing band

A simulated monthly cycle: the uncovered delta (blue) wanders inside the band until gamma pushes it out; each red arrow is an MES order bringing it back to zero. Inside the band, the spread saved is worth more than the precision.

The execution. Orders on MES are aggressive limit orders near the mid (the Micro book during cash hours is deep and the spread minimal); the pathological case of a fill missed within a few minutes degrades to a market order, because here — unlike the 15 cents of TRPS — the economics of a single tick are negligible next to the cost of staying uncovered. Every execution updates the journal with the new state of the hedge, and the evening summary records the decomposition of the day’s P&L into its estimated components — theta collected, realized gamma cost (½·gamma·ΔS²), vega effect — which is the dashboard for understanding why the strategy is making or losing money, not just how much (DHCS page).

The monthly roll#

At 7-10 days to expiry (a configured parameter), the evening job adds a step: close the current put, open the next month’s at the strike matching the target delta (−0.25/−0.40, DHCS page), and recompute the hedge from scratch. Three implementation notes. First, the order of the legs: the old put is closed before the new one is opened — for a few minutes the portfolio is over-hedged (the short futures remain), which is the imbalance in the prudent direction; never the other way around. Second, sizing is recomputed at every roll on the current account value and the stress budget from the DHCS page (the simulated loss in the extreme scenario must not exceed the configured fraction): it’s the natural moment for the strategy to readjust to the capital, never doing so mid-cycle. Third, the roll is also the occasion for the regime check: the bot records current IV, term structure and premium collected, feeding the historical series I use to verify that the rate still pays for the risk (the IV/RV thermometer from the Volatility risk premium and Edge pages).

Why this bot can afford to be lazy#

Before the comparison, a note on how the band is chosen — the bot’s only truly “tunable” parameter, and therefore the only one worth spending method on. The right way isn’t optimizing on the backtest (Risk measures page: magic parameters are overfitting waiting to happen), but replay: you run the daily historical series of index and IV through the production code — the exact same code, not an imitation of it — and measure, for different bands, the trade-off between cumulative transaction costs and tracking volatility. The curve that comes out is flat over a wide range: between 0.03 and 0.08 of delta little changes; below, you pay spreads for nothing; above, the residual noise starts to weigh. The flatness is the news: where the curve is flat, the choice is robust, so you pick a central value and never touch it again. The replay also serves as a general shakedown: running it through a simulated March 2020 and August 2024 reveals more bugs than six months of quiet paper trading.

The comparison with The TRPS bot is the conceptual point of this page. The TRPS bot has critical appointments: if it misses the 16:00 window it loses the day; if it misses the 10:00 changing of the guard it leaves the positions with only the night guard past its shift. The DHCS bot doesn’t: if the evening job fails — Gateway down, house without power, a bug — the consequence is that the hedge stays yesterday’s, and the accumulated exposure is one extra day’s gamma: tracking error, not an emergency (DHCS page: the gap between rebalances is already part of the strategy’s design). The options position, at 20-30 days to expiry, has modest gamma; stops aren’t needed because the delta is hedged; and the futures market is open nearly 24 hours, so in the extreme case I make the adjustment myself from the app at any time (Principle 3). In design terms: the TRPS bot has to be punctual, the DHCS bot has to be exact — and exactness, unlike punctuality, tolerates postponement. What follows is an architecture without a state machine: a single idempotent job launched by systemd at the scheduled time, which retries later if it fails and, if it fails again, notifies and gives up, knowing that tomorrow’s delta calculation will absorb the backlog on its own. The reconciliation of Principle 4 remains sacred — it’s the one true prerequisite of every execution — but the dead-man switch here can afford relaxed thresholds: one ping a day, not one at every step.

The bad scenarios, for completeness. A partial fill on the roll (old put closed, new one not executed): the bot stays in the prudent over-hedged state and retries the opening the next day — a day of theta is lost, no risk is added. The intraweek vega spike (DHCS page): the bot has, deliberately, no automatic reaction logic — no VIX stop, no emergency de-risking — because every reactive de-risking rule I tested sold at volatility highs what should have been held until it came back in; the spike is absorbed by the sizing done upstream on the stress budget, and any extraordinary decision belongs to the human, informed by a phone notification when the mark-to-market loss crosses a threshold (the channel, status and halt commands included, is the same one shared with the TRPS bot: the Setup page and The TRPS bot). And the margin scenario: here too the what-if gates every order, but the delta-hedged position has the pleasant property (TRPS vs DHCS page) that the requirement stays relatively stable precisely because the futures offset the options in the model’s scenarios — the DHCS bot, in practice, has never seen a margin rejection under conditions where the TRPS one was struggling.

Educational content only, not financial advice. Selling options can lead to losses greater than the invested capital. Read the full disclaimers.
First site release: April 2026.