Strategy · Pine Script v6 · Own pane

TnS_StochDiv_V6

by raybird

This Pine Script strategy detects causal reversals using a smoothed stochastic oscillator to track momentum.

View on GitHub

GitHub stars1on the repository
Pine versionv6current
Lines of code150
Settings11inputs
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

TnS_StochDiv_V6 identifies harmonic divergences in price versus the oscillator and applies a Kronos resonance proxy based on phase coherence. ATR dynamically sets stop loss and target levels using a risk-reward ratio. The strategy draws signals and analysis in a separate pane. Main settings adjust stochastic lengths, divergence lookback ranges, minimum coherence threshold, and risk parameters. It uses a fixed percentage of equity for position sizing.

Details

Published by

raybird on GitHub

Draws

Separate pane below the chart

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
%K Lengthint14periodK
%K Smoothingint3smoothK
%D Smoothingint3periodD
Overboughtint80obLevel
Oversoldint20osLevel
Pivot Lookback Leftint5lbLeft
Pivot Lookback Rightint5lbRight
Max History Scanint60maxBarsBack
Min Phase Coherencefloat1.5min_coher
SL ATR Multiplefloat1.5sl_atr_mult
Target R:R Ratiofloat3.0tp_rr
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

Golden Buy

by hasnocool
106 stars

This strategy runs on the price chart under the title golden buy. It sets cash order size and a percent commission. Traders adjust an ATR stop-loss multiplier and a risk-reward ratio, and they can enable shorts or divergence filters. The visible inputs configu

Strategy v4 Oscillators & momentumDivergence
Updated 2 years ago · GPL-3.0 GitHub repository of Golden Buy
13 stars

Ruckard Squeezed E004 is a price-chart strategy that compares successive Squeeze Momentum colour-section changes. A smaller squeeze value with a higher price opens a short; a higher squeeze value with a lower price opens a long. Direction can be limited to lon

Strategy v5 Oscillators & momentumVolatility & bands
Updated 1 year ago · None stated GitHub repository of Ruckard Squeezed E004

Fusion Cipher Strategy

by shahzaib-574
1 stars

Fusion Cipher Strategy is an overlay strategy that scores wave momentum, money flow, VWAP, RSI, Stochastic RSI, ADX, and divergence conditions before opening trades. It enters long when the composite score meets a minimum and the wave is below a pullback thres

Strategy v6 Oscillators & momentumMoving averages
Updated 3 months ago · None stated GitHub repository of Fusion Cipher Strategy
330 stars

MACD + Divergences [Alorse] is a momentum strategy that calculates the MACD oscillator and identifies regular and hidden divergences using pivot high and low points. It filters trade signals with dual Exponential Moving Averages (EMA 150 and 600) to ensure tra

Strategy v4 Oscillators & momentumDivergence Repaints
Updated 2 months ago · None stated GitHub repository of MACD + Divergences [Alorse]

EMA Ribbon MACD

by iamrichardD
57 stars

This strategy combines an EMA ribbon with MACD confirmation and plots in a separate pane. It enters when ribbon alignment, optional MACD zero or signal crosses, volume, smart-money, and multi-timeframe filters agree, then exits with percentage stop loss and ta

Strategy v6 TrendMoving averages
Updated 1 year ago · Apache-2.0 GitHub repository of EMA Ribbon MACD

More Oscillators & momentum 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