Swing Breakout Sequence Strategy
Created 07 Jul 2024
·
Updated 05 Apr 2025
The Swing Breakout Sequence (SBS) Strategy is a Premium mechanical strategy for the NinjaTrader 8 platform, inspired by Stoic Trader's trading model. The strategy can be used to pass propfirm evaluation challenges.
Prerequisites
To properly use this strategy you should have the following prerequisites available.
- NinjaTrader 8, with any license type. Order Flow is not needed to run this strategy. Click here to download
- An automated-trading.ch account with an active Premium Subscription
Important Disclaimer
We strongly recommend that you never run your algorithmic trading systems on your hard-earned real money. You should always minimize your risk and run your strategies on trader funding programs, so the maximum amount you risk losing is the monthly subscription fee you pay those programs.
Entry Setup Examples
This strategy has one entry setup, based on the Swing Breakout Sequence algorithm — a high-probability entry model with a defined risk-reward ratio, based on a sequence of 5 swings.
Here is the algorithm for an entry setup:
- The first step is the full detection of a Swing Breakout Sequence, formed of 5 swings respecting the pattern for a bullish entry (or exactly the inverse for a bearish entry). Having the 5 swings isn't sufficient on its own — the final criteria for a valid SBS is that price breaks out from one of the swings composing it. Since the 5th swing is the lowest for a bullish SBS (and the highest for a bearish one), the strategy — like the indicator — offers the ability to choose which swing triggers the breakout. According to our backtests, the 1st swing in the sequence tends to be the best choice.
- If price closes outside the range defined by the prior swings, the SBS is invalidated, disposed of, and not displayed.
- The SBS isn't drawn in real time during swing formation — if it were, many SBS patterns would be drawn then invalidated and removed in real time, creating visual confusion. Only valid ones, confirmed by a breakout, are drawn.
-
Once an SBS is validated, the algorithm calculates a ratio on it, based on two levels:
- The target level: defined by the 3rd swing
- The stop level: the lowest (bullish) or highest (bearish) swing in the sequence — either the 5th swing or the prior lowest low/highest high swing
Features
The Swing Breakout Sequence strategy has a set of unique features:
- Robust in-house implementation of the Swing Breakout Sequence algorithm
- No pending orders are placed — only market orders
- Full-auto strategy that can be scaled into multiple instances
- Precise backtesting capabilities following NinjaTrader's official best practices, achieving precise entry/exit backtesting at the tick level
- A robust in-house order management library, resistant to connection loss, that works seamlessly on Rithmic accounts or NinjaTrader brokerage accounts
Dynamic Quantity and Risk Management
As with all our strategies, this strategy implements two methods for setting the quantity of open positions:
- Fixed Quantity: uses the same quantity for every position. If the stop loss is variable between positions, win/loss amounts will vary too.
- Dynamic Risk-Adjusted Quantity: calculates each position's quantity from its stop loss, the maximum risk (in $) allowed per position, and the maximum allowed quantity — producing equal win/loss amounts across all positions regardless of stop loss width.
Position Management
As with all our strategies, this strategy implements multiple position management methods:
- ATM Strategy: delegate position management entirely to your own ATM strategy, selected from a drop-down.
- Dollar Cost Averaging (Grid): increases the position's quantity as price moves against it, bringing the average price closer to the current price so the position can close at breakeven on a pullback.
- Trailing Stop: trails the stop loss with each new swing point formed on the winning side of the position.
- SuperTrend: uses the SuperTrend indicator as a management method.
The strategy also allows setting the stop loss based on multiple strategies and the take profit based on a ratio — see the Parameters section for details.
Account Management
The strategy implements daily stop-trading triggers based on the net winning position count, the net losing position count, or a target realized net profit or net loss.
Parameters
We try to keep the parameters to a minimum — only the most important are exposed.
| General | |
| Execute Historical Trades | Enables executing trades when the strategy runs in Historical, Backtest, or Optimization modes — should be unchecked when running Live. |
| Daily TakeProfit Target | The strategy stops for the day once this daily take-profit amount is reached. Ignored when set to 0. |
| Weekly TakeProfit Target | The strategy stops for the week once this weekly take-profit amount is reached. Resets at the start of each new week. Ignored when set to 0. |
| Daily StopLoss Limit | The strategy stops for the day once the daily loss limit is reached (positive value — e.g. 300 stops trading once realized PnL ≤ -$300). Ignored when set to 0. |
| Stop @ Winning Count | Stops trading for the day once the net winning-trade count reaches this value. Ignored when set to 0. |
| Stop @ Losing Count | Stops trading for the day once the net losing-trade count reaches this value. Ignored when set to 0. |
| Execute on Different Instrument | Executes trades on a different instrument than the active chart's — e.g. run logic on Minis but execute on Micros. All risk calculation happens on the execution instrument, and trades on a different instrument aren't drawn on the chart. |
| Execution Instrument | Choose from a list of Micros available on your NinjaTrader connection as the instrument trades execute on. Trades won't be drawn on the chart in this case. |
| Order Label | A label suffixed to every position sent to the broker, useful to differentiate your orders from other users of the same strategy. |
| Swing Breakout Sequence | |
| Show Sequence Numbers | Enables/disables drawing of numbers labels below/above each swing sequence point. |
| Show Sequence Lines | Enables/disables drawing of lines connecting the swing sequence points. |
| Render Opacity (1-100) | The opacity to render objects on the chart. |
| Swings Period | Swings are higher lows, higher highs, lower highs, and lower lows. This parameter sets how many bars is enough to separate two swings of the same type — the higher this value, the fewer swings overall. |
| Invalidation Method |
|
| Breakout Swing |
|
| Breakout Fibo Level | Only used when Breakout Swing is Fibonacci Retracement — one of 23.60%, 38.20%, 50%, 61.80%, or 76.40%, each calculated from Swing 4 in the sequence. |
| Min SBS Ratio | The distance of the potential take profit divided by the stop loss distance at the current price when the SBS validates. Reflects the SBS's skewness — closer to 1 means less skewed. A value of 0.9 has proven optimal in our testing. |
| Min SBS Bars Count | Filters out SBS structures spanning too few bars to be significant. |
| Max SBS Bars Count | Filters out SBS structures spanning too many bars — these generally don't produce profitable signals. |
| Max SBS Height Points | Filters out SBS structures that are too tall, in points. |
| Entry Setup | |
| Time Zone |
The time zone used for the Trade Time parameter below.
|
| Trade Time | The time intervals during which the strategy is allowed to place trades — e.g. "09:30-16:15" for RTH in EST. Multiple comma-separated intervals in increasing order are supported, cut at midnight to avoid issues stepping into a new day. |
| Quantity Strategy |
|
| Max Qty | Maximum allowed quantity when Risk Adjusted is selected — useful since some propfirms enforce order-quantity limits that can invalidate an account. |
| Invert Entries | Inverts entries from long to short and vice versa — the stop loss becomes the take profit and vice versa, with the risk ratio inverted accordingly (a 2:1 take profit becomes 1:2). Useful in choppy regimes where the original breakout logic doesn't hold. |
| Long/Short Entry Mode |
|
| SuperTrend Entry Filter | Restricts long entries to when SuperTrend is bullish, and short entries to when it's bearish. |
| SMAs Entry Filter | Requires the SBS sequence to break out above/below two Simple Moving Averages. |
| SMA Slow Period / SMA Fast Period | The periods of the two Simple Moving Averages used as an entry filter. |
| Entry Mode |
|
| FVG Candle Filter |
|
| Min. Gap (ticks) | The minimum distance, in ticks, between the FVG's wicks to be valid — the higher this value, the fewer FVGs are detected. |
| Order Qty | Used only when Quantity Strategy is Fixed — the fixed quantity per trade (and per quantity increase during order management). Typically 1 or 2. |
| Order Management | |
| Order Management Strategy |
|
| ATM Strategy Template Name | Only used with the ATM Strategy order management method — the exact template name of your custom ATM strategy. Must match an existing template, or no position will be opened. |
| On Opposite Signal |
|
| Enable Price Breakeven | Enables/disables the price-based breakeven mechanism. |
| Breakeven Price Strategy |
|
| Breakeven Price Trigger | Available if price-based breakeven is enabled — the trigger value needed to move the stop loss to breakeven. |
| Enable Time Breakeven | Enables/disables the time-based (minutes) breakeven mechanism. |
| Breakeven Time Trigger | Available if time-based breakeven is enabled — the trigger value, in minutes, needed to move the stop loss to breakeven. |
| StopLoss Strategy |
|
| TakeProfit Strategy |
|
| Scale out % Qty at % Target / Scale out at % Target / Scale out % Qty | Closes a percentage of the position's quantity once price hits a percentage of the profit target (rounded down when fractional). |
| Take Profit Currency | The take-profit amount in dollars, used with the Fixed Currency Value strategy. |
| Stop Loss Points | Available when the Stop Loss strategy is Points. |
| Target Risk Per Trade ($) | The maximum risk, in dollars, per position — used before opening a trade to verify the calculated stop loss respects this limit; if not, the trade is skipped. |
| Max Allowed Risk Per ($) | Only used with Risk Adjusted quantity — controls how far the real calculated risk is allowed to deviate from the Target Risk. |
| Stoploss offset Points | Adds an offset, in points, to the calculated stop loss level — used when computing risk per trade. |
| Take Profit Points | Available when the Take Profit strategy is Points. |
| SuperTrend | |
| SuperTrend Mode | ATR-based, or Adaptive (based on candle close/high/low). |
| Period / Multiplier / Moving Avg. Type / Smooth | Standard SuperTrend calculation parameters. |
| SuperTrend Close Only Winning | When SuperTrend is used as an order management method, avoids closing trades that are immediately below/above supertrend right after opening — only closes positions currently in profit. |
| Trailing Stop Parameters | |
| Trailing Stop Strategy | Points (calculated from the entry price) or Ratio (calculated from the stop loss value, mirrored on the winning side). |
| Trailing Stop Trigger / Trail Amount | The trigger and trailing amount (in Points or Ratio) for the Classic Trail Stop method. |
| DCA (Grid) Parameters | |
| Breakeven Profit Shift | Adds a bit of profit to the breakeven definition, to cover commissions when closing the grid at breakeven. |
| Grid Size to Breakeven | The number of order increases required before considering closing the position at breakeven. |
| Min Grid Gap (Point) | The minimum gap, in points, between two grid orders. |
| Bar Close Trigger | Makes grid orders open on bar close in the direction of the trade. |
| Command Buttons | |
| The strategy exposes manual command buttons on the Chart Trader panel — make sure it's displayed on your active chart. | |
| Arm/Disarm Buttons | Manually enable/disable entering long or short trades — useful if you have a directional bias. |
| Close Position Button | Immediately flattens the position without restarting the strategy, which keeps looking for new trades afterward. |
| Increase Qty Button | Increases the current position's quantity by the Order Qty amount. |
| Set Breakeven Button | Moves the open position's stop loss to breakeven, if doing so would improve it. |
Performance Reports
Past results are not a guarantee of future results. All backtesting results are for indicative purposes only.
- Commissions are included, using NinjaTrader's Lifetime license commission schema, for realistic results.
- We follow NinjaTrader's official guide for precise intrabar-granularity backtesting using additional tick-level data series, and only use market orders — never pending orders — in both real-time and backtest modes.
The strategy has been backtested across multiple risk profiles and instruments (MES, MNQ), and a defensive parameter template has also been run live on an Apex Live Trader Funding account, successfully passing the account validation challenge.
No performance reports have been uploaded for this strategy yet.
Download & Installation Instructions
License Requirements
At automated-trading.ch you can choose to either purchase a monthly subscription to use our premium products, or use our free products without subscribing.
In both cases, you need to create an account so you can get a License you can use for both premium and free products.
To obtain your license, simply sign up and then get your license on the billing page.
Download
You can also download this strategy — and every other automated-trading.ch strategy or indicator — anytime from your centralized Downloads page.
Installation Steps
Frequently Asked Questions
General
Billing
Skeptics
Release Notes
- Bug Fix: Error when using ATM Strategy
- Added Decrease quantity command button; Added "Invert Entries" Parameter; Scaling out added Scale out at % Target/Qty; Breakeven considers commissions
- Fixed performance regression related to swing price detection
- Added filter Max bars between swings; Added Immediate on Swing 4 breakout mode; Added SMA Slow/Fast entry filter; Bug Fix crashing on new market session live
- Added Scale out 50% Qty at 50% Target management option
- Fix bug on Market Replay session transitions; Fix SuperTrend trailing stop miss bug; Added Max SBS Height points parameter
- Fibo levels calculated Swing3->extreme point (was extreme->Swing3); Added Fibo 0.236 as TP target
- Reorganization of Parameters; Added SuperTrend as trade management method; pixel-based SBS sequence number drawing; Added "Invalidation Method" parameter; sequences on invalidated swings removed
- Bug Fix: breakeven not triggered on long trades; Increase position button also triggering breakeven; breakeven button sometimes closing positions
- Bug Fix: ATM usage crashing Strategy; Command button Close now closes ATM positions; drawing objects disposed in optimization mode
- Added Entry mode selection: Immediate or wait for FVG; Added "Min Grid Gap" and "Bar Close Trigger" params to DCA (Grid) method
- Bug Fix when using ATM strategy
- Added Max Allowed Risk per trade separate from Target Risk per trade
- Bug fix: Trailing stop mechanism should trigger outside trade time
- Added StopLoss & Takeprofit line drawing with drag & drop
- Bug Fixes: weekly profit target calc; EST timezone glitch; Currency risk closing early; Trailing stop with Fixed currency value stoploss
- Bug Fix: rare error when little data loaded on chart
- Auto submit of License on Billing cycle date; all parameters displayed on Strategy Analyzer optimization; Clear warning message when strategy added from Strategy Tab not Chart
- Added weekly profit target
- Major fixes when Take Profit method set to Swing3; Stop Loss calc updated to include Prior Swing, Swing4, Swing5; Fix Chart Panel Glitch on tab change
- Removed strong condition on Swing5 price (relaxed successive-swing rule)
- Bug Fix: running strategy on multiple accounts overlaps daily limit stops
- Less strict detection rule for more pattern detection; Added Fibonacci Retracement Breakout method; Added Trade Time zone selection EST/local; Added Min & Max SBS Bars count filter
- Added Classic Trailing Stop management method; Fix issue with entry; Update parameter refresh logic; Added stoploss offset in points
- Added Swing 3 as new take profit strategy
- First Release of the strategy