Protected Highs & Lows [Advanced] Indicator
Created 22 Feb 2025
·
Updated 22 Feb 2025
The NinjaTrader 8 Highs & Lows indicator [Advanced] is a Premium NinjaTrader 8 indicator that presents an alternative approach to identifying Market Structure, inspired by the TradingView indicator Protected Highs & Lows [TFO].
Prerequisites
To properly use this indicator you should have the following prerequisites available.
- NinjaTrader 8, with any license type. Click here to download
- An automated-trading.ch account with an active Premium Subscription
Description
This is an advanced, enhanced version of our free Protected Highs & Lows indicator. The main differences between the free and premium versions are:
- Better drawing of the market structure indicator on the chart
- Drawing of higher-timeframe candlesticks when a higher timeframe is selected
- Export of signals usable in the NinjaTrader Strategy Builder, Bloodhound, and AlgoStudio
This indicator introduces the concept of protected swing pivot points, used to determine market structure events such as:
- MSS: Change of Structure (or Change of Character, or Market Structure Shift) — indicates the trend might change
- BOS: Break of Structure (or Market Structure Break) — indicates a continuation of the trend
What are protected swings?
When price closes below a valid swing low, the indicator looks back from the current bar to find the highest high made in that range — that becomes the protected high. Similarly, when price closes above a valid swing high, it looks back to find the lowest low made in that range, which becomes the protected low.
If a higher high is established but the price doesn't later close below the last established lower low, that higher high isn't considered a protected swing — and the same applies symmetrically on the low side.
Examples
Market Structure Shift & Market Structure Break based on protected swings
On MNQ on the 1-minute timeframe, price swings are marked in small rectangles in red and green — higher highs and lower lows based on a sensitivity, or swing period, that defines the minimum distance between swings. Swings marked "V" are Valid swings; swings marked "Pr" are Protected swings. MSS lines mark Market Structure Shift levels.
Drawing Fibonacci retracements
The indicator can draw Fibonacci retracements automatically each time a market event (MSS or BOS) is detected — usable to trade when price hits, for example, the 50% retracement. The drawing can also be edited manually: removed, dragged, or extended with the mouse.
Running on a higher timeframe
The indicator can draw its elements on a higher timeframe while trading on a lower one — for example, running on the 1-minute timeframe while the indicator's elements are detected on the 20-minute timeframe: valid swings are drawn on the higher-timeframe candles, and MSS/BOS events are drawn on the higher timeframe too.
Features
The Protected Highs & Lows indicator has a set of unique features:
- Can be run on a multi-timeframe setting
- Draws higher-timeframe candles when a higher timeframe is enabled
- Plots Break of Structure and Change of Structure
- Draws valid swings and protected swings
- Draws Fibonacci retracement between valid/protected levels
- Highly customizable, lightweight, and adaptable to a wide range of instruments
Parameters
We always try to keep the parameters to a minimum.
| Market Structure | |
| Swing Period | Swings are higher lows, higher highs, lower highs, and lower lows. After each price bar close, a swing can be detected, but the next bar (or the second, or third...) can cancel it by creating a new swing of the same type. This parameter sets how many bars is enough to separate two swings of the same type — the higher this value, the fewer swings overall; the lower, the more swings. A value of 3 or 4 is a common choice. |
| Run on Higher Timeframe | Runs the swing detection algorithm on a higher timeframe, drawn on the current active chart timeframe. |
| Higher TimeFrame | Selects the higher timeframe on which swing points are detected. Make sure to select a timeframe higher than the active chart's, or the indicator won't work. |
| Higher TimeFrame Period | Sets the period of the higher timeframe. |
| Draw Higher Timeframe Candles | Enables drawing (overlaying) higher-timeframe candles on top of the active chart. |
| Show Break of Structure (BoS) | Enables/disables drawing of Break of Structures. |
| Show Structure Shift (MSS) | Enables/disables drawing of Change of Characters, also known as Market Structure Shifts. |
| Show Valid Swings | Enables/disables drawing of valid swings with a "V" label. |
| Show Retracement | Enables/disables showing Fibonacci retracement. |
| Rendering | |
| Bullish Color | Draw color of bullish items. |
| Bearish Color | Draw color of bearish items. |
| Render Opacity (1-100) | Opacity from 0 (fully transparent) to 100 to render on the chart. |
| Alert Sound | |
| Play Sound | Enables playing an alert sound when an event (MSS or BOS) is detected. |
| Play Sound On Valid Swings | Enables playing a sound when a valid swing is detected. |
| Play Sound File | The file name played on sound alert — can be set to any .wav file on your computer. |
Signals & Usage in Strategy Builder
The indicator exposes signals usable from the Strategy Builder and third-party software such as Bloodhound and AlgoStudio.
Those signal plots are transparent and aren't drawn on the chart. From the Strategy Builder, you can select them and build logic based on their values.
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
Subscriptions Q&A
Release Notes
- First Release of the indicator