Protected Highs & Lows Indicator

Created 30 Mar 2024 · Updated 18 Oct 2024

The NinjaTrader 8 Highs & Lows indicator is a Free NinjaTrader 8 indicator that presents an alternative approach to identifying Market Structure, inspired by the TradingView indicator Protected Highs & Lows [TFO]. An Advanced Premium version with additional features is also available.

Prerequisites

To properly use this indicator you should have the following prerequisites available.


Description

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 2000-volume timeframe, the pivot swing arrows shown in red and green above and below the candlesticks are protected swings.

Market Structure Shift and Break based on protected swings
Click to enlarge

Features

The Protected Highs & Lows indicator has a set of unique features:

  • Free — the indicator is completely free to use
  • Plots Break of Structure and Change of Structure
  • Highly customizable, lightweight, and adaptable to a wide range of instruments

Parameters

We always try to keep the parameters to a minimum.

Swings
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.
Structures
Show Structures Sets which market structure to show/hide:
  • All: shows both Market Structure Shifts and Break of Structures
  • None: doesn't show market structures — only protected highs and lows
  • Break of Structure (BoS): shows only Break of Structures
  • Structure Shift (MSS): shows only Structure Shift (MSS)
Show Valid SwingsEnables/disables drawing of valid swings as a circle.
Extend Retracement BarsNumber of bars to extend the retracement levels.
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.
Rendering
Retracement ColorDraw color of retracement levels.
Bearish ColorDraw color of bearish items.
Bullish ColorDraw color of bullish items.
Draw Offset (Points)An offset, in points, used when drawing markers of swings and valid swings on the chart.

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 Free product — no paid subscription is required to run it live, though creating an account is still required to get your license.
Download
Sign in to download this file.
Latest Version v1.5.0.1 · Published 1 year ago
This file was downloaded 1629 times. Last download was 4 days 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
After adding the indicator to the chart, it runs on the chart's historical data first, then continues running on live market data.

Frequently Asked Questions

General

Yes — if you have an idea that you believe can improve this indicator, use the contact page to send us a message.

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.

Release Notes

  • Bug Fix with index

  • Added Playsound on Valid Swings

  • Added Playsound; Added Offset drawing in points

  • Added Retracement Color; Fixed Serialization of parameter templates

  • Fixed algorithm for detecting protected highs & lows; Added drawing of retracement, valid swings; Added higher timeframe analysis

  • Fixed market structure detection algorithm based on protected highs & lows only; Added None as display option

  • 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 Free
Latest Version v1.5.0.1
Last Updated 1 year ago
Downloads 1629