ULTRA RSI 2025//@version=6
indicator(title="ULTRA RSI 2025", shorttitle="ULTRA RSI 2025", format=format.price, precision=2)
// ==================== CONFIGURAÇÃO VISUAL FUTURISTA ====================
cyberTheme = input.string("IC", title="🎨 Tema Visual", options= , group="🎨 Visual Settings")
showGradients = input.bool(true, title="🎨 Exibir Preenchimentos em Gradiente", group="🎨 Visual Settings")
glowIntensity = input.float(0.3, title="🎨 Intensidade do Brilho", minval=0.0, maxval=1.0, step=0.1, group="🎨 Visual Settings")
// Cores para hline (usando input.color)
overboughtColor = input.color(color.new(#ff0000, 20), title="📈 Cor Sobrevendido", group="🎨 Visual Settings")
oversoldColor = input.color(color.new(#31fc09, 20), title="📉 Cor Sobrecomprado", group="🎨 Visual Settings")
midlineColor = input.color(color.new(#ffffff, 81), title="⚡ Cor da Linha Média", group="🎨 Visual Settings")
// ==================== CORES FUTURISTAS ====================
getThemeColors() =>
switch cyberTheme
"IC" =>
"Matrix Green" =>
"Tron Orange" =>
"Blade Runner Pink" =>
=>
= getThemeColors()
// Colores adicionales cyber
cyberGreen = color.new(#39FF14, 0)
cyberRed = color.new(#FF073A, 0)
darkCyber = color.new(#0D1117, 0)
neonWhite = color.new(#FFFFFF, 0)
// ==================== CÓDIGO RSI ORIGINAL (SIN MODIFICAR) ====================
rsiLengthInput = input.int(14, minval=1, title=" RSI Length", group=" RSI Settings")
rsiSourceInput = input.source(close, " Source", group=" RSI Settings")
calculateDivergence = input.bool(false, title=" Calculate Divergence", group=" RSI Settings", display = display.data_window, tooltip = "Calculating divergences is needed in order for divergence alerts to fire.")
change = ta.change(rsiSourceInput)
up = ta.rma(math.max(change, 0), rsiLengthInput)
down = ta.rma(-math.min(change, 0), rsiLengthInput)
rsi = down == 0 ? 100 : up == 0 ? 0 : 100 - (100 / (1 + up / down))
// ==================== VISUAL FUTURISTA ====================
// Color dinámico para el RSI
getRsiColor(rsiValue) =>
if rsiValue >= 80
neonPrimary // Azul neón para sobrecomprado
else if rsiValue >= 70
color.new(neonPrimary, 30)
else if rsiValue <= 20
cyberRed // Rojo cyber para sobrevendido
else if rsiValue <= 30
color.new(cyberRed, 30)
else if rsiValue > 50
color.new(cyberGreen, 40)
else
color.new(neonSecondary, 50)
rsiColor = getRsiColor(rsi)
glowColor = color.new(rsiColor, math.round(100 - glowIntensity * 100))
// Plot RSI con efecto glow futurista
rsiPlot = plot(rsi, "🔮 Cyber RSI", color=rsiColor, linewidth=3)
plot(rsi, "✨ RSI Glow 1", color=glowColor, linewidth=5)
plot(rsi, "✨ RSI Glow 2", color=color.new(rsiColor, 90), linewidth=7)
// Líneas de banda con estilo cyber
rsiUpperBand = hline(70, "🔥 Cyber Overbought", color=overboughtColor, linestyle=hline.style_dashed, linewidth=2)
midline = hline(50, " Cyber Midline", color=midlineColor, linestyle=hline.style_dotted)
rsiLowerBand = hline(30, "❄️ Cyber Oversold", color=oversoldColor, linestyle=hline.style_dashed, linewidth=2)
// Background fills futuristas
midLinePlot = plot(50, color = na, editable = false, display = display.none)
// Fill condicional usando operador ternario
backgroundFillColor = showGradients ? color.new(darkCyber, 90) : na
overboughtFillColor = showGradients ? color.new(neonPrimary, 0) : na
overboughtFillColorBottom = showGradients ? color.new(neonPrimary, 100) : na
oversoldFillColorTop = showGradients ? color.new(neonSecondary, 100) : na
oversoldFillColorBottom = showGradients ? color.new(neonSecondary, 0) : na
fill(rsiUpperBand, rsiLowerBand, color=backgroundFillColor, title="🌃 Cyber Background")
fill(rsiPlot, midLinePlot, 100, 70, top_color = overboughtFillColor, bottom_color = overboughtFillColorBottom, title = "🌌 Cyber Overbought Zone")
fill(rsiPlot, midLinePlot, 30, 0, top_color = oversoldFillColorTop, bottom_color = oversoldFillColorBottom, title = "🌌 Cyber Oversold Zone")
// ==================== SMOOTHING MA (CÓDIGO ORIGINAL) ====================
GRP = "🌊 Smoothing"
TT_BB = "Only applies when 'SMA + Bollinger Bands' is selected. Determines the distance between the SMA and the bands."
maTypeInput = input.string("SMA", "Type", options = , group = GRP, display = display.data_window)
maLengthInput = input.int(14, "Length", group = GRP, display = display.data_window)
bbMultInput = input.float(2.0, "BB StdDev", minval = 0.001, maxval = 50, step = 0.5, tooltip = TT_BB, group = GRP, display = display.data_window)
var enableMA = maTypeInput != "None"
var isBB = maTypeInput == "SMA + Bollinger Bands"
// Smoothing MA Calculation (CÓDIGO ORIGINAL)
ma(source, length, MAtype) =>
switch MAtype
"SMA" => ta.sma(source, length)
"SMA + Bollinger Bands" => ta.sma(source, length)
"EMA" => ta.ema(source, length)
"SMMA (RMA)" => ta.rma(source, length)
"WMA" => ta.wma(source, length)
"VWMA" => ta.vwma(source, length)
// Smoothing MA plots con colores cyber
smoothingMA = enableMA ? ma(rsi, maLengthInput, maTypeInput) : na
smoothingStDev = isBB ? ta.stdev(rsi, maLengthInput) * bbMultInput : na
plot(smoothingMA, "🌊 Cyber MA", color=color.new(color.yellow, 0), linewidth=2, display = enableMA ? display.all : display.none, editable = enableMA)
bbUpperBand = plot(smoothingMA + smoothingStDev, title = "🔺 Upper Cyber Band", color=neonPrimary, linewidth=2, display = isBB ? display.all : display.none, editable = isBB)
bbLowerBand = plot(smoothingMA - smoothingStDev, title = "🔻 Lower Cyber Band", color=neonSecondary, linewidth=2, display = isBB ? display.all : display.none, editable = isBB)
// Fill para Bollinger Bands
bbFillColor = isBB ? color.new(neonPrimary, 90) : na
fill(bbUpperBand, bbLowerBand, color=bbFillColor, title="🌌 Cyber Bollinger Fill", display = isBB ? display.all : display.none, editable = isBB)
// ==================== DIVERGENCE (CÓDIGO ORIGINAL CORREGIDO) ====================
lookbackRight = 5
lookbackLeft = 5
rangeUpper = 60
rangeLower = 5
bearColor = cyberRed
bullColor = cyberGreen
textColor = neonWhite
noneColor = color.new(color.white, 100)
// Función _inRange calculada en cada barra
_inRange(bool cond) =>
bars = ta.barssince(cond)
rangeLower <= bars and bars <= rangeUpper
plFound = false
phFound = false
bullCond = false
bearCond = false
rsiLBR = rsi
// Calcular _inRange en cada barra para evitar inconsistencias
plFoundPrev = not na(ta.pivotlow(rsi, lookbackLeft, lookbackRight) )
phFoundPrev = not na(ta.pivothigh(rsi, lookbackLeft, lookbackRight) )
inRangeBull = _inRange(plFoundPrev)
inRangeBear = _inRange(phFoundPrev)
if calculateDivergence
//------------------------------------------------------------------------------
// Regular Bullish
// rsi: Higher Low
plFound := not na(ta.pivotlow(rsi, lookbackLeft, lookbackRight))
rsiHL = rsiLBR > ta.valuewhen(plFound, rsiLBR, 1) and inRangeBull
// Price: Lower Low
lowLBR = low
priceLL = lowLBR < ta.valuewhen(plFound, lowLBR, 1)
bullCond := priceLL and rsiHL and plFound
//------------------------------------------------------------------------------
// Regular Bearish
// rsi: Lower High
phFound := not na(ta.pivothigh(rsi, lookbackLeft, lookbackRight))
rsiLH = rsiLBR < ta.valuewhen(phFound, rsiLBR, 1) and inRangeBear
// Price: Higher High
highLBR = high
priceHH = highLBR > ta.valuewhen(phFound, highLBR, 1)
bearCond := priceHH and rsiLH and phFound
// Divergence plots con estilo cyber
plot(
plFound ? rsiLBR : na,
offset = -lookbackRight,
title = "🚀 Cyber Bull Divergence",
linewidth = 3,
color = (bullCond ? bullColor : noneColor),
display = display.pane,
editable = calculateDivergence)
plotshape(
bullCond ? rsiLBR : na,
offset = -lookbackRight,
title = "🚀 Cyber Bull Signal",
text = "🚀 BULL",
style = shape.labelup,
location = location.absolute,
color = bullColor,
textcolor = textColor,
size = size.normal,
display = display.pane,
editable = calculateDivergence)
plot(
phFound ? rsiLBR : na,
offset = -lookbackRight,
title = "🔻 Cyber Bear Divergence",
linewidth = 3,
color = (bearCond ? bearColor : noneColor),
display = display.pane,
editable = calculateDivergence)
plotshape(
bearCond ? rsiLBR : na,
offset = -lookbackRight,
title = "🔻 Cyber Bear Signal",
text = "🔻 BEAR",
style = shape.labeldown,
location = location.absolute,
color = bearColor,
textcolor = textColor,
size = size.normal,
display = display.pane,
editable = calculateDivergence)
// ==================== TABLA DE INFORMACIÓN CYBER ====================
// Calcular ta.change en cada barra para consistencia
rsiChange3 = ta.change(rsi, 3)
if barstate.islast
var table infoTable = table.new(position.top_right, 2, 5,
bgcolor=color.new(darkCyber, 10),
border_width=2,
border_color=neonPrimary,
frame_width=3,
frame_color=neonSecondary)
table.clear(infoTable, 0, 0, 1, 4)
table.cell(infoTable, 0, 0, " ULTRA RSI", bgcolor=neonPrimary, text_color=neonWhite, text_size=size.small)
table.cell(infoTable, 1, 0, " INFO", bgcolor=neonSecondary, text_color=neonWhite, text_size=size.small)
table.cell(infoTable, 0, 1, " VALOR RSI", bgcolor=color.new(darkCyber, 30), text_color=neonPrimary, text_size=size.small)
table.cell(infoTable, 1, 1, str.tostring(math.round(rsi, 2)), bgcolor=color.new(darkCyber, 30), text_color=neonWhite, text_size=size.small)
rsiStatus = rsi >= 70 ? " SOBRENDIDO" : rsi <= 30 ? " SOBRECOMPRADO" : " NEUTRO"
statusColor = rsi >= 70 ? cyberRed : rsi <= 30 ? cyberGreen : neonWhite
table.cell(infoTable, 0, 2, " MOMENTO", bgcolor=color.new(darkCyber, 30), text_color=neonSecondary, text_size=size.small)
table.cell(infoTable, 1, 2, rsiStatus, bgcolor=color.new(darkCyber, 30), text_color=statusColor, text_size=size.small)
if enableMA
table.cell(infoTable, 0, 3, " EMA RSI", bgcolor=color.new(darkCyber, 30), text_color=neonPrimary, text_size=size.small)
table.cell(infoTable, 1, 3, str.tostring(math.round(smoothingMA, 2)), bgcolor=color.new(darkCyber, 30), text_color=neonWhite, text_size=size.small)
momentum = rsiChange3 > 0 ? " SUBINDO" : " CAINDO"
momentumColor = rsiChange3 > 0 ? cyberGreen : cyberRed
table.cell(infoTable, 0, 4, " TENDÊNCIA", bgcolor=color.new(darkCyber, 30), text_color=neonPrimary, text_size=size.small)
table.cell(infoTable, 1, 4, momentum, bgcolor=color.new(darkCyber, 30), text_color=momentumColor, text_size=size.small)
// ==================== ALERTS (CÓDIGO ORIGINAL) ====================
alertcondition(bullCond, title='🚀 Cyber Bullish Divergence', message="🎯 Found a new Cyber Bullish Divergence!")
alertcondition(bearCond, title='🔻 Cyber Bearish Divergence', message='🎯 Found a new Cyber Bearish Divergence!')
Indicadores de Banda
Pivot Points StandardThis Pivot Points indicator calculates and plots pivot levels on your chart according to several popular methods (such as Traditional, Fibonacci, Woodie, Classic, Camarilla, etc.), helping traders identify key support and resistance levels. Pivot points are essential tools for predicting market reversal points, and this indicator does so efficiently in real-time.
Features:
Pivot Calculation Methods: Traditional, Fibonacci, Woodie, Classic, Camarilla, and more.
Customization Options: Adjust the pivot type, number of visible pivots, and other parameters like line color and thickness.
Custom Alerts: Receive automatic alerts when the price crosses any pivot level (S1, S2, R1, R2, etc.), helping you react quickly to potential market reversals.
Multiple Timeframe Support: Set the timeframe for the pivot calculations and view corresponding pivot levels for that period.
Visible Pivot Levels: Choose to show or hide the pivot levels directly on the chart, with the option to display the exact price of each level.
Flexible Label Positioning: Select whether pivot labels should appear on the left or right side of the pivot line.
Benefits:
Facilitates Decision-Making: Pivot levels help identify key zones where price is likely to reverse or stay within a range.
Real-Time Alerts: Alerts notify you as soon as the price crosses any key pivot level, enabling you to make quick and precise decisions without constantly monitoring the chart.
Customization: Easily adjust the indicator to suit your trading style and visual preferences.
Ideal For:
Traders looking for technical analysis tools to identify key market levels.
Those who want to receive automatic alerts about pivot level crossovers to streamline decision-making.
Investors using pivot analysis in their trading strategy to determine entry or exit points.
Volume-Time Imbalance (VTI)Volume-Time Imbalance (VTI) – Indicator Description
This indicator measures the imbalance between traded volume and the time elapsed between bars to identify unusual spikes in volume per second (volume per unit of time). Its purpose is to highlight volume movements that may indicate moments of strong interest, acceleration, or reversal in the market.
How it works:
It calculates the traded volume divided by the time (in seconds) elapsed since the previous bar — thus obtaining the volume per second.
An EMA (exponential moving average) of this volume per second is calculated to smooth the data.
The VTI value is the ratio between the current volume per second and this moving average, showing if the current volume is above what is expected for that pace.
The higher the VTI, the greater the imbalance between volume and time, indicating possible bursts of activity.
Settings:
VTI Moving Average Length: The period of the moving average used to smooth the volume per second (default is 20).
Alert Thresholds: Alert levels to identify moderate and high imbalances (defaults are 1.5 and 2.0).
Show VTI Histogram: Displays the VTI histogram in the indicator window.
Color Background: Colors the indicator background based on the strength of the imbalance (orange for moderate, red for high).
Show Alert Arrows: Shows arrows below the chart when a strong volume spike occurs (high alert).
Interpretation:
VTI values above the moderate level (1.5) indicate an unusual increase in volume relative to time.
Values above the high level (2.0) signal strong spikes that may anticipate significant moves or trend changes.
Use the colors and arrows as visual confirmations to quickly identify these moments.
BSL & SSL - Liquidity Zones
BSL & SSL - Liquidity Zones
Indicator Description (for TradingView)
Concept
The BSL & SSL - Liquidity Zones indicator is a simple yet powerful visual tool that helps traders identify key liquidity zones in the market by tracking prominent highs and lows on the chart.
It is based on the concept that the Highest High (Buy Side Liquidity - BSL) and Lowest Low (Sell Side Liquidity - SSL) represent zones where stop-loss orders and pending orders accumulate — often attracting future price movements.
Purpose
This indicator helps traders spot hidden liquidity levels which may act as targets or potential reversal points. It is especially useful for traders who apply Smart Money Concepts (SMC) or institutional trading models.
Great for detecting potential stop hunts and understanding market structure shifts.
How It Works
The indicator calculates the Highest High and Lowest Low over a user-defined period (default: 20 candles).
When a new Higher High forms, it marks a new BSL.
When a new Lower Low forms, it marks a new SSL.
These zones are likely to attract price in the future — either as targets or traps.
Visualization
The indicator draws static horizontal lines (Stepline style) at BSL and SSL levels.
These lines remain in place until broken or a new level is formed.
Visual Labels enhance clarity:
🟢 Green Label → BSL
🔴 Red Label → SSL
Trading Insights / Practical Use
When price approaches a BSL or SSL zone, ask yourself:
✅ Will price break the level to grab liquidity?
✅ Will there be a reversal after liquidity is taken?
The indicator does not provide signals by itself — it serves as a valuable confirmation tool when combined with:
Price Action
Support & Resistance
Momentum Indicators
SMC Tools
Key Benefits
✅ Easy to use
✅ Enhances liquidity analysis
✅ Highlights zones targeted by institutional players
✅ Simple calculation — no complex formulas
Limitations
🚫 Does NOT generate buy/sell signals
🚫 Should be used as part of a complete trading framework
Conclusion
BSL & SSL - Liquidity Zones is a versatile and intuitive tool for any trader looking to better understand where liquidity is positioned on the chart.
It works across all timeframes and complements any trading strategy, especially Smart Money-based approaches.
MohdTZ - XO Trend Scanner/EMA/ATR/Supertrend/WatermarkApply the Script:
Copy the code into TradingView’s Pine Script editor.
Save and add the indicator to your chart.
Verify Supertrend:
Look for a line that switches between green (uptrend) and red (downtrend) based on price movement relative to the Supertrend level.
It should appear alongside the 200 EMA, Slow EMA, ATR band fill, and trend scanner EMAs.
Customize Settings:
Adjust supertrend_length and supertrend_multiplier in the indicator settings to fine-tune sensitivity.
Change supertrend_color_up, supertrend_color_down, or supertrend_linewidth for visual preferences.
Modify atr_band_color if you want a different fill color for the ATR bands.
Check for Clutter:
The chart now includes multiple overlays (200 EMA, Slow EMA, ATR bands, Supertrend, Fast/Slow EMAs). If it’s too crowded, toggle i_bothEMAs to false to show only the Consolidated EMA, or adjust line widths/transparency.
Why Supertrend Wasn’t Visible Before
The original scripts didn’t include Supertrend calculations or plotting.
If you were expecting Supertrend from another indicator or script, it’s possible another indicator was disabled or not applied. This script now explicitly includes Supertrend.
Additional Notes
Chart Appearance: The Supertrend line will plot above or below the price, changing color based on trend direction. Ensure it’s visible by checking the chart’s scale and that no other indicators are overlapping.
Conflicts: If you don’t see the Supertrend, verify that no other indicators are hiding it (e.g., due to overlapping colors or chart scaling). You can disable other indicators temporarily to confirm.
Further Customization: If you want Supertrend to interact with other components (e.g., combine with EMA signals, adjust bar coloring based on Supertrend), let me know, and I can add that logic.
Debugging: If the Supertrend doesn’t appear, check the TradingView console for errors, or share a screenshot/description of your chart setup.
If you meant a specific Supertrend implementation (e.g., with unique parameters or additional features) or if you’re referring to a different issue (e.g., a specific Supertrend script you expected), please provide more details, and I’ll refine the solution. Let me know if you need help applying this or visualizing the result!
learn Supertrend parameters
Bollinger Bands
KABOOM FVGFair value gaps (FVG) highlight imbalances areas between market participants and have become popular amongst technical analysts. The following script aims to display fair value gaps alongside the percentage of filled gaps and the average duration (in bars) before gaps are filled.
Users can be alerted when an FVG is filled using the alerts built into this script.
In practice, FVG's highlight areas of support (bullish FVG) and resistances (bearish FVG). Once a gap is filled, suggesting the end of the imbalance, we can expect the price to reverse.
🔶 USAGE
This approach is more contrarian in nature, users wishing to use a more trend-following approach can use the identification of FVG as direct signals, going long with the identification of a bullish FVG, and short with a bearish FVG.
Bullish FVG
low > high(t-2)
close(t-1) > high(t-2)
(low - high(t-2)) / high(t-2) > threshold
Upper Bullish FVG = low
Lower Bullish FVG = high(t-2)
Bearish FVG
high < low(t-2)
close(t-1) < low(t-2)
(low(t-2) - high) / high < -threshold
Upper Bearish FVG = low(t-2)
Lower Bearish FVG = high
🔶 SETTINGS
Threshold %: Threshold percentage used to filter our FVG's based on their height.
Auto Threshold: Use the cumulative mean of relative FVG heights as threshold.
Unmitigatted Levels: Extent the mitigation level of the number of unmitigated FVG's set by the user.
Mitigation Levels: Show the mitigation levels of mitigated FVG's.
Timeframe : Timeframe of the price data used to detect FVG's.
VWAP + RSI + ADX Buy SignalThis is combination of RSI VWAP and ADX for generating buy signals.All are required to backtest it and post the result thereof in comments section.
PWL PWH PDL PDH refined)NEw Script which shows PWH, PWL, PDH., PDL, to be used with key levels to scalp intraday moves. Clean and easy.
TSLA + NQ1! MTF StrategyGreat! Here's an upgraded automated TradingView Pine Script (v5) strategy template with:
✅ Entry signals based on TSLA & NQ1! key levels
✅ RSI filter (momentum confirmation)
✅ Stop Loss / Take Profit
✅ Configurable Multi-Timeframe EMA filter (e.g., 1H)
EMA Momentum + OBV + Volume Signals with DivergenceHere’s a detailed description of the script "EMA Momentum + OBV + Volume Signals with Divergence" you've created in Pine Script v6:
🔍 Overview
This script is a technical analysis tool for TradingView that combines 7-day Exponential Moving Averages (EMA) of:
Momentum
On-Balance Volume (OBV)
Volume
It generates:
Buy/Sell signals based on EMA direction
Regular divergence detection (price up, OBV/volume down)
Hidden/reverse divergence detection
A dynamic table displaying 3-day comparative stats for each indicator
📊 Key Indicators Used
Momentum
momentum = close - close
EMA applied to smooth out noise
Rising momentum indicates price acceleration
OBV (On-Balance Volume)
A cumulative total that adds/subtracts volume based on price movement
EMA helps identify smoothed volume trend
Volume
Raw volume and its 7-day EMA used to track market participation
✅ Signal Logic
Buy Signal:
Triggered when EMA of momentum, OBV, and volume are all rising
Sell Signal:
Triggered when any one of the EMAs starts falling — indicating weakening trend
🔀 Divergence Detection
Regular Divergence:
Price makes a higher high
EMA OBV and EMA volume make lower highs
This suggests a potential reversal
Hidden (Reverse) Divergence:
Bullish Hidden: Price makes higher lows, OBV falls
Bearish Hidden: Price makes lower highs, OBV rises
These can signal continuation of trend after pullbacks
📋 Table Structure (Bottom-Right Corner)
Shows values for:
EMA Momentum
EMA OBV
Raw OBV
EMA Volume
Raw Volume
Each row includes:
Value from D-2 (two bars ago)
D-1
Now
Difference
% Change
This provides a quick multi-day trend snapshot.
🎨 Visuals
Triangle Buy (Green) below bar
Triangle Sell (Red) above bar
Orange background for regular divergence
Navy background for bullish hidden divergence
Maroon background for bearish hidden divergence
EMA-based MoM + OBV + Volume + Alerts"EMA-based Momentum + OBV + Volume Signals with Table, Alerts, and Background Highlighting"
📌 Purpose:
This script helps traders identify trend strength and reversals using:
Momentum,
On-Balance Volume (OBV),
Volume itself.
All of these are smoothed using a 7-day Exponential Moving Average (EMA) for more reliable signals, and displayed via:
Buy/Sell triangles
A live data table
Background color changes
Visual plots
TradingView alerts
🧠 Core Concepts Used:
1. Momentum (EMA-based):
Measures the strength of price movement over a 10-bar window (configurable). The raw value is smoothed with a 7-day EMA to reduce noise.
2. OBV (EMA-based):
OBV tracks whether volume is flowing into or out of a security based on price changes. The cumulative OBV is smoothed using a 7-day EMA.
3. Volume (EMA-based):
Raw volume is also smoothed using a 7-day EMA to highlight sustained increases or decreases.
🟢 Buy Signal Logic:
A Buy signal is generated when:
EMA of Momentum is rising (i.e., emaMomentumDiff > 0)
EMA of OBV is rising
EMA of Volume is rising
This means all three trend indicators are improving, signaling a potentially strong bullish move.
🔴 Sell Signal Logic:
A Sell signal is generated when any one of the three EMA indicators starts falling (i.e., has a negative difference).
This indicates reversal or weakness, signaling potential exit or short opportunity.
📊 On-Screen Table (Bottom-Right):
Displays current and past data for each metric:
D-2, D-1, and Now values
Difference
% Change
Metrics:
EMA-Momentum (blue)
EMA-OBV (orange)
EMA-Volume (fuchsia)
🎨 Background Color:
Light green background during Buy signal
Light red background during Sell signal
Helps visually identify the zone you're trading in.
📈 Plot Lines:
Blue line = EMA of Momentum
Orange line = EMA of OBV
These help visually confirm trends directly on the price chart.
BTC Breakout Alert (Max High Logic)//@version=5
indicator("BTC Breakout Alert (Max High Logic)", overlay=true)
// === Inputs ===
lookbackBars = input.int(50, title="Lookback Period for Recent High")
volumeThreshold = input.int(1500, title="Minimum Volume (15m)")
// === Indicators ===
// MACD
= ta.macd(close, 12, 26, 9)
macdBullish = macdLine > signalLine and macdLine <= signalLine
// RSI
rsi = ta.rsi(close, 14)
rsiBullish = rsi > 55
// Volume condition
volOK = volume > volumeThreshold
// Dynamic breakout level: highest high of recent N bars
recentHigh = ta.highest(high, lookbackBars)
priceBreakout = close > recentHigh and close > open
// Final condition
highProbTrade = priceBreakout and macdBullish and rsiBullish and volOK
// === Plot Signals ===
plotshape(highProbTrade, title="High Prob Buy Signal", location=location.belowbar, color=color.green, style=shape.labelup, text="BUY 🚀")
// === Alert Setup ===
alertcondition(highProbTrade, title="High Prob Long Entry", message="🚀 High probability BTC breakout detected — consider entering long.")
Improved Stoch RSI + Supertrend Filter + ATR SL/TPThis custom indicator, "Improved Stoch RSI + Supertrend Filter + ATR SL/TP," is a powerful tool designed to generate high-probability trading signals in trending markets. It combines three technical indicators:
1. **Stochastic RSI** – Provides overbought and oversold signals by calculating the stochastic of the RSI, which helps identify momentum reversals.
2. **Supertrend Filter** – A trend-following indicator that filters signals to only trade in the direction of the current trend, reducing false signals and improving overall accuracy.
3. **ATR-based Stop-Loss and Take-Profit** – Uses the Average True Range (ATR) multiplied by a 1.5 factor to set dynamic stop-loss levels, and calculates take-profit levels based on a configurable Risk-Reward Ratio (default: 1.5).
**How it works:**
* When the %K line of the Stochastic RSI crosses above the %D line below the oversold level (default: 20), and the Supertrend indicates an uptrend, a **long trade signal** is generated.
* When the %K line of the Stochastic RSI crosses below the %D line above the overbought level (default: 80), and the Supertrend indicates a downtrend, a **short trade signal** is generated.
* Each trade signal comes with a plotted stop-loss and take-profit level based on the ATR, giving you predefined risk management points.
This indicator helps traders:
* Trade only with the prevailing trend
* Identify reversal points with high accuracy
* Manage risk consistently with ATR-based stop-loss and take-profit
It's suitable for all timeframes and can be used as a standalone system or to complement other trading strategies.
21DMA Structure Counter (EMA/SMA Option)21DMA Structure Counter (EMA/SMA Option)
Overview
The 21DMA Structure Counter is an advanced technical indicator that tracks consecutive periods where price action remains above a 21-period moving average structure. This indicator helps traders identify momentum phases and potential trend exhaustion points using statistical analysis.
Key Features
Moving Average Structure
- Configurable MA Type: Choose between EMA (Exponential Moving Average) or SMA (Simple Moving Average)
- 21-Period Default: Optimized for the widely-watched 21-period moving average
- Triple MA Structure: Tracks high, close, and low moving averages for comprehensive analysis
Statistical Analysis
- Cycle Counting: Automatically counts consecutive periods above the MA structure
- Historical Data: Maintains up to 2,500 historical cycles (approximately 10 years of daily data)
- Z-Score Calculation: Provides statistical context using mean and standard deviation
- Multiple Standard Deviation Levels: Displays +1, +2, and +3 standard deviation thresholds
Visual Indicators
Color-Coded Bars:
- Gray: Below 10-year average
- Yellow: Between average and +1 standard deviation
- Orange: Between +1 and +2 standard deviations
- Red: Between +2 and +3 standard deviations
- Fuchsia: Above +3 standard deviations (extreme readings)
Breadth Integration
- Multiple Breadth Options: NDFI, NDTH, NDTW (NASDAQ breadth indicators), or VIX
- Background Shading: Visual alerts when breadth reaches extreme levels
- High/Low Thresholds: Customizable levels for breadth analysis
- Real-time Display: Current breadth value shown in data table
Smart Reset Logic
- High Below Structure Reset: Automatically resets count when daily high falls below the lowest MA
- Flexible Hold Period: Continues counting during temporary weakness as long as structure isn't violated
- Precise Entry/Exit: Strict criteria for starting cycles, flexible for maintaining them
How to Use
Trend Identification
- Rising Counts: Indicate sustained momentum above key moving average structure
- Extreme Readings: Z-scores above +2 or +3 suggest potential trend exhaustion
- Historical Context: Compare current cycles to 10-year statistical averages
Risk Management
- Breadth Confirmation: Use breadth shading to confirm market-wide strength/weakness
- Statistical Extremes: Exercise caution when readings reach +3 standard deviations
- Reset Signals: Pay attention to structure violations for potential trend changes
Multi-Timeframe Application
- Daily Charts: Primary timeframe for swing trading and position management
- Weekly/Monthly: Longer-term trend analysis
- Intraday: Shorter-term momentum assessment (adjust MA period accordingly)
Settings
Moving Average Options
- Type: EMA or SMA selection
- Period: Default 21 (customizable)
- Reset Days: Days below structure required for reset
Visual Customization
- Standard Deviation Lines: Toggle and customize colors for +1, +2, +3 SD
- Breadth Selection: Choose from NDFI, NDTH, NDTW, or VIX
- Threshold Levels: Set custom high/low breadth thresholds
- Table Styling: Customize text colors, background, and font size
Technical Notes
- Data Retention: Maintains 2,500 historical cycles for robust statistical analysis
- Real-time Updates: Calculations update with each new bar
- Breadth Integration: Uses security() function to pull external breadth data
- Performance Optimized: Efficient array management prevents memory issues
Best Practices
1. Combine with Price Action: Use alongside support/resistance and chart patterns
2. Monitor Breadth Divergences: Watch for breadth weakness during strong readings
3. Respect Statistical Extremes: Exercise caution at +2/+3 standard deviation levels
4. Context Matters: Consider overall market environment and sector rotation
5. Risk Management: Use appropriate position sizing, especially at extreme readings
Disclaimer
This indicator is for educational and informational purposes only. It should not be used as the sole basis for trading decisions. Always combine with other forms of analysis and proper risk management techniques.
Compatible with Pine Script v6 | Optimized for daily timeframes | Best used on major indices and liquid stocks
Zweig Composite System (Weekly Smoothed)Uses 10-week (≈50-day) moving averages
Pulls weekly data for yield, breadth, and price
Maintains original Zweig thresholds for signal reliability
Displays a green triangle labeled "Zweig" when all 3 conditions align
Zweig Composite System🧠 Zweig Composite Strategy Components:
Price Momentum
Bullish when price is above a 10-week (≈50-day) moving average.
Monetary Policy (Interest Rate Direction)
Bullish when interest rates are falling (Fed is easing).
We simulate this with 10-year Treasury yields trending down.
Breadth Thrust
Already included (strong upward surge in market breadth).
ATR-Distance Helper (manual ref level)Average True Range is not a buy–sell signal by itself; it is a measuring tape for price movement. Use it to size trades, set adaptive stops, or decide whether a breakout or poke past a reference level (such as yesterday’s POC) is meaningful—e.g., “price dipped 0.1 ATR below POC, so the sweep was genuine, not a two-tick head-fake.”
RCI Ribbon with Cross Signals (Filtered)nothing to say just use itnothing to say just use itnothing to say just use itnothing to say just use it
AlphaTrend AutoTrade PRO v3.1//@version=5
// ---------------------------------------------------------------------------
// AlphaTrend AutoTrade PRO v3.1 (compile‑safe, dynamic lot)
// ---------------------------------------------------------------------------
// – Fixed Lot OR %Equity sizing via runtime `qty` parameter
// – ATR-based SL/TP + optional Trailing
// – Optional filters (HTF-RSI, Session, Weekday)
// – Webhook JSON + Debug Shapes
// ---------------------------------------------------------------------------
//──────────────────────── ① Order Size Mode ─────────────────────────
accountMode = input.string("Fixed", "Order Size Mode", options= )
fixedLot = input.float(1.0, "Fixed Lot Size", step=0.1)
riskPct = input.float(1.0, "% Equity Risk per Trade (if Percent)", step=0.1)
// Strategy header must use constant; we pick FIXED 1 lot as default placeholder
strategy("AlphaTrend AutoTrade PRO v3.1", overlay=true,
default_qty_type=strategy.fixed,
default_qty_value=1,
initial_capital=10000,
currency=currency.USD,
calc_on_every_tick=false,
max_bars_back=500)
// Helper to compute dynamic qty each entry
calcQty(bool isLong) =>
accountMode == "Fixed" ? fixedLot :
// Percent equity: qty = (equity * pct) / price
(strategy.equity * (riskPct/100.0)) / close
//──────────────────────── ② AlphaTrend & Risk Inputs ───────────────
atrMult = input.float(1.0, "ATR Multiplier", step=0.05)
atrLen = input.int(14, "ATR Period")
slATR = input.float(1.2, "SL × ATR")
tpATR = input.float(1.8, "TP × ATR")
trailOn = input.bool(true, "Enable Trailing")
trailStart= input.float(1.5, "Trail Start × ATR")
trailOffset= input.float(1.0, "Trail Offset × ATR")
//──────────────────────── ③ Filters ────────────────────────────────
htfEnable = input.bool(false, "Higher‑TF RSI filter")
htfTF = input.timeframe("15", "Higher‑TF TF")
rsithreshold= input.int(50, "HTF RSI Threshold", minval=10, maxval=90)
sessEnable = input.bool(false, "Session filter (Bangkok)")
sessionStr = input.session("1300-2300", "Active HHMM‑HHMM")
dowEnable = input.bool(false, "Filter by Weekday")
tradeDays = input.string("12345", "Trade days (1=Mon)")
showDebug = input.bool(true, "Show Debug Shapes")
secretToken = input.string("MYSECRET", "Webhook Token")
//──────────────────────── ④ AlphaTrend Calc ───────────────────────
atr = ta.sma(ta.tr, atrLen)
upT = low - atr*atrMult
dnT = high + atr*atrMult
var float at = na
condUp = ta.rsi(close, atrLen) >= 50
at := condUp ? math.max(nz(at , upT), upT) : math.min(nz(at , dnT), dnT)
rawLong = ta.crossover(at, at )
rawShort = ta.crossunder(at, at )
htfPassLong = not htfEnable or request.security(syminfo.tickerid, htfTF, ta.rsi(close, atrLen) > rsithreshold)
htfPassShort = not htfEnable or request.security(syminfo.tickerid, htfTF, ta.rsi(close, atrLen) < rsithreshold)
sessPass = not sessEnable or not na(time(timeframe.period, sessionStr))
dowPass = not dowEnable or str.contains(tradeDays, str.tostring(dayofweek))
longCond = rawLong and htfPassLong and sessPass and dowPass
shortCond = rawShort and htfPassShort and sessPass and dowPass
//──────────────────────── ⑤ Risk Params ───────────────────────────
slPts = atr*slATR
tpPts = atr*tpATR
trailP = trailOn ? atr*trailStart : na
trailO = trailOn ? atr*trailOffset : na
lotDesc = accountMode=="Fixed" ? str.tostring(fixedLot) : str.tostring(riskPct)+"%"
//──────────────────────── ⑥ Execute & Webhook ─────────────────────
if longCond
lot = calcQty(true)
strategy.entry("L", strategy.long, qty=lot)
strategy.exit("XL", from_entry="L", stop=close-slPts, limit=close+tpPts, trail_points=trailP, trail_offset=trailO)
if barstate.isconfirmed and barstate.isrealtime
msg = '{"token":"'+secretToken+'","action":"buy","symbol":"'+syminfo.ticker+'","price":'+str.tostring(close)+',"sl":'+str.tostring(close-slPts)+',"tp":'+str.tostring(close+tpPts)+',"lot":"'+lotDesc+'"}'
alert(msg, alert.freq_once_per_bar_close)
if shortCond
lot = calcQty(false)
strategy.entry("S", strategy.short, qty=lot)
strategy.exit("XS", from_entry="S", stop=close+slPts, limit=close-tpPts, trail_points=trailP, trail_offset=trailO)
if barstate.isconfirmed and barstate.isrealtime
msg = '{"token":"'+secretToken+'","action":"sell","symbol":"'+syminfo.ticker+'","price":'+str.tostring(close)+',"sl":'+str.tostring(close+slPts)+',"tp":'+str.tostring(close-tpPts)+',"lot":"'+lotDesc+'"}'
alert(msg, alert.freq_once_per_bar_close)
//──────────────────────── ⑦ Debug Shapes ──────────────────────────
plotshape(rawLong and showDebug, title="RawLong", style=shape.circle, location=location.belowbar, color=color.aqua, size=size.tiny)
plotshape(rawShort and showDebug, title="RawShort", style=shape.circle, location=location.abovebar, color=color.purple, size=size.tiny)
plotshape(longCond and showDebug, title="LongOK", style=shape.arrowup, location=location.belowbar, color=color.green)
plotshape(shortCond and showDebug, title="ShortOK", style=shape.arrowdown, location=location.abovebar, color=color.red)
//──────────────────────── ⑧ Plot AlphaTrend ───────────────────────
col = at > at ? color.green : color.red
plot(at, "AlphaTrend", color=col, linewidth=3)
plot(at , "AlphaTrendLag", color=color.new(col,70), linewidth=2)