Strategy · Pine Script v6 · On the chart

PineForge Cascade MTF Tuple

by pineforge-4pass· code credited to PineForge

PineForge Cascade MTF Tuple is a multi-timeframe trend-following strategy designed for price charts.

View on GitHub

GitHub stars1on the repository
Pine versionv6current
Lines of code34
Settings5inputs
LicenceApache-2.0
Last update5 days ago23 Oct 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above, or the copy button on the code below.
  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

34 lines of Pine Script v6 from validation/mtf-cascade-tuple-01/strategy.pine, published under Apache-2.0. Keep the author's credit and licence lines when you reuse it.

strategy.pine
//@version=6
// SPDX-License-Identifier: Apache-2.0
// Copyright 2026 PineForge
// PineForge Corporate Strategy: Cascade MTF Tuple
// A tuple materializes higher-timeframe center and volatility from one request.
strategy("PineForge — Cascade MTF Tuple", overlay=true,
     initial_capital=100000,
     default_qty_type=strategy.fixed, default_qty_value=2,
     pyramiding=0, commission_type=strategy.commission.percent,
     commission_value=0.05, slippage=1,
     margin_long=100, margin_short=100,
     process_orders_on_close=false, calc_on_order_fills=false)

higherTimeframe = input.timeframe("240", "Higher Timeframe", group="Signal")
centerLength = input.int(27, "Higher EMA", minval=3, group="Signal")
atrLength = input.int(15, "Higher ATR", minval=2, group="Signal")
entryDistance = input.float(0.35, "Entry Distance ATR", minval=0, step=0.05, group="Signal")
stopAtr = input.float(2.0, "Stop Higher ATR", minval=0.5, step=0.1, group="Risk")

[higherCenter, higherAtr] = request.security(syminfo.tickerid, higherTimeframe,
     [ta.ema(close, centerLength), ta.atr(atrLength)],
     gaps=barmerge.gaps_off, lookahead=barmerge.lookahead_off)
entryLine = higherCenter + higherAtr * entryDistance

if ta.crossover(close, entryLine)
    strategy.entry("Cascade Long", strategy.long)
if strategy.position_size > 0 and close < higherCenter
    strategy.close("Cascade Long", comment="Higher center lost")
if strategy.position_size > 0
    strategy.exit("Cascade Guard", from_entry="Cascade Long",
         stop=strategy.position_avg_price - higherAtr * stopAtr)

plot(higherCenter, "Higher Center", color=color.blue)
plot(entryLine, "Tuple Entry Line", color=color.green)

Overview

PineForge Cascade MTF Tuple uses a single security request to retrieve an Exponential Moving Average and Average True Range from a higher timeframe. The strategy plots an entry threshold offset above the higher-timeframe average using an ATR multiplier. It enters a long position when price breaks above this threshold, exits when price falls below the higher-timeframe center line, and enforces a risk stop based on higher-timeframe volatility.

Details

Published by

pineforge-4pass on GitHub

Code credit

PineForge, as written in the script's header

Type

Strategy, Pine Script v6

Draws

On the price chart

Category

Trend, Moving averages, Volatility & bands, Breakout

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.

Topics

algorithmic-tradingbacktestingparitypine-scriptpinescriptquantitative-financetest-corpustradingview

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
Higher Timeframetimeframe240higherTimeframe
Higher EMAint27centerLength
Higher ATRint15atrLength
Entry Distance ATRfloat0.35entryDistance
Stop Higher ATRfloat2.0stopAtr
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 runs on the price chart and enters long when a fast simple moving average crosses above a slow one, and short on the opposite cross, while closing the other side. Entries also need ATR above a filter, a pullback check, a minimum candle-body chang

Strategy v5 TrendMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of 9:22 5 MIN 15 MIN BANKNIFTY

均线突破交易系统

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 4 months ago · None stated GitHub repository of 均线突破交易系统
16 stars

This strategy plots Donchian channels, trailing stops, and profit targets directly on the price chart. It enters breakout trades using a 55-bar Donchian channel and sizes positions according to an ATR-based risk percentage per unit. The system adds units as pr

Strategy v6 TrendBreakout
Updated 11 months ago · None stated GitHub repository of Seykota Alt 10: Profit Targets
4 stars

This strategy executes trend-following trades based on Bollinger Band breakouts confirmed by a long-term moving average filter. A long position opens when the price crosses above the upper Bollinger Band, provided the band spread meets a minimum threshold and

Strategy v5 Volatility & bandsTrend
Updated 2 years ago · None stated GitHub repository of Bollinger Trend - Strategy V1
4 stars

The Keltner Channel Strategy is a breakout system plotted directly on the main price chart. It calculates upper and lower channel bands around an exponential or simple moving average using ATR, True Range, or bar range multiplied by a specified factor. A long

Strategy v5 TrendVolatility & bands
Updated 5 months ago · None stated GitHub repository of Keltner Channel Strategy

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