TrendDetectorLibLibrary "TrendDetector_Lib"
method formatTF(timeframe)
Namespace types: series string, simple string, input string, const string
Parameters:
timeframe (string) : (string) The timeframe to convert (e.g., "15", "60", "240").
Returns: (string) The formatted timeframe (e.g., "15M", "1H", "4H").
f_ma(type, src, len)
Computes a Moving Average value based on type and length.
Parameters:
type (simple string) : (string) One of: "SMA", "EMA", "RMA", "WMA", "VWMA".
src (float) : (series float) Source series for MA (e.g., close).
len (simple int) : (simple int) Length of the MA.
Returns: (float) The computed MA series.
render(tbl, trendDetectorSwitch, frameColor, frameWidth, borderColor, borderWidth, textColor, ma1ShowTrendData, ma1Timeframe, ma1Value, ma2ShowTrendData, ma2Timeframe, ma2Value, ma3ShowTrendData, ma3Timeframe, ma3Value)
Fills the provided table with Trend Detector contents.
@desc This renderer does NOT plot and does NOT create tables; call from indicator after your table exists.
Parameters:
tbl (table) : (table) Existing table to render into.
trendDetectorSwitch (bool) : (bool) Master toggle to draw the table content.
frameColor (color) : (color) Table frame color.
frameWidth (int) : (int) Table frame width (0–5).
borderColor (color) : (color) Table border color.
borderWidth (int) : (int) Table border width (0–5).
textColor (color) : (color) Table text color.
ma1ShowTrendData (bool) : (bool) Show MA #1 in table.
ma1Timeframe (simple string) : (string) MA #1 timeframe.
ma1Value (float)
ma2ShowTrendData (bool) : (bool) Show MA #2 in table.
ma2Timeframe (simple string) : (string) MA #2 timeframe.
ma2Value (float)
ma3ShowTrendData (bool) : (bool) Show MA #3 in table.
ma3Timeframe (simple string) : (string) MA #3 timeframe.
ma3Value (float)
在腳本中搜尋"mtf"
MTFDataLibrary "MTFData"
Functions to store multi timeframe candle data and swing points.
getCandleData(timeframe, openArray, highArray, lowArray, closeArray, timeArray, olcLookback, alltfs_olcLookback, tfIndex)
Stores current or higher timeframe candle data in arrays.
Parameters:
timeframe (string) : The timeframe, for example "240" for 4h
openArray (array) : An array to store the candle open price
highArray (array) : An array to store the candle high price
lowArray (array) : An array to store the candle low price
closeArray (array) : An array to store the candle close price
timeArray (array) : An array to store the candle time
olcLookback (int) : The history reference of the lookback limiting candle
alltfs_olcLookback (array) : An array holding the candle time of olcLookback candles ago, which can be used for limiting lookbacks
tfIndex (int) : The timeframe's index in the alltfs_olcLookback array
Returns: true if the timeframe changed
trackHiLo(tfchange, timeframe, openArray, highArray, lowArray, closeArray, timeArray, highWickArray, highBodyArray, highTimeArray, lowWickArray, lowBodyArray, lowTimeArray, alltfs_olcLookback, tfIndex)
Stores current or higher timeframe swingpoint data into arrays.
Parameters:
tfchange (bool) : Must be true when the timeframe has changed (a new candle has opened)
timeframe (string) : The timeframe, for example "240" for 4h
openArray (array) : An array that stores the timeframe's candle open price
highArray (array) : An array that stores the timeframe's candle high price
lowArray (array) : An array that stores the timeframe's candle low price
closeArray (array) : An array that stores the timeframe's candle close price
timeArray (array) : An array that stores the timeframe's candle time
highWickArray (array) : An array to store the swing high price
highBodyArray (array) : An array to store the swing high's highest body price
highTimeArray (array) : An array to store the swing high candle's time
lowWickArray (array) : An array to store the swing low price
lowBodyArray (array) : An array to store the swing low's lowest body price
lowTimeArray (array) : An array to store the swing high candle's time
alltfs_olcLookback (array) : An array holding the time of the max allowed swing point age
tfIndex (int) : The timeframe's index in the alltfs_olcLookback array
Returns: Nothing. The array handling happens inside the function.
tfReadable(tfInSec)
Converts a timeframe string ("240") into a more readable string ("4h").
Parameters:
tfInSec (int) : The timeframe that should be converted, as timeframe.in_seconds()
Returns: A more readable timeframe string
MTF Confluence Reporter - Trend & Momentum AlignmentThis indicator is a multi-timeframe confluence dashboard designed to answer one question clearly:
“Across my key timeframes, is the market leaning Bullish, Bearish, or Mixed—and how strong is that lean?”
It combines two separate “votes” per timeframe:
4MA Direction (trend alignment / slope bias)
StochRSI State (momentum bias)
Those votes are then blended into a single Confluence result, shown as a clean readout with a 0–100 Strength score, plus hysteresis to reduce flicker near the decision boundary.
What you see in the table
1) 4MA
This is the trend component. It summarizes whether the selected timeframes are generally Bull or Bear based on the moving-average direction logic (your 4MA engine).
2) Stoch
This is the momentum component. It summarizes whether StochRSI across the selected timeframes is leaning Bull or Bear.
3) Qualified (YES/NO)
A safety gate. “Qualified = YES” means the internal conditions required for a valid confluence read are met (i.e., enough alignment/consistency to treat the output as actionable).
If it’s NO, treat the market as mixed / transitional and tighten risk.
4) Strength (0–100)
Your blended score (trend + momentum).
Higher = stronger agreement across timeframes.
A simple way to interpret it:
80–100: Strong alignment (clean regime)
60–79: Moderate alignment (tradable, but expect chop)
50–59: Weak / transitioning (be cautious)
< 50: Bearish side of the regime logic (or mixed turning down)
5) Strength Bar
A visual “battery meter” for the Strength score. This is meant to be read at a glance during fast decision-making.
6) Confluence (BULL/BEAR)
The actual regime output. This is the “final answer” based on the Strength score and hysteresis rules.
7) Hysteresis (Enter / Exit thresholds)
This is the anti-flicker system.
Example shown on the chart:
Enter > 60
Exit < 50
Meaning:
The script only “flips ON” a Bull regime when strength becomes convincingly Bullish (above 60).
It won’t “flip OFF” until strength meaningfully weakens (below 50).
This reduces rapid flipping during 50/50 conditions.
How to use it (practical workflow)
Step 1 — Use Confluence as your “market mode”
BULL: Favor longs, trend-following entries, buying pullbacks.
BEAR: Favor defense, shorts/hedges (if you trade them), or wait for reset.
Qualified = NO: Reduce size, tighten stops, or wait—conditions are not clean.
Step 2 — Use Strength to time aggressiveness
Strength rising: Momentum is joining trend → entries tend to have better follow-through.
Strength falling: Alignment is fading → take profit quicker or tighten risk.
Step 3 — Use hysteresis as your “noise filter”
If you’re a swing trader, hysteresis is your friend:
Don’t overreact to a single bar change.
Let the regime confirm and stay confirmed.
Best use-cases
Swing trading / position bias (daily/weekly context)
Hedge decisions (when alignment flips and stays flipped)
Filtering entries from other tools (only take signals that match the regime)
Settings notes:
This script is designed to be flexible:
You can choose which timeframes matter most to you (commonly 1H / 4H / 1D / 1W / 1M).
If your version includes weighting, you can tune weights to match your trading style (short-term vs swing).
Thresholds (Enter/Exit) can be tightened for faster flips or widened for smoother regimes.
Important notes / disclaimer (TradingView-safe)
This tool is an informational confluence dashboard, not financial advice. No indicator can predict the future. Always confirm with market structure, risk management, and your own plan. Past behavior on a chart does not guarantee future results.
How I Use This Indicator (Example Workflow)
I use this tool primarily as a market-bias and risk-filter, not as a standalone entry signal.
Establish the regime first
I start by checking the Confluence row:
BULL: I focus on long-side ideas and bullish continuation setups.
BEAR: I become defensive, avoid counter-trend trades, or look for short/hedge opportunities where applicable.
Qualified = NO: I treat the market as transitional and reduce risk.
Use Strength to adjust aggressiveness
When Strength is elevated and rising, I am more comfortable holding positions and allowing trades more room to develop.
When Strength is declining, I tighten stops, reduce position size, or manage trades more actively.
Let hysteresis do the work
I do not react to every minor fluctuation near the midpoint.
The built-in hysteresis thresholds help me stay aligned with the prevailing regime instead of over-trading during indecision.
Entries come from other tools
Actual entries are taken using price structure, support/resistance, or other indicators.
This dashboard simply tells me whether the broader environment supports that idea or not.
In short, I treat this indicator as a context and confirmation layer—it helps answer when to be aggressive, cautious, or patient.
MTF Indicator DashboardMulti-Timeframe Indicator Dashboard
A comprehensive multi-timeframe dashboard that displays the status of key technical indicators across 8 different timeframes in a compact, color-coded table.
Features:
Monitors 8 timeframes simultaneously: 3m, 5m, 15m, 30m, 1H, 2H, 4H, and Daily
Tracks 5 key indicators:
RSI (2-period with 6-period smoothing): Green when above 50, Red when below 50
ADX/DI (2-period): Green when +DI > 20 and dominant, Red when -DI > 20 and dominant
MACD (2, 3, 6): Green when MACD line above signal line, Red when below
EMAs (9, 20, 50, 100, 200, 400): Green when price above all EMAs, Red when below all EMAs
Overall: Combined signal requiring 2+ indicators to agree for bullish/bearish confirmation
Display:
Clean, compact table positioned in top-right corner
Color-coded boxes: Green (bullish), Red (bearish), Gray (neutral)
Minimal visual clutter for quick analysis
Updates in real-time
Use Case:
Perfect for traders who want to quickly identify timeframe alignment and confluence across multiple technical indicators. Ideal for scalping, day trading, and swing trading to spot high-probability setups when multiple timeframes align.
Settings:
All indicator parameters match the calculations used and can be viewed in the source code.
MTF EMA Cross Labels perfect indicator to make trading on your phone easier. all info on 1 screen.
ema's are adjustable
MTF MACD( TF0 cross 0 ) MULTI TIMEFRAME MACD Checking with OSMA TF+1 Momentum check
and TF+2 Trend Check to clarify the clean signal
MTF Volume Weighted Average PriceSame Orignal VWAP
Now you can set it to any Time Frame, and see it on that Time Frame While on your current Time Frame.
MTF Dynamic MA TrackerThis indicator allows you to track the behavior of price relative to a key Moving Average across up to 9 different timeframes simultaneously.
The idea behind this tool is to see what your favourite MA is doing at various TFs while solving the problem of "chart clutter." Plotting 9 different Moving Averages on a single chart usually results in a messy interface that is hard to read. This script solves that using Dynamic Dimming.
Default Settings:
By default, the script is configured to track the EMA 200 (Exponential Moving Average). However, this is for illustration purposes only. You can fully customize the indicator to track your preferred Moving Average Type (EMA, SMA, HMA, WMA, or RMA) and your preferred Length (e.g., 50, 100, 200) in the settings menu.
Key Features:
Multi-Timeframe Tracking:
Monitor your chosen Moving Average across 9 user-defined timeframes (e.g., 1m, 5m, 15m, 1H, 4H, Daily, etc.) directly on your current chart.
Dynamic Visibility (Dimming):
By default, the MA lines remain transparent (dimmed) to keep your chart clean.
The lines automatically brighten (light up) only when the price comes within a specific proximity of the MA. This highlights immediate Support or Resistance levels without visual noise.
You can customize the "Proximity Method" using either a Percentage of price or an ATR multiplier.
Tag Detection & Alerts:
The script detects "Tags"—moments where price interacts with a Moving Average (e.g., wicks into it and closes back above/below).
Bull Tag (Support): Price dips into the MA but closes above it.
Bear Tag (Resistance): Price spikes into the MA but closes below it.
You can set alerts to trigger whenever these interactions occur on any monitored timeframe.
Dashboard (Nexus):
A status table displays "Clusters" (when price is near multiple MAs simultaneously) and lists any active Bull/Bear tags occurring on the current bar.
Customization:
MA Type: Choose between EMA, SMA, HMA, WMA, or RMA.
MA Length: Input any length (Default: 200).
Timeframes: Individually enable/disable and select up to 9 specific timeframes.
Dimming: Adjust the transparency for "dimmed" vs "bright" states.
libSchedulerTLDR: This is a lightweight, easy-to-use way to throttle sections of Pinescript v6 scripts, the same as you'd use barstate.isconfirmed or barstate.islast. You can use this for enormous efficiency gains, provided you design your script to handle updates on differing intervals rather than computing everything on each cycle. Usage is easy:
```
import showmethegrail/libScheduler/1 as libScheduler
i_tf_fetch = input.enum(libScheduler.Timeframes.C, "Fetch Interval",
tooltip="Do things just once every interval, default=once per chart timeframe.")
var scheduler = libScheduler.Scheduler.new().init()
if scheduler.every(i_tf_fetch)
// Do stuff
```
That's it. If you need to know more, the code is well-commented.
Combine this with sensible caching, and you can right-size the compute-heavy sections of your script, for better stability and managed use of Pinescript compute quotas. You'll need to know the proper use of var and varip to make the most of this, but I found this effectively replaced a lot of boilerplate in throttling my own scripts.
Sound software engineering, made Pinescript-level easy. That's all.
MTF EMAs: 200 EMA (1hr & 15m), 8 EMA (5m)Using the 200 ema on 1hr and 15 min timeframe to ID entry points for scalping.
MTF EMA50/200 // ADX (Auto TF Pairing) with SL/TP // v6Strategy overview (EMA50/EMA200 + ADX, multi-timeframe):
This system trades only in the direction of the higher-timeframe trend and uses the current chart timeframe for precise entries.
Trend filter (Higher TF):
Bull trend: EMA50 > EMA200 and ADX ≥ threshold → only LONGs allowed
Bear trend: EMA50 < EMA200 and ADX ≥ threshold → only SHORTs allowed
If ADX is below the “no-trend” threshold, the market is considered choppy and trades are avoided.
Entry (Lower TF / chart TF):
Enter only when the chart timeframe confirms momentum in the HTF direction using one of:
Touch: price pulls back to EMA50 and closes back on the trend side
Rejection: stricter “touch + reject” near EMA50
Cross: close crosses EMA50 in the trend direction
Stop Loss (structure + volatility):
LONG: below the safer of last swing low or EMA50, minus an ATR buffer
SHORT: above the safer of last swing high or EMA50, plus an ATR buffer
Take Profit (risk-based):
Targets are set as multiples of risk (R) from entry:
TP1 = 2R (default)
TP2 = 3R (optional)
The indicator plots only the latest trade’s Entry (black line), Stop (red dashed), and TP (green dashed), and it auto-pairs the chart timeframe with a “next level up” higher timeframe for the trend filter.
MTF MomentumThis script identifies momentum for the following three timeframes: 1 minute, 5 minutes, and 15 minutes.
MTF Auto Fibs + All Levels [Clean]auto fib off whatever higher time frame you want! Helps you seen levels faster and with out switch time frames
MTF Multi Indicator Table by JAB76TABLE for trading with EMA and ICHIMOKU , HELPS IN ANALYSIS OF TREND
MTF Switch Level (Single TF)Multi-timeframe Switch Level (Single TF)
This indicator marks the most recent “switch level” created by breakout / breakdown behaviour on the current timeframe.
How it works
– After a bullish breakout (close above the previous bar’s high), the script sets a bearish switch level at that previous high.
– After a bearish breakdown (close below the previous bar’s low), it sets a bullish switch level at that previous low.
– A single horizontal line extends from the latest switch level.
– The line and “S” label turn bullish when price is above the level and bearish when price is below it.
– Optional alerts fire when price crosses the active switch level.
Use-cases
– Visualise where breakout traders are likely trapped.
– Define a simple “above = bullish / below = bearish” bias line.
– Combine with higher-timeframe analysis or other tools for context.
Inputs
– Enable/disable bullish and bearish switch conditions.
– Line length, colour, style, thickness.
– Label position and offsets.
– Alert conditions for crosses.
Disclaimer
This tool is for charting and educational purposes only and is not financial advice or a signal service. Always do your own research and risk management.
MTF Bias Alert SystemMulti-Time-Frame Bias Alert System
include HTF BIAS and any Time Frame Confluence
MTF Alignment & Key Levelsso this one is specifically for the 1hr and 4hr time frame. but what it does is alert you once the monthly weekly and daily timeframes align with a trend in a certain direction wether its bearish or bullish but then it will mark out key levels on the 1hr and 4hr time frame to indicate when price breaks through that level to enter a trade in the direction of the higher timeframes alignment.
MTF S/R Array - Full CustomA clean, institutional-style multi-timeframe support and resistance indicator designed for precision trading decisions. Plots previous and current period levels with full customization for backtesting and live trading.
━━━━━━━━━━━━━━━━━━━━━━
WHAT IT PLOTS
━━━━━━━━━━━━━━━━━━━━━━
MONTHLY
- Previous Month High / Low / Close
- Previous Month Highest Closing Price
- Current Month High / Low / Highest Close
WEEKLY
- Previous Week High / Low / Close
- Current Week High / Low
DAILY
- Previous Day High / Low / Close
- Current Day High / Low
SESSIONS (Full Session - EST)
- Asian: 7pm - 4am
- London: 3am - 12pm
- New York: 8am - 5pm
OPENING RANGE
- Monday/Tuesday combined high and low
- Clean box visualization for weekly initial balance
━━━━━━━━━━━━━━━━━━━━━━
WHY THESE LEVELS MATTER
━━━━━━━━━━━━━━━━━━━━━━
Institutions and smart money reference these key levels for:
- Liquidity targets
- Stop hunts
- Reversal zones
- Trend continuation entries
Previous period levels act as magnets for price. Current levels show where the battle is happening now.
━━━━━━━━━━━━━━━━━━━━━━
FULL CUSTOMIZATION
━━━━━━━━━━━━━━━━━━━━━━
Every level type has independent controls:
- Show/Hide Previous and Current separately
- Extend Bars - control how far each level stretches
- Line Width - adjust thickness per level
- Transparency - fade previous levels for clarity
- Colors - separate colors for High/Low vs Close
Additional settings:
- Labels on/off with size and style options
- Info table with position and size controls
- Opening range box transparency and border width
━━━━━━━━━━━━━━━━━━━━━━
HOW TO USE
━━━━━━━━━━━━━━━━━━━━━━
1. Use on lower timeframes (1m, 5m, 15m) to see HTF levels
2. Watch for price reactions at previous period highs/lows
3. Look for session high/low sweeps followed by reversals
4. Use Monday/Tuesday opening range for weekly bias and targets
5. Previous levels extend further back for backtesting context
━━━━━━━━━━━━━━━━━━━━━━
TIPS
━━━━━━━━━━━━━━━━━━━━━━
- Increase "Prev Extend Bars" on monthly/weekly to see levels across more history
- Use higher transparency on previous levels to keep chart clean
- Turn off sessions you don't trade to reduce clutter
- The info table shows all values at a glance - position it where it doesn't block price action
━━━━━━━━━━━━━━━━━━━━━━
BEST FOR
━━━━━━━━━━━━━━━━━━━━━━
- ICT / Smart Money Concepts traders
- Session-based strategies
- Swing traders using HTF levels on LTF entries
- Anyone who wants clean, customizable S/R levels
Works on Forex, Crypto, Stocks, Futures, and Indices.
MTF Trend Dashboard (PSAR, SuperTrend, 200EMA, 9/30 EMA)This script is a multi–timeframe trend dashboard designed to quickly show the market bias across several timeframes in one place.
It does not generate buy/sell signals – it is a visual decision tool to support your own strategy.
What it shows
For up to 5 selectable timeframes, the table displays:
Parabolic SAR – whether PSAR is below (bullish) or above (bearish) the candle.
Supertrend – whether the Supertrend line is below or above the price.
200 EMA status – whether price is trading above (bullish trend) or below (bearish trend) the 200 EMA.
9 / 30 EMA crossover – whether 9 EMA is above (bullish) or below (bearish) the 30 EMA.
Green cells represent bullish conditions, red cells represent bearish conditions.
How to use
Quickly check higher–timeframe trend alignment before entering trades.
Use it as a trend filter for scalping or intraday entries on lower timeframes.
Combine with your own price action / SMC / support–resistance rules for actual entries and exits.
MTF Stoch RSI + RSI Signalsthis script will provide Buy and sell signals considering RSI and price action
MTF Slow Stochastic Buy/Sellcompare between 2 timeframe 1 minute and 3 minute, if both 1 and 3 minute time frame value %K is greater then %D then display BUY text.
if both timeframe value %D is greater then %K, display SELL text
MTF RSI + MACD Bullish Confluencethis based on rsi more then 50 and macd line bullish crossover or above '0' and time frame 15 min, 1 hour, 4 hour , 1 day and 1 week






















