The idea
This is PakunFX's open-source script, published as "RSI-Adaptive T3 + Squeeze Momentum Strategy". It pairs a T3 moving average whose length follows RSI with a Bollinger-versus-Keltner squeeze. A trade is opened only when that squeeze is already off, T3 has just turned, and the linear-regression momentum value val agrees with that direction. Both longs and shorts are used.
The author's published chart is BITSTAMP:BTCUSD on the 30-minute timeframe, so this page lists it as a BTC strategy. The script does not hard-code a symbol, and it has no standalone stop or take-profit. The position is reversed by an opposite strategy.entry.

How the indicators are built
- RSI is calculated on close over rsiLen bars (default 14). The T3 length is math.round(minLen + (maxLen - minLen) * (1 - RSI/100)), with defaults 5 and 50. Lower RSI makes T3 longer; higher RSI makes it shorter.
- T3 is the usual Tillson six-EMA mix, with Volume Factor 0.7 by default. The script uses a custom pine_ema(). When the length changes with RSI, the new smoothing factor is applied to the previous EMA value; the average is not rebuilt from scratch.
- The Bollinger basis is an SMA of close over length (default 27). The band width in the source is multKC times the standard deviation. The BB MultFactor input named mult is never used.
- The Keltner Channel is an SMA of lengthKC (default 20), plus or minus the SMA of true range (or high-low range) over the same length, times multKC (default 1.5).
- sqzOff (squeeze off) requires the lower Bollinger Band to sit below the lower Keltner band and the upper Bollinger Band to sit above the upper Keltner band — the bands have moved back outside the channel. If only one side qualifies, both sqzOn and sqzOff can be false, and no entry is taken.
- val is a lengthKC-period linear regression, offset 0, of close minus the average of the lengthKC mid-range and the lengthKC SMA of close. val > 0 is treated as bullish, val < 0 as bearish.
Entries
- Long (order name Long): T3 crosses above its previous value (ta.crossover(t3, t3[1]), i.e. T3 has just turned up after being flat or down), val > 0, and sqzOff is true.
- Short (order name Short): T3 crosses below its previous value, val < 0, and sqzOff is true.
- The source does not require a flat book. If a position is already open the other way, the opposite strategy.entry reverses it under TradingView's default behavior.
Exits and sizing
- There is no strategy.exit or strategy.close. The only exit is an opposite entry.
- If the opposite setup does not appear for a long stretch, the position stays open and is not trailed.
- Orders are 100% of equity. The script does not set initial capital or commission, so the tester uses TradingView defaults.
Inputs (defaults in the source)
| Input | Default | What it does |
|---|---|---|
| RSI Length / Min T3 Length / Max T3 Length | 14 / 5 / 50 | Maps RSI into a T3 length between 5 and 50 |
| T3 Volume Factor | 0.7 | Tillson T3 volume factor v |
| BB Length / BB MultFactor | 27 / 2.0 | Bollinger length; the MultFactor input is unused in the source |
| KC Length / KC MultFactor / Use TrueRange (KC) | 20 / 1.5 / true | Keltner length and multiple; the Bollinger width also uses this multiple |
| Order size | 100% of equity | strategy.percent_of_equity, default 100 |
Caveats
- BB MultFactor (mult) is exposed as an input, but the band width is computed with the Keltner multiple multKC. Changing BB MultFactor does not move the bands.
- When the T3 length changes with RSI, the custom EMA keeps smoothing from its previous value. That is not identical to a fixed-length T3 recomputed each bar.
- There is no stop. If price runs the other way and a flip signal is slow to appear, the drawdown can keep growing.
- Each order is 100% of equity. Live fee schedules, contract multipliers, and quote currencies often differ, so tester results are not exchange fills.
- The author showed 30-minute BTC. The default squeeze and T3 lengths may not fit a much longer or shorter timeframe.
Install it on TradingView
- Download the .pine file from Coinpred (a current membership is required; see the page) or check the original publication for a newer revision.
- Open the symbol and timeframe you want in TradingView, open the Pine Editor, paste the source, and add it to the chart.
- Start from the script defaults, then change inputs for your market and timeframe. To change Bollinger width, adjust KC MultFactor, not BB MultFactor.
- The order size in the source applies to the strategy tester only. Live order routing has to be set separately.
- Crypto trades around the clock. The tester's timezone and session settings may differ from your venue by several hours.
About backtest figures
Source, license, and version
- Source: https://www.tradingview.com/script/7UNWrm2O-RSI-Adaptive-T3-Squeeze-Momentum-Strategy/
- Author: PakunFX (header © PakunFX)
- License: Mozilla Public License 2.0. Redistribution must keep the original copyright and license notices; if you modify the source file, the modified file must remain under MPL 2.0. Coinpred ships the unmodified source.
- Version: 1.0 in the publication record and pine-facade. Pine v6, scriptAccess open_no_auth.



