Hidden Bullish Divergence [1H]Detects hidden bullish divergence on the 1-hour timeframe using RSI. It will plot a label when conditions are met. Watch for the green label under a candle — this indicates hidden bullish divergence.
Indicadores e estratégias
RSI Overbought ScannerRSI Overbought Scanner
Description
The RSI Overbought Scanner is a Pine Script indicator designed to identify potential overbought conditions across multiple timeframes (1-minute, 5-minute, and 15-minute) using the Relative Strength Index (RSI). This tool is ideal for traders looking to spot stocks or assets that may be overextended to the upside, potentially signaling a reversal or pullback opportunity.
Key Features
Multi-Timeframe Analysis: Evaluates RSI on 1m, 5m, and 15m timeframes to confirm overbought conditions (RSI > 70).
Visual Output: Plots a binary result (1 for overbought, 0 otherwise) for easy integration with TradingView's screener.
Debugging Table: Displays a table in the top-right corner showing RSI values and overbought status for each timeframe, with color-coded indicators (red for overbought, green for not overbought).
Alert Integration: Includes an alert condition that triggers when all three timeframes are overbought, providing a customizable message with the ticker symbol.
How It Works
RSI Calculation: Computes RSI with a default length of 14 for the 1m timeframe and retrieves RSI values for 5m and 15m timeframes using request.security.
Overbought Condition: Checks if RSI exceeds 70 on all three timeframes.
Output: Plots a value of 1 when all conditions are met, otherwise 0. A table updates on the last confirmed bar to show RSI values and overbought status.
Alerts: Triggers an alert when all timeframes are overbought, notifying users of potential trading opportunities.
Usage
Add the indicator to your chart and use it with TradingView's screener to filter assets meeting the overbought criteria.
Customize the RSI length or overbought level (default 70) in the indicator settings to suit your trading strategy.
Set up alerts to receive notifications when the overbought condition is met across all timeframes.
Notes
This script is written in Pine Script v6.
Best used in conjunction with other technical analysis tools to confirm signals.
The table is for debugging and visual confirmation, updating only on the last confirmed bar to avoid performance issues.
RAHA Indicator📈 RAHA Indicator
Roni's Adjusted Hybrid Average
The indicator developed by Aaron Roni Pesach combines an innovative RAHA average - an adjusted hybrid average with smart trend analysis, using additional oscillators in a sophisticated way.
LONG and SHORT signals are given only when:
✅ Technical conditions confirm
✅ And the long-term trend is consistent
RAHA Indicator helps traders identify entry points while filtering out noise and market anomalies.
📈 RAHA Indicator
Roni's Adjusted Hybrid Average
האינדיקטור שפותח על ידי אהרון רוני פסח משלב ממוצע חדשני מסוג RAHA - ממוצע היברידי מתואם עם ניתוח מגמה חכם, באמצעות שימוש במתנדים נוספים באופן מתוחכם.
איתותי LONG ו‑SHORT ניתנים רק כאשר:
✅ התנאים הטכניים מאשרים
✅ והמגמה בטווח ארוך תואמת
RAHA Indicator מסייע לסוחרים לזהות נקודות כניסה תוך סינון רעשים וחריגות שוק.
RAHA Indicator📈 RAHA Indicator
Roni's Adjusted Hybrid Average
The indicator developed by Aaron Roni Pesach combines an innovative RAHA average - an adjusted hybrid average with smart trend analysis, using additional oscillators in a sophisticated way.
LONG and SHORT signals are given only when:
✅ Technical conditions confirm
✅ And the long-term trend is consistent
RAHA Indicator helps traders identify entry points while filtering out noise and market anomalies.
📈 RAHA Indicator
Roni's Adjusted Hybrid Average
האינדיקטור שפותח על ידי אהרון רוני פסח משלב ממוצע חדשני מסוג RAHA - ממוצע היברידי מתואם עם ניתוח מגמה חכם, באמצעות שימוש במתנדים נוספים באופן מתוחכם.
איתותי LONG ו‑SHORT ניתנים רק כאשר:
✅ התנאים הטכניים מאשרים
✅ והמגמה בטווח ארוך תואמת
RAHA Indicator מסייע לסוחרים לזהות נקודות כניסה תוך סינון רעשים וחריגות שוק.
Base Finder ProFind bases easily with Base finder pro. For each bases, plots length and depth of the bases.
WCWebhookLibraryLibrary "WCWebhookLibrary"
The webhook message library provides several functions for building JSON payloads
method buildWebhookJson(msg, constants)
Builds the final JSON payload from a webhookMessage type.
Namespace types: webhookMessage
Parameters:
msg (webhookMessage) : (webhookMessage) A prepared webhookMessage.
constants (CONSTANTS)
Returns: A JSON Payload.
method buildTakeProfitJson(msg)
Builds the takeProfit JSON message to be used in a webhook message.
Namespace types: takeProfitMessage
Parameters:
msg (takeProfitMessage) : (takeProfitMessage)
Returns: A JSON takeProfit payload.
method buildStopLossJson(msg, constants)
Builds the stopLoss JSON message to be used in a webhook message.
Namespace types: stopLossMessage
Parameters:
msg (stopLossMessage) : (stopLossMessage)
constants (CONSTANTS)
Returns: A JSON stopLoss payload.
CONSTANTS
Constants for payload values.
Fields:
ACTION_BUY (series string)
ACTION_SELL (series string)
ACTION_EXIT (series string)
ACTION_CANCEL (series string)
ACTION_ADD (series string)
SENTIMENT_BULLISH (series string)
SENTIMENT_BEARISH (series string)
SENTIMENT_LONG (series string)
SENTIMENT_SHORT (series string)
SENTIMENT_FLAT (series string)
STOP_LOSS_TYPE_STOP (series string)
STOP_LOSS_TYPE_STOP_LIMIT (series string)
STOP_LOSS_TYPE_TRAILING_STOP (series string)
EXTENDED_HOURS (series bool)
webhookMessage
Final webhook message.
Fields:
ticker (series string)
action (series string)
sentiment (series string)
price (series float)
quantity (series int)
takeProfit (series string)
stopLoss (series string)
extended_hours (series bool)
takeProfitMessage
Take profit message.
Fields:
limitPrice (series float)
percent (series float)
amount (series float)
stopLossMessage
Stop loss message.
Fields:
type (series string)
percent (series float)
amount (series float)
stopPrice (series float)
limitPrice (series float)
trailPrice (series float)
trailPercent (series float)
Squeeze Breakout Pro🔥 What This Script Does
This is a Breakout Strength Scanner with Squeeze + Pattern Range + Volume Confirmation + Risk Management + Take Profits.
✅ Core Functions:
Squeeze Detector:
Finds low volatility zones using Bollinger Band width compression.
Marks them with a “Squeeze” label — this signals that a big move is likely coming soon.
Pattern Range Detection:
Automatically identifies recent pivot highs (resistance) and pivot lows (support) using the pivotLen.
Draws the current consolidation range visually with horizontal lines.
Breakout Confirmation:
Requires:
✅ A break above resistance or below support.
✅ Confirmed with above-average volume.
✅ Must occur while in a volatility squeeze.
Plots arrows:
🔼 Green Up Arrow = Confirmed Bullish Breakout.
🔽 Red Down Arrow = Confirmed Bearish Breakout.
Trade Management Built-In:
Stop Loss: Just beyond the opposite side of the pattern range.
Take Profits:
✅ TP1 = 1.5x risk.
✅ TP2 = 2x risk.
Position Size Calculator:
Based on your input account size (accountBal) and risk percentage (riskPct).
Shows how many contracts, shares, or units to buy/sell to risk exactly that % of your account.
Higher Timeframe Trend Filter:
Default is 4-hour trend filter (can be changed).
✅ Only shows if the higher timeframe trend is Bullish (EMA50 > EMA200) or Bearish.
Displayed on the dashboard.
📊 How to Use It Step-By-Step
🟧 1. Look for a Squeeze:
A “Squeeze” label will appear.
This means price is coiled tight — a breakout is likely.
🟩 2. Wait for a Breakout Arrow:
🔼 Green Arrow: Bullish breakout (price breaks resistance + volume confirms + squeeze active).
🔽 Red Arrow: Bearish breakout (price breaks support + volume confirms + squeeze active).
🟥 3. Check the Dashboard:
✅ Trend Bias: Should ideally match your breakout.
If the higher timeframe is Bullish, long breakouts have better odds.
If Bearish, short breakouts are higher probability.
✅ Vol Confirm: Will say “Yes” if the volume condition is met.
🏹 4. Manage the Trade (Auto Levels):
The script draws:
🔴 Stop Loss Line (below range for longs, above for shorts).
🟢 Take Profit 1 (1.5x risk).
🟢 Take Profit 2 (2x risk).
Use these as guidelines for exits.
💰 5. Use Position Size Display:
Check the TP and SL distances and the suggested position size based on your account balance and risk percentage.
🚀 Pro Tips for Maximum Success
✅ Use Trend Confluence:
Only trade long breakouts when the higher timeframe trend is Bullish (EMA50 > EMA200).
Only trade short breakouts when the higher timeframe trend is Bearish.
✅ Avoid Fakeouts:
If a breakout arrow forms but the candle closes far away from the pattern breakout — wait for a retest or confirmation.
Higher volume + clean breakout works better than low-volume squeezes.
✅ Best Timeframes:
4H to Daily: For swing trades.
15m to 1H: For intraday trades (adjust htf to "240" for 4H trend confirmation even on lower charts).
✅ Increase Win Rate:
Use this script with key support/resistance zones, weekly ranges, or fib retracements.
Breakouts that happen near macro key levels have the highest follow-through.
✅ Set Alerts:
Right-click the breakout arrow or use alertcondition() events in the script.
Set alerts for:
📈 Breakout UP
📉 Breakout DOWN
🏹 Squeeze Active (prep for breakout)
✅ Walk Away Once In:
Let TP1 or TP2 hit.
Or move stop to breakeven after TP1 hits for free runners.
🔥 What Makes This Script Powerful:
Combines price action (pattern range) + volatility squeeze + volume confirmation + trend bias + risk management.
Most traders use these individually. This does it all in one clean tool.
💎 Professional Edge:
This is the type of script that turns reactive trading into systematic trading. No guessing. Clean rules. Repeatable.
Breakout Retest Visualizer (with Confluence)Breakout Retest Visualizer (Smart Money Edition)
This indicator is designed for day traders who rely on price action, breakout structure, and smart confluence filters to identify high-quality trade opportunities during the New York session.
🚀 What It Does:
Plots Yesterday's High & Low as static reference levels.
Tracks the New York open price with a horizontal line.
Detects breakouts above Yesterday’s High or breakdowns below Yesterday’s Low.
Confirms valid breakouts only when 4 key confluences align:
✅ EMA 9 & EMA 21 trend alignment
✅ RSI momentum confirmation (RSI > 55 or < 45)
✅ Volume spike (volume > 20-bar average)
✅ Within New York session hours (9:30am – 4:00pm EST)
Marks Breakout Retests and highlights strong continuation signals with “Runner” labels.
📈 Visual Markers:
🟢 Green "Runner" = Bullish continuation after retest
🔻 Purple Triangle = Bullish breakout retest zone
🔴 Red "Runner" = Bearish continuation
🔺 Yellow Triangle = Bearish breakdown retest
🎯 Who It’s For:
Ideal for intraday scalpers and momentum traders who want:
Clean breakout structure
Smart money-style retests
High-confidence entries backed by volume, trend, and RSI confluence
🧠 Tips for Use:
Use the retest markers to plan precise entries after structure breaks.
Combine this with order blocks or FVG zones for deeper confluence.
Avoid trading during pre-market or low-volume hours.
[ BETA ][ IND ][ LIB ] Dynamic LookBack RSI RangeGet visual confirmation with this indicator if the current range selected had been oversold or overbough in the latest n bars
FS JIMENEZ)FS JIMENEZ is a tactical breakout-retest strategy optimized for volatile price action and disciplined entries. It features:
• Swing structure validation
• Smart cooldown and price spacing logic
• SL compression after 3 bars
• Dynamic TP targeting based on candle strength and ATR
• Optional trailing SL via buffer multiplier
Built for traders seeking precision and controlled exposure across volati
Ghost Momentum Strategy [SOXL/SOXS Flip]Enter SOXL on a bull then sells on momentum cross and enters into SOXS. Exits SOXS on momentum cross and then enters into SOXL. Keeps doing this. Plug into a platform like traderspost
OG SuperTrend + RSI Option + Enhanced ORB v2 © 2025This elite-level indicator combines the precision of SuperTrend and RSI signals with a mathematically accurate Opening Range Breakout (ORB) system and Previous Day High/Low zones, providing traders with real-time directional bias and sniper-level entry guidance.
🔍 Core Features:
✅ SuperTrend + RSI Buy/Sell Signals
✅ Real-time RSI Tracker (Top Right)
✅ Clean visual BUY/SELL labels on trend shifts
✅ Mathematically accurate 5-Min & 10-Min ORB Levels
✅ Live tracking of Previous Day High/Low Zones
✅ Clean chart layout with elite color-coded precision
✅ Instant alert conditions for both bullish and bearish setups
🔔 Recommended Use:
Combine with price action, candlestick patterns, and volume spikes
Ideal for options flow, intraday scalping, and breakout strategies
Works beautifully on 1m, 5m, 15m, and 1H timeframes
📊 Settings Include:
Adjustable ATR Period & SuperTrend Multiplier
Toggle Buy/Sell Labels
Customizable RSI Length
Navy Seal Trading - EdgarTrader📌 Navy Seal Trading – Asia, London, and NY Sessions
This indicator clearly displays the ranges of the Asia, London, and New York sessions, featuring:
✅ Full range visualization for each session
✅ Asia session high, low, and midline, with extended projection lines for precise reaction analysis
✅ Clean, minimalistic, and professional colors to keep your chart focused
🔷 Designed for the Navy Seal Trading community, focused on precision, discipline, and professional execution in the markets.
Use it to:
✔️ Mark liquidity zones
✔️ Identify Asia manipulation ranges
✔️ Prepare executions in London and NY with clear context
💡 Remember: Clarity in your zones gives you the confidence and discipline to execute like a true Navy Seal Trader.
ORB NormanORB with adjustable times for up to 3 ORB's.
High and Low for each defined timeframe with adjustable lenghts for each day.
MaxEvolved Japanese CloseShow the closing price of the Japanese candle. Usefull with Heiken Ashi.
Afficher le prix de fermeture de la chandelle japonaise. Utile pour Heiken Ashi.
Tuga SupertrendDescription
This strategy uses the Supertrend indicator enhanced with commission and slippage filters to capture trends on the daily chart. It’s designed to work on any asset but is especially effective in markets with consistent movements.
Use the date inputs to set the backtest period (default: from January 1, 2018, through today, June 30, 2025).
The default input values are optimized for the daily chart. For other timeframes, adjust the parameters to suit the asset you’re testing.
Release Notes
June 30, 2025
• Updated default backtest period to end on June 30, 2025.
• Default commission adjusted to 0.1 %.
• Slippage set to 3 ticks.
• Default slippage set to 3 ticks.
• Simplified the strategy name to “Tuga Supertrend”.
Default Parameters
Parameter Default Value
Supertrend Period 10
Multiplier (Factor) 3
Commission 0.1 %
Slippage 3 ticks
Start Date January 1, 2018
End Date June 30, 2025
RSI Mansfield +An adaptive relative strength indicator for any market and timeframe.
OVERVIEW
This indicator plots the Mansfield Relative Strength (RSI Mansfield) oscillator, a tool to compare the performance of your instrument against a chosen benchmark index or asset. It auto-adjusts to cryptocurrencies, stocks, and various timeframes, applying the appropriate smoothing techniques to reveal true relative strength or weakness.
CONCEPTS
Relative Strength: Measures how the price of your asset evolves compared to a benchmark (e.g., BTC dominance, S&P 500).
Mansfield Normalization: Expresses the deviation from the moving average of the ratio between your asset and the benchmark, scaled to highlight trends.
Adaptive Smoothing: Automatically selects EMA or SMA smoothing depending on market type and timeframe.
Divergences: Detects regular and hidden bullish or bearish divergences in the Mansfield oscillator, which can signal potential reversals.
FEATURES
Supports major global stock indices and crypto benchmarks.
Auto-selection of moving average length (daily, weekly, monthly).
Dynamic coloring: green for positive relative strength, red for negative.
Configurable detection of four divergence types:
Regular Bullish Divergence
Hidden Bullish Divergence
Regular Bearish Divergence
Hidden Bearish Divergence
Toggle switch to show/hide divergences.
Clear zero baseline reference.
USAGE
Benchmark Selection
Choose the benchmark index or asset you want to compare against, e.g., Bitcoin Dominance, S&P 500, or other regional indices.
Interpret Colors
Green oscillator: outperforming the benchmark.
Red oscillator: underperforming.
Analyze Divergences
Enable divergence detection to spot potential reversal points. Regular divergences indicate classical divergence; hidden divergences may confirm continuation.
Timeframes
Works on intraday, daily, weekly, or monthly charts. The indicator auto-adjusts smoothing and calculation length accordingly.
Advanced Day Separator with Future ProjectionsThe general indicator works on historical data, meaning they develop after the fact. The same is for indicators that show day separation. I was always forced to manually draw in vertical lines for the upcoming week. This indicator I built solves that issue by projecting vertical day separations for the upcoming week. Enjoy! :-)
TrendBoxThis indicator is called "TrendBox," designed to help traders analyze daily price ranges using several technical indicators. Below is a breakdown of its functionality, purpose, and key components:
Purpose
The script overlays indicators on a chart to assess whether the price is above or below key levels and moving in a trend.
VIX-based expected range (index fund targeted)
- This helps calculate the expected dealers range based on VIX implications. You can expect to see ranges be bought on and sold on. Moving outside this range creates heightened volatility and most of the time a gamma squeeze follows.
VWAP (Volume Weighted Average Price)
- This allows you to understand the mid point or average pricing of the daily session. If you're paying a premium or getting a discount on the daily session.
Daily Market Open
- Identifying the market open price is a key level on a daily session and allows you to identify some level of intraday trend.
Daily 4-period VWMA
- This is a crucial role of our indicator and showing short term time frame bias. Seeing price move over the top of our daily 4 level establishes a short term trend and can be used as a distribution guide, closing positions when we see longer time frame candles close under it. Vice versa for shorting.
It also displays a status box (optional) summarizing whether the price is above or below these levels, helping traders quickly evaluate market conditions.
TTM Squeeze Value OscillatorThis indicator is specifically designed for use with TradingView's Stock Screener, not for chart analysis. It provides numerical values and binary signals that allow traders to efficiently scan stocks for specific TTM Squeeze conditions, momentum patterns, and EMA alignments.
What It Does
The TTM Squeeze Value Oscillator converts the popular TTM Squeeze indicator into a screenable format by outputting specific numerical values and binary signals (1 or 0) that can be filtered in TradingView's screener tool.
Key Features
1. TTM Squeeze Compression Levels
Value 0: Low Compression (Black) - Bollinger Bands inside outer Keltner Channels
Value 1: Mid Compression (Red) - Bollinger Bands inside middle Keltner Channels
Value 2: High Compression (Orange) - Bollinger Bands inside inner Keltner Channels
Value 3: Squeeze Fired (Green) - Bollinger Bands outside Keltner Channels
2. Momentum Analysis
Four distinct momentum conditions based on TTM Squeeze methodology:
Buy Momentum Increasing - Positive momentum growing stronger
Buy Momentum Decreasing - Positive momentum weakening
Sell Momentum Increasing - Negative momentum growing stronger
Sell Momentum Decreasing - Negative momentum weakening
3. EMA Stacking Analysis
Three EMA alignment patterns using 8, 21, and 48 period EMAs:
EMA Stacked Bullish - 8 EMA > 21 EMA > 48 EMA (uptrend alignment)
EMA Stacked Bearish - 8 EMA < 21 EMA < 48 EMA (downtrend alignment)
EMA Mixed - EMAs not in clear bullish or bearish alignment
4. Consecutive Day Counters
Tracks how many consecutive days each squeeze condition has persisted:
Low Compression Days
Mid Compression Days
High Compression Days
Squeeze Fired Days
5. Combined Signal Analysis
Pre-calculated combinations of squeeze conditions with momentum:
All squeeze levels combined with all four momentum conditions
16 total combined signals for advanced screening
VARNI-LINE-CHART//@version=5
indicator("VARNI-LINE-CHART",shorttitle = "VARNI-LINE-CHART", overlay=false)
// Input for Index and Expiry Date
spot_ = input.string("BANKNIFTY", title = "Spot Symbol", options = , group = "Index")
tooltip_day = "Enter the day of the expiry. Add 0 in front if the day is a single digit. For example: 05 instead of 5"
tooltip_month = "Enter the month of the expiry. Add 0 in front if the month is a single digit. For example: 06 instead of 6"
tooltip_year = "Enter the year of the expiry. Use the last two digits of the year. For example: 24 instead of 2024"
_day = input.string("13", title = "Expiry Day", tooltip = tooltip_day, group="Expiry Date")
_month = input.string("02", title = "Expiry Month", tooltip = tooltip_month, group="Expiry Date")
_year = input.string("25", title = "Expiry Year", tooltip = tooltip_year, group="Expiry Date")
// Input for Strikes
tooltip_ = "You can select any Strike, and choose to include both strikes or just one"
strike_ce = input.int(23500, "Call Strike", tooltip = tooltip_,step = 50, group = "Select Strike")
strike_pe = input.int(23500, "Put Strike", tooltip = tooltip_,step = 50, group = "Select Strike")
var string spot = na
if spot_ == "SENSEX"
spot := "BSX"
else if spot_ == "BANKEX"
spot := "BKX"
else
spot := spot_
// Option to include both strikes
strike_choice = input.string("Combined", title = "Select Strike", options = , group = "Select Strike")
// Generate symbols for Call and Put options
var string symbol_CE = spot + _year + _month + _day + "C" + str.tostring(strike_ce)
var string symbol_PE = spot + _year + _month + _day + "P" + str.tostring(strike_pe)
// Request security data for both Call and Put options
= request.security(symbol_CE, timeframe.period, )
= request.security(symbol_PE, timeframe.period, )
call_volume = request.security( symbol_CE, timeframe.period , volume )
put_volume = request.security( symbol_PE, timeframe.period , volume )
var float combined_open = 0
var float combined_high = 0
var float combined_low = 0
var float combined_close = 0
var float combined_vol = 0
// Calculate combined premium based on strike choice
if strike_choice == "Combined"
combined_open := call_open + put_open
combined_close := call_close + put_close
combined_high := math.max(combined_open, combined_close)
combined_low := math.min(combined_open, combined_close)
combined_vol := call_volume + put_volume
else if strike_choice == "Only Call"
combined_open := call_open
combined_close := call_close
combined_high := call_high
combined_low := call_low
combined_vol := call_volume
else
combined_open := put_open
combined_close := put_close
combined_high := put_high
combined_low := put_low
combined_vol := put_volume
// Plot combined premium as a line chart
plot(combined_close, title = "Combined Premium", color = combined_close > combined_open ? color.green : color.red, linewidth = 2)
// Indicator selection
use_ema_crossover = input.bool(false, title = "Use EMA Crossover", group = "Indicators")
use_supertrend = input.bool(false, title = "Use Supertrend", group = "Indicators")
use_vwap = input.bool(true, title = "Use VWAP", group = "Indicators")
use_rsi = input.bool(false, title = "Use RSI", group = "Indicators")
use_sma = input.bool(false, title = "Use SMA", group = "Indicators")
pine_supertrend_value(factor, atrPeriod) =>
src = combined_close
atr = ta.atr(atrPeriod)
upperBand = src + factor * atr
lowerBand = src - factor * atr
prevLowerBand = nz(lowerBand )
prevUpperBand = nz(upperBand )
lowerBand := lowerBand > prevLowerBand or combined_close < prevLowerBand ? lowerBand : prevLowerBand
upperBand := upperBand < prevUpperBand or combined_close > prevUpperBand ? upperBand : prevUpperBand
int _direction = na
float superTrend = na
prevSuperTrend = superTrend
if na(atr )
_direction := 1
else if prevSuperTrend == prevUpperBand
_direction := combined_close > upperBand ? -1 : 1
else
_direction := combined_close < lowerBand ? 1 : -1
superTrend := _direction == -1 ? lowerBand : upperBand
superTrend
pine_supertrend_dir(factor, atrPeriod) =>
src = combined_close
atr = ta.atr(atrPeriod)
upperBand = src + factor * atr
lowerBand = src - factor * atr
prevLowerBand = nz(lowerBand )
prevUpperBand = nz(upperBand )
lowerBand := lowerBand > prevLowerBand or combined_close < prevLowerBand ? lowerBand : prevLowerBand
upperBand := upperBand < prevUpperBand or combined_close > prevUpperBand ? upperBand : prevUpperBand
int _direction = na
float superTrend = na
prevSuperTrend = superTrend
if na(atr )
_direction := 1
else if prevSuperTrend == prevUpperBand
_direction := combined_close > upperBand ? -1 : 1
else
_direction := combined_close < lowerBand ? 1 : -1
superTrend := _direction == -1 ? lowerBand : upperBand
_direction
// Input for EMA lengths
fastLength = input.int(7, 'Fast EMA Length', group = "EMA")
slowLength = input.int(12, 'Slow EMA Length', group = "EMA")
// Input for SuperTrend
atrLength = input.int(7, 'ATR Length', group = "SuperTrend")
fac = input.float(2, 'Factor', group = "SuperTrend")
// Input for RSI
rsi_length = input.int(7, 'Length', group="RSI")
rsi_ob_level = input.int(80, 'Overbought', group="RSI")
rsi_os_level = input.int(20, 'Oversold', group="RSI")
// Input for SMA
sma_length = input.int(7, 'SMA Length', group = "SMA")
var float fast_ema = na
var float slow_ema = na
var float supertrend = na
var int direction = na
var float rsi_val = na
var float sma_val = na
var float sumPriceVolume = na
var float sumVolume = na
var float vwap = na
// Fast EMA
if use_ema_crossover
fast_ema := ta.ema(combined_close, fastLength)
slow_ema := ta.ema(combined_close, slowLength)
// Supertrend
if use_supertrend
supertrend := pine_supertrend_value( fac, atrLength)
direction := pine_supertrend_dir( fac, atrLength)
// VWAP
if use_vwap
if (dayofweek != dayofweek )
sumPriceVolume := 0.0
sumVolume := 0.0
vwap := 0.0
sumPriceVolume += combined_close * combined_vol
sumVolume += combined_vol
vwap := sumPriceVolume / sumVolume
// RSI
if use_rsi
rsi_val := ta.rsi(combined_close, rsi_length)
// SMA
if use_sma
sma_val := ta.sma(combined_close, sma_length)
plot(fast_ema, title='Fast EMA', color=color.blue, linewidth=2)
plot(slow_ema, title='Slow EMA', color=color.yellow, linewidth=2)
plot(direction < 0 ? supertrend : na, "Up direction", color = color.green, style=plot.style_linebr)
plot(direction > 0 ? supertrend : na, "Down direction", color = color.red, style=plot.style_linebr)
plot(vwap, title='VWAP', color=color.purple, linewidth=2)
plot(sma_val, title='SMA', color=color.maroon, linewidth=2)
// Define buy and sell conditions based on selected indicators
var bool buy = false
var bool sell = false
var int buyC = 0
var int sellC = 0
if dayofweek != dayofweek
buyC := 0
sellC := 0
if use_ema_crossover
buy := ( ta.crossover(fast_ema, slow_ema) ) and buyC == 0
sell := ( ta.crossunder(fast_ema, slow_ema) ) and sellC == 0
if use_vwap
buy := ( buy ? buy and (combined_close > vwap and combined_close <= vwap ) : (combined_close > vwap and combined_close <= vwap )) and buyC == 0
sell := ( sell ? sell and (combined_close < vwap and combined_close >= vwap ) : (combined_close < vwap and combined_close >= vwap )) and sellC == 0
if use_rsi
buy := ( buy ? buy and ta.crossover(rsi_val, rsi_ob_level) : ta.crossover(rsi_val, rsi_ob_level) ) and buyC == 0
sell := ( sell ? sell and ta.crossunder(rsi_val, rsi_os_level) : ta.crossunder(rsi_val, rsi_os_level) ) and sellC == 0
if use_sma
buy := ( buy ? buy and ta.crossover(combined_close, sma_val) : ta.crossover(combined_close, sma_val) ) and buyC == 0
sell := ( sell ? sell and ta.crossunder(combined_close, sma_val) : ta.crossunder(combined_close, sma_val) ) and sellC == 0
if use_supertrend
buy := ( buy ? direction == -1 : direction == -1 and direction == 1 ) and buyC == 0
sell := ( sell ? direction == 1 : direction == 1 and direction == -1 ) and sellC == 0
if buy
buyC := 1
sellC := 0
if sell
sellC := 1
buyC := 0
// Plot buy and sell signals
plotshape(buy, title = "Buy", text = 'Buy', style = shape.labeldown, location = location.top, color= color.green, textcolor = color.white, size = size.small)
plotshape(sell, title = "Sell", text = 'Sell', style = shape.labelup, location = location.bottom, color= color.red, textcolor = color.white, size = size.small)
// Alert conditions
alertcondition(buy, "Buy Alert", "Buy Signal")
alertcondition(sell, "Sell Alert", "Sell Signal")
Order Blocks v2Order Blocks v2 – Smart OB Detection with Time & FVG Filters
Order Blocks v2 is an advanced tool designed to identify potential institutional footprints in the market by dynamically plotting bullish and bearish order blocks.
This indicator refines classic OB logic by combining:
Fractal-based break conditions
Time-level filtering (Power of 3)
Optional Fair Value Gap (FVG) confirmation
Real-time plotting and auto-invalidation
Perfect for traders using ICT, Smart Money, or algorithmic timing models like Hopplipka.
🧠 What the indicator does
Detects order blocks after break of bullish/bearish fractals
Supports 3-bar or 5-bar fractal structures
Allows OB detection based on close breaks or high/low breaks
Optionally confirms OBs only if followed by a Fair Value Gap within N candles
Filters OBs based on specific time levels (3, 7, 11, 14) — core anchors in many algorithmic models
Automatically deletes invalidated OBs once price closes through the zone
⚙️ How it works
The indicator:
Tracks local fractal highs/lows
Once a fractal is broken by price, it backtracks to identify the best OB candle (highest bullish or lowest bearish)
Validates the level by checking:
OB type logic (close or HL break)
Time stamp match with algorithmic time anchors (e.g. 3, 7, 11, 14 – known from the Power of 3 concept)
Optional FVG confirmation after OB
Plots OB zones as lines (body or wick-based) and removes them if invalidated by a candle close
This ensures traders see only valid, active levels — removing noise from broken or out-of-context zones.
🔧 Customization
Choose 3-bar or 5-bar fractals
OB detection type: close break or HL break
Enable/disable OBs only on times 3, 7, 11, 14 (Hopplipka style)
Optional: require nearby FVG for validation
Line style: solid, dashed, or dotted
Adjust OB length, width, color, and use body or wick for OB height
🚀 How to use it
Add the script to your chart
Choose your preferred OB detection mode and filters
Use plotted OB zones to:
Anticipate price rejections and reversals
Validate Smart Money or ICT-based entry zones
Align setups with algorithmic time sequences (3, 7, 11, 14)
Filter out invalid OBs automatically, keeping your chart clean
The tool is useful on any timeframe but performs best when combined with a liquidity-based or time-anchored trading model.
💡 What makes it original
Combines fractal logic with OB confirmation and time anchors
Implements time-based filtering inspired by Hopplipka’s interpretation of the "Power of 3"
Allows OB validation via optional FVG follow-up — rarely available in public indicators
Auto-cleans invalidated OBs to reduce clutter
Designed to reflect market structure logic used by institutions and algorithms
💬 Why it’s worth using
Order Blocks v2 simplifies one of the most nuanced parts of SMC: identifying clean and high-probability OBs.
It removes subjectivity, adds clear timing logic, and integrates optional confluence tools — like FVG.
For traders serious about algorithmic-level structure and clean setups, this tool delivers both logic and clarity.
⚠️ Important
This indicator:
Is not a signal generator or financial advice tool
Is intended for experienced traders using OB/SMC/time-based logic
Does not predict market direction — it provides visual structural levels only