Strategy · Pine Script v6 · On the chart

RG Structure Visual Edition

by AllienNova

RG Structure is a pivot-constrained break-and-retest strategy that calculates dynamic trendlines, market structure changes, and regime states on the price chart.

View on GitHub

GitHub stars5on the repository
Pine versionv6current
Lines of code763
Settings39inputs
LicenceNone stated
Last update7 weeks ago3 Sep 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

RG Structure Visual Edition identifies support and resistance lines through pivot points and evaluates break-and-retest signals using ATR-based penetration and rejection scoring. The strategy enters positions on validated setup retests and exits via ATR-based initial stop losses, break-even adjustments, partial take-profits, and trailing stops. Configurable settings adjust pivot lookback periods, touch tolerances, regime thresholds, and risk management parameters. The script plots dynamic trendlines, pivot markers, trade event labels, and an on-screen dashboard.

Details

Published by

AllienNova on GitHub

Type

Strategy, Pine Script v6

Draws

On the price chart

Category

Trend, Support & resistance, SMC / ICT / price action, Screeners & dashboards

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.

Topics

aicredit-repairfintechtypescript

Settings

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

SettingTypeDefaultVariable
Lookback Window (N)int200i_N
Pivot Left Barsint2i_left
Pivot Right Barsint2i_right
Max Pivots for Line Fittingint12i_maxPivots
Violation Eval Stepint4i_evalStep
Min Pivot Touchesint2i_minTouches
Touch Tolerance (α × ATR)float0.10i_alpha
Span Reward Weight (ωs)float0.20i_omegaS
Violation Penalty (λ)float1.50i_lambda
Break Penetration (βp × ATR)float0.10i_betaP
Break Confirmation (βc × ATR)float0.15i_betaC
Retest Buffer (γ × ATR)float0.20i_gamma
Show all 39 settings
SettingTypeDefaultVariable
Fail Buffer (δ × ATR)float0.20i_delta
Retest Window (M bars)int12i_M
Regime Windowint150i_erLen
ER Trend Thresholdfloat0.35i_erTrend
ER Range Thresholdfloat0.20i_erRange
Max Crossings for Trendint8i_crossMax
Min Crossings for Rangeint20i_crossMin
Risk % (A Setup)float1.0i_riskA
Risk % (B Setup)float0.5i_riskB
A Setup Q Thresholdfloat0.70i_qA
B Setup Q Thresholdfloat0.60i_qB
Max dGeom (ATR units)float2.5i_dMax
Stop Buffer (× ATR)float0.20i_stopBuf
BE Trigger (R)float0.8i_beTrigger
Partial Take Profit (R)float1.0i_tpR
Partial Qty %int60i_tpPct
Trail Start (R)float1.0i_trailStart
Trail Buffer (× ATR)float0.20i_trailBuf
Time Stop Barsint20i_timeStop
Show Pivot Markersbooltruei_showPivots
Show Trendlinesbooltruei_showTrendlines
Show Break/Retest Zonesbooltruei_showZones
Show Trailing Stopbooltruei_showTrail
Show Regime Backgroundbooltruei_showRegime
Show Event Labelsbooltruei_showLabels
Show Info Tablebooltruei_showTable
Show CHOCH/MSS Markersbooltruei_showCHOCH
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

FilledValueGap A006

by ruckard
13 stars

This strategy enters trades in the opposite direction of filled value gaps, operating under the assumption that price action will resume the primary trend after filling a recent gap. It plots directly on the main price chart and supports MA-based trend filters

Strategy v5 SMC / ICT / price actionTrend
Updated 1 year ago · None stated GitHub repository of FilledValueGap A006

XXX

by MeridianAlgo
9 stars

This multi-timeframe scalping strategy plots moving averages alongside Smart Money Concepts elements on the price chart. It calculates trend signals using configurable moving average types like ALMA, Hull MA, or TEMA across alternate timeframes. It also plots

Strategy v5 TrendMoving averages Repaints
Updated 4 months ago · MIT GitHub repository of XXX

FVG Strategy

by muammeryldrm42
7 stars

Calculates three-bar Fair Value Gaps (FVG) and filters them using Average True Range. When price mitigates the FVG midpoint, the strategy enters a position in the direction of the gap, provided an optional EMA trend filter is satisfied. Exits are defined by an

Strategy v5 SMC / ICT / price actionSupport & resistance
Updated 3 months ago · MIT GitHub repository of FVG Strategy

NQ 9:45-10:15 ICT Strategy

by eddiebelaval
7 stars

This ICT-based strategy trades during the 9:45 AM to 10:15 AM New York session window. It calculates a daily bias using a 20-period daily EMA and tracks previous day highs and lows to identify liquidity sweeps. The script refines order block entry levels and m

Strategy v6 SMC / ICT / price actionSessions & time Repaints
Updated 3 months ago · None stated GitHub repository of NQ 9:45-10:15 ICT Strategy

FxHD Strategy v2.0

by alboogycOdR
6 stars

FxHD Strategy v2.0 is a Fibonacci multi-timeframe strategy drawn on the price chart. It reads a higher timeframe, defaulting to four hours, and sets bias with CRT kill zones, the last two candles, dynamic CRT, or market structure, plus a fallback method. It pl

Strategy v6 Support & resistanceSMC / ICT / price action
Updated 7 months ago · None stated GitHub repository of FxHD Strategy v2.0

Institutional HFT Engine - QuantAlgo

by thesenegalesehitch
4 stars

This strategy evaluates trading opportunities using a probabilistic scoring model combined with Smart Money Concepts (SMC) pattern detection, including Break of Structure (BOS), Fair Value Gaps (FVG), and Order Blocks. It overlays signals directly on the price

Strategy v6 SMC / ICT / price actionSessions & time
Updated 4 months ago · Custom licence GitHub repository of Institutional HFT Engine - QuantAlgo

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