Strategy · Pine Script v6 · On the chart

TQQQ TSI Divergence

by yalili8521

This strategy identifies hidden bullish and bearish divergences between price pivots and the True Strength Index (TSI) indicator.

View on GitHub

GitHub stars2on the repository
Pine versionv6current
Lines of code264
Settings17inputs
LicenceNone stated
Last update7 days ago21 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

TQQQ TSI Divergence incorporates an Exponential Moving Average (EMA) trend filter and a customizable trading session time window. Long positions enter on hidden bullish divergences during uptrends, while short positions enter on hidden bearish divergences during downtrends. Trade management includes initial percentage stop losses, break-even trailing triggers, cooldown periods, and an end-of-session forced exit.

Details

Published by

yalili8521 on GitHub

Type

Strategy, Pine Script v6

Draws

On the price chart

Category

Oscillators & momentum, Divergence, Trend, Sessions & time

Markets

Stocks, Indices

Timeframes

M15-H1

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
TSI Long Lengthint13tsi_long_len
TSI Short Lengthint7tsi_short_len
TSI Signal Lengthint7tsi_sig_len
Pivot Lookback/Forwardint5pivot_len
Max bars between pivotsint50max_pivot_dist
Use EMA trend filterbooltrueuse_trend
Trend EMA lengthint50ema_len
Session filterbooltrueuse_session
Session start hour (ET)int9sess_start_h
Session start minuteint30sess_start_m
Session end hour (ET)int15sess_end_h
Session end minuteint30sess_end_m
Show all 17 settings
SettingTypeDefaultVariable
Initial Stop Loss %float0.50sl_pct
BE trigger % (activates trail)float0.20be_trigger_pct
Trailing Stop %float0.40trail_pct
Allow shortsbooltrueallow_short
Bars between tradesint10cooldown_bars
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

106 stars

This strategy enters long positions during a specified trading session when multiple technical indicators align. It executes a buy order when the low drops below the lower Bollinger Band while RSI and ADX exceed configurable threshold values, price closes abov

Strategy v4 Volatility & bandsOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of Bollinger Band + RSI + ADX + MACD
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
6 stars

This strategy combines higher-timeframe market bias filtering with an oscillator and ADX trend detection to generate trading signals. It calculates market bias using Heikin-Ashi values across custom timeframes and filters entries using dynamic or static ADX th

Strategy v6 TrendOscillators & momentum
Updated 7 months ago · None stated GitHub repository of EURUSD Synergy + PropEA Hedge

This strategy executes long positions by combining a 200-period EMA trend filter, Stochastic RSI oversold crosses, and Williams Alligator retracements, supplemented by RSI divergence detection. It triggers long entries when the price trades above the 200 EMA w

Strategy v4 TrendOscillators & momentum
Updated 3 years ago · Apache-2.0 GitHub repository of 200 EMA + Alligator + Stochastic Long Strategy
4 stars

This strategy calculates fast and slow exponential moving averages, the Relative Strength Index, and the Average True Range directly on the price chart. It enters long positions when the fast EMA crosses above the slow EMA with RSI above the minimum threshold

Strategy v6 TrendMoving averages
Updated 2 months ago · MIT GitHub repository of NQ Nasdaq Strategy [trugurpala]

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