Strategy · Pine Script v5 · On the chart

NSE Swing v6 Pro UI

by Tilak004

A trend-following swing strategy for Indian stocks.

View on GitHub

GitHub stars1on the repository
Pine versionv5runs as is
Lines of code728
Settings36inputs
LicenceNone stated
Last updateyesterday28 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 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

Longs need an EMA 21, 50 and 200 alignment with rising slopes, then enter on a pullback to the 21 EMA or a breakout above a recent swing high, filtered by ADX, volume against its average, RSI and an optional weekly and Nifty regime check. Stops and targets are ATR multiples, with an optional trailing stop. A conviction score, compact dashboard, labels and risk zones are drawn on the chart. Shorts are supported but less emphasized.

Details

Published by

Tilak004 on GitHub

Draws

On the price chart

Category

Trend, Breakout

Markets

Stocks

Timeframes

H4 and above

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
EMA 21int21e21_len
EMA 50int50e50_len
EMA 200int200e200_len
RSI Lengthint14rsi_len
ADX Lengthint14adx_len
Min ADX – Longsint18adx_long
Min ADX – Shortsint20adx_short
Volume MA Lengthint20vol_len
Volume mult – Longsfloat1.1vol_long
Volume mult – Shortsfloat1.3vol_short
Enable Weekly soft filterbooltrueuse_htf
ATR Lengthint14atr_len
Show all 36 settings
SettingTypeDefaultVariable
SL (ATR×)float1.5sl_mult
TP (ATR×) – Longsfloat3.5tp_mult_long
TP (ATR×) – Shortsfloat2.25tp_short
Trailing stop (off = matches backtest)boolfalseuse_trail
Trail activates (ATR×)float1.0trail_atr
Trail offset (ATR×)float1.5trail_offset
Compact dashboard (fits short panes)booltruecompact
Entry / exit labelsbooltrueshow_marks
Verbose labels (price + score)boolfalselabel_full
Shade risk / reward zonesboolfalseshow_zones
Tint background while in a tradeboolfalseshow_bg
Enable Pullback entriesbooltrueuse_pb
Enable Breakout entriesbooltrueuse_bo
Breakout lookback (bars)int12bo_period
Pullback zone tolerancefloat1.008pb_tol
Enable regime filterbooltrueuse_regime
Nifty50 symbolsymbolNSE:NIFTYnifty_sym
Regime EMA periodint200regime_ema
Base min barsint15base_period
Max range %float5.0max_range_pct
Base breakout vol ×float1.2base_vol_mult
Swing low lookbackint50room_bars
Min room to fall (ATR×)float3.0min_room_atr
Min DI- lead over DI+float5.0di_gap_min
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

This trend-following strategy executes a classic Donchian channel breakout system designed to cross-validate backtest results against external framework benchmarks. It triggers a long entry when the closing price breaks above the highest high of the prior entr

Strategy v6 BreakoutTrend
Updated yesterday · AGPL-3.0 GitHub repository of Forven S01509 - Simple Donchian 20/10 Breakout
257 stars

This strategy plots running pivot highs as red R circles and pivot lows as blue S circles directly on the price chart. It computes an EMA 3 and a Cto trend line from close prices, then generates long signals on upward EMA-Cto crossovers combined with price pos

Strategy v6 TrendMoving averages Repaints
Updated 6 weeks ago · None stated GitHub repository of Best Chart 1m Strategy Candle Bar

12/26-IT Strategy

by hasnocool
106 stars

This strategy executes trades based on crossovers between a 12-period and a 26-period exponential moving average (EMA). Long positions can be filtered by pivot resistance breakouts and RSI boundary ranges. For trade management, it provides two configurable par

Strategy v5 TrendMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of 12/26-IT Strategy

均线突破交易系统

by tangly1024
76 stars

This strategy trades long breakouts of a fast and a slow moving average on the price chart. It opens a long position when price crosses above either average, using a percentage of equity as size. It reduces the position by a set share when the high reaches the

Strategy v5 TrendMoving averages
Updated 5 months ago · None stated GitHub repository of 均线突破交易系统
53 stars

This strategy enters long or short on the price chart when price is on the correct side of a 200-period EMA, MACD agrees, RSI is not at the opposing extreme, ADX exceeds a threshold, volume beats a 20-bar average, and close breaks the recent high or low. A tim

Strategy v6 TrendOscillators & momentum
Updated 2 months ago · MPL-2.0 GitHub repository of BTCUSD 5M Optimized Strategy

More Trend scripts

Related on ForexR

Trade Your Charts With a Regulated Broker

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

Compare brokers