Indicator · Pine Script v6 · On the chart

Week 02

by moonyroy

This indicator plots ZigZag lines on the price chart to map swing highs and lows.

View on GitHub

GitHub stars1on the repository
Pine versionv6current
Lines of code413
Settings7inputs
LicenceNone stated
Last update4 days ago24 Oct 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above. It reads the file straight from GitHub.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.

Source Code

The code stays on GitHub. The author has not published this script under an open licence, so ForexR does not show its code. Copy script reads the file straight from GitHub into your clipboard, so you can still try it on your own chart. Ask the author before reusing the code anywhere else.

Overview

Week 02 detects break_high and break_low events to identify pivot points. The code supports a primary chart timeframe and optional second timeframe ZigZag with selectable modes such as normal or reset on outside bar. Lines are drawn connecting consecutive swing points, updating in real time as price breaks structure. It builds foundational market structure for further CHoCH and BOS detection.

Details

Published by

moonyroy on GitHub

Type

Indicator, Pine Script v6

Draws

On the price chart

Category

Trend, Support & resistance, SMC / ICT / price action, Breakout

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
modestringnormalmode_input
show chart timeframe zigzagbooltrueshowChartTfZigzag
second zigzag timeframestringNo second zigzagsecondZigzagTf
second zigzag modestringnormalsecondZigzagMode
show second zigzagbooltrueshowSecondZigzag
second zigzag colorcolor#f23645htfZigzagColor
second zigzag widthint1htfZigzagWidth
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

24 stars

This indicator maps Smart Money Concepts (SMC) market structure directly onto the price chart. It detects internal and swing structure breaks (BOS and CHoCH), tracks bullish and bearish order blocks, identifies fair value gaps (FVG), highlights equal highs and

Indicator v5 SMC / ICT / price actionSupport & resistance Repaints
Updated 10 days ago · Custom licence GitHub repository of Smart Money Concepts [LuxAlgo] Test B

714AutoM8tr

by alboogycOdR
6 stars

714AutoM8tr is a Smart Money Concepts indicator that plots internal and swing market structures directly on the price chart. It identifies Break of Structure and Change of Character points alongside internal and swing order blocks. Users can customize order bl

Indicator v5 SMC / ICT / price actionSupport & resistance Repaints
Updated 7 months ago · None stated GitHub repository of 714AutoM8tr
4 stars

Snag - Detect Bull Bear is an indicator that identifies bull and bear market phases on the price chart. It uses a customizable ZigZag to detect trend reversals, tracking high and low points. The script applies Fibonacci-based rules to confirm breakout shifts b

Indicator v5 TrendSupport & resistance
Updated 4 years ago · None stated GitHub repository of Snag - Detect Bull Bear
2 stars

This indicator detects market structure breaks using a configurable ZigZag length to identify swing highs and lows. It marks bullish and bearish order blocks along with breaker blocks on the price chart. Breakouts are confirmed via a Fibonacci retracement fact

Indicator v5 SMC / ICT / price actionSupport & resistance
Updated 2 months ago · None stated GitHub repository of Market Structure Break & Order Block
575 stars

This indicator detects equal highs and lows by comparing prices within user-defined left and right bars using a tolerance percentage. It plots horizontal lines on the price chart for equal highs in one color and lows in another. A screener allows input of mult

Indicator v5 Support & resistanceTrend
Updated 1 year ago · MPL-2.0 GitHub repository of ICT Equal Highs and Lows with Screener

This Pine Script indicator plots a ZigZag on the price chart. It identifies reversal points when price moves more than a set percentage from the last pivot. The script calculates forecasts using zigzag data and labels detected geometric patterns including harm

Indicator v4 TrendSupport & resistance

More indicators

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers