Indicator · Pine Script v5 · On the chart

MTF OTF Close Filter

by flaviusapop

MTF OTF Close Filter calculates multi-timeframe breakout or continuation states by comparing each timeframe's current close to the highest and lowest closes over the prior N bars.

View on GitHub

GitHub stars2on the repository
Pine versionv5runs as is
Lines of code237
Settings14inputs
LicenceNone stated
Last update5 weeks ago23 Sep 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 indicator, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.

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

MTF OTF Close Filter plots a six-cell status table at the bottom right of the chart showing UP, DOWN, or Neutral states for 1m, 2m, 5m, 30m, 60m, and 120m timeframes. An optional semi-transparent background tint overlays the price chart based on overall alignment across all timeframes. Mode 0 and 1 produce strict or lenient breakout signals while Mode 2 carries the prior state forward once established, avoiding neutral after the first breakout. Main settings adjust lookback periods for low, high, and chart timeframes plus the mode selection.

Details

Published by

flaviusapop on GitHub

Draws

On the price 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
Mode (0 Breakout · 1 Continuation · 2 Stateful)int2mode
N lookback · 1m / 2m / 5mint3n_ltf
N lookback · 30m / 60m / 120mint5n_htf
N lookback · chart interval (background only)int3n_chart
Balance bars · consecutive inside closesint3bal_bars
Table positionstringBottom Righttbl_pos_str
Text sizestringSmalltxt_sz_str
Show transparent background tintbooltrueshow_bg
Tint transparency (0 = opaque · 100 = invisible)int88bg_transp
UPcolorcolor.new(#00C850, 0)c_up
DOWNcolorcolor.new(#C83232, 0)c_dn
Neutralcolorcolor.new(#5A5A5A, 0)c_neut
Show all 14 settings
SettingTypeDefaultVariable
Status bar backgroundcolorcolor.new(#121212, 75)c_bg
Label textcolorcolor.whitec_txt
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

32 stars

Ghost Channels fits dynamic parallel trend channels over a configurable lookback window using linear regression or pivot swing methods. It layers confirmation signals onto the channel geometry, detecting candlestick pattern reactions at the rails, volume-confi

Indicator v6 TrendBreakout
Updated 4 days ago · MIT GitHub repository of Ghost Channels [mph1nance]
1 stars

A price-chart indicator that extends a three-regime signal engine (trend, range edge reversal, breakout) with higher-timeframe context and a transparent confidence score. The higher timeframe uses the previous completed bar, either auto-selected or set manuall

Indicator v6 TrendBreakout Repaints
Updated 2 months ago · None stated GitHub repository of NO.1 V4 MTF Confidence Fusion

More Breakout 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