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.


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
    The ratio is the distance from the current price to the target level, divided by the distance from the current price to the stop level. A ratio of 1 means the SBS has well-balanced leg lengths; the further from 1, the more skewed the SBS. The strategy allows filtering out entries based on this ratio's value.
Swing Breakout Sequence pattern definition showing 5-swing structure
Click to enlarge

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 TradesEnables executing trades when the strategy runs in Historical, Backtest, or Optimization modes — should be unchecked when running Live.
Daily TakeProfit TargetThe strategy stops for the day once this daily take-profit amount is reached. Ignored when set to 0.
Weekly TakeProfit TargetThe 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 LimitThe 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 CountStops trading for the day once the net winning-trade count reaches this value. Ignored when set to 0.
Stop @ Losing CountStops trading for the day once the net losing-trade count reaches this value. Ignored when set to 0.
Execute on Different InstrumentExecutes 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 InstrumentChoose 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 LabelA 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 NumbersEnables/disables drawing of numbers labels below/above each swing sequence point.
Show Sequence LinesEnables/disables drawing of lines connecting the swing sequence points.
Render Opacity (1-100)The opacity to render objects on the chart.
Swings PeriodSwings 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
  • Bar Wick: an SBS becomes invalid if a bar wick mitigates the prior swing level
  • Bar Close: an SBS becomes invalid if its prior swing level is mitigated by a bar close
Breakout Swing
  • Prior Swing, Swing 1 through Swing 4: the SBS gets validated and drawn when price closes above/below the corresponding swing
  • Immediate Swing 4: validates and draws the SBS immediately when price closes above/below the 0.618 Fibo level after the 3rd swing forms, without waiting for a breakout or a 5th swing
  • Fibonacci Retracement: validates and draws the SBS when price closes above/below the level specified by Breakout Fibo Level
Breakout Fibo LevelOnly 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 RatioThe 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 CountFilters out SBS structures spanning too few bars to be significant.
Max SBS Bars CountFilters out SBS structures spanning too many bars — these generally don't produce profitable signals.
Max SBS Height PointsFilters out SBS structures that are too tall, in points.
Entry Setup
Time Zone The time zone used for the Trade Time parameter below.
  • EST: Eastern Time
  • Local Time: the local machine timezone
Trade TimeThe 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
  • Fixed Quantity: a fixed quantity; skipped if the evaluated risk exceeds Target Risk Per Trade ($)
  • Risk Adjusted: dynamic contract size, calculated from the stop loss price and Target Risk Per Trade ($)
Max QtyMaximum allowed quantity when Risk Adjusted is selected — useful since some propfirms enforce order-quantity limits that can invalidate an account.
Invert EntriesInverts 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
  • Long: only long trades open
  • Short: only short trades open
  • Long & Short: both directions open
SuperTrend Entry FilterRestricts long entries to when SuperTrend is bullish, and short entries to when it's bearish.
SMAs Entry FilterRequires the SBS sequence to break out above/below two Simple Moving Averages.
SMA Slow Period / SMA Fast PeriodThe periods of the two Simple Moving Averages used as an entry filter.
Entry Mode
  • Immediate on Breakout: triggers immediately after a valid SBS sequence is detected
  • Wait For FVG: waits for a Fair Value Gap to form right after the SBS sequence before triggering
FVG Candle Filter
  • 3 Candles of Same Kind: only FVGs with 3 candles of the same type
  • 2 Candles of Same Kind: only FVGs with at least 2 candles of the same type
  • No Filter: no candle-type filtering — produces more FVGs
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 QtyUsed 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
  • Classic Trail Stop: trails the stop loss based on a trigger and a trailing amount
  • ATM Strategy: delegates management entirely to a NinjaTrader ATM strategy template of your choice
  • Dollar Cost Averaging (Grid): increases order quantity each time a swing forms on the losing side, averaging the position's price
  • Trail Stop on Swings: trails the stop loss each time a swing forms in the winning direction
  • SuperTrend: closes trades when price crosses the SuperTrend level
  • None: the stop loss defined by Target Risk Per Trade ($) is used instead
ATM Strategy Template NameOnly 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
  • Breakeven: moves the position to breakeven when an opposite signal occurs
  • Close Position: closes the position immediately
  • DoNothing: no action taken
Enable Price BreakevenEnables/disables the price-based breakeven mechanism.
Breakeven Price Strategy
  • Points: breakeven triggers based on points
  • Percentage: breakeven triggers based on percentage of take profit reached
Breakeven Price TriggerAvailable if price-based breakeven is enabled — the trigger value needed to move the stop loss to breakeven.
Enable Time BreakevenEnables/disables the time-based (minutes) breakeven mechanism.
Breakeven Time TriggerAvailable if time-based breakeven is enabled — the trigger value, in minutes, needed to move the stop loss to breakeven.
StopLoss Strategy
  • Sequence Defined: the lowest price between the prior low swing and the 5th swing (bearish), or the highest price between the prior high swing and 5th swing (bullish)
  • Super Trend: set at the SuperTrend level, falling back to Sequence Defined if unavailable
  • Fixed Currency Value: only Target Risk Per Trade ($) is used
  • Points: a fixed number of points from entry
TakeProfit Strategy
  • Fixed Currency Value: uses Take Profit Currency
  • Points, Swing 3, Fibo 0.236
  • Fixed win/loss ratios: 0.5:1 through 6:1
Scale out % Qty at % Target / Scale out at % Target / Scale out % QtyCloses a percentage of the position's quantity once price hits a percentage of the profit target (rounded down when fractional).
Take Profit CurrencyThe take-profit amount in dollars, used with the Fixed Currency Value strategy.
Stop Loss PointsAvailable 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 PointsAdds an offset, in points, to the calculated stop loss level — used when computing risk per trade.
Take Profit PointsAvailable when the Take Profit strategy is Points.
SuperTrend
SuperTrend ModeATR-based, or Adaptive (based on candle close/high/low).
Period / Multiplier / Moving Avg. Type / SmoothStandard SuperTrend calculation parameters.
SuperTrend Close Only WinningWhen 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 StrategyPoints (calculated from the entry price) or Ratio (calculated from the stop loss value, mirrored on the winning side).
Trailing Stop Trigger / Trail AmountThe trigger and trailing amount (in Points or Ratio) for the Classic Trail Stop method.
DCA (Grid) Parameters
Breakeven Profit ShiftAdds a bit of profit to the breakeven definition, to cover commissions when closing the grid at breakeven.
Grid Size to BreakevenThe 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 TriggerMakes 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 ButtonsManually enable/disable entering long or short trades — useful if you have a directional bias.
Close Position ButtonImmediately flattens the position without restarting the strategy, which keeps looking for new trades afterward.
Increase Qty ButtonIncreases the current position's quantity by the Order Qty amount.
Set Breakeven ButtonMoves 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.

Important: This is a Premium product. It can be run in Backtest, Playback, and Optimization modes for free; an active Premium subscription is required to run it live.
Download
Sign in to download this file.
Latest Version v2.0.2.1 · Published 1 year ago
This file was downloaded 1618 times. Last download was 9 hours ago.

You can also download this strategy — and every other automated-trading.ch strategy or indicator — anytime from your centralized Downloads page.

Installation Steps
1
Import the downloaded .zip file into NinjaTrader using the Import NinjaScript menu item.
2
Open a new chart window, making sure the Tick Replay checkbox is checked (if you don't see it, go to Tools → Options → Market Data and enable Show Tick Replay).
3
Right-click the chart and choose Strategies (or press Ctrl+S) to open the Add New Strategy dialog, then make sure to check the Enabled checkbox.
4
After adding the strategy, it runs on the chart's historical data first, then switches to Real-Time mode and adds a license text box to the Chart Trader panel — make sure that panel is displayed.
5
Paste your license (found on the billing page) into the text box and click Check License.
6
Once verified, the "Check License" button turns green along with the next verification date — this only needs to be repeated after that date.
7
Without an active subscription, the strategy can still be run in Playback and Historical modes to test it first.

Frequently Asked Questions

General

Using a VPS is good but not imperative — a low-cost Windows VPS instance is sufficient for most users.

Yes, as long as each instance runs on a unique instrument — NinjaTrader aggregates orders into one position per instrument per account, so running two instances on the same instrument won't work.

You can, but running multiple instances of the strategy directly is usually a better solution — the license allows unlimited instances across multiple machines.

Yes — the strategy is designed for exactly that, and works seamlessly on Rithmic, NinjaTrader brokerage, Tradovate, or any other provider connected to your NinjaTrader platform.

It's designed to be fully automatic, but its command buttons also let you manage trades manually if you'd rather run it semi-auto.

Automated strategies trade around the clock, execute faster and more precisely, remove psychology and sentiment from the equation, and can scale to dozens or hundreds of instances — producing genuinely passive income rather than another stressful manual job.

Yes — if you have an idea that could improve the strategy, use the contact page to get in touch.

No, the source code is protected for copyright reasons.
Billing

Yes, you can cancel your subscription from the account page at any time to prevent future payments. We can't refund the unused portion of your subscription, but you'll be able to use it for the remainder of the billing cycle.

No, we don't offer a trial subscription plan, but you can download and test the product in backtest and playback modes before subscribing.

We do not offer full or partial refunds, but you may cancel your subscription at any time to stop future payments.
Skeptics

I've been a professional software developer since 2010 and have developed automated trading strategies since 2012, both for myself and for clients worldwide — I've also worked in finance and investment banking. I'm not a marketer, and I don't outsource strategy development.

I'm not selling it — I'm renting it, as an additional income source alongside diversifying my own trading. The strategy is purely mechanical, with no hidden quantitative edge that erodes as more people use it.

Pending (limit) orders offer better price execution and some protection against connectivity issues, but they can be rejected under high volatility, need active management, and are visible to the broker. Market orders guarantee execution regardless of volatility, are invisible to the broker before submission, and execute faster — the only real drawback is that a lost connection prevents sending them at all. NinjaTrader's MIT (market-if-touched) orders are a solid alternative if you specifically want pending-order behavior.

We follow NinjaTrader's official guide for precise intrabar-granularity backtesting using additional tick-level data series. Don't take our word for it — run a backtest at the end of each trading day and compare it against the strategy's actual live trades that day.

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
discord
Join our Discord community
Questions, feedback, or just want to chat with other traders? Come say hi.
Join Discord
Quick Facts
Platform NinjaTrader 8
Category Strategy
Plan Required Premium
Latest Version v2.0.2.1
Last Updated 1 year ago
Downloads 1618