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.


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.

Protected swings explanation
Click to enlarge

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.

Market Structure Shift & Market Structure Break based on protected swings
Click to enlarge
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.

Drawing Fibonacci retracements
Click to enlarge
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.

Running on a higher timeframe
Click to enlarge

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 PeriodSwings 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 TimeframeRuns the swing detection algorithm on a higher timeframe, drawn on the current active chart timeframe.
Higher TimeFrameSelects 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 PeriodSets the period of the higher timeframe.
Draw Higher Timeframe CandlesEnables 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 SwingsEnables/disables drawing of valid swings with a "V" label.
Show RetracementEnables/disables showing Fibonacci retracement.
Rendering
Bullish ColorDraw color of bullish items.
Bearish ColorDraw color of bearish items.
Render Opacity (1-100)Opacity from 0 (fully transparent) to 100 to render on the chart.
Alert Sound
Play SoundEnables playing an alert sound when an event (MSS or BOS) is detected.
Play Sound On Valid SwingsEnables playing a sound when a valid swing is detected.
Play Sound FileThe 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.

Signal plots
Click to enlarge
Strategy Builder example
Click to enlarge

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 v1.0.0.0 · Published 1 year ago
This file was downloaded 245 times. Last download was 1 day 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.
3
Right-click the chart and choose Indicators... to add the indicator to the chart.
4
Copy/paste your license key, found on the billing page, into the license parameter.
5
After adding the indicator to the chart with a valid license, it runs on the chart's historical data first, then continues running on live market data.

Frequently Asked Questions

General

No, the source code of the indicator is protected for copyright reasons.

No, this indicator only does rendering and doesn't provide data that can be used from within a strategy — check out our other strategies for one based on this same concept.

Yes, you can use this indicator without TickReplay, but bear in mind that in this case the indicator will not detect events on historical candles — it will only start detecting them on real-time volume and price data.
Subscriptions Q&A

After you sign up, you'll get access to the billing page, where you can grab your license and use it on every free or premium product. We don't use NinjaTrader's built-in vendor licensing system — we've built our own, where you submit the license number on each product you're using.

Yes, you can cancel/resume your subscription with a click of a button, no questions asked. You don't even need to request something or send a message — you can manage your subscription in a completely autonomous way.

Our products verify the license validity on the 1st day of each month. At that date, you need to provide the license number to the product (with a simple copy/paste) so that it stays valid for the rest of the month.

We do not store payment credentials — they are encrypted and passed to Stripe or PayPal for a safe & secure way to purchase subscriptions on our site.

Please send us a message from the Contact page.

Release Notes

  • First Release of the indicator
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 Indicator
Plan Required Premium
Latest Version v1.0.0.0
Last Updated 1 year ago
Downloads 245