The CTA bot (trend following on futures)#
If the TRPS bot lives on fifteen-minute windows and the DHCS bot on an evening ritual that must balance to the decimal, the CTA bot has a single appointment a day, in mid-morning, and the virtue asked of it is neither punctuality nor exactness: it’s constancy. The strategy of the CTA trend following page — the ensemble of 1/3/12-month signs, vol scaling, a non-trading band on fifteen or so futures — is the slowest of the three, and its bot is accordingly the calmest: it runs now alongside the other two, on the same mini PC, the same Gateway, the same notification channel and the same kill switch of the Setup page, and it applies the same four principles of the Execution page. What it adds is scale: fifteen markets instead of one, four exchanges, a calendar of expirations that never coincide — and that’s where the architecture earns its page. As always, all times in America/New_York.
One cycle a day#
The appointment is at 10:30, a time chosen by subtraction: away from the opening bell and from the TRPS stop cycle, away from the evening windows where the DHCS ritual, the TRPS selection and the rolls crowd together, inside the liquid hours of every exchange in the universe. The luxury of affording a comfortable time comes from the signal’s slowness: the calculations use yesterday’s closes — a twelve-month signal withstands a one-month delay almost without degradation, let alone half a day (Hurst and coauthors) — so the mid-morning execution chases nothing and nobody.
The cycle’s sequence is fixed: data, signals, plan, rolls, risk, orders, write-up. The bot updates the contracts’ historical series, computes each instrument’s three signs and volatility, produces the quantized target position, compares it with the actual position and lets through the non-trading band only the deviations that exceed it: on a typical day the plan is empty or nearly so, and that’s the design behavior — evaluation is daily, effective trading has a near-monthly frequency. The orders that survive the band are limit orders at the mid, stepping one tick at a time toward the executable price, never market orders; an order still unfilled at the end of the window is simply cancelled, because the signal is slow and losing a day costs less than a chased spread — tomorrow the cycle recomputes everything from scratch and, if the deviation is still there, tries again. At the end of the cycle, a single recap on Telegram: target versus actual positions, trades executed and trades blocked (by the band, by the caps, by the risk checks), signals per instrument, any declared degradations. One message a day, not a stream: alert fatigue is an operational risk like any other.
The roll, from service to engine#
The bot was rolling futures before this strategy existed: the quarterly roll of the night-guard contracts, the roll of the DHCS hedge — service functions, one contract at a time, described on the Futures page. The CTA leg promotes that infrastructure to engine. For fifteen markets the bot maintains the expiration calendar and selects the front contract with a configurable days threshold per instrument; on physical commodities — gold, silver, copper, WTI, the grains — the roll happens strictly before the first notice day, because past that date the contract stops being an exposure and becomes a delivery, and a retail trader doesn’t sign for barrels. The roll is position hygiene, not a signal: it doesn’t pass through the non-trading band, it closes the old contract and reopens the same size and the same sign on the new one. With a single common-sense exception: the rebalancing plan is computed before the roll, and an instrument that today has to be taken to zero anyway doesn’t get rolled — it’s closed directly on the contract in hand, one round of spread saved.
Beneath the roll lives the data structure that makes the signal possible: the continuous return series. At the contract change you concatenate returns — the change of the new contract on its own closes — never prices, so the jump between old and new never enters the signal and the series measures what a rolled position would actually have returned. It’s the accounting detail everything else rests on; getting it wrong produces phantom trends at every expiration’s roll, and no downstream chart would ever notice.
The leg’s guardrails#
What keeps fifteen markets from becoming fifteen different ways to get hurt? The bot’s global guardrails — the margin gate with its what-if, the daily order cap, the circuit breaker on the account value, the kill switch — apply to the CTA with no exemptions, and the leg’s dedicated caps can only tighten, never loosen.
The risk budget, in volatility. Each instrument has its budget (around 2% of the leg’s capital), each sector a ceiling on aggregate exposure — the defense against the false diversification of a portfolio that looks broad and is all one bet on energy — and the whole leg an overall cap defined in volatility: the sum of the positions’ annualized dollar vols doesn’t exceed half the leg’s capital. The definition in vol is not pedantry: a two-year Treasury contract has an enormous notional and a minuscule risk, and a cap on notional would punish it for the wrong reason; the cap in vol measures the same quantity the positions are sized with, and stays identical if one day the contract size moves from micro to standard.
The drawdown brake. If the leg’s P&L falls more than 15% from its peak, the budgets are halved until the drawdown comes back under half the threshold. It’s a rule written before starting, with only one possible direction — reduce — and it exists to take away from me the trade’s most dangerous decision: the one made in the middle of a drawdown, with the history of failed CTAs there to testify how that ends.
Vol targeting. Above everything, the portfolio multiplier of the CTA trend following page: the leg’s realized vol above the 10% target → sizes down, below → sizes up, with a cap at 1.5 and a floor at 0.5. It’s the only “regime” automatism the design allows, because it has no free parameters and can only dampen.
A simulated year of the leg: when realized volatility (top) rises above the target, the leverage multiplier (bottom) falls in proportion, down to the floor; the cap at 1.5 blocks the opposite euphoria in placid regimes. De-risking with no parameters and no opinions. Illustrative numbers.
The kill switch, no exceptions. It’s worth stating, because the choice isn’t obvious: with the kill switch active the CTA bot places no order, not even those that would reduce risk. The positions stay covered by the caps, and the kill is an operator’s event, not an algorithm’s; a system that grants itself “prudent” exceptions to its own emergency stop has a paper emergency stop.
Failing gracefully#
And when something breaks? The multi-market scale shifts the center of gravity of failures: this bot’s characteristic risk is not the wrong order but the wrong bookkeeping. With three strategies holding futures in the same account, every position must have an owner: the internal ledger attributes each contract to its strategy, and the exclusion of ES and MES from the CTA universe — a design decision, not a matter of taste — means that on every symbol of the leg the only possible owner is the leg itself. Every morning the bot reconciles the ledger against the broker’s actual positions, symbol by symbol: an unexplained discrepancy produces a critical alert and the suspension of new orders on that symbol until the discrepancy is understood — never trade on an inventory you don’t trust, which is Principle 4 applied at scale. In the same family is the metadata check: each contract’s multiplier and tick declared in the configuration are verified at every startup against the broker’s, because sizing a position on the wrong multiplier is the stupidest way to lose money with an otherwise correct system.
The other failures degrade gracefully by construction. The unfilled order gets cancelled and retried tomorrow, as already said: no intermediate state to look after. The skipped cycle — Gateway down, house without power — leaves yesterday’s positions with the band as a cushion, and tomorrow you restart from updated data: for a monthly signal it’s tracking error, not an emergency. A stopped or standby bot leaves the futures positions open and unmanaged, like the TRPS’s GTCs: it’s written in the runbook, and the answer in the extreme case is me from the app, in a market that quotes nearly 24 hours. And once a month, on the first Monday, the leg’s statement reaches me by email: the month’s, the year’s and the since-inception return, actual commissions against the friction budget, estimated margin against the account’s real one — the series that tells me, at the right cadence for a slow signal, whether reality is honoring the design.
What stays manual, here more than elsewhere: the universe. Adding or removing a market, moving an instrument into wind-down (closes allowed, opens not), changing the contract size — these are desk decisions with double confirmation, not automatisms; the bot executes the configuration, it doesn’t debate it. The division of labor is the usual one: the system does the constancy, I do the (few) judgment calls — and after the experience of the other two bots I can say it’s the constancy, not the judgment, that turned out to be the part I didn’t know I lacked.
The roll, though, deserves more than the two paragraphs I gave it here: the dates that actually matter, the window where the liquidity goes, the emergency ladder and the true cost of every round. That’s the Futures rollover page.