Strategy · Pine Script v6 · On the chart

TN PineGen Vol Switch Regime [TeleNexus]

by raybird

This strategy dynamically switches between breakout and mean-reversion modes based on market volatility.

View on GitHub

GitHub stars1on the repository
Pine versionv6current
Lines of code45
Settings5inputs
LicenceNone stated
Last update2 months ago15 Aug 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

TN PineGen Vol Switch Regime [TeleNexus] compares the Average True Range (ATR) against a simple moving average lookback to classify the regime as high or low volatility. During low volatility, it fades price extremes outside the range for mean reversion. During high volatility, it buys or sells breakouts beyond the range highs and lows. Positions exit via an ATR-based stop loss and a fixed risk-to-reward limit target, with range channels plotted on the price chart.

Details

Published by

raybird on GitHub

Type

Strategy, Pine Script v6

Draws

On the price chart

Category

Volatility & bands, Breakout, Mean reversion

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
ATR Lengthint14atrLen
Volatility Lookbackint50lookback
Range Lengthint20rangeLen
Risk Rewardfloat2.0rr
Stop ATR Multfloat1.5atrMult
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

BBPullback

by hasnocool
106 stars

This strategy executes pullback trades based on internally computed Bollinger Bands and candle price action directly on the main price chart. It tracks breakout and pullback states to trigger long and short entries. Users can select among three distinct take p

Strategy v5 Volatility & bandsMean reversion
Updated 2 years ago · GPL-3.0 GitHub repository of BBPullback
3 stars

This strategy plots Bollinger Bands on the price chart and enters long only when flat. It buys on a strong bullish close above the middle band or on a small-body pullback that tags the middle band with a long lower wick. The stop sits below the signal bar by a

Strategy v5 Volatility & bandsBreakout
Updated yesterday · None stated GitHub repository of H4 布林ATR型態多單策略

KC Integration

by Sikako
1 stars

KC Integration is a trading strategy that calculates multiple sets of Keltner Channels tailored for both trend-following and counter-trend conditions. It plots upper, middle, and lower channel bands directly on the main price chart to identify potential breako

Strategy v5 Volatility & bandsBreakout
Updated 3 years ago · None stated GitHub repository of KC Integration
1 stars

The strategy detects range expansion by comparing the previous bar's range to its ATR multiple. It places pending stop entries above highs of up bars or below lows of down bars. On trigger it enters positions with take profit and stop loss in ticks using OCA g

Strategy v6 Volatility & bandsSupport & resistance
Updated 5 days ago · Apache-2.0 GitHub repository of PF probe 97 - tp/sl gap reversal oca

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