Strategy · Pine Script v5 · On the chart

BOS & CHoCH Strategy

by cavaldos· code credited to Based on LuxAlgo SMC Logic - BOS & CHoCH Only Strategy

A strategy that detects break of structure and change of character events from swing and internal pivots, based on LuxAlgo-style smart money logic, and draws them on the price chart.

View on GitHub

GitHub stars1on the repository
Pine versionv5runs as is
Lines of code222
Settings9inputs
LicenceNone stated
Last update6 months ago19 Apr 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 strategy, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart. The trades and results appear in the Strategy Tester tab; adjust the settings with the gear icon.

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

The trade-on setting chooses whether swing or internal structure drives trades. Settings cover swing length, internal length and the colors of each event type. The visible code does not show stop loss or sizing rules, so exits should be checked before use.

Details

Published by

cavaldos on GitHub

Code credit

Based on LuxAlgo SMC Logic - BOS & CHoCH Only Strategy, as written in the script's header

Type

Strategy, Pine Script v5

Draws

On the price chart

Category

SMC / ICT / price action

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

  • The strategy enters trades without a stop loss

Settings

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

SettingTypeDefaultVariable
Show Swing BOS/CHoCHbooltrueshowSwing
Swing Lengthint50swingLength
Show Internal BOS/CHoCHbooltrueshowInternal
Internal Lengthint5internalLength
Swing BOS Colorcolorcolor.new(#2962ff, 0)bosSwingColor
Swing CHoCH Colorcolorcolor.new(#ff9800, 0)chochSwingColor
Internal BOS Colorcolorcolor.new(#2962ff, 50)bosInternalColor
Internal CHoCH Colorcolorcolor.new(#ff9800, 50)chochInternalColor
Trade Based OnstringSwingtradeOn
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

Daily Bias + FVG Strategy

by TradersPost
218 stars

This overlay strategy plots previous-day high and low, the daily open, and fair value gap zones on the price chart. It takes entries on a selectable timeframe when the FVG requirement and an optional session window allow them, then uses an ATR or fixed pip sto

Strategy v6 SMC / ICT / price actionSupport & resistance Repaints
Updated 3 months ago · None stated GitHub repository of Daily Bias + FVG Strategy
105 stars

Gold Scalping BOS & CHoCH is an overlay strategy designed for detecting market structure shifts. It calculates rolling swing highs and lows to identify Break of Structure (BOS) and Change of Character (CHoCH) events. Long signals trigger when bullish BOS and C

Strategy v6 SMC / ICT / price actionSupport & resistance
Updated 1 year ago · None stated GitHub repository of Gold Scalping BOS & CHoCH
57 stars

This strategy identifies trend reversals through market structure changes (CHoCH) filtered by MACD momentum. It initiates long positions on bullish structure breaks when MACD is positive and above its signal line, and short positions on bearish breaks when MAC

Strategy v6 SMC / ICT / price actionOscillators & momentum Repaints
Updated 1 year ago · Apache-2.0 GitHub repository of Market Structure MACD 4H + Trailing
43 stars

Donald - AI Futures is a price-chart strategy that estimates inner and outer high-low zones and a smoothed close with rational quadratic kernel regression. It builds bullish and bearish momentum signals, optionally compares volume with a volume-weighted moving

Strategy v5 Oscillators & momentumSMC / ICT / price action Repaints
Updated 2 years ago · None stated GitHub repository of Donald - AI Futures

More strategys

Trade Your Charts With a Regulated Broker

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

Compare brokers