Volume Delta Volume Signals by Claudio [hapharmonic]// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org
// © hapharmonic
//@version=6
FV = format.volume
FP = format.percent
indicator('Volume Delta Volume Signals by Claudio ', format = FV, max_bars_back = 4999, max_labels_count = 500)
//------------------------------------------
// Settings |
//------------------------------------------
bool usecandle = input.bool(true, title = 'Volume on Candles',display=display.none)
color C_Up = input.color(#12cef8, title = 'Volume Buy', inline = ' ', group = 'Style')
color C_Down = input.color(#fe3f00, title = 'Volume Sell', inline = ' ', group = 'Style')
// ✅ Nueva entrada para colores de señales
color buySignalColor = input.color(color.new(color.green, 0), "Buy Signal Color", group = "Signals")
color sellSignalColor = input.color(color.new(color.red, 0), "Sell Signal Color", group = "Signals")
string P_ = input.string(position.top_right,"Position",options = ,
group = "Style",display=display.none)
string sL = input.string(size.small , 'Size Label', options = , group = 'Style',display=display.none)
string sT = input.string(size.normal, 'Size Table', options = , group = 'Style',display=display.none)
bool Label = input.bool(false, inline = 'l')
History = input.bool(true, inline = 'l')
// Inputs for EMA lengths and volume confirmation
bool MAV = input.bool(true, title = 'EMA', group = 'EMA')
string volumeOption = input.string('Use Volume Confirmation', title = 'Volume Option', options = , group = 'EMA',display=display.none)
bool useVolumeConfirmation = volumeOption == 'none' ? false : true
int emaFastLength = input(12, title = 'Fast EMA Length', group = 'EMA',display=display.none)
int emaSlowLength = input(26, title = 'Slow EMA Length', group = 'EMA',display=display.none)
int volumeConfirmationLength = input(6, title = 'Volume Confirmation Length', group = 'EMA',display=display.none)
string alert_freq = input.string(alert.freq_once_per_bar_close, title="Alert Frequency",
options= ,group = "EMA",
tooltip="If you choose once_per_bar, you will receive immediate notifications (but this may cause interference or indicator repainting).
However, if you choose once_per_bar_close, it will wait for the candle to confirm the signal before notifying.",display=display.none)
//------------------------------------------
// UDT_identifier |
//------------------------------------------
type OHLCV
float O = open
float H = high
float L = low
float C = close
float V = volume
type VolumeData
float buyVol
float sellVol
float pcBuy
float pcSell
bool isBuyGreater
float higherVol
float lowerVol
color higherCol
color lowerCol
//------------------------------------------
// Calculate volumes and percentages |
//------------------------------------------
calcVolumes(OHLCV ohlcv) =>
var VolumeData data = VolumeData.new()
data.buyVol := ohlcv.V * (ohlcv.C - ohlcv.L) / (ohlcv.H - ohlcv.L)
data.sellVol := ohlcv.V - data.buyVol
data.pcBuy := data.buyVol / ohlcv.V * 100
data.pcSell := 100 - data.pcBuy
data.isBuyGreater := data.buyVol > data.sellVol
data.higherVol := data.isBuyGreater ? data.buyVol : data.sellVol
data.lowerVol := data.isBuyGreater ? data.sellVol : data.buyVol
data.higherCol := data.isBuyGreater ? C_Up : C_Down
data.lowerCol := data.isBuyGreater ? C_Down : C_Up
data
//------------------------------------------
// Get volume data |
//------------------------------------------
ohlcv = OHLCV.new()
volData = calcVolumes(ohlcv)
// Plot volumes and create labels
plot(ohlcv.V, color=color.new(volData.higherCol, 90), style=plot.style_columns, title='Total',display = display.all - display.status_line)
plot(ohlcv.V, color=volData.higherCol, style=plot.style_stepline_diamond, title='Total2', linewidth = 2,display = display.pane)
plot(volData.higherVol, color=volData.higherCol, style=plot.style_columns, title='Higher Volume', display = display.all - display.status_line)
plot(volData.lowerVol , color=volData.lowerCol , style=plot.style_columns, title='Lower Volume',display = display.all - display.status_line)
S(D,F)=>str.tostring(D,F)
volStr = S(math.sign(ta.change(ohlcv.C)) * ohlcv.V, FV)
buyVolStr = S(volData.buyVol , FV )
sellVolStr = S(volData.sellVol , FV )
// ✅ MODIFICACIÓN: Porcentaje sin decimales
buyPercentStr = str.tostring(math.round(volData.pcBuy)) + " %"
sellPercentStr = str.tostring(math.round(volData.pcSell)) + " %"
totalbuyPercentC_ = volData.buyVol / (volData.buyVol + volData.sellVol) * 100
sup = not na(ohlcv.V)
if sup
TC = text.align_center
CW = color.white
var table tb = table.new(P_, 6, 6, bgcolor = na, frame_width = 2, frame_color = chart.fg_color, border_width = 1, border_color = CW)
tb.cell(0, 0, text = 'Volume Candles', text_color = #FFBF00, bgcolor = #0E2841, text_halign = TC, text_valign = TC, text_size = sT)
tb.merge_cells(0, 0, 5, 0)
tb.cell(0, 1, text = 'Current Volume', text_color = CW, bgcolor = #0B3040, text_halign = TC, text_valign = TC, text_size = sT)
tb.merge_cells(0, 1, 1, 1)
tb.cell(0, 2, text = 'Buy', text_color = #000000, bgcolor = #92D050, text_halign = TC, text_valign = TC, text_size = sT)
tb.cell(1, 2, text = 'Sell', text_color = #000000, bgcolor = #FF0000, text_halign = TC, text_valign = TC, text_size = sT)
tb.cell(0, 3, text = buyVolStr, text_color = CW, bgcolor = #074F69, text_halign = TC, text_valign = TC, text_size = sT)
tb.cell(1, 3, text = sellVolStr, text_color = CW, bgcolor = #074F69, text_halign = TC, text_valign = TC, text_size = sT)
tb.cell(0, 5, text = 'Net: ' + volStr, text_color = CW, bgcolor = #074F69, text_halign = TC, text_valign = TC, text_size = sT)
tb.merge_cells(0, 5, 1, 5)
tb.cell(0, 4, text = buyPercentStr, text_color = CW, bgcolor = #074F69, text_halign = TC, text_valign = TC, text_size = sT)
tb.cell(1, 4, text = sellPercentStr, text_color = CW, bgcolor = #074F69, text_halign = TC, text_valign = TC, text_size = sT)
cellCount = 20
filledCells = 0
for r = 5 to 1 by 1
for c = 2 to 5 by 1
if filledCells < cellCount * (totalbuyPercentC_ / 100)
tb.cell(c, r, text = '', bgcolor = C_Up)
else
tb.cell(c, r, text = '', bgcolor = C_Down)
filledCells := filledCells + 1
filledCells
if Label
sp = ' '
l = label.new(bar_index, ohlcv.V,
text=str.format('Net: {0} Buy: {1} ({2}) Sell: {3} ({4}) {5}/\ {5}l {5}l',
volStr, buyVolStr, buyPercentStr, sellVolStr, sellPercentStr, sp),
style=label.style_none, textcolor=volData.higherCol, size=sL, textalign=text.align_left)
if not History
(l ).delete()
//------------------------------------------
// Draw volume levels on the candlesticks |
//------------------------------------------
float base = na,float value = na
bool uc = usecandle and sup
if volData.isBuyGreater
base := math.min(ohlcv.O, ohlcv.C)
value := base + math.abs(ohlcv.O - ohlcv.C) * (volData.pcBuy / 100)
else
base := math.max(ohlcv.O, ohlcv.C)
value := base - math.abs(ohlcv.O - ohlcv.C) * (volData.pcSell / 100)
barcolor(sup ? color.new(na, na) : ohlcv.C < ohlcv.O ? color.red : color.green,display = usecandle? display.all:display.none)
UseC = uc ? volData.higherCol:color.new(na, na)
plotcandle(uc?base:na, uc?base:na, uc?value:na, uc?value:na,
title='Body', color=UseC, bordercolor=na, wickcolor=UseC,
display = usecandle ? display.all - display.status_line : display.none, force_overlay=true,editable=false)
plotcandle(uc?ohlcv.O:na, uc?ohlcv.H:na, uc?ohlcv.L:na, uc?ohlcv.C:na,
title='Fill', color=color.new(UseC,80), bordercolor=UseC, wickcolor=UseC,
display = usecandle ? display.all - display.status_line : display.none, force_overlay=true,editable=false)
//------------------------------------------------------------
// Plot the EMA and filter out the noise with volume control. |
//------------------------------------------------------------
float emaFast = ta.ema(ohlcv.C, emaFastLength)
float emaSlow = ta.ema(ohlcv.C, emaSlowLength)
bool signal = emaFast > emaSlow
color c_signal = signal ? C_Up : C_Down
float volumeMA = ta.sma(ohlcv.V, volumeConfirmationLength)
bool crossover = ta.crossover(emaFast, emaSlow)
bool crossunder = ta.crossunder(emaFast, emaSlow)
isVolumeConfirmed(source, length, ma) =>
math.sum(source > ma ? source : 0, length) >= math.sum(source < ma ? source : 0, length)
bool ISV = isVolumeConfirmed(ohlcv.V, volumeConfirmationLength, volumeMA)
bool crossoverConfirmed = crossover and (not useVolumeConfirmation or ISV)
bool crossunderConfirmed = crossunder and (not useVolumeConfirmation or ISV)
PF = MAV ? emaFast : na
PS = MAV ? emaSlow : na
p1 = plot(PF, color = c_signal, editable = false, force_overlay = true, display = display.pane)
plot(PF, color = color.new(c_signal, 80), linewidth = 10, editable = false, force_overlay = true, display = display.pane)
plot(PF, color = color.new(c_signal, 90), linewidth = 20, editable = false, force_overlay = true, display = display.pane)
plot(PF, color = color.new(c_signal, 95), linewidth = 30, editable = false, force_overlay = true, display = display.pane)
plot(PF, color = color.new(c_signal, 98), linewidth = 45, editable = false, force_overlay = true, display = display.pane)
p2 = plot(PS, color = c_signal, editable = false, force_overlay = true, display = display.pane)
plot(PS, color = color.new(c_signal, 80), linewidth = 10, editable = false, force_overlay = true, display = display.pane)
plot(PS, color = color.new(c_signal, 90), linewidth = 20, editable = false, force_overlay = true, display = display.pane)
plot(PS, color = color.new(c_signal, 95), linewidth = 30, editable = false, force_overlay = true, display = display.pane)
plot(PS, color = color.new(c_signal, 98), linewidth = 45, editable = false, force_overlay = true, display = display.pane)
fill(p1, p2, top_value=crossover ? emaFast : emaSlow,
bottom_value =crossover ? emaSlow : emaFast,
top_color =color.new(c_signal, 80),
bottom_color =color.new(c_signal, 95)
)
// ✅ Usar colores configurables para señales
plotshape(crossoverConfirmed and MAV, style=shape.triangleup , location=location.belowbar, color=buySignalColor , size=size.small, force_overlay=true,display =display.pane)
plotshape(crossunderConfirmed and MAV, style=shape.triangledown, location=location.abovebar, color=sellSignalColor, size=size.small, force_overlay=true,display =display.pane)
string msg = '--------- '+"Buy volume ="+buyVolStr+" Buy Percent = "+buyPercentStr+" Sell volume = "+sellVolStr+" Sell Percent = "+sellPercentStr+" Net = "+volStr+' ---------'
if crossoverConfirmed
alert("Price (" + str.tostring(close) + ") Crossed over MA " + msg, alert_freq)
if crossunderConfirmed
alert("Price (" + str.tostring(close) + ") Crossed under MA " + msg, alert_freq)
Trend Analysis
🔵Blue Mark📌 Blue Mark – TradingView Indicator
The Blue Mark indicator highlights extreme price points across multiple timeframes (15m, 5m, 1m), helping intraday traders identify liquidity zones and areas of institutional interest. It is designed for traders who want to spot high-probability entry and exit points based on market structure and volume concentration.
✔️ Marks extreme highs and lows on 15m, 5m, and 1m charts
✔️ Ideal for intraday trading and short-term strategies
✔️ Helps detect liquidity zones where institutional orders are likely concentrated
✔️ Supports tactical entries and exits aligned with market structure
How to use:
Apply the indicator to your chart.
Observe the marked extreme points on different timeframes.
Use these levels to plan entries, exits, or confirm areas of institutional interest.
Apex Squeeze Breakout Trading System (by SKC)Apex Squeeze Breakout Trading System (by SKC)
This system is designed to detect high-probability squeeze breakout opportunities using a hybrid scoring model of momentum, volume, volatility, and trend confirmation. It includes:
SuperTrend-based trend shifts
Breakout detection using Bollinger/Keltner channel compression
Volume spike filters
RSI-based recovery signals
Dynamic ATR-based SL and TP levels (T1 & T2)
Trade state management with label journaling
Configurable for Day Trading or Swing setups
Visuals: Buy/Sell markers, Entry/SL/TP levels, Squeeze dots, PS/SS markers
Perfect for traders seeking clear, structured entries with defined risk and multiple profit targets.
Developed & finalized by SKC.
Let me know if you want a more technical, shorter, or fun version.
SwingArm High Pressure V6.7.3SwingArm High Pressure V6.7.3 - User Guide
Overview
SwingArm High Pressure is a multi-timeframe trading indicator designed to identify high-probability entry zones and profit targets. This indicator works best when combined with the standard SwingArm indicator to display 8-hour and higher timeframes for complete market analysis.
Key Features
1. Multi-Timeframe Analysis
Chart Timeframe (CT): Your primary entry timeframe
Higher Timeframe 1 (HTF1): Secondary confirmation and targets
Higher Timeframe 2 (HTF2): Extended swing targets
2. Trading Type Selection
Choose between two preset configurations:
CT/15m/1H: For day trading and scalping
CT/2H/4H: For swing trading (recommended to pair with standard SwingArm for 8H+ timeframes)
3. Entry Zones
Optimal Entry Boxes (High-Pressure Zones)
BLUE boxes: Bullish optimal entry zones (high-pressure buying opportunity)
YELLOW boxes: Bearish optimal entry zones (high-pressure selling opportunity)
These represent the highest probability entries when price reaches these levels
Fresh SwingArm Zones
GREEN zones: Freshly created bullish swingarm areas
RED zones: Freshly created bearish swingarm areas
Deeper entries into zones (78.6%-88.6%) provide better risk/reward ratios
4. Fibonacci Levels
Each swingarm zone contains three Fibonacci retracement levels:
Fib. 61.8%: Early entry (consider waiting for deeper levels)
Fib. 78.6%: Good entry opportunity
Fib. 88.6%: Deep entry with excellent risk/reward
5. Zone Labels
The indicator automatically labels zones based on their function:
Internal Zones (shorter timeframes):
Display as "INTERNAL - Buy/Sell Zones"
May cycle multiple times before reaching targets
Best for scalping and quick trades
External Zones (higher timeframes):
Display as "EXTERNAL TARGET - Take Profit"
Primary profit-taking areas
Use for swing trade exits
Trading Strategy
Entry Setup
Wait for fresh zone creation (green/red zones appear)
Identify optimal entry boxes (blue/yellow high-pressure areas)
Enter at Fibonacci levels:
Best entries: 78.6%-88.6% (deeper is better)
Acceptable: 61.8% (but watch for deeper retracements)
Trade Management
Stop Loss: Place below swingarm low (long) or above swingarm high (short)
Targets: Use higher timeframe zones for profit objectives
Internal vs External: Internal zones may flip multiple times; external zones are swing targets
Timeframe Hierarchy
Lower timeframe zones = Entry areas
Higher timeframe zones = Target/profit areas
Example: Enter at 15M zones, target 2H/4H zones for exits
Alert System
Available Alerts
Fresh SwingArm Zone Alerts: Notifies when new green/red zones are created
Fib. 88.6% Break Alerts: Deepest entry level touched
Fib. 78.6% Break Alerts: Good entry level touched
Fib. 61.8% Break Alerts: Early entry level touched
Pressure ON / Optimal Alerts: High-pressure zones activated
Circle Alerts: Pressure signal confirmations
Probability Alerts: Set threshold for long/short probability notifications
Alert Messages Include:
Entry quality rating (DEEPEST, DEEP, GOOD, EARLY)
Current price level
Risk/reward guidance
Target zone information
Probability System
The indicator calculates buying and selling pressure across multiple timeframes:
Long Probability: Bullish pressure percentage
Short Probability: Bearish pressure percentage
Set custom thresholds (default 50%) to receive alerts only when probability exceeds your criteria
Customization Options
Visual Settings
RSI Candle Colors: Enable/disable and customize overbought (blue) and oversold (red) candle colors
Label Display: Toggle individual Fibonacci level labels (61.8%, 78.6%, 88.6%)
Label Colors: Customize colors for long and short labels
Label Size: Adjust label size (Tiny to Huge)
Swingarm Pressure Labels: Show/hide zone break labels
Table Display
Probability Status Table: Shows current pressure analysis
Swingarm Status: Displays current swingarm states across timeframes
Position & Size: Customize table location and text size
Statistics Table
Break Statistics: Track swingarm breaks over time
Performance Metrics: View historical break data per timeframe
Best Practices
Combine with Standard SwingArm: Use the regular SwingArm indicator to display 8-hour and higher timeframes for complete market structure
Respect Timeframe Hierarchy: Always enter on lower timeframes and target higher timeframes
Wait for Deep Entries: The 78.6% and 88.6% levels offer the best risk/reward ratios
Watch Internal Cycles: Shorter timeframe zones may reverse multiple times - don't expect straight-line moves to targets
Use Optimal Entry Boxes: Blue and yellow high-pressure zones provide the highest probability setups
Confirm with Multiple Timeframes: Look for alignment across all three selected timeframes for strongest signals
Notes
This indicator is optimized for 1m, 15m, 1H, 2H, and 4H timeframes
For best results, use in conjunction with proper risk management
Entry opportunities include both optimal entry boxes AND fresh swingarm zones
Deeper zone entries consistently provide better risk/reward ratios
Support
For questions or assistance, refer to the indicator settings tooltips or contact the developer through x.
Disclaimer:
This indicator is for educational purposes. Always practice proper risk management and never risk more than you can afford to lose.
🔵Morning Session📌 Morning Session – TradingView Indicator
The Morning Session highlights the time window between 10:00 – 12:00, a key part of the London session when the market gains volume and volatility. The indicator plots the High of Day (HOD) and Low of Day (LOD) formed during this period, giving traders a clear framework to analyze price action and spot potential trading opportunities.
✔️ Focuses on the most active part of the London session
✔️ Marks critical HOD & LOD levels within the morning range
✔️ Useful for breakout or reversal strategies around session highs and lows
Fibonacci Daily PivotsElevate your trading game with this premium Fibonacci indicator that automatically calculates and displays critical daily pivot levels based on the previous trading day's high and low. This powerful tool eliminates the guesswork by instantly plotting 11 precision Fibonacci levels (-36.8% to +136.8%) every trading day, giving you institutional-grade support and resistance zones that professional traders rely on. With smart weekend handling (Monday uses Friday's data), customizable visual elements, real-time price alerts, and clean day separation markers, this indicator transforms complex Fibonacci analysis into a simple, automated trading edge. Whether you're scalping intraday moves or planning swing trades, these daily-refreshed pivot levels provide the clarity and precision you need to identify high-probability entry and exit points, making it an essential tool for any serious trader looking to consistently profit from market structure and price action around key Fibonacci zones.
随机检验–波动率切换策略(表格版)随机检验 – 波动率切换策略(表格版)
模型原理
本指标基于统计学与波动率研究方法,结合多周期(15m / 1h / 4h)的市场数据,构建出一个“趋势-震荡”状态切换的分析框架。
核心思想:
通过 成交量加权的随机检验(coin test) 判断趋势方向及强弱;
使用 布林带带宽(Bandwidth)与方差比率(Variance Ratio) 识别波动收敛与扩张;
引入 贝叶斯统计(Beta 后验分布) 构造上涨概率背景,并对冲单一频段噪声;
在 布林视角与箱体视角 下生成右侧概率评分,最终融合多源概率形成市场状态评估。
关键假设
市场价格在短期内可视为“抛硬币检验”的结果,上涨/下跌概率并非完全均等,而是受成交量加权影响;
波动率在收敛后往往伴随趋势突破,布林带带宽可作为先行指标;
1h 周期的贝叶斯后验概率能够提供稳健的背景多空倾向;
多周期之间的关系符合“主判(1h)→承接(4h/15m)”的层级逻辑。
输出与功能
在图表右侧显示表格化仪表盘:
趋势状态(1h / 15m / 4h)
布林/箱体区间与收敛信号
各视角下的概率评分与融合结果
贝叶斯多空概率与后验分布摘要(E、SD、有效样本量)
同时绘制 1h 布林带,直观观察波动结构。
使用说明
该指标为 辅助决策工具,不直接生成交易信号。用户应结合自身策略和风险控制使用。
该版本为公开的测试版本。
Randomized Test – Volatility Switching Strategy (Dashboard Version)
Model Principle
This indicator is built on statistical and volatility analysis methods, combining multi-timeframe market data (15m / 1h / 4h) to construct a framework for switching between “trend” and “range” states.
Core ideas:
Use a volume-weighted randomized test (coin test) to determine trend direction and strength;
Apply Bollinger Bandwidth (BW) and Variance Ratio (VR) to detect volatility contraction and expansion;
Introduce Bayesian statistics (Beta posterior distribution) to build the bullish probability background and reduce single-frequency noise;
Generate right-side probability scores under both Bollinger view and Box view, and fuse them into a comprehensive market state evaluation.
Key Assumptions
In the short term, market prices can be modeled as outcomes of a “coin test,” where up/down probabilities are not perfectly equal but weighted by volume;
After volatility contraction, markets often break into trends, and Bollinger Bandwidth serves as a leading indicator;
The 1h Bayesian posterior probability provides a stable background bias for bullish/bearish tendencies;
Multi-timeframe relationships follow a hierarchical logic: main judgment (1h) → confirmation (4h/15m).
Outputs and Features
A dashboard-style table displayed on the right side of the chart, including:
Trend states (1h / 15m / 4h)
Bollinger/Box ranges and convergence signals
Probability scores and fusion results from different perspectives
Bayesian bullish probability and posterior summary (E, SD, effective sample size)
Visualization of the 1h Bollinger Bands for direct observation of volatility structure.
Usage
This indicator is an auxiliary decision-making tool. It does not generate trading signals directly. Users should apply it in combination with their own strategies and risk management.
This version is released as a public test version.
Contrarian Period High & LowContrarian Period High & Low
This indicator pairs nicely with the Contrarian 100 MA and can be located here:
Overview
The "Contrarian Period High & Low" indicator is a powerful technical analysis tool designed for traders seeking to identify key support and resistance levels and capitalize on contrarian trading opportunities. By tracking the highest highs and lowest lows over user-defined periods (Daily, Weekly, or Monthly), this indicator plots historical levels and generates buy and sell signals when price breaks these levels in a contrarian manner. A unique blue dot counter and action table enhance decision-making, making it ideal for swing traders, trend followers, and those trading forex, stocks, or cryptocurrencies. Optimized for daily charts, it can be adapted to other timeframes with proper testing.
How It Works
The indicator identifies the highest high and lowest low within a specified period (e.g., daily, weekly, or monthly) and draws horizontal lines for the previous period’s extremes on the chart. These levels act as dynamic support and resistance zones. Contrarian signals are generated when the price crosses below the previous period’s low (buy signal) or above the previous period’s high (sell signal), indicating potential reversals. A blue dot counter tracks consecutive buy signals, and a table displays the count and recommended action, helping traders decide whether to hold or flip positions.
Key Components
Period High/Low Levels: Tracks the highest high and lowest low for each period, plotting red lines for highs and green lines for lows from the bar where they occurred, extending for a user-defined length (default: 200 bars).
Contrarian Signals: Generates buy signals (blue circles) when price crosses below the previous period’s low and sell signals (white circles) when price crosses above the previous period’s high, designed to capture potential reversals.
Blue Dot Tracker: Counts consecutive buy signals (“blue dots”). If three or more occur, it suggests a stronger trend, with the table recommending whether to “Hold Investment” or “Flip Investment.”
Action Table: A 2x2 table in the bottom-right corner displays the blue dot count and action (“Hold Investment” if count ≥ 4, else “Flip Investment”) for quick reference.
Mathematical Concepts
Period Detection: Uses an approximate bar count to define periods (1 bar for Daily, 5 bars for Weekly, 20 bars for Monthly on a daily chart). When a new period starts, the previous period’s high/low is finalized and plotted.
High/Low Tracking:
Highest high (periodHigh) and lowest low (periodLow) are updated within the period.
Lines are drawn at these levels when the period ends, starting from the bar where the extreme occurred (periodHighBar, periodLowBar).
Signal Logic:
Buy signal: ta.crossunder(close , prevPeriodLow) and not lowBroken and barstate.isconfirmed
Sell signal: ta.crossover(close , prevPeriodHigh) and not highBroken and barstate.isconfirmed
Flags (highBroken, lowBroken) prevent multiple signals for the same level within a period.
Blue Dot Counter: Increments on each buy signal, resets on a sell signal or if price exceeds the entry price after three or more buy signals.
Entry and Exit Rules
Buy Signal (Blue Circle): Triggered when the price crosses below the previous period’s low, suggesting a potential oversold condition and buying opportunity. The signal appears as a blue circle below the price bar.
Sell Signal (White Circle): Triggered when the price crosses above the previous period’s high, indicating a potential overbought condition and selling opportunity. The signal appears as a white circle above the price bar.
Blue Dot Tracker:
Increments blueDotCount on each buy signal and sets an entryPrice on the first buy.
Resets on a sell signal or if price exceeds entryPrice after three or more buy signals.
If blueDotCount >= 3, the table suggests holding; if >= 4, it reinforces “Hold Investment.”
Exit Rules: Exit a buy position on a sell signal or when price exceeds the entry price after three or more buy signals. Combine with other tools (e.g., trendlines, support/resistance) for additional confirmation. Always apply proper risk management.
Recommended Usage
The "Contrarian Period High & Low" indicator is optimized for daily charts but can be adapted to other timeframes (e.g., 1H, 4H) with adjustments to the period bar count. It excels in markets with clear support/resistance levels and potential reversal zones. Traders should:
Backtest the indicator on their chosen asset and timeframe to validate signal reliability.
Combine with other technical tools (e.g., moving averages, Fibonacci levels) for stronger trade confirmation.
Adjust barsPerPeriod (e.g., ~120 bars for Weekly on hourly charts) based on the chart timeframe and market volatility.
Monitor the action table to guide position management based on blue dot counts.
Customization Options
Period Type: Choose between Daily, Weekly, or Monthly periods (default: Monthly).
Line Length: Set the length of high/low lines in bars (default: 200).
Show Highs/Lows: Toggle visibility of period high (red) and low (green) lines.
Max Lines to Keep: Limit the number of historical lines displayed (default: 10).
Hide Signals: Toggle buy/sell signal visibility for a cleaner chart.
Table Display: A fixed table in the bottom-right corner shows the blue dot count and action, with yellow (Hold) or green (Flip) backgrounds based on the count.
Why Use This Indicator?
The "Contrarian Period High & Low" indicator offers a unique blend of support/resistance visualization and contrarian signal generation, making it a versatile tool for identifying potential reversals. Its clear visual cues (lines and signals), blue dot tracker, and actionable table provide traders with an intuitive way to monitor market structure and manage trades. Whether you’re a beginner or an experienced trader, this indicator enhances your ability to spot key levels and time entries/exits effectively.
Tips for Users
Test the indicator thoroughly on your chosen market and timeframe to optimize settings (e.g., adjust barsPerPeriod for non-daily charts).
Use in conjunction with price action or other indicators for stronger trade setups.
Monitor the action table to decide whether to hold or flip positions based on blue dot counts.
Ensure your chart timeframe aligns with the selected period type (e.g., daily chart for Monthly periods).
Apply strict risk management to protect against false breakouts.
Happy trading with the Contrarian Period High & Low indicator! Share your feedback and strategies in the TradingView community!
Opening Range BoxThis indicator, called the "Opening Range Box," is a visual tool that helps you track the start of key trading sessions like London and New York.
It does three main things:
Finds the Daily 'First Move': It automatically calculates the High and Low reached during the first 30 minutes (or whatever time you set) of each defined session.
Draws a Box: It immediately draws a colored, transparent box on your chart from the moment the session starts. This box acts as a clear reference for the session's initial boundaries.
Extends the Levels: After the initial 30 minutes are over, the box stops growing vertically (it locks in the OR High/Low) but continues to stretch out horizontally for the rest of the trading session. This allows you to easily see how the price reacts to the opening levels throughout the day.
In short: It visually highlights the most important price levels established at the very beginning of the major market sessions.
[FRK] Dual Timeline - Separate Pane
The Dual Timeline - Separate Pane indicator is a sophisticated multi-timeframe analysis tool that tracks and displays up to 4 different timeline counts simultaneously in a dedicated pane below your chart. This indicator is designed for traders who use Time-Based Trading (TDT) strategies and need precise tracking of candle/bar counts across multiple timeframes.
Key Features
🔢 Multi-Timeline Tracking:
• Timeline 1: Current chart timeframe counting
• Timeline 2: Customizable higher timeframe (HTF) with proper boundary alignment
• Timeline 3: Specialized 90-minute cycle counting aligned to 2:30 AM NY time
• Timeline 4: Advanced HTF counting with special handling for daily/weekly timeframes
🎯 Strategic Milestone Display:
• Tracks key milestone numbers: 1, 3, 5, 7, 9, 13, 17, 21, 25, 31
• Color-coded sequences for TDT strategies:
◦ Green: Primary sequence (3, 7, 13, 21)
◦ Purple: Secondary sequence (5, 9, 17, 25)
◦ Orange: Current position markers
◦ Gray: Future projections
⚙️ Advanced Customization:
• Individual milestone visibility controls
• Quick presets for TDT strategies:
◦ Top 3 performers (1, 3, 13, 17, 21)
◦ TDT Primary sequence (1, 3, 7, 13, 21)
◦ TDT Secondary sequence (1, 5, 9, 17, 25)
• Customizable colors and font sizes
• Timeline enable/disable controls
📊 Professional Visual Layout:
• Clean separate pane display with labeled timelines
• Subtle center lines for easy reading
• Current position arrows (▲) for active counts
• Connecting lines from latest milestones
• Dots for non-milestone positions
• Future projection capabilities
Special Features
Time-Based Alignment:
• Daily/Weekly timeframes align to 6:00 PM NY (Asia market open)
• Custom 4-hour boundaries: 10:00, 14:00, 18:00, 22:00, 02:00, 06:00
• 90-minute cycles precisely aligned to 2:30 AM NY base time
• HTF boundary detection for accurate positioning
Smart Positioning:
• Time-based positioning for gap handling
• Extended visibility range (1000+ bars back, 500+ bars forward)
• Automatic bar position calculation
• Cross-timeframe synchronization
Use Cases
1. TDT Strategy Implementation: Perfect for Time-Based Trading strategies that rely on specific count sequences
2. Multi-Timeframe Analysis: Track multiple timeframes simultaneously without switching charts
3. Cycle Analysis: Specialized 90-minute cycle tracking for intraday strategies
4. Milestone Targeting: Visual identification of key support/resistance levels based on time counts
5. Future Planning: Project upcoming milestone levels for trade planning
Settings Groups
• Timeline 1-4: Individual start times and timeframe selections
• Display: Colors, fonts, and visual preferences
• Milestone Visibility: Granular control over which counts to display
• Quick Presets: One-click strategy templates
Data Window Output
The indicator provides detailed count information in the data window for precise analysis and strategy backtesting.
Perfect for traders using:
• Time-based trading strategies
• Multi-timeframe analysis
• Cycle-based approaches
• Milestone targeting systems
• Advanced chart timing techniques
This indicator transforms complex multi-timeframe counting into an intuitive visual tool, making it easier to spot patterns, time entries, and plan exits across multiple time dimensions simultaneously.
Ultimate BB Squeeze [Final]This indicator gives the move as it is about to happen and I have even added adx to the same so as to have a directional trade and not get stopped by loss.
pyogi24 Intraday Ichimoku + RSIcustom script to get entry exit
its based on the ichimoku cloud indicator
and the cross over of the leading ang lagging spans to get the signals,
its under development.
i have also integrated the vwap so we know the bias of the trend.
this should work on a trending day.
Unmitigated Candle Highs and Lows What Does "Unmitigated" Mean?
- Unmitigated High: The highest point of a bullish candle that hasn’t been revisited or retested by price after it formed.
- Unmitigated Low: The lowest point of a bearish candle that remains untouched by subsequent price movement.
These levels are often seen as "untapped" supply or demand zones, meaning:
- Price may return to these levels to fill orders left behind.
- They can act as magnetic zones, attracting price back for a reaction.
📈 Why Traders Care About Them
- Liquidity Pools: Institutions often leave unfilled orders at these levels. Price may return to "mitigate" or fulfill those orders.
- Reversal or Continuation Signals: When price revisits an unmitigated high/low, it may either reverse sharply or break through, depending on market context.
- Entry/Exit Points: Traders use these zones to plan entries, stop losses, or take profits.
🧠 Example
Imagine a strong bullish candle forms, but price never returns to its low. That low is considered unmitigated. If price revisits it later, traders watch closely for a bounce or a break.
ICT Killzones Pro Suite — ICT & SMC Indicator with AlertsThe ICT Killzones Pro Suite is a complete ICT and Smart Money Concepts (SMC) indicator that brings together the most important institutional concepts into one single tool.
Instead of manually drawing sessions, structure breaks, liquidity levels or imbalances, this ICT indicator for TradingView automatically plots them with precision and full customization.
It is widely used by traders in Forex, Indices, Crypto and Commodities who want to study market structure the same way institutions do.
🔎 Features
✅ Killzones (Asia, London, New York)
Session boxes with customizable colors
50% midline level for equilibrium reference
Real-time status display (“In Killzone” / “Out of Killzone”)
✅ Equal Highs & Equal Lows (Liquidity zones)
Automatic detection of EQH/EQL
Equality tolerance parameter
Zone expiry (bars)
Rejection filter (2 consecutive closes)
Option to show only the latest active EQH/EQL
✅ Break of Structure (BOS) & Market Structure Shift (MSS)
Detects continuation (BOS) and reversal (MSS) structures
Customizable line styles and colors
“Body only” or “Body/Wick” break modes
Option to show only the latest signals
✅ Open Price Range (OPR)
Institutional daily open level in UTC
Historical OPR memory for backtesting
Optional labels for quick identification
✅ Previous Highs and Lows
Daily (PDH/PDL), Weekly (PWH/PWL), Monthly (PMH/PML)
Full label system
Customizable line width/style
Breakout alerts for each level
✅ Fair Value Gaps (FVGs)
Automatic imbalance detection
Wick or body detection modes
Highlighted imbalance candles in yellow
✅ Alerts Engine
One global alert condition
Modular alerts:
• Killzone opens/closes
• EQH/EQL created or broken
• BOS/MSS bullish & bearish signals
• Previous Highs/Lows breakouts
• FVGs
⚙️ Parameters Explained
Killzones: start/end times in UTC, colors, extension lines, 50% midline
EQH/EQL: tolerance (0 = strict equality, >0 = margin allowed), expiry age (bars), rejection filter, body/wick break type, latest only toggle
BOS/MSS: swing bars (pivots), body vs wick detection, line styles & widths, only-latest option
OPR: exact UTC time (HH:MM), history toggle, label size/color
Previous Highs/Lows: daily/weekly/monthly levels, line styles, label settings, breakout alerts
FVGs: wick vs body detection, candle highlight color
Alerts: global condition + per-module toggles (sessions, liquidity, BOS/MSS, FVG)
Every parameter is fully customizable, making this SMC indicator adaptable to any trading style or timeframe.
📌 Why use this ICT & SMC indicator?
Saves time by automating repetitive tasks
Provides an institutional framework directly on charts
Keeps analysis structured and consistent
Optimized for intraday scalping and swing trading
⚠️ Disclaimer
This script is for educational purposes only. It does not guarantee profits or predict markets with certainty. Always use proper risk management.
🔑 Access
This is an invite-only script on TradingView.
Click Request Access on this page to apply.
Quarterly EarningsThis Pine script shows quarterly EPS, Sales, and P/E (TTM-based) in a styled table.
Multi-Oscillator Adaptive Kernel with MomentumMulti-Oscillator Adaptive Kernel w. Momentum
An adaptation of the indicator by AlphaAlgos : Multi-Oscillator-Adaptive-Kernel (MOAK) with Divergence . Please find the description of the indicator in the above link.
Apart from adding labels to show trend/momentum changes, the following changes have been made to the original script:
1. Sensitivity is used in the computation to scale the fast MOAK signal,
2. Selection between two indicator modes:
Trending - (the original script method) assesses whether smoothed MOAK is above/below 0 - for up/down trends respectively.
Momentum - assesses whether the fast MOAK signal is above/below the smoothed MOAK, and can be used to indicate potential trend reversals as momentum of current trend fades.
One Trade Setup for LifeIndicators are refered from @TFlab and @ChartPrime and @UAlgo
***
## Indicator Overview 🚀
**One Trade Setup for Life** is a sophisticated TradingView Pine Script indicator blending Smart Money Concepts (SMC), advanced Price Action, and Liquidity Analysis. It provides signals for structural market moves, trade setups, and custom alerts. This tool is designed for **precision execution**, giving traders a comprehensive edge in diverse market conditions.
***
## Key Logic Sections & Explanation
### Smart Money Concept Logic 💸
- **Pivot Lines**: Plots SMC levels based on swing high/low pivots, customizable for wick/body detection and colored to represent bullish or bearish market structure.
- **Market Structure Detection**: Tracks changes such as BOS (Break of Structure) and CHoCH (Change of Character), using real-time breakout logic to highlight structural shifts, confirm reversal setups, and trigger accompanying alerts.
- **Engulfing & Confirmation**: Identifies engulfing candles, confirms market structure changes, and plots colored lines—with shape plots at exact highs/lows for visual clarity.
***
### Pure Price Action 📈
- **Swing Detection**: Adjustable bars for detecting swing points, making the indicator sensitive to trend reversals and continuations based on candle closes or wicks.
- **BOS/CHoCH Lines**: Plots dashed, solid, or dotted lines (user-selected) to visualize structural changes in price, adding color-coded markers for transparency.
- **Sentiment Table**: Displays an emoji-based sentiment table at the chart bottom, updating live to quickly gauge overall price action and market mood (bull, bear, neutral emoji).
***
### Supertrend Logic 🟩🟥
- **ATR-Based Trend Filter**: Implements Supertrend bands using customizable ATR length, multiplier, and increment. Options include normalization for flexibility in ranging versus trending markets.
- **Multi-Factor Signals**: Detects buy/sell crossovers and plots median/stdev areas for additional confirmation. Users can visually track Supertrend support/resistance as trade triggers.
***
### RSI & Activity Analysis 📊
- **RSI Calculation**: Provides customizable RSI length, overbought/oversold thresholds. Candle coloring flips as RSI hits extreme levels, giving immediate visual signals for exhaustion or reversals.
- **Trading Volume Proxy**: Advanced logic computes percentile rankings and plots quintile bands, triggering signal arrows when activity surges above or below key thresholds.
***
### Liquidity Sweep & Fair Value Gap Logic 💧
- **Sweep Zones**: Detects price sweeps at key resistance/support lines generated from pivots, marking with labels and enabling sweep alerts.
- **FVG & Mitigation**: Integrates Fair Value Gap (FVG) detection. The indicator can filter FVG zones by aggressiveness, classify supply/demand FVGs, and highlight where price is likely to react for entry or exit.
***
### Support, Resistance, and Swing Levels 🟦🟥
- **Multi-Period SR Lines**: Draws dynamic lines for support/resistance from high/low pivots, adjustable for length and quantity, and visually distinct using color, label, and style options.
- **Main Swing Alerts**: Tracks swing direction, assigns colors, and fires alerts only when direction changes, ensuring traders catch priority momentum shifts.
***
### Detailed Alerts System 🚨
- **Custom Alert Inputs**: Users can toggle alerts for CHoCH, BOS, liquidity structure, high-volume, FVG events, sweep zones, false breakouts, and trigger candles—ensuring critical signals are never missed.
- **On-Chart Graphics**: Circles, arrows, and emoji labels clearly mark confirmation, swings, and reversal points directly on the chart, streamlining decision-making.
***
## Example Markdown Table: Alert Features
| Alert Type | Logic/Trigger | Emoji | Visual Output |
|------------------------|--------------------------------------|-------|---------------------------|
| CHoCH (Change of Char.)| Counter-trend BOS detection | 🔄 | Colored line & arrow |
| BOS (Break of Struct.) | Trend BOS, confirming market shift | 💥 | Line/circle at high/low |
| Liquidity Sweep | Price breaks support/resistance | 💧 | Label "Sweep" + alert |
| FVG Alert | FVG zone formation by aggression | ⚡ | Box highlight + alert |
| Supertrend Trigger | Median/std crossovers | 🟩🟥 | Colored area, Buy/Sell |
***
## Customization, Emoji & Styling 🎨
- **All key inputs are grouped and tooltipped for easy setup.**
- **Charts use emojis for sentiment** and direction, visible on tables and labels.
- **Colors are user-selected** for all markers (pivot, BOS, CHoCH, FVG, SR, swing).
- **Visuals (circles/arrows)** highlight entry, exit, and alert points for instant interpretation—making the script unique and easy to use.
***
## Publication & Use 🌐
This script is covered under the Mozilla Public License 2.0. When publishing, provide the following metadata:
- **Title**: One Trade Setup for Life
- **Description**: A fusion tool combining SMC, price action, advanced liquidity analytics, and market structure detection—with a robust alert system and richly visual trading interface.
**Enjoy clear signals, custom alerts, and visually appealing chart markers—all in one package!** 🏆
EMA/SMA Market Indicator V1 (Situational Awareness Uptrend)Red condition (highest priority in code)
Background = red if any of these are true:
Close < 10MA
OR Close < 20MA
OR (10MA and 20MA slopes ≤ threshold → “flat/down”)
Green condition (only if not red)
Background = green if:
(Close > 10MA or Close > 20MA)
AND Close > 50MA
Otherwise = nothing (transparent)
If neither red nor green is true → background is off.
So when is there no background?
Close is not below 10MA
Close is not below 20MA
MAs are not both flat/down
AND the price fails the “green test” (ex. under 50MA, or not above 10/20).
Fibonacci Ret/Ext ProFibonacci Ret/Ext Pro - Advanced Fibonacci Retracement & Extension Tool
Transform your technical analysis with this professional-grade Fibonacci indicator that automatically detects market structure and draws precise retracement and extension levels.
Key Features:
🎯 Smart Market Structure Detection
Automatic pivot high/low identification with customizable periods
CHoCH (Change of Character) visualization
Real-time swing tracking with intelligent structure recognition
Bullish/bearish market structure highlighting
📊 Comprehensive Fibonacci Levels
Standard levels: 0, 23.6%, 38.2%, 50%, 61.8%, 78.6%, 100%
Extension levels: 127.2%, 161.8%
Negative retracement levels: -27.2%, -38.2%, -61.8%, -100%, -161.8%, -200%
Fully customizable level values and colors
⚙️ Advanced Customization
Individual level toggles - show only what you need
Custom colors for each Fibonacci level
Adjustable line widths and styles
Smart label positioning with price display
Golden Zone highlighting (customizable fill areas)
🔄 Dynamic Display Options
Real-time level extension to current bar
Swing line connections between pivots
Automatic level updates on structure changes
Clean chart display - old levels are automatically cleared
📍 Professional Labeling
Configurable label positions (left/right, above/below/on-line)
Multiple size options (tiny to large)
Price values displayed alongside Fibonacci ratios
Clean, professional appearance
How It Works:
The indicator automatically identifies significant swing highs and lows based on your chosen structure period. When market structure changes from bullish to bearish (or vice versa), it instantly calculates and displays Fibonacci levels from the most recent swing points. No manual drawing required - the algorithm handles everything automatically.
Perfect For:
Swing traders identifying key support/resistance levels
Day traders looking for precise entry/exit points
Position traders planning long-term entries
Anyone seeking professional Fibonacci analysis without manual plotting
Settings Presets:
Short (8 bars) - For intraday/scalping
Medium (21 bars) - For swing trading
Long (55 bars) - For position trading
Custom - Define your own structure period
This indicator provides clean, professional Fibonacci analysis that updates automatically as market structure evolves. No more manual Fibonacci drawing - let the algorithm identify the key levels for you.
Want to take your trading to the next level?
This Fibonacci tool is just one component of a complete trading system. For the full professional experience, check out my Optimus Indicator - a comprehensive full-stack trading system that includes:
Multi-timeframe trend analysis
Advanced buy/sell signals with filtering
Win/loss tracking and statistics
Stop loss management
Real-time alerts and notifications
And much more...
The Optimus Indicator provides everything a serious trader needs in one integrated platform. If you're ready for professional-grade trading tools, reach out privately for access to the complete system.
Disclaimer: This indicator is for educational and informational purposes only. Past performance does not guarantee future results. Always use proper risk management and never risk more than you can afford to lose.
Best MA Finder: Sharpe/Sortino ScannerThis script, Best MA Finder: Sharpe/Sortino Scanner, is a tool designed to identify the moving average (SMA or EMA) that best acts as a dynamic trend threshold on a chart, based on risk-adjusted historical performance. It scans a wide range of MA lengths (SMA or EMA) and selects the one whose simple price vs MA crossover delivered the strongest results using either the Sharpe ratio or the Sortino ratio. Reading it is intuitive: when price spent time above the selected MA, conditions were on average more favorable in the backtest; below, less favorable. It is a trend and risk gauge, not an overbought or oversold signal.
What it does:
- Runs individual long-only crossover backtests for many MA lengths across short to very long horizons.
- For each length, measures the total number of trades, the annualized Sharpe ratio, and the annualized Sortino ratio.
- Uses the chosen metric value (Sharpe or Sortino) as the score to rank candidates.
- Applies a minimum trade filter to discard statistically weak results.
- Optionally applies a local stability filter to prefer a length that also outperforms its close neighbors by at least a small margin.
- Selects the optimal MA and displays it on the chart with a concise summary table.
How to use it:
- Choose MA type: SMA or EMA.
- Choose the metric: Sharpe or Sortino.
- Set the minimum trade count to filter out weak samples.
- Select the risk-free mode:
Auto: uses a short-term risk-free rate for USD-priced symbols when available.
Manual: you provide a risk-free ticker.
None: no risk-free rate.
- Optionally enable stability controls: neighbor radius and epsilon.
- Toggle the on-chart summary table as needed.
On-chart output:
- The selected optimal MA is plotted.
- The optional table shows MA length, number of trades, chosen metric value annualized, and the annual risk-free rate used.
Key features:
- Risk-adjusted optimization via Sharpe or Sortino for fair, comparable assessment.
- Broad MA scan with SMA and EMA support.
- Optional stability filter to avoid one-off spikes.
- Clear and auditable presentation directly on the chart.
Use cases:
- Traders who want a defensible, data-driven trend threshold without manual trial and error.
- Swing and trend-following workflows across timeframes and asset classes.
- Quick SMA vs EMA comparisons using risk-adjusted results.
Limitations:
- Not a full trading strategy with position sizing, costs, funding, slippage, or stops.
- Long-only, one position at a time.
- Discrete set of MA lengths, not a continuous optimizer.
- Requires sufficient price history and, if used, a reliable risk-free series.
This script is open-source and built from original logic. It does not replicate closed-source scripts or reuse significant external components.
Smart Money Support/Resistance — LiteSmart Money Support/Resistance — Lite
Overview & Methodology
This indicator identifies support and resistance as zones derived from concentrated buying and selling pressure, rather than relying solely on traditional swing highs/lows. Its design focuses on transparency: how data is sourced, how zones are computed, and how the on‑chart display should be interpreted.
Lower‑Timeframe (LTF) Data
The script requests Up Volume, Down Volume, and Volume Delta from a lower timeframe to expose intrabar order‑flow structure that the chart’s native timeframe cannot show. In practical terms, this lets you see where buyers or sellers briefly dominated inside the body of a higher‑timeframe bar.
bool use_custom_tf_input = input.bool(true, title="Use custom lower timeframe", tooltip="Override the automatically chosen lower timeframe for volume calculations.", group=grpVolume)
string custom_tf_input = input. Timeframe("1", title="Lower timeframe", tooltip="Lower timeframe used for up/down volume calculations (default 5 seconds).", group=grpVolume)
import TradingView/ta/10 as tvta
resolve_lower_tf(useCustom, customTF) =>
useCustom ? customTF :
timeframe.isseconds ? "1S" :
timeframe.isintraday ? "1" :
timeframe.isdaily ? "5" : "60"
get_up_down_volume(lowerTf) =>
= tvta.requestUpAndDownVolume(lowerTf)
var float upVolume = na
var float downVolume = na
var float deltaVolume = na
string lower_tf = resolve_lower_tf(use_custom_tf_input, custom_tf_input)
= get_up_down_volume(lower_tf)
upVolume := u_tmp
downVolume := d_tmp
deltaVolume := dl_tmp
• Data source: TradingView’s ta.requestUpAndDownVolume(lowerTf) via the official TA library.
• Plan capabilities: higher‑tier subscriptions unlock seconds‑based charts and allow more historical bars per chart. This expands both the temporal depth of LTF data and the precision of short‑horizon analysis, while base tiers provide minute‑level data suitable for day/short‑swing studies.
• Coverage clarity: a small on‑chart Coverage Panel reports the active lower timeframe, the number of bars covered, and the latest computed support/resistance ranges so you always know the bounds of valid LTF input.
Core Method
1) Data acquisition (LTF)
The script retrieves three series from the chosen lower timeframe:
– Up Volume (buyers)
– Down Volume (sellers)
– Delta (Up – Down)
2) Rolling window & extrema
Over a user‑defined lookback (Global Volume Period), the algorithm builds rolling arrays of completed bars and scans for extrema:
– Buyers_max / Buyers_min from Up Volume
– Sellers_max / Sellers_min from Down Volume
Only completed bars are considered; the current bar is excluded for stability.
3) Price mapping
The extrema are mapped back to their source candles to obtain price bounds:
– For “maximum” roles the algorithm uses the relevant candle highs.
– For “minimum” roles it uses the relevant candle lows.
These pairs define candidate resistance (max‑based) and support (min‑based) zones or vice versa.
4) Zone construction & minimum width
To ensure practicality on all symbols, zones enforce a minimum vertical thickness of two ticks. This prevents visually invisible or overly thin ranges on instruments with tight ticks.
5) Vertical role resolution
When both max‑ and min‑based zones exist, the script compares their midpoints. If, due to local price structure, the min‑based zone sits above the max‑based zone, display roles are swapped so the higher zone is labeled Resistance and the lower zone Support. Colors/widths are updated accordingly to keep the visual legend consistent.
6) Rendering & panel
Two horizontal lines and a filled box represent each active zone. The Coverage Panel (bottom‑right by default) prints:
– Lower‑timeframe in use
– Number of bars covered by LTF data
– Current Support and Resistance ranges
If the two zones overlap, an additional “Range Market” note is shown.
Key Inputs
• Global Volume Period: shared lookback window for the extrema search.
• Lower timeframe: user‑selectable override of the automatically resolved lower timeframe.
• Visualization toggles: independent show/hide controls and colors for maximum (resistance) and minimum (support) zones.
• Coverage Panel: enable/disable the single‑cell table and its readout.
Operational Notes
• The algorithm aligns all lookups to completed bars (no peeking). Price references are shifted appropriately to avoid using the still‑forming bar in calculations.
• Second‑based lower timeframes improve granularity for scalping and very short‑term entries. Minute‑based lower timeframes provide broader coverage for intraday and short‑swing contexts.
• Use the Coverage Panel to confirm the true extent of available LTF history on your symbol/plan before drawing conclusions from very deep lookbacks.
Visual Walkthrough
A step‑by‑step image sequence accompanies this description. Each figure demonstrates how the indicator reads LTF volume, locates extrema, builds price‑mapped zones, and updates labels/colors when vertical order requires it.
Chart Interpretation
This chart illustrates two distinct perspectives of the Smart Money Support/Resistance — Lite indicator, each derived from different lookback horizons and lower-timeframe (LTF) resolutions.
1- Short-term view (43 bars, 10-second LTF)
Using the most recent 43 completed bars with 10-second intrabar data, the algorithm detects that both maximum and minimum volume extrema fall within a narrow range. The result is a clearly identified range market: resistance between 178.15–184.55 and support between 175.02–179.38.
The Coverage Panel (bottom-right) confirms the scope of valid input: the lower timeframe used, number of bars covered, and the resulting zones. This short-term scan highlights how the indicator adapts to limited data depth, flagging sideways structure where neither side dominates.
2 - Long-term view (120 bars, 30-second LTF)
Over a wider 120-bar lookback with higher-granularity 30-second data, broader supply and demand zones emerge.
– The long-term resistance zone captures the concentration of buyers and sellers at the upper boundary of recent price history.
– The long-term support zone anchors to the opposite side of the distribution, derived from maxima and minima of both buying and selling pressure.
These zones reflect deeper structural levels where market participants previously committed significant volume.
Combined Perspective
By aligning the short-term and long-term outputs, the chart shows how the indicator distinguishes immediate consolidation (range market) from more durable support and resistance levels derived from extended history. This dual resolution approach makes clear that support and resistance are not static lines but dynamic zones, dependent on both timeframe depth and the resolution of intrabar volume data.
Z-Score Trend Channels [BackQuant]Z-Score Trend Channels
A self-contained price-statistics framework that turns a rolling z-score into price channels, bias states, and trade markers. Run either trend-following or mean-reversion from the same tool with clear, on-chart context.
What it is
A rolling statistical map that measures how far price is from its recent average in standard-deviation units (z-score).
Adaptive channels drawn in price space from fixed z thresholds, so the rails breathe with volatility.
A simple trend proxy from z-score momentum to separate trending from ranging conditions.
On-chart signals for pullback entries, stretched extremes, and practical exits.
Core idea (plain English math)
Rolling mean and volatility - Over a lookback you get the average price and its standard deviation.
Z-score - How many standard deviations the current price is above or below its average: z = (price - mean) / stdev. z near 0 means near average; positive is above; negative is below.
Noise control - An EMA smooths the raw z to reduce jitter and false flickers.
Channels back in price - Fixed z levels are converted back to price to form the upper, lower, and extreme rails.
Trend proxy - A smoothed change in z is used as a lightweight trend-strength line. Positive strength with positive z favors uptrend; negative strength with negative z favors downtrend.
What you see on the chart
Channels and fills - Mean, upper, lower, and optional extreme lines. The area mean->upper tints with the bearish color, mean->lower tints with the bullish color.
Background tint (optional) - Soft green, red, or neutral based on detected trend state.
Signals - Bullish Entry (triangle up) when z exits the oversold zone upward; Bearish Entry (triangle down) when z exits the overbought zone downward; Extreme markers (diamonds) at the extreme bands with a one-bar turn.
Table - Current z, trend state, trend strength, distance to bands, market state tag, and a quick volatility regime label.
Edge labels - MEAN, OB, and OS labels slightly projected forward with level values.
Inputs you will actually use
Z-Score Period - Lookback for mean and stdev. Larger = slower and steadier rails, smaller = more reactive.
Smoothing Period - EMA on z. Lower = earlier but choppier flips; higher = later but cleaner.
Price Source - Default hlc3. Choose close if you prefer session-close logic.
Upper and Lower Thresholds - Default around +2.0 and -2.0. Tighten for more signals, widen for fewer and stronger.
Extreme Upper and Lower - Deeper stretch guards, e.g., +/- 2.5.
Strength Period - EMA on z momentum. Sets how fast the trend proxy flips.
Trend Threshold - Minimum absolute z to accept a directional bias.
Visual toggles - Channels, signals, background tint, stats table, colors, and optional last-bar trend label.
How to use it: trend-following playbook
Read the state - Uptrend when z > Trend Threshold and trend strength > 0. Downtrend when z < -Trend Threshold and trend strength < 0. Neutral otherwise.
Entries - In an uptrend, prefer Bullish Entry signals that fire near the lower channel. In a downtrend, prefer Bearish Entry signals that fire near the upper channel.
Stops - Conservative: beyond the extreme channel on your side. Tighter: just outside the standard band that framed the signal.
Exits - For longs, exit or trim on a cross back through z = 0 or a clean tag of the upper threshold. For shorts, mirror with z = 0 up-cross or tag of the lower threshold. You can also reduce if trend strength flips against you.
Adds - In strong trends, additional signals near your side’s band can be add points. Avoid adding once z hovers near the opposite band for several bars.
How to use it: mean-reversion playbook
Find stretch - Standard reversions: Bullish Entry when z leaves the oversold zone upward; Bearish Entry when z leaves the overbought zone downward. Aggressive reversions: Extreme markers at extreme bands with a one-bar turn.
Entries - Take the signal as price exits the zone. Prefer setups where trend strength is near zero or tilting against the prior push.
Targets - First target is the mean line. A runner can aim for the opposite standard channel if momentum keeps flipping.
Stops - Outside the extreme band beyond your entry. If fading without extremes, place risk just beyond the opposite standard band.
Filters - Optional: skip counter-trend fades against a very strong trend state unless your risk is tight and predefined.
Reading the stats table
Current Z-Score - Magnitude and sign of displacement now.
Trend State - Uptrend, Downtrend, or Ranging.
Trend Strength - Smoothed z momentum. Higher absolute values imply stronger directional conviction.
Distance to Upper/Lower - Percent distance from price to each band, useful for sizing targets or judging room left.
Market State - Overbought, Oversold, Extreme OB, Extreme OS, or Normal.
Volatility Regime - High, Normal, or Low relative to recent distribution. Expect bands to widen in High and tighten in Low.
Parameter guidance (conceptual)
Z-Score Period - Choose longer for a structural mean, shorter for a reactive mean.
Smoothing Period - Lower for earlier but noisier reads; higher for slower but steadier reads.
Thresholds - Start around +/- 2.0. Tighten for scalping or quiet ranges. Widen for noisy or fast markets.
Trend Threshold and Strength Period - Raise to avoid weak, transient bias. Lower to capture earlier regime shifts.
Practical examples
Trend pullback long - State shows Uptrend. Price tests the lower channel; z dips near or below the lower threshold; a Bullish Entry prints. Stop just below extreme lower; first target mean; keep a runner if trend strength stays positive.
Mean-revert short - State is Ranging. z tags the extreme upper, an Extreme Bearish marker prints, then a Bearish Entry prints on the leave. Stop above extreme upper; target the mean; consider a runner toward the lower channel if strength turns negative.
Potential Questions you might have
Why z-score instead of fixed offsets - Because the bands adapt with volatility. When the tape gets quiet the rails tighten, when it runs hot the rails expand. Your entries stay normalized.
Do I need both modes - No. Many users run only trend pullbacks or only mean-reversions. The tool lets you toggle what you need and keep the chart readable.
Multi-timeframe workflow - A common approach is to set bias from a higher timeframe’s trend state and execute on a lower timeframe’s signals that align with it.
Summary
Z-Score Trend Channels gives you an adaptive mean, volatility-aware rails, a simple trend lens, and clear signals. Trade the trend by buying pullbacks in green and selling pullbacks in red, or fade stretched extremes back to the mean with defined risk. One framework, two strategies, consistent logic.