🔍 Candle Scanner (75m/D/W/M) + Volume + EMA + Trend//@version=5
indicator("🔍 Candle Scanner (75m/D/W/M) + Volume + EMA + Trend", overlay=true)
is75min = timeframe.period == "75"
// Time Slot Logic for 75-min only
startTime = timestamp("Asia/Kolkata", year, month, dayofmonth, 9, 15)
candle75 = math.floor((time - startTime) / (75 * 60 * 1000)) + 1
candleNo = is75min and candle75 >= 1 and candle75 <= 5 ? candle75 : na
getTimeSlot(n) =>
slot = ""
if n == 1
slot := "09:15–10:30"
else if n == 2
slot := "10:30–11:45"
else if n == 3
slot := "11:45–13:00"
else if n == 4
slot := "13:00–14:15"
else if n == 5
slot := "14:15–15:30"
slot
// EMA Filters
ema20 = ta.ema(close, 20)
ema50 = ta.ema(close, 50)
aboveEMA20 = close > ema20
aboveEMA50 = close > ema50
// Volume Strength
avgVol = ta.sma(volume, 20)
volStrength = volume > avgVol ? "High Volume" : "Low Volume"
// Candle Body Strength
bodySize = math.abs(close - open)
fullSize = high - low
bodyStrength = fullSize > 0 ? (bodySize / fullSize > 0.6 ? "Strong Body" : "Small Body") : "Small Body"
// Prior Trend
priorTrend = close < close and close < close ? "Downtrend" :
close > close and close > close ? "Uptrend" : "Sideways"
// Patterns
bullishEngulfing = close > open and close < open and close > open and open < close
bearishEngulfing = close < open and close > open and close < open and open > close
hammer = (high - low) > 3 * bodySize and (close - low) / (0.001 + high - low) > 0.6 and (open - low) / (0.001 + high - low) > 0.6
shootingStar = (high - low) > 3 * bodySize and (high - close) / (0.001 + high - low) > 0.6 and (high - open) / (0.001 + high - low) > 0.6
doji = bodySize <= fullSize * 0.1
morningStar = close < open and bodySize < (high - low ) * 0.3 and close > (open + close ) / 2
eveningStar = close > open and bodySize < (high - low ) * 0.3 and close < (open + close ) / 2
// Pattern Selection
pattern = ""
sentiment = ""
colorBox = color.gray
yOffset = 15
if bullishEngulfing
pattern := "Bull Engulfing"
sentiment := "Bullish"
colorBox := color.green
yOffset := -15
else if bearishEngulfing
pattern := "Bear Engulfing"
sentiment := "Bearish"
colorBox := color.red
yOffset := 15
else if hammer
pattern := "Hammer"
sentiment := "Bullish"
colorBox := color.green
yOffset := -15
else if shootingStar
pattern := "Shooting Star"
sentiment := "Bearish"
colorBox := color.red
yOffset := 15
else if doji
pattern := "Doji"
sentiment := "Neutral"
colorBox := color.gray
yOffset := 15
else if morningStar
pattern := "Morning Star"
sentiment := "Bullish"
colorBox := color.green
yOffset := -15
else if eveningStar
pattern := "Evening Star"
sentiment := "Bearish"
colorBox := color.red
yOffset := 15
timeSlot = is75min and not na(candleNo) ? getTimeSlot(candleNo) : ""
info = pattern != "" ? "🕒 " + (is75min ? timeSlot + " | " : "") + pattern + " (" + sentiment + ") | " + volStrength + " | " + bodyStrength + " | Trend: " + priorTrend + " | EMA20: " + (aboveEMA20 ? "Above" : "Below") + " | EMA50: " + (aboveEMA50 ? "Above" : "Below") : ""
// Label Draw
var label lb = na
if info != ""
lb := label.new(bar_index, high + yOffset, text=info, style=label.style_label_down, textcolor=color.white, size=size.small, color=colorBox)
label.delete(lb )
// Smart Alert
validAlert = pattern != "" and (volStrength == "High Volume") and bodyStrength == "Strong Body" and (aboveEMA20 or aboveEMA50)
alertcondition(validAlert, title="📢 Smart Candle Alert", message="Smart Alert: Candle with Volume + EMA + Trend + Pattern Filtered")
Pattern grafici
Multi-Timeframe RSI Table# Multi-Timeframe RSI Table
## Overview
This indicator displays RSI (Relative Strength Index) values across multiple timeframes in a convenient table format, allowing traders to quickly assess momentum conditions across different time horizons without switching charts.
## Features
• *7 Timeframes*: 5m, 15m, 1h, 4h, Daily, Weekly, Monthly
• *Color-coded RSI Values*:
- 🔴 Red: Overbought (≥70)
- 🟢 Green: Oversold (≤30)
- 🟠 Orange: Bullish momentum (50-70)
- 🟡 Yellow: Bearish momentum (30-50)
• *Clean Table Display*: Positioned in top-right corner for easy viewing
• *Customizable Settings*: Adjustable RSI length and overbought/oversold levels
## How to Use
1. Add the indicator to your chart
2. The table automatically displays current RSI values for all timeframes
3. Use color coding to quickly identify:
- *Buying opportunities* when multiple timeframes show green (oversold)
- *Selling opportunities* when multiple timeframes show red (overbought)
- *Trend alignment* when higher timeframes match your trading direction
## Trading Applications
• *Multi-timeframe analysis*: Confirm signals across different time horizons
• *Entry timing*: Find optimal entry points when shorter timeframes align with longer trends
• *Risk management*: Avoid trades when higher timeframes show opposite momentum
• *Swing trading*: Identify when daily/weekly RSI supports your position direction
## Settings
• *RSI Length*: Default 14 periods (standard RSI calculation)
• *Overbought Level*: Default 70 (customizable)
• *Oversold Level*: Default 30 (customizable)
## Best Practices
• Look for alignment across multiple timeframes for stronger signals
• Use higher timeframe RSI to determine overall trend direction
• Combine with price action and support/resistance levels
• Avoid trading against strong momentum shown in higher timeframes
Perfect for day traders, swing traders, and anyone who needs quick multi-timeframe RSI analysis without constantly switching chart timeframes.
Volume Labels BABYBOTVolume labels babybot spwan for use with 1 min breakout volume candles OKLO NFLX ASML HIMS
XAUUSD Scalper Levels (ChatGPT v2.5)The Pine v6 indicator plots predefined short/long trading zones and breakout levels on XAUUSD, watches for price entering those zones or crossing the breakout lines, and when that happens it builds a formatted message (entry, SL, up to three TPs, and an invalidation note) plus a risk-based lot size calculated from your equity, risk %, and contract value; it then fires an `alert()` with that message and, on the last bar, shows a floating label displaying the next-trade lot suggestion.
Impulse Alert - Demand (Buy) [Fixed]🔵 Impulse Alert – Demand (Buy)
This indicator is designed to detect high-probability Demand Zones based on impulsive bullish price action, helping traders get alerted only when it matters most.
🧠 Core Logic:
Scans the chart for 2 consecutive bullish impulsive candles with significant range (body size)
Also captures single large bullish impulse candles that often mark institutional buying
Marks the origin of the move as a potential Demand Zone
Sends alerts when such bullish setups form, allowing you to monitor charts passively
⚙️ Features:
✅ Alerts on impulsive move formations
✅ Detects both 2-candle and single-candle impulses
✅ Custom zone detection logic based on pip size and momentum
✅ Cleaner & smarter: removes distractions and avoids false signals
📌 Best Used For:
Smart Money / Supply & Demand traders
Identifying potential institutional buy zones
Executing trades with HTF confluence
Traders who want to get alerted without screen-watching
🔁 Suggested Strategy:
Set HTF directional bias (H1, H4, D1)
Use this indicator on LTF (1M–15M) for impulsive bullish entries
Wait for price to return to the marked zone for low-risk entries
💡 Pro Tip: Combine with your Supply Zone (Sell) indicator to track both sides of market structure and increase R:R
👤 Created by: Rohit Jadhav | YT/Insta/X - @GrowthByTrading
📬 Want updates, enhancements, or personal versions? Leave feedback or reach out through profile!
Impulse Alert - Supply (Sell) [Fixed]🟥 Supply Zone (Sell) – Institutional Order Block Detector
This custom indicator automatically detects valid Supply Zones (Sell Zones) based on Smart Money Concepts and institutional trading behavior.
🔍 How It Works:
Identifies strong bearish impulsive moves after price forms a potential Order Block
Valid supply zones are plotted after:
A valid rally–base–drop or drop–base–drop structure
A shift in structure or clear imbalance is detected
The zone is created from the last bullish candle before a strong bearish engulfing move
Zones remain on chart until price revisits and reacts
📊 Use Case:
Ideal for traders using Smart Money Concepts (SMC), Supply & Demand, or ICT-inspired strategies
Perfect for scalping, day trading, or swing setups
Designed for confluence with HTF bias and LTF execution
⚙️ Features:
Supply Zone auto-plotting
Customizable zone color and opacity
Alerts when price returns to the zone (retest entry opportunity)
🧠 Tip for Best Use:
Use in confluence with:
HTF Supply zones (manual or other indicator)
Market Structure breaks
Fair Value Gaps or Imbalance zones
Strong impulsive moves from HTF to LTF
🔁 Future Additions (Coming Soon):
Demand Zone detection
Zone strength rating system
Refined zone filters (volume, candle size, etc.)
Alerts for mitigation or invalidation
📌 Created by: Rohit Jadhav | Real-time market trader | YT/Insta - @GrowthByTrading
💬 Feedback? Drop a comment or connect via profile for updates and tutorials!
The Devils Mark [TakingProphets]“The Devil’s Mark” is a subtle yet deadly point of interest on the chart—where price has a habit of coming back to die.
Built around a deceptively simple condition, this tool marks highly reactive levels that often act as short-term magnets for price.
Whether you're trading reversals, continuations, or looking to refine sniper entries, the Devil’s Mark offers a clean way to anticipate potential retracements and engineered liquidity sweeps. It doesn't rely on indicators, oscillators, or moving averages—just raw price action logic that repeats day after day.
🔥 What It Does
The Devil’s Mark identifies a candle where the open equals either the high or the low—a specific structure known to frequently draw price back for manipulation, inducement, or mitigation.
Once identified, it marks the level with a custom emoji (😈 by default) and—optionally—a horizontal line extending forward. When price returns and reacts to this level, the mark self-deletes to keep your chart clean and relevant.
💡 Key Features
👿 Devil’s Mark Logic
Triggers when the open equals high (potential sell-side setup) or open equals low (potential buy-side setup)
These conditions often mark areas where liquidity has been engineered—likely to be revisited later
Applies to any timeframe, adapting automatically to the chart you're on
Custom Emojis
Choose from 😈, 🔥, 💀, or 🤡
Each emoji is placed precisely at the candle’s open, labeled in your chosen color for clarity
📈 Optional Horizontal Lines
Toggle lines on/off depending on your preference
Lines extend forward to highlight the key level price is likely to return to
Helps visualize interaction points, re-entries, or partial exits
🧼 Automatic Cleanup
Once price interacts with the Devil’s Mark (via wick or body), the label and line are automatically deleted
This keeps your chart minimal and focused only on active untested levels
🚨 Alerts Built In
Receive an alert when a new Devil’s Mark is formed, including the exact price and condition
Ideal for monitoring developing setups without staring at the chart
🧾 Info Box (Optional)
Displays the symbol, timeframe, and indicator title at the bottom of your chart
Helps when journaling trades or sharing analysis with your community
⚙️ Customization
Choose your emoji: 😈, 🔥, 💀, 🤡
Line visibility toggle
Fully customizable colors for bullish (Open = Low) and bearish (Open = High) marks
Enable/disable alerts to suit your workflow
Minimalist by default, but expandable for those who like more on-chart structure
🔄 Use Cases
Targeted liquidity grabs around recent highs/lows
Short-term reversion points for scalpers
Confluence for stop-hunts and inducement plays
Marking levels that often serve as "second entries" or "trap breaks"
⚠️ Final Note
This tool doesn’t predict direction—it highlights structure. Use it in combination with your narrative, bias, and entry model. Especially effective when paired with SMC or ICT-based strategies that account for liquidity, displacement, and manipulation.
Trade smart, stay disciplined, and don’t ignore the marks—they have a habit of dragging price back, whether you like it or not.
90/30 Minute Cycle BoxesThis indicator automatically draws time-based cycle boxes to help visualize market structure and cyclical behavior.
Features:
90-Minute Primary Cycles: Highlights each 90-minute interval with a colored box, showing the high and low of that period.
30-Minute Sub-Cycles: Each 90-minute box is divided into 3 sub-boxes representing 30-minute phases.
Multi-Timeframe Compatible: Works on all timeframes, adapting dynamically to your chart.
Visual Clarity: Alternating box colors make it easy to track price action within and across cycles.
This tool is ideal for traders who use time cycles in their analysis, especially those applying ICT, Smart Money Concepts, or time-based market theories.
Prophet Model [TakingProphets]This model has helped me secure multiple funded prop firm payouts.
Inspired by ICT trader “Its Johnny,” the Prophet Model is one of the most effective tools I’ve ever used to consistently identify high-conviction, high-probability setups.
Let me be clear: this indicator alone won’t make you profitable—but when paired with discipline and discretion, it becomes a serious edge. Built specifically for traders who understand ICT and Flow State principles, this tool streamlines your workflow by dynamically aligning SMC concepts into one cohesive model.
It’s structured. It’s intentional. And in the right hands, it’s one of the most powerful indicators on the market.
🧠 Overview
The Prophet Model is a logic-driven smart money framework that automates your confluence-building process. It aligns multiple components of market structure, liquidity, and displacement into a visual checklist, guiding you toward clean setups without clutter.
THIS INDICATOR LOOKS FOR:
-Tap into HTF PD Arrays using intelligent timeframe mapping
-Confirm delivery shifts using ICT Candle Range Theory (CRT)
-Wait for sweep > displacement > gap—before entry is even considered
-Visualize TP, SL, and BE levels based on real ranges, not arbitrary ticks
-Check setup validity in real time with a dynamic criteria checklist
-Strengthen execution with Flow State relationship confirmations
Detailed Feature Breakdown
🔭 High Time Frame PDA Mapping
Each lower timeframe (e.g. M1, M5, M15) is automatically aligned with its higher timeframe counterpart (e.g. M15, H1, H4).
The model continuously scans for unmitigated Fair Value Gaps (FVGs) on that HTF and draws them in real-time on your current chart—highlighting areas of premium and discount efficiently.
-Only non-weekend, clean gaps are drawn
-Gaps update dynamically and extend by user-defined bar counts
-HTF PDA mitigation is visually tracked and used as a condition in confluence
🕯️ Candle Range Theory (CRT) Detection
Once an HTF PDA is active, the model checks for a valid CRT shift. It compares the last two candles on the higher timeframe to determine whether delivery conditions have shifted (based on ICT’s structure rules).
When detected, a CRT label is shown, supporting directional conviction and potential to expand.
💧 Liquidity Sweep Detection
Before any entry logic is triggered, the model waits for a buy-side or sell-side sweep to occur within the HTF FVG. These sweeps are drawn as dashed lines labeled $$$ and tracked using pivot logic.
-Sweeps are required to form before any CISD
-They must occur inside the active HTF PDA
-Each sweep condition must be met before advancing to next criteria
⚡ Change in State of Delivery (CISD)
Arguably the most critical part of the model: after a sweep, the model waits for a displacement in the opposite direction. Once confirmed, it marks the CISD line (black) and stores this as a trigger point for the next phase of setup building.
Key logic:
-Uses candle sequences to define CISD legs
-Detects when structure shifts via displacement close
-Optional: includes a CRT confirmation for additional confluence
📦 Overlapping Fair Value Gap (FVG) & Entry Adjustment
Once a CISD is confirmed, the model checks if an internal FVG (within the 3-candle structure) overlaps the displacement. If found, the EPE (Easiest Point of Entry) is automatically adjusted to this zone and relabeled.
-This adds an extra layer of precision to your entry—only visible when the overlap exists.
🎯 Take Profit / Break Even / Stop Loss Mapping
After a valid CISD is formed, the model auto-calculates:
-Take Profit: 2.25x the CISD range
-Break Even: 1x the CISD range
-Stop Loss: Recent high/low depending on trade direction
These are plotted on the chart using clearly labeled lines in green (TP), orange (BE), and red (SL), with optional price display.
All risk levels are based on actual structure—not static values.
🧾 Dynamic Setup Checklist
A four-point strategy checklist is drawn on the chart, updating in real time:
-HTF PDA Tap ✅
-CRT Confirmation ✅
-Liquidity Sweep ✅
-CISD Confirmation ✅
This helps traders visually track setup progression without needing to second-guess or manually monitor each component.
🔁 Flow State Alignment Table
This top-right table outlines ideal timeframe pairings based on ICT’s Flow State methodology:
-Monthly PDA + Daily CISD
-Weekly PDA + H4 CISD
-Daily PDA + H1 CISD
The model automatically highlights the correct row when your current timeframe aligns with the expected CISD timeframe—helping you focus only on clean, time-aligned setups.
🟧 Easiest Point of Entry (EPE) Tracking
The model dynamically marks the EPE after CISD confirmation. If an overlapping FVG is detected, it shifts to that level instead. The label changes from “CISD” to “EPE” to help you visually distinguish entry refinement.
-Orange line and label
-Adjusts live when overlap is present
-Helps improve entry precision and reduce drawdown
🧾 Info Box (Optional)
Displays symbol, timeframe, indicator title, and date at the bottom of your chart—useful for journaling, screenshots, or presentations.
⚙️ Customization
Every feature can be toggled on/off:
-Visibility controls for CRT, FVGs, CISD, and Limits
-Color inputs for borders, fills, and text
-Adjustable label sizes, table text sizes, and FVG extension bars
-This allows full flexibility whether you're scalping indices or swing trading majors.
⚠️ Important Notes
This is not a buy/sell signal and is not meant to be traded blindly.
It is designed as a visual framework for ICT and Flow State traders who understand narrative, timing, and context.
Always use proper risk management and confirm bias through your own analysis.
Bollinger + Supertrend Hybrid Pro (Auto-Backtest)This strategy tell you when to huy and sell it is bollinger and supertrend
MA20/EMA200 Crossover Alert# MA20/EMA200 Crossover Alert with Telegram Integration
**Description:**
This indicator identifies key trend reversals by detecting when the 20-period Simple Moving Average (MA20) crosses the 200-period Exponential Moving Average (EMA200). These crossovers are widely recognized as significant signals for medium to long-term trend changes.
**Key Features:**
- Real-time detection of MA20/EMA200 crossovers on any timeframe (optimized for 1H)
- Visual signals with up/down triangles at crossover points
- Background color highlights for easy identification
- Built-in alert system with JSON-formatted messages for Telegram webhook integration
- Clean, customizable interface with adjustable MA/EMA periods
**Signals:**
- 🟢 **Bullish Signal**: MA20 crosses above EMA200 (potential uptrend beginning)
- 🔴 **Bearish Signal**: MA20 crosses below EMA200 (potential downtrend beginning)
**Alert Integration:**
The indicator includes pre-formatted alert messages designed for direct integration with Telegram bots via webhooks. Each alert contains:
- Symbol and exchange information
- Current price at crossover
- Signal type (BULLISH/BEARISH)
- Descriptive message
**Best Use Cases:**
- Trend following strategies
- Position entry/exit timing
- Multi-timeframe analysis
- Automated trading system triggers
**Note:** This indicator works best on liquid markets and higher timeframes (1H, 4H, 1D) to reduce false signals. Always combine with other analysis methods for confirmation.
**Tags:** ma, ema, moving average, crossover, trend, telegram, alert, webhook, trading, signal
52/26/13/4 High WeekThis is a tool to identify the 52-week high of a candlestick for use in breakout strategies. It can be used in conjunction with Pocket Pivot and EMA or Volume.
It is ideal for studying price behavior and trend following.
zavaUnni- Trendlines Pro & fibonacci Zones zavaUnni- Trendlines Pro & fibonacci Zones is a momentum-based trading tool that automatically detects pivot points to visualize real-time trendlines, zigzag structures, and Fibonacci retracement zones.
Key Features
1. Divergence-Based Pivot Detection
Utilizes popular momentum indicators like RSI, CCI, MACD CCI, OBV, etc.
Automatically detects significant highs/lows based on divergence signals
These pivot points are used to construct trendlines and calculate retracement zones
2. Automatic Fibonacci Retracement Zones
Draws Fibonacci levels such as 0.382, 0.618, and 0.786 from detected pivot highs/lows
Supports both initial fixed levels and dynamic updated zones based on live price action
Recalculates zones automatically when specific price conditions are met
3. Supertrend-Based Zigzag and Trendlines
detect real-time trend direction changes
Plots zigzag lines between significant pivot highs/lows
Automatically generates trendlines only when slope conditions are met (e.g., below -3° or above +1°)
Invalidates and resets trendlines if broken or the slope becomes too flat/steep
Settings Overview
Index
Selects the indicator (RSI, CCI, MACDcci, OBV, etc.) used for pivot detection
zigzag Length
Supertrend sensitivity period for direction changes
Fibonacci_bg
Toggle background color fill for Fibonacci zones
Fibonacci_label
Show labels for each Fibonacci level (23.6%, 38.2%, etc.)
Bull Trend Line Color
Color of upward trendlines
Bear Trend Line Color
Color of downward trendlines
zigzag_color
Color of the zigzag lines
QQQ Buy/Sell SuperSignalBuy/SELL combining Stochastic RSI , MACD & ADX
Buy Alert:
Stoch RSI oversold (<0.15)
MACD < -5
ADX > 20 AND DI+ > DI- (uptrend developing)
Sell Alert:
Stoch RSI overbought (>0.85)
MACD > 5
ADX > 20 AND DI- > DI+ (downtrend developing)
Dual ORB (5 & 15 Min) Retest SignalsThe Dual Orb Indicator allows you to see the orb effortlessly! it also gives you buy/sell signals on both the 5 minute timeframe and the 15 minute timeframe! if you have any questions or suggestions please comment below and let me know what you think!
EMA Crossover with DiamondsShows crossover of ema 21 and with ema 50 with diamond possible buy and sell positions.
Dr. Fib - FGBAB - Automatic Fibonacci Levels v2.0This indicator draws automatic Fibonacci retracements and projections on the chart.
Fibonacci levels are full customizable (color, line, width) once added into the chart it will calculate the higher high and lower lows based on the NumberOfBars input parameter (100 bars by default) so you can use in any timeframe to know possible retracements levels and target projection levels.
Excellent tool for trading stocks, crypto and futures.
Feel free to follow on X @FGBAB.
Thanks for using it.
Dr. Fib – FGBAB.
ORB Breakouts with AlertsORB Breakout indicator with alerts. Lets you select which candles to set alerts and highlights on.
Multi-Timeframe SMTSummery
The Multi-Timeframe SMT indicator is designed to identify and visualize Higher Timeframe (HTF) data on a Lower Timeframe (LTF) chart, allowing traders to see the broader market context without changing their current chart's resolution. It accurately draws pivots and SMT divergences from higher timeframes on the corresponding candles of your current lower timeframe chart.
Its core features include:
Multi-Timeframe Analysis: Configure and monitor pivots on up to four independent timeframes, from intraday to monthly.
Customizable Pivot Detection: Define the strength of pivots by adjusting the number of bars to the left and right.
SMT Divergence: Automatically identifies bullish and bearish SMT divergences by comparing the price action of the main chart symbol with a chosen correlated asset.
Early SMT Detection: A unique feature that monitors a lower "detection timeframe" to provide early warnings of potential SMT setups before they're confirmed on the main timeframe. Note that this early detection is only shown on timeframes equal to or lower than the "Detection timeframe" you have set.
Visual Cues & Alerts: Clear on-chart labels, lines, and fully customizable alerts notify you of confirmed pivots and SMT divergences, ensuring you don't miss key opportunities.
Important Nuance Regarding Pivot Label Display
Due to a self-imposed limit within this script's drawing management logic, the indicator might quickly reach its drawing capacity if you enable pivot crosses for multiple timeframes simultaneously. When this internal drawing limit is exceeded, the script is designed to automatically remove the oldest drawings to make space for new ones.
Therefore, to ensure optimal performance and visibility of the most recent and relevant pivots, it's highly recommended to only enable the "Show Pivot Crosses" option for one timeframe at a time. If you wish to view pivots for a different timeframe, simply disable the pivot crosses for the currently active timeframe and then enable them for your desired one. This approach prevents the rapid cycling and disappearance of pivot labels, providing a clearer and more stable visual experience.
In-Depth Explanation of the Logic
This script is built on two primary concepts: pivot points and Smart Money Technique (SMT) divergence. It systematically collects historical data on multiple timeframes, identifies pivots, and then compares them between two assets to find divergences.
Pivot Point Identification
A pivot is a turning point in the market. A pivot high is a candle that has a higher high than the candles to its immediate left and right. Conversely, a pivot low is a candle with a lower low than its neighbors.
How it Works in the Script:
The script tracks the highest high and lowest low for each period of the selected timeframe (e.g., for each 4-hour candle). When a new high-timeframe candle closes, it stores that high/low value and its bar index in an array. The checkForPivot() function then checks if a recently stored high or low qualifies as a pivot.
Key Inputs:
Left Strength (leftBars1): The number of candles to the left that must have a lower high (for a pivot high) or higher low (for a pivot low).
Right Strength (rightBars1): The number of candles to the right that must meet the same criteria.
For example, with Left Strength and Right Strength both set to 3, a pivot high is only confirmed when its high is greater than the highs of the 3 previous high-timeframe candles and the 3 subsequent high-timeframe candles. Increasing these values will identify more significant, longer-term pivots.
Smart Money Technique (SMT) Divergence
SMT Divergence is a concept popularized by The Inner Circle Trader (ICT). It occurs when two closely correlated assets fail to move in sync. For instance, if Asset A makes a higher high but Asset B fails to do so and instead makes a lower high, this creates a bearish SMT divergence. It suggests that the "smart money" may not be supporting the move in Asset A, signaling a potential reversal.
Bearish SMT: Main asset makes a higher high, while the correlated asset makes a lower high. This is a potential sell signal.
Bullish SMT: Main asset makes a lower low, while the correlated asset makes a higher low. This is a potential buy signal.
How it Works in the Script:
Data Request: For each timeframe, the script uses the request.security() function to fetch the high and low data for both the main chart symbol (syminfo.tickerid) and the chosen Comparison Asset.
Pivot Comparison: When a new pivot is confirmed on the main asset, the script checks if a corresponding pivot also formed on the comparison asset at the same time.
Divergence Check: It then compares the direction of the pivots. For a bearish SMT, it checks if the main asset's new pivot high is higher than its previous pivot high, while the comparison asset's new pivot high is lower than its previous one. The logic is reversed for bullish SMT.
Visualization: If a divergence is found, the script draws a red (bearish) or green (bullish) line connecting the two pivots on your chart and places an "SMT" label.
Early SMT Detection
This is a proactive feature designed to give you a heads-up. Waiting for a 4-hour or daily pivot to form can take a long time. The early detection system looks for SMT divergences on a much smaller, user-defined Detection timeframe (e.g., 15-minute).
How it Works in the Script:
Awaiting Setup: After a primary pivot (Pivot A) is formed on the main timeframe (e.g., a Daily pivot high), the script begins monitoring.
Intraday Monitoring: It then watches the Detection timeframe (e.g., 15-minute) for smaller intraday pivots.
Potential Divergence: It looks for an intraday pivot that forms a divergence against the primary Pivot A.
Watchline & Alert: When this "potential" divergence occurs, the script draws a dashed white line and triggers a "Potential SMT" alert. This isn't a confirmed SMT on the main timeframe yet, but it's a powerful early warning that one may be forming.
Drawing & Object Management
To keep the chart clean and prevent performance issues, the script manages its drawings (lines and labels) efficiently. It stores them in arrays and uses a drawing limit to automatically delete the oldest drawings as new ones are created, ensuring your TradingView remains responsive.
How to Use the Indicator
Configuration
Enable Timeframes: Use the checkboxes (Enable Timeframe 1, Enable Timeframe 2, etc.) to activate the timeframes you want to monitor. It's often best to start with one or two to keep the chart clean.
Select Timeframes: Choose the higher timeframes you want to analyze (e.g., 240 for 4-hour, D for Daily, W for Weekly).
Set Pivot Strength: The default of 3 for Left/Right strength is a good starting point. Increase it to find more significant market structure points or decrease it for more frequent, shorter-term pivots.
Configure SMT:
Check Enable SMT for the timeframes where you want to detect divergence.
Enter a Comparison Asset . This is crucial. Ensure the assets are correlated.
To use the early warning system, check Enable early SMT detection and select an appropriate Detection timeframe (e.g., 15 or 60 minutes for a Daily analysis).