Markets don't behave the same way all year. A pullback buy that does well in a trend gets chopped to pieces in a range. Regime mode lets one strategy hold several plans, each with the conditions it was made for, and the Activate Regime node is where you state those conditions. Wire a condition into it, and while that condition holds, that regime's plan does the trading.
- Takes
- One condition: when this regime should be active
- Gives
- Nothing on the canvas. It switches its regime on
- Reach for it
- Different market conditions call for different strategies
How it works
Flip the Regime Engine switch on the canvas and the regime drawer opens. The strategy you already had becomes the Default Strategy, and every regime you add (up to five) gets a card with two canvases of its own.
The Detection canvas says when the regime is active. It comes with an Activate Regime node already on it, which can't be deleted, and there's only ever one per regime. Build a condition from indicators, comparisons and logic, and wire it in. Order nodes (entries, Trade nodes, brackets, exits) aren't allowed here. The Execution canvas says what the regime trades: a complete strategy, with its own entries, Trade nodes and exits.
The engine keeps checking every regime's detection as it steps through the data, and exactly one regime is in charge at any moment. Priority is position. The cards read P1, P2 and so on from left to right, and when two regimes are true at once, the one further left wins. When none of them is true, the Default Strategy runs. Only the active regime's entries can open trades; every other execution canvas waits its turn.
The Default can also stand aside. Leave its execution canvas empty and the strategy takes no trades at all while no regime is active. The builder warns you that nothing is built there, but it runs, as long as at least one regime has an Entry.
Stability Bars
A regime's card sets how long its detection has to hold before the regime takes over. The default, 1, switches as soon as a completed bar says so. 3 waits for three bars in a row. 0 switches the instant the condition turns true, and the card flags it with a warning, because a condition hovering at its threshold can flip the regime back and forth. The bars counted are the primary series' unless you pick another series on the card.
On Enter and On Leave
A switch can happen with trades open, so each card says what to do with them:
| Hold (default) | Force Exit | |
|---|---|---|
| On Enter | Open trades carry on, managed by the regime that opened them | Every open position is closed at market as this regime takes over |
| On Leave | This regime's trades carry on, managed by its own Trade nodes | Every open position is closed at market as this regime hands over |
Example: trade the trend, stand aside in chop
You trade a pullback entry on NQ 15m. Your notes say it works when the market trends and bleeds when it ranges, and you'd rather sit out the ranges entirely.
Turn on the Regime Engine and add a regime called Trend. On its Detection canvas, wire an ADX / DMI (period 14) into a Comparison set to Greater Than a Constant of 25, and that into Activate Regime. Set its Stability Bars to 3, so one hot bar isn't enough. Copy your pullback strategy onto Trend's Execution canvas and clear the Default Strategy's. Finally, set Trend's On Leave to Force Exit, so no trend trade lingers once the trend is gone.
Now the strategy trades only after ADX has held above 25 for three bars, closes everything the moment it drops back under, and does nothing in between.
Settings
Activate Regime has no settings of its own. Stability Bars, the series it counts, On Enter and On Leave all live on the regime's card, as described above.
Use something else when
When it doesn't behave
The builder won't let me wire a Crossover in
A Crossover's output is true for a single bar, so the regime would switch on and off every time it fired. Use its Bars since with a Comparison, or compare the two lines directly with a Comparison. The same goes for a State Machine's events.
My run stopped with “50 regime flips in one day”
The engine stops a run whose regimes switch more than 50 times in one trading day, because a strategy flapping that fast is trading noise. Raise Stability Bars, or give the detection some distance from its threshold (two thresholds instead of one, or a slower indicator).
Trades from the old regime keep running after a switch
That's Hold, the default. The trades are still managed by the regime that opened them until they close. Set that regime's On Leave to Force Exit if they should go when it does.
A regime never activates
Check the regimes to its left first: if one of them is true whenever this one is, it always wins. Then check the detection itself. The Inspector's checks flag a detection whose conditions can never be true together.
Going further
Each regime trades only a slice of the history, so each one has fewer trades behind it than the whole strategy does. The Regimes tab in the results breaks the run down by regime (time spent in each, profit, the switches between them) and tells you when a regime's trade count is too small to grade. Believe it. Five regimes tuned on one backtest is five chances to fit noise.
With the Regime Engine off, the Run: picker on the canvas runs one regime's execution canvas on its own. It's a fair way to test each plan by itself before you let them share the clock. And a set of regimes you like can go into the drawer's library, ready to import into another strategy.