Smart Adaptive Double Patterns [The_lurker]Smart Adaptive Double Patterns
This is an advanced technical indicator that combines two of the strongest and most renowned classical price reversal patterns:
✅ Double Bottom Pattern — a bullish reversal pattern that forms after a downtrend
✅ Double Top Pattern — a bearish reversal pattern that forms after an uptrend
The indicator does not merely detect patterns — it provides a fully integrated, intelligent system that includes:
✅ Precise quality scoring for each pattern using 5 technical criteria
✅ Automatic price target calculation at three levels (Conservative, Balanced, Aggressive)
✅ Multi-layer dynamic filtering to avoid false signals
✅ Live pattern tracking from formation to target achievement or failure
✅ Comprehensive alert system covering all possible trading scenarios
🎯 Why Is This Indicator Unique?
1️⃣ High Detection Accuracy
Unlike traditional indicators that rely on simple rules, this one applies 5 strict structural conditions to confirm pattern validity:
A clear trend must precede the pattern
High symmetry between the two bottoms or two tops
No break of critical price levels during formation
Logical spacing between key points
Technical confirmation from ADX, ATR, and Volume
2️⃣ Advanced Quality Scoring System
Each pattern is scored out of 100 based on 5 weighted criteria:
Symmetry (30%): How closely the two bottoms or tops match
Trend Strength (20%): Strength of the prior trend
Volume Behavior (20%): Trading activity at critical points
Pattern Depth (15%): Vertical distance between neckline and bottom/top
Structural Integrity (15%): Full compliance with structural rules
3️⃣ Smart Target Management
Separate targets for bullish (Double Bottom) and bearish (Double Top) patterns
Separate projections for success and failure cases
Multiple options: Conservative (0.618) / Balanced (1.0) / Aggressive (1.618)
Live tracking with dynamic moving lines
4️⃣ Professional Failure Handling
Failed patterns are not ignored — they are turned into counter-trend opportunities:
Failed Double Bottom → triggers a bearish signal with downside targets
Failed Double Top → triggers a bullish signal with upside targets
Automatic color change for clear visual distinction
5️⃣ Full Customization Flexibility
Enable/disable each pattern independently
22+ adjustable settings
Unique colors for each pattern and quality level
Full bilingual support (Arabic / English)
📐 Pattern Details
🟦 Double Bottom Pattern
Sequence of points:
🔹 Point 1: Peak marking the start of a strong downtrend
🔹 Point 2 (Bottom 1): First low — first key bounce
🔹 Point 3: Intermediate high — forms the neckline (resistance)
🔹 Point 4 (Bottom 2): Second low — should closely match Bottom 1
🔹 Point 5: Breakout point — pattern confirmation
Mandatory Conditions:
✅ Clear downtrend before Point 2
✅ Bottoms 2 & 4 nearly identical (≤1.5% difference by default)
✅ Point 3 higher than both bottoms
✅ Neither bottom is broken during formation
✅ Sufficient time between points (≥10 candles by default)
✅ Success Scenario
→ Price breaks above the neckline (Point 3)
→ Point 5 is plotted at breakout candle
→ Dashed vertical line drawn from Point 5 to target
→ Horizontal dashed line tracks price toward target
→ Dashboard shows: Pattern Type | Quality | Rating | Target | Status
→ When target hits: line turns green + ✅ appears
🎯 Target Calculation
Pattern Height = Point 3 − Point 4
• Conservative: Point 3 + (Height × 0.618 × Quality Factor)
• Balanced: Point 3 + (Height × 1.0 × Quality Factor)
• Aggressive: Point 3 + (Height × 1.618 × Quality Factor)
❌ Failure Scenario
→ Price breaks below both Bottom 1 or Bottom 2 before neckline breakout
Visual Changes:
All lines turn red
Red ✖ appears at breakdown candle
Neckline stops expanding
Red dashed vertical line from breakdown point to bearish target
Red horizontal tracking line follows price
Dashboard updates to:
⚠ Failed Bottom – Bearish
→ Shows new bearish target
→ Indicates target mode for failure case
→ Status: Bearish Reversal
→ Fully red display
🟥 Double Top Pattern
Sequence of points:
🔹 Point 1: Trough marking the start of a strong uptrend
🔹 Point 2 (Top 1): First peak — first key resistance
🔹 Point 3: Intermediate low — forms the neckline (support)
🔹 Point 4 (Top 2): Second peak — should closely match Top 1
🔹 Point 5: Breakdown point — pattern confirmation
Mandatory Conditions:
✅ Clear uptrend before Point 2
✅ Tops 2 & 4 nearly identical (≤1.5% difference by default)
✅ Point 3 lower than both tops
✅ Neither top is breached during formation
✅ Sufficient time between points (≥10 candles by default)
✅ Success Scenario
→ Price breaks below the neckline (Point 3)
→ Point 5 is plotted at breakdown candle
→ Dashed vertical line drawn to target
→ Horizontal tracking line moves with price
→ Dashboard updates accordingly
→ Green line + ✅ on hit
🎯 Target Calculation
Pattern Height = Point 4 − Point 3
• Conservative: Point 3 − (Height × 0.618 × Quality Factor)
• Balanced: Point 3 − (Height × 1.0 × Quality Factor)
• Aggressive: Point 3 − (Height × 1.618 × Quality Factor)
❌ Failure Scenario
→ Price breaks above either Top 1 or Top 2 before neckline breakdown
Visual Changes:
All lines turn cyan (light blue)
Cyan ✖ appears at breakout candle
Neckline stops expanding
Cyan dashed vertical line to bullish target
Cyan horizontal tracking line follows price
Dashboard updates to:
⚠ Failed Top – Bullish
→ Shows new bullish target
→ Indicates target mode for failure case
→ Status: Bullish Reversal
→ Fully cyan display
🎯 Upside Target (after Double Top failure)
Max Top = max(Point 2, Point 4)
Height = Max Top − Point 3
• Conservative: Max Top + (Height × 0.618)
• Balanced: Max Top + (Height × 1.0)
• Aggressive: Max Top + (Height × 1.618)
📊 Quality Scoring System (0–100)
1️⃣ Symmetry (30%)
Measures price match between the two bottoms or two tops.
High score (25–30): Near-perfect symmetry → very strong pattern
Medium (15–24): Good match → reliable signal
Low (5–14): Weak symmetry → use caution
Zero: No symmetry → invalid pattern
2️⃣ Trend Strength (20%)
Uses ADX and DI indicators.
20 pts: Strong trend confirmed (e.g., ADX ≥ 20 + correct DI alignment)
10 pts: Trend filter disabled
6 pts: Weak or sideways trend
3️⃣ Volume Behavior (20%)
Declining volume on second touch is a positive sign (shows exhaustion).
15–20 pts: Clear volume drop → strong signal
10 pts: Neutral volume
6 pts: Rising volume → higher risk of continuation
4️⃣ Pattern Depth (15%)
Deeper patterns = stronger reversals.
12–15 pts: Deep → high reversal power
8–11 pts: Medium → acceptable
<8 pts: Shallow → weak signal
5️⃣ Structural Integrity (15%)
Checks logical structure (e.g., Point 1 > Point 3 in Double Bottom).
12–15 pts: Ideal structure
8–11 pts: Minor flaws
<8 pts: Poor setup
📈 Final Quality Rating & Colors
• 85–100 → ⭐ Excellent
→ Double Bottom: Cyan #00BCD4
→ Double Top: Light Red #FF5252
• 75–84 → ✨ Very Good
• 65–74 → ✓ Good
• 60–64 → ○ Acceptable
→ All use Amber #FFC107
• <60 → ❌ Rejected (not shown)
→ Gray #9E9E9E
🔧 Dynamic Filters
1️⃣ ATR Filter (Volatility Check)
Rejects patterns in abnormally high volatility periods.
→ If current ATR > 1.8 × 50-period ATR MA → pattern rejected
✅ Recommended for crypto, small caps
❌ Optional for calm markets (gold, bonds)
2️⃣ ADX Filter (Trend Confirmation)
Ensures a real trend exists before the pattern.
→ If ADX < 14 (70% of default 20) → pattern rejected
✅ Strongly recommended (keep ON)
3️⃣ Volume Filter (Behavior Validation)
Not used to reject patterns, but strongly affects quality score.
✅ Best for liquid markets (Forex majors, large stocks)
❌ Optional for illiquid assets
⚙️ Key Settings Explained
🔘 General Settings
• Language: Arabic / English
• Show Previous Patterns: Yes / No
→ “No” keeps chart clean; “Yes” for historical review
🔘 Pattern Selection
• Enable Double Bottom: ✅ / ❌
• Enable Double Top: ✅ / ❌
→ Use combinations:
✅✅ → Full reversal scanning
✅❌ → Long setups only
❌✅ → Short setups only
❌❌ → Indicator OFF
🔘 Detection Parameters
• Pivots Left (1–20): Higher = more reliable, fewer patterns
• Pivots Right (1–20): Lower = faster signals
• Min Width (5–100): Min candles between Bottom/Top 1 & 2
• Tolerance % (0.1%–5%): Max allowed price difference
• Min Arm (5–50): Min candles between pivot & neckline
• Min Trend (5–50): Min candles in prior trend
• Trend Lookback (50–500): How far back to detect trend start
• Extension Multiplier (1.0–5.0): How long to wait for breakout
🔘 Quality Settings
• Min Quality Score (0–100):
→ Conservative: 75–85
→ Balanced: 60–70
→ Flexible: 50–55
• Custom Weights: Adjust based on market (e.g., increase Volume weight in Forex)
🔘 Target Settings
• Bottom Bullish Target: Conservative / Balanced / Aggressive
• Bottom Bearish Target: (used on failure)
• Top Bearish Target: Conservative / Balanced / Aggressive
• Top Bullish Target: (used on failure)
🔘 Visual Settings
• Label Size: Small / Normal / Large / Huge
• Pattern Colors: Fully customizable
• Table: Show/Hide + Size (Small/Normal/Large) + Position (Top-Right / Top-Left / Bottom-Right / Bottom-Left)
• Fill Transparency: 70%–95% (default: 85%)
🔔 Alert System (8 Independent Alerts)
📌 Double Bottom Alerts
Bullish Breakout → “Double Bottom Breakout – Bullish!”
Bullish Target Hit → “Bullish Target Achieved!”
Failure (Bearish) → “Double Bottom Failed – Bearish!”
Bearish Target Hit → “Bearish Target Achieved (Failure)!”
📌 Double Top Alerts
Bearish Breakdown → “Double Top Breakdown – Bearish!”
Bearish Target Hit → “Bearish Target Achieved!”
Failure (Bullish) → “Double Top Failed – Bullish!”
Bullish Target Hit → “Bullish Target Achieved (Failure)!”
Each alert can be enabled/disabled independently and supports pop-ups, emails, or webhooks.
⚠️ Disclaimer:
This indicator is for educational and analytical purposes only. It does not constitute financial, investment, or trading advice. Use it in conjunction with your own strategy and risk management. Neither TradingView nor the developer is liable for any financial decisions or losses.
Chart patterns
Prev/Current Day Open & Close (RamtinFX)Draws three transparent vertical lines marking the previous day’s close, the current day’s open, and the current day’s close.
Session Open Range, Breakout & Trap Framework - TrendPredator OBSession Open Range, Breakout & Trap Framework — TrendPredator Open Box
Stacey Burke’s trading approach combines concepts from George Douglas Taylor, Tony Crabel, Steve Mauro, and Robert Schabacker. His framework focuses on reading price behaviour across daily templates and identifying how markets move through recurring cycles of expansion, contraction, and reversal. While effective, much of this analysis requires real-time interpretation of session-based behaviour, which can be demanding for traders working on lower intraday timeframes.
The TrendPredator indicators formalize parts of this methodology by introducing mechanical rules for multi-timeframe bias tracking and session structure analysis. They aim to present the key elements of the system—bias, breakouts, fakeouts, and range behaviour—in a consistent and objective way that reduces discretionary interpretation.
The Open Box indicator focuses specifically on the opening behaviour of major trading sessions. It builds on principles found in classical Open Range Breakout (ORB) techniques described by Tony Crabel, where a defined time window around the session open forms a structural reference range. Price behaviour relative to this range—breaking out, failing back inside, or expanding—can highlight developing session bias, potential trap formation, and directional conviction.
This indicator applies these concepts throughout the major equity sessions. It automatically maps the session’s initial range (“Open Box”) and tracks how price interacts with it as liquidity and volatility increase. It also incorporates related structural references such as:
* the first-hour high and low of the futures session
* the exact session open level
* an anchored VWAP starting at the session open
* automated expansion levels projected from the Open Box
In combination, these components provide a unified view of early session activity, including breakout attempts, fakeouts, VWAP reactions, and liquidity targeting. The Open Box offers a structured lens for observing how price transitions through the major sessions (Asia → London → New York) and how these behaviours relate to higher-timeframe bias defined in the broader TrendPredator framework.
Core Features
Open Box (Session Structure)
The indicator defines an initial session range beginning at the selected session open. This “Open Box” represents a fixed time window—commonly the first 30 minutes, or any user-defined duration—that serves as a structural reference for analysing early session behaviour.
The range highlights whether price remains inside the box, breaks out, or rejects the boundaries, providing a consistent foundation for interpreting early directional tendencies and recognising breakout, continuation, or fakeout characteristics.
How it works:
* At the session open, the indicator calculates the high and low over the specified time window.
* This range is plotted as the initial structure of the session.
* Price behaviour at the boundaries can illustrate emerging bias or potential trap formation.
* An optional secondary range (e.g., 15-minute high/low) can be enabled to capture early volatility with additional precision.
Inputs / Options:
* Session specifications (Tokyo, London, New York)
* Open Box start and end times (e.g., equity open + first 30 minutes, or any custom length)
* Open Box colour and label settings
* Formatting options for Open Box high and low lines
* Optional secondary range per session (e.g., 15-minute high/low)
* Forward extension of Open Box high/low lines
* Number of historic Open Boxes to display
Session VWAPs
The indicator plots VWAPs for each major trading session—Asia, London, and New York—anchored to their respective session opens. These session-specific VWAPs assist in tracking how value develops through the day and how price interacts with session-based volume distributions.
How it works:
* At each session open, a VWAP is anchored to the open price.
* The VWAP updates throughout the session as new volume and price data arrive.
* Deviations above or below the VWAP may indicate balance, imbalance, or directional control.
* Viewed together, session VWAPs help identify transitions in value across sessions.
Inputs / Options:
* Enable or disable VWAP per session
* Adjustable anchor and end times (optionally to end of day)
* Line styling and label settings
* Number of historic VWAPs to draw
First Hour High/Low Extensions
The indicator marks the high and low formed during the first hour of each session. These reference points often function as early control levels and provide context for assessing whether the session is establishing bias, consolidating, or exhibiting reversal behaviour.
How it works:
* After the session starts, the indicator records the highest and lowest prices during the first hour.
* These levels are plotted and extended across the session.
* They provide a visual reference for observing reactions, targets, or rejection zones.
Inputs / Options:
* Enable or disable for each session
* Line style, colour, and label visibility
* Number of historic sessions displayed
EQO Levels (Equity Open)
The indicator plots the opening price of each configured session. These “Equity Open” levels represent short-term reference points that can attract price early in the session.
Once the level is revisited after the Open Box has formed, it is automatically cut to avoid clutter. If not revisited, the line remains as an untested reference, similar to a naked point of control.
How it works:
* At session open, the open price is recorded.
* The level is plotted as a local reference.
* If price interacts with the level after the Open Box completes, the line is cut.
* Untested EQOs extend forward until interacted with.
Inputs / Options:
* Enable/disable per session
* Line style and label settings
* Optional extension into the next day
* Option for cutting vs. hiding on revisit
* Number of historic sessions displayed
OB Range Expansions (Automatic)
Range expansions are calculated from the height of the Open Box. These levels provide structured reference zones for identifying potential continuation or exhaustion areas within a session.
How it works:
* After the Open Box is formed, multiples of the range (e.g., 1×, 2×, 3×) are projected.
* These expansion levels are plotted above and below the range.
* Price reactions near these areas can illustrate continuation, hesitation, or potential reversal.
Inputs / Options:
* Enable or disable per session
* Select number of multiples
* Line style, colour, and label settings
* Extension length into the session
Stacey Burke 12-Candle Window Marker
The indicator can highlight the 12-candle window often referenced in Stacey Burke’s session methodology. This window represents the key active period of each session where breakout attempts, volatility shifts, and reversal signatures often occur.
How it works:
* A configurable window (default 12 candles) is highlighted from each session open.
* This window acts as a guide for observing active session behaviour.
* It remains visible throughout the session for structural context.
Inputs / Options:
* Enable/disable per session
* Configurable window duration (default: 3 hours)
* Colour and transparency controls
Concept and Integration
The Open Box is built around the same multi-timeframe logic that underpins the broader TrendPredator framework.
While higher-timeframe tools track bias and setups across the H8–D–W–M levels, the Open Box focuses on the H1–M30 domain to define session structure and observe how early intraday behaviour aligns with higher-timeframe conditions.
The indicator integrates with the TrendPredator FO (Breakout, Fakeout & Trend Switch Detector), which highlights microstructure signals on lower timeframes (M15/M5). Together they form a layered workflow:
* Higher timeframes: context, bias, and developing setups
* TrendPredator OB: intraday and intra-session structure
* TrendPredator FO: microstructure confirmation (e.g., FOL/FOH, switches)
This alignment provides a structured way to observe how daily directional context interacts with intraday behaviour.
See the public open source indicator TP FO here (click on it for access):
Practical Application
Before Session Open
* Review previous session Open Box, Open level, and VWAPs
* Assess how higher-timeframe bias aligns with potential intraday continuation or reversal
* Note untested EQO levels or VWAPs that may function as liquidity attractors
During Session Open
* Observe behaviour around the first-hour high/low and higher-timeframe reference levels
* Monitor how the M15 and 30-minute ranges close
* Track reactions relative to the session open level and the session VWAP
After the Open Box completes
* Assess price interaction with Open Box boundaries and first-hour levels
* Use microstructure signals (e.g., FOH/FOL, switches) for potential confirmation
* Refer to expansion levels as reference zones for management or target setting
After Session
* Review how price behaved relative to the Open Box, EQO levels, VWAPs, and expansion zones
* Analyse breakout attempts, fakeouts, and whether intraday structure aligned with the broader daily move
Example Workflow and Trade
1. Higher-timeframe analysis signals a Daily Fakeout Low Continuation (bullish context).
2. The New York session forms an Open Box; price breaks above and holds above the first-hour high.
3. A Fakeout Low + Switch Bar appears on M5 (via FO), after retesting the session VWAP triggering the entry.
4. 1x expansion level serves as reference targets for take profit.
Relation to the TrendPredator Ecosystem
The Open Box is part of the TrendPredator Indicator Family, designed to apply multi-timeframe logic consistently across:
* higher-timeframe context and setups
* intraday and session structure (OB)
* microstructure confirmation (FO)
Together, these modules offer a unified structure for analysing how daily and intraday cycles interact.
Disclaimer
This indicator is for educational purposes only and does not guarantee profits.
It does not provide buy or sell signals but highlights structural and behavioural areas for analysis.
Users are solely responsible for their trading decisions and outcomes.
لbsm15// This work is licensed under a Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) creativecommons.org
// © LuxAlgo
//@version=5
indicator("لbsm15", overlay = true, max_lines_count = 500, max_boxes_count = 500, max_bars_back = 3000)
//------------------------------------------------------------------------------
//Settings
//-----------------------------------------------------------------------------{
liqGrp = 'Liquidity Detection'
liqLen = input.int (7, title = 'Detection Length', minval = 3, maxval = 13, inline = 'LIQ', group = liqGrp)
liqMar = 10 / input.float (6.9, 'Margin', minval = 4, maxval = 9, step = 0.1, inline = 'LIQ', group = liqGrp)
liqBuy = input.bool (true, 'Buyside Liquidity Zones, Margin', inline = 'Buyside', group = liqGrp)
marBuy = input.float(2.3, '', minval = 1.5, maxval = 10, step = .1, inline = 'Buyside', group = liqGrp)
cLIQ_B = input.color (color.new(#4caf50, 0), '', inline = 'Buyside', group = liqGrp)
liqSel = input.bool (true, 'Sellside Liquidity Zones, Margin', inline = 'Sellside', group = liqGrp)
marSel = input.float(2.3, '', minval = 1.5, maxval = 10, step = .1, inline = 'Sellside', group = liqGrp)
cLIQ_S = input.color (color.new(#f23645, 0), '', inline = 'Sellside', group = liqGrp)
lqVoid = input.bool (false, 'Liquidity Voids, Bullish', inline = 'void', group = liqGrp)
cLQV_B = input.color (color.new(#4caf50, 0), '', inline = 'void', group = liqGrp)
cLQV_S = input.color (color.new(#f23645, 0), 'Bearish', inline = 'void', group = liqGrp)
lqText = input.bool (false, 'Label', inline = 'void', group = liqGrp)
mode = input.string('Present', title = 'Mode', options = , inline = 'MOD', group = liqGrp)
visLiq = input.int (3, ' # Visible Levels', minval = 1, maxval = 50, inline = 'MOD', group = liqGrp)
//-----------------------------------------------------------------------------}
//General Calculations
//-----------------------------------------------------------------------------{
maxSize = 50
atr = ta.atr(10)
atr200 = ta.atr(200)
per = mode == 'Present' ? last_bar_index - bar_index <= 500 : true
//-----------------------------------------------------------------------------}
//User Defined Types
//-----------------------------------------------------------------------------{
// @type used to store pivot high/low data
//
// @field d (array) The array where the trend direction is to be maintained
// @field x (array) The array where the bar index value of pivot high/low is to be maintained
// @field y (array) The array where the price value of pivot high/low is to be maintained
type ZZ
int d
int x
float y
// @type bar properties with their values
//
// @field o (float) open price of the bar
// @field h (float) high price of the bar
// @field l (float) low price of the bar
// @field c (float) close price of the bar
// @field i (int) index of the bar
type bar
float o = open
float h = high
float l = low
float c = close
int i = bar_index
// @type liquidity object definition
//
// @field bx (box) box maitaing the liquity level margin extreme levels
// @field bxz (box) box maitaing the liquity zone margin extreme levels
// @field bxt (box) box maitaing the labels
// @field brZ (bool) mainains broken zone status
// @field brL (bool) mainains broken level status
// @field ln (line) maitaing the liquity level line
// @field lne (line) maitaing the liquity extended level line
type liq
box bx
box bxz
box bxt
bool brZ
bool brL
line ln
line lne
//-----------------------------------------------------------------------------}
//Variables
//-----------------------------------------------------------------------------{
var ZZ aZZ = ZZ.new(
array.new (maxSize, 0),
array.new (maxSize, 0),
array.new (maxSize, na)
)
bar b = bar.new()
var liq b_liq_B = array.new (1, liq.new(box(na), box(na), box(na), false, false, line(na), line(na)))
var liq b_liq_S = array.new (1, liq.new(box(na), box(na), box(na), false, false, line(na), line(na)))
var b_liq_V = array.new_box()
var int dir = na, var int x1 = na, var float y1 = na, var int x2 = na, var float y2 = na
//-----------------------------------------------------------------------------}
//Functions/methods
//-----------------------------------------------------------------------------{
// @function maintains arrays
// it prepends a `value` to the arrays and removes their oldest element at last position
// @param aZZ (UDT, array, array>) The UDT obejct of arrays
// @param _d (array) The array where the trend direction is maintained
// @param _x (array) The array where the bar index value of pivot high/low is maintained
// @param _y (array) The array where the price value of pivot high/low is maintained
//
// @returns none
method in_out(ZZ aZZ, int _d, int _x, float _y) =>
aZZ.d.unshift(_d), aZZ.x.unshift(_x), aZZ.y.unshift(_y), aZZ.d.pop(), aZZ.x.pop(), aZZ.y.pop()
// @function (build-in) sets the maximum number of bars that is available for historical reference
max_bars_back(time, 1000)
//-----------------------------------------------------------------------------}
//Calculations
//-----------------------------------------------------------------------------{
x2 := b.i - 1
ph = ta.pivothigh(liqLen, 1)
pl = ta.pivotlow (liqLen, 1)
if ph
dir := aZZ.d.get(0)
x1 := aZZ.x.get(0)
y1 := aZZ.y.get(0)
y2 := nz(b.h )
if dir < 1
aZZ.in_out(1, x2, y2)
else
if dir == 1 and ph > y1
aZZ.x.set(0, x2), aZZ.y.set(0, y2)
if per
count = 0
st_P = 0.
st_B = 0
minP = 0.
maxP = 10e6
for i = 0 to maxSize - 1
if aZZ.d.get(i) == 1
if aZZ.y.get(i) > ph + (atr / liqMar)
break
else
if aZZ.y.get(i) > ph - (atr / liqMar) and aZZ.y.get(i) < ph + (atr / liqMar)
count += 1
st_B := aZZ.x.get(i)
st_P := aZZ.y.get(i)
if aZZ.y.get(i) > minP
minP := aZZ.y.get(i)
if aZZ.y.get(i) < maxP
maxP := aZZ.y.get(i)
if count > 2
getB = b_liq_B.get(0)
if st_B == getB.bx.get_left()
getB.bx.set_top(math.avg(minP, maxP) + (atr / liqMar))
getB.bx.set_rightbottom(b.i + 10, math.avg(minP, maxP) - (atr / liqMar))
else
b_liq_B.unshift(
liq.new(
box.new(st_B, math.avg(minP, maxP) + (atr / liqMar), b.i + 10, math.avg(minP, maxP) - (atr / liqMar), bgcolor=color(na), border_color=color(na)),
box.new(na, na, na, na, bgcolor = color(na), border_color = color(na)),
box.new(st_B, st_P, b.i + 10, st_P, text = 'Buyside liquidity', text_size = size.tiny, text_halign = text.align_left, text_valign = text.align_bottom, text_color = color.new(cLIQ_B, 25), bgcolor = color(na), border_color = color(na)),
false,
false,
line.new(st_B , st_P, b.i - 1, st_P, color = color.new(cLIQ_B, 0)),
line.new(b.i - 1, st_P, na , st_P, color = color.new(cLIQ_B, 0), style = line.style_dotted))
)
alert('buyside liquidity level detected/updated for ' + syminfo.ticker)
if b_liq_B.size() > visLiq
getLast = b_liq_B.pop()
getLast.bx.delete()
getLast.bxz.delete()
getLast.bxt.delete()
getLast.ln.delete()
getLast.lne.delete()
if pl
dir := aZZ.d.get (0)
x1 := aZZ.x.get (0)
y1 := aZZ.y.get (0)
y2 := nz(b.l )
if dir > -1
aZZ.in_out(-1, x2, y2)
else
if dir == -1 and pl < y1
aZZ.x.set(0, x2), aZZ.y.set(0, y2)
if per
count = 0
st_P = 0.
st_B = 0
minP = 0.
maxP = 10e6
for i = 0 to maxSize - 1
if aZZ.d.get(i) == -1
if aZZ.y.get(i) < pl - (atr / liqMar)
break
else
if aZZ.y.get(i) > pl - (atr / liqMar) and aZZ.y.get(i) < pl + (atr / liqMar)
count += 1
st_B := aZZ.x.get(i)
st_P := aZZ.y.get(i)
if aZZ.y.get(i) > minP
minP := aZZ.y.get(i)
if aZZ.y.get(i) < maxP
maxP := aZZ.y.get(i)
if count > 2
getB = b_liq_S.get(0)
if st_B == getB.bx.get_left()
getB.bx.set_top(math.avg(minP, maxP) + (atr / liqMar))
getB.bx.set_rightbottom(b.i + 10, math.avg(minP, maxP) - (atr / liqMar))
else
b_liq_S.unshift(
liq.new(
box.new(st_B, math.avg(minP, maxP) + (atr / liqMar), b.i + 10, math.avg(minP, maxP) - (atr / liqMar), bgcolor=color(na), border_color=color(na)),
box.new(na, na, na, na, bgcolor=color(na), border_color=color(na)),
box.new(st_B, st_P, b.i + 10, st_P, text = 'Sellside liquidity', text_size = size.tiny, text_halign = text.align_left, text_valign = text.align_top, text_color = color.new(cLIQ_S, 25), bgcolor=color(na), border_color=color(na)),
false,
false,
line.new(st_B , st_P, b.i - 1, st_P, color = color.new(cLIQ_S, 0)),
line.new(b.i - 1, st_P, na , st_P, color = color.new(cLIQ_S, 0), style = line.style_dotted))
)
alert('sellside liquidity level detected/updated for ' + syminfo.ticker)
if b_liq_S.size() > visLiq
getLast = b_liq_S.pop()
getLast.bx.delete()
getLast.bxz.delete()
getLast.bxt.delete()
getLast.ln.delete()
getLast.lne.delete()
for i = 0 to b_liq_B.size() - 1
x = b_liq_B.get(i)
if not x.brL
x.lne.set_x2(b.i)
if b.h > x.bx.get_top()
x.brL := true
x.brZ := true
alert('buyside liquidity level breached for ' + syminfo.ticker)
x.bxz.set_lefttop(b.i - 1, math.min(x.ln.get_y1() + marBuy * (atr), b.h))
x.bxz.set_rightbottom(b.i + 1, x.ln.get_y1())
x.bxz.set_bgcolor(color.new(cLIQ_B, liqBuy ? 73 : 100))
else if x.brZ
if b.l > x.ln.get_y1() - marBuy * (atr) and b.h < x.ln.get_y1() + marBuy * (atr)
x.bxz.set_right(b.i + 1)
x.bxz.set_top(math.max(b.h, x.bxz.get_top()))
if liqBuy
x.lne.set_x2(b.i + 1)
else
x.brZ := false
for i = 0 to b_liq_S.size() - 1
x = b_liq_S.get(i)
if not x.brL
x.lne.set_x2(b.i)
if b.l < x.bx.get_bottom()
x.brL := true
x.brZ := true
alert('sellside liquidity level breached for ' + syminfo.ticker)
x.bxz.set_lefttop(b.i - 1, x.ln.get_y1())
x.bxz.set_rightbottom(b.i + 1, math.max(x.ln.get_y1() - marSel * (atr), b.l))
x.bxz.set_bgcolor(color.new(cLIQ_S, liqSel ? 73 : 100))
else if x.brZ
if b.l > x.ln.get_y1() - marSel * (atr) and b.h < x.ln.get_y1() + marSel * (atr)
x.bxz.set_rightbottom(b.i + 1, math.min(b.l, x.bxz.get_bottom()))
if liqSel
x.lne.set_x2(b.i + 1)
else
x.brZ := false
if lqVoid and per
bull = b.l - b.h > atr200 and b.l > b.h and b.c > b.h
bear = b.l - b.h > atr200 and b.h < b.l and b.c < b.l
if bull
l = 13
if bull
st = math.abs(b.l - b.l ) / l
for i = 0 to l - 1
array.push(b_liq_V, box.new(b.i - 2, b.l + i * st, b.i, b.l + (i + 1) * st, border_color = na, bgcolor = color.new(cLQV_B, 90) ))
else
st = math.abs(b.l - b.h ) / l
for i = 0 to l - 1
if lqText and i == 0
array.push(b_liq_V, box.new(b.i - 2, b.h + i * st, b.i, b.h + (i + 1) * st, text = 'Liquidity Void ', text_size = size.tiny, text_halign = text.align_right, text_valign = text.align_bottom, text_color = na, border_color = na, bgcolor = color.new(cLQV_B, 90) ))
else
array.push(b_liq_V, box.new(b.i - 2, b.h + i * st, b.i, b.h + (i + 1) * st, border_color = na, bgcolor = color.new(cLQV_B, 90) ))
if bear
l = 13
if bear
st = math.abs(b.h - b.h) / l
for i = 0 to l - 1
array.push(b_liq_V, box.new(b.i - 2, b.h + i * st, b.i, b.h + (i + 1) * st, border_color = na, bgcolor = color.new(cLQV_S, 90) ))
else
st = math.abs(b.l - b.h) / l
for i = 0 to l - 1
if lqText and i == l - 1
array.push(b_liq_V, box.new(b.i - 2, b.h + i * st, b.i, b.h + (i + 1) * st, text = 'Liquidity Void ', text_size = size.tiny, text_halign = text.align_right, text_valign = text.align_top, text_color = na, border_color = na, bgcolor = color.new(cLQV_S, 90) ))
else
array.push(b_liq_V, box.new(b.i - 2, b.h + i * st, b.i, b.h + (i + 1) * st, border_color = na, bgcolor = color.new(cLQV_S, 90) ))
if b_liq_V.size() > 0
qt = b_liq_V.size()
for bn = qt - 1 to 0
if bn < b_liq_V.size()
cb = b_liq_V.get(bn)
ba = math.avg(cb.get_bottom(), cb.get_top())
if math.sign(b.c - ba) != math.sign(b.c - ba) or math.sign(b.c - ba) != math.sign(b.l - ba) or math.sign(b.c - ba) != math.sign(b.h - ba)
b_liq_V.remove(bn)
else
cb.set_right(b.i + 1)
if b.i - cb.get_left() > 21
cb.set_text_color(color.new(color.gray, 25))
//-----------------------------------------------------------------------------}
Adaptive Trend Direction Degree (Lax)Trend direction
Trend strength
Momentum
Potential reversal points
Morning ORB FVG Trigger✅ Overview
Morning ORB FVG Trigger is a complete intraday trading framework built around:
A Morning Opening Range Breakout (ORB)
The first Fair Value Gap (FVG) after that breakout
Strict risk management and position sizing
Optional HTF trend filter (Daily / Weekly / Monthly)
Optional Daily ATR filter to avoid extreme days
The script is designed for futures / indices / FX on intraday charts up to 15 minutes and for traders who want a clean, mechanical entry framework with clear risk.
🧠 Core idea
Define a morning opening range (e.g. 09:30–09:45).
Wait for a clean breakout above/below that range.
After the breakout, wait for the first FVG in breakout direction,
confirmed by the next candle (no immediate full reclaim).
Use a chosen stop logic + R:R factor to build risk/reward boxes.
Calculate position size based on your account risk.
(Optional) Only take trades:
In the direction of the HTF EMA trend (D/W/M).
On days where the morning range is within a band of the Daily ATR.
You can also disable all signals/boxes and use the script just as a visual ORB tool.
⏰ 1. ORB / Morning Range
Inputs (Main section)
Morning Range Session
Time window of the opening range in exchange time
Example: 09:30–09:45 for a 15-minute ORB.
You can type custom ranges (e.g. 09:30–09:35 for a 5-minute ORB).
Risk/Reward (TP factor)
Multiplier for the take-profit distance relative to the stop.
2.0 = TP is 2× the stop distance
1.5 = TP is 1.5× the stop distance
Show ORB range
If enabled, draws:
ORB high/low lines
ORB labels (e.g. 15min ORB high / low)
Optional midline
Extend ORB lines to the right (bars)
How many bars to extend the ORB high/low horizontally beyond the ORB itself.
Trade box width (bars)
Horizontal width (in bars) of:
Red risk box (entry–stop)
Green reward box (entry–TP)
Implementation details
The ORB is always calculated on 1-minute data internally, so it stays precise even on 5m/15m charts.
The script only works on intraday timeframes up to 15 minutes.
📦 2. FVG Block
Group: “FVG”
Threshold %
Minimum size of an FVG in % of price.
0 = every FVG
Higher values = only larger gaps
Auto threshold (from volatility)
If enabled, the minimum FVG size is derived from historical volatility
instead of a fixed percentage.
Allow breakout FVG partly inside ORB
Off (default): the FVG must lie fully outside the ORB.
On: the breakout FVG itself may still overlap the ORB a bit,
as long as it is the first one attached to the breakout move.
Enable FVG entry signals, boxes & alerts
On: full system – FVG detection, entry labels, risk/TP boxes, alerts.
Off: no entries, no risk/TP boxes, no alerts.
You only get the ORB and (optionally) the HTF dashboard, so you can trade your own setups.
Entry mode
Entry mode (Mid / Edge / NextOpen)
Mid – Entry at the midpoint of the FVG.
Edge – Long at the upper FVG edge, short at the lower FVG edge.
NextOpen – No limit order in the gap. Entry is placed at the next bar open after FVG confirmation.
Edge offset (ticks)
Additional offset for Edge entries:
Long:
+ticks = a bit above the FVG (more conservative)
-ticks = deeper into the FVG (more aggressive)
Short:
+ticks = a bit below the FVG
-ticks = deeper into the FVG
FVG detection logic
Uses a LuxAlgo-style 3-candle FVG pattern (gap between candle 1 and 3).
Only one FVG is taken: the first valid FVG after the ORB breakout in breakup direction.
The FVG candle is the middle bar; the script:
Detects the FVG on the previous bar.
Waits for the current bar to confirm it:
Bullish: current low must stay above the lower FVG boundary
Bearish: current high must stay below the upper FVG boundary
Only then an entry signal is generated.
🛑 3. Stop Logic
Group: “Stop Logic”
Stop mode (PrevBar / Pivot / FVG Candle)
PrevBar – Stop at the low/high of the candle before the FVG
(tight/aggressive).
FVG Candle – Stop at the low/high of the FVG candle itself
(medium).
Pivot – Stop at the most recent swing high/low
using pivotLeft / pivotRight pivots (more conservative).
Ticks (stop buffer)
Offset (in ticks) from the selected stop level.
> 0 = further away (more room, more risk)
< 0 = closer (tighter stop)
Pivot left / Pivot right
Number of candles left/right to define a swing high/low
when using Pivot stop mode.
Typical intraday values: 2–3.
The script also sanity-checks the stop:
if the calculated stop would be invalid (e.g. above entry in a long), it moves it by a minimal distance (2 ticks) to keep a valid risk.
📈 4. HTF Trend Filter (Daily / Weekly / Monthly)
Group: “HTF Trend Filter”
Enable HTF trend filter
If enabled, trades are only allowed:
Long when at least 2 of D/W/M closes are above their EMA
Short when at least 2 of D/W/M closes are below their EMA
EMA length (D/W/M)
EMA length for all three higher timeframes (Daily, Weekly, Monthly).
This helps focus entries in the direction of the dominant higher-timeframe trend.
📊 5. ATR Filter (Daily)
Group: “ATR Filter (Daily)”
Use daily ATR filter
If enabled, the height of the ORB (ORB high – ORB low) must be within
a band of the Daily ATR to allow any signals.
Daily ATR length
ATR period on the Daily timeframe.
Min ORB size vs ATR
Lower bound:
Example: 0.3 → ORB must be at least 0.3 × Daily ATR
0.0 = no minimum.
Max ORB size vs ATR
Upper bound:
Example: 1.5 → ORB must be ≤ 1.5 × Daily ATR
0.0 = no maximum.
If the ORB is too small (choppy) or too large (exhausted move), no breakout or FVG signal will be generated on that day.
🧭 6. HTF Dashboard & Signal Labels
Group: “HTF Trend Dashboard”
Show HTF dashboard
Draws a small label at the top of the chart showing:
HTF Trend (EMA X)
D: UP/FLAT/DOWN
W: UP/FLAT/DOWN
M: UP/FLAT/DOWN
Dashboard position
Top Right, Top Center, Top Left – places the dashboard at the top.
Over Risk Info – no top dashboard; instead, the HTF trend info is shown as a label near the risk box when a new signal appears.
Lookback (bars) for top anchor
How many bars to use to determine the top price level for dashboard placement.
Show HTF trend above risk box on signal
Only relevant if Dashboard position = Over Risk Info.
When enabled, a small HTF label appears near the risk box for each new trade.
Signal label vertical offset (ticks)
Vertical spacing between risk info label and HTF label.
Minimum spacing HTF/Risk (ticks)
Ensures a minimum vertical distance so the two labels don’t overlap.
HTF signal label X offset (bars)
Horizontal offset (left/right) relative to the risk info label.
⏳ 7. ORB–FVG Filters (Session & Time Window)
Group: “ORB FVG Filter”
Only same session day
If enabled, FVG entries are only allowed on the same calendar day
as the ORB. When the date changes, all state & drawings are reset.
Limit hours after ORB
Enables a time window after the ORB end.
Trading window after ORB (hours)
Length of that window in hours.
Example: 2.0 → FVG signals only in the first 2 hours after ORB end.
💰 8. Risk Management & Position Sizing
Group: “Risk Management”
Calculate position size
If enabled, the script computes suggested mini and micro contract size for you.
Account size
Your trading account size (in account currency).
Risk mode
Percent – risk is a % of account size (Account risk %).
Fixed amount – risk is a fixed dollar amount (Fixed risk ($)).
Account risk %
Risk per trade as a percentage of account size (e.g. 1.0 for 1%).
Fixed risk ($)
Fixed risk per trade in dollars when using Fixed amount mode.
Micro factor (vs mini)
How much a micro contract is worth relative to a mini.
Example:
0.1 → one micro moves 1/10 of one mini.
Risk Info label
For each new trade, a label is shown above the boxes with:
Stop distance in price and $ risk per mini
Max risk allowed for the trade
Suggested mini and micro size
Text like:
Suggested: 2 mini
Suggested: 5 micro
or Suggested: no trade
This makes the script especially useful for prop-firm rules or strict risk discipline.
🎨 9. Visual Style (Boxes, Labels, ORB Lines)
Group: “Box & Label Style (Trade)”
Label font size (Very small, Small, Normal, Large)
Entry label BG / text color
Stop label BG / text color
TP label BG / text color
Risk info BG / text color
Risk box color (entry–stop zone)
Reward box color (entry–TP zone)
Group: “ORB Style”
ORB high line color
ORB low line color
ORB line width
ORB label font size
ORB label background color
ORB label text color
Show ORB midline
ORB midline color / width / style (Solid / Dashed / Dotted)
⚠️ 10. Alerts
Group: “Alerts”
The script defines three alert conditions:
Long entry FVG breakout
Triggered when a new long signal appears.
Short entry FVG breakout
Triggered when a new short signal appears.
FVG entry (long/short)
Generic alert for any new signal (long or short).
To use them:
Add the indicator to the chart.
Open the Alerts dialog → “Condition”.
Select this script and one of the alert conditions.
Set your preferred expiration and notification settings.
Alerts only fire when Enable FVG entry signals, boxes & alerts is on.
🧩 11. How the trading logic flows (summary)
Build ORB on 1-minute data during the selected session.
Optionally reject the day if ORB is outside the ATR bounds.
Wait for a breakout (close above high or below low), respecting HTF trend filter.
After breakout, look for the first valid FVG in that direction:
Outside the ORB (unless breakout FVG allowed inside)
Confirmed by the next candle (no full reclaim)
Once confirmed:
Compute entry, stop, target.
Draw risk/reward boxes and all labels.
Optionally show HTF signal label over the risk info.
Trigger alerts if enabled.
If you disable FVG signals, only steps 1–3 (plus dashboard) are effectively active.
⚠️ 12. Notes & Disclaimer
Script is intended for intraday trading up to 15-minute timeframes.
All signals are mechanical and do not guarantee profitability.
Always backtest and forward-test on your own data before risking real money.
This script is for educational purposes only and is not financial advice.
🚀 Quick-start guide
Add the script to your chart
Use an intraday timeframe ≤ 15 minutes (1m, 3m, 5m, 15m).
Works best on liquid indices, futures, FX and large-cap stocks.
Set the Morning Range
In “Morning Range Session” choose the exchange’s opening window.
Examples
US index futures (CME): 08:30–08:45 or 08:30–08:35
US stocks (NYSE/Nasdaq): 09:30–09:45 or 09:30–09:35
The ORB is always calculated on 1-minute data internally, so the range stays accurate on higher intraday charts.
Keep the default filters at first
HTF Trend Filter: ON
EMA length = 20
This will only allow trades in the direction of the dominant D/W/M trend.
ATR Filter: OFF (optional; you can enable later once you’re comfortable).
Use the full trade system
In the FVG group leave
“Enable FVG entry signals, boxes & alerts” = ON
Entry mode: Mid
Stop mode: FVG Candle or PrevBar
Risk/Reward: 2.0 as a starting point.
Set your risk
Turn on “Calculate position size”.
Enter your Account size and choose either:
Risk mode = Percent (e.g. 1.0 = 1% per trade), or
Risk mode = Fixed amount (e.g. $250 per trade).
The risk info label will show:
Stop distance in price and $/contract
Max allowed risk
Suggested mini and micro contract size.
Enable alerts (optional)
Open the Alerts dialog → Condition: this script.
Choose one of:
Long entry FVG breakout
Short entry FVG breakout
FVG entry (long/short)
Choose “Once per bar” or “Once per bar close”, and your preferred notification type.
Replay & journal
Use the TradingView bar replay tool to step through past days.
Focus on:
How the ORB defines the structure.
How the first confirmed FVG outside the ORB behaves.
Whether the risk/TP levels fit your own style and product.
🎛 Recommended settings & profiles
These are starting points, not rules. Always adapt to the instrument and your own risk tolerance.
1. Conservative / Trend-following
Timeframe: 5m or 15m
Morning Range Session: 15-minute ORB around the cash or futures open
FVG
Threshold %: 0.05–0.1 (filter out very small gaps)
Auto threshold: OFF (keep it simple)
Allow breakout FVG partly inside ORB: OFF
Enable FVG entry signals/boxes/alerts: ON
Entry mode: Mid
Stop Logic
Stop mode: Pivot
Pivot left/right: 2–3
Stop buffer: +1–2 ticks
HTF Trend Filter
Enabled: ON
EMA length: 20
ATR Filter
Enabled: ON
Daily ATR length: 14
Min ORB vs ATR: 0.3–0.4
Max ORB vs ATR: 1.2–1.5
Risk Management
Risk mode: Percent
Account risk: 0.5–1.0%
Idea: Only trade when the higher-timeframe trend supports the move and the opening range is of a “normal” size for the current volatility.
2. Balanced / Intraday directional
Timeframe: 3m or 5m
FVG
Threshold %: 0.02–0.05
Auto threshold: ON (lets the script adapt to volatility)
Allow breakout FVG partly inside ORB: ON
(first breakout FVG may partly sit inside the ORB)
Entry mode: Edge
Edge offset (ticks): 0 or +1
Stop Logic
Stop mode: FVG Candle
Stop buffer: 0–1 ticks
HTF Trend Filter
Enabled: ON
ATR Filter
Enabled: OFF (optional)
Risk Management
Risk mode: Percent
Account risk: 1.0–1.5% (if this fits your plan)
Idea: Slightly more aggressive entries at the gap edge, still aligned with HTF trend, but with more flexibility on ATR.
3. Aggressive / Scalping around the ORB
Timeframe: 1m or 3m
FVG
Threshold %: 0.0–0.02
Auto threshold: ON
Allow breakout FVG partly inside ORB: ON
Entry mode: NextOpen or Edge with a negative offset (deeper into the gap)
Stop Logic
Stop mode: PrevBar
Stop buffer: 0 or -1 tick
HTF Trend Filter
Enabled: OFF (or ON but treat as soft guidance)
ATR Filter
Enabled: OFF
Risk Management
Risk mode: Percent
Account risk: lower, e.g. 0.25–0.5% per trade
Idea: More trades and tighter stops. Best for experienced traders who understand the limitations of scalping and whipsaw risk.
Final reminder
All of these are templates, not guarantees:
Always check how the system behaves on your market and session.
Start on replay and demo before trading real money.
Adjust filters (HTF, ATR, thresholds) until the signals fit your personal approach.
Levels S/R Boxes + Gaps + SL/TPWhat It Does:
Automatically identifies and displays:
🟦 Support/Resistance zones (horizontal boxes)
🟨 Price gaps (unfilled gaps from market open/close)
🎯 Stop Loss levels (where to protect trades)
💰 Take Profit levels (where to exit trades)
Purpose: Shows you exactly where price is likely to bounce, reverse, or break through.
Best Practices:
✅ Trade at the boxes - Don't chase price
✅ Use SL/TP lines - Automatic risk management
✅ Wait for confirmation - Candle pattern + S/R level
✅ Gaps get filled - Trade towards yellow boxes
✅ Solid lines = stronger - Prefer 3+ touch levels
❌ Don't ignore SL - Always protect yourself
❌ Don't trade middle - Wait for S/R zones
❌ Don't fight strong levels - Respect solid boxes
Settings (Quick Reference):
S/R Strength: 10 (default) - Lower = more levels, Higher = fewer stronger levels
Max Levels: 5 (default) - Number of S/R boxes to show
Show Gaps: ON - Display yellow gap boxes
Show SL/TP: ON - Display entry/exit suggestions
P&F Label Overlay🧙 The Wizard's Challenge: P&F Label Overlay on Your Chart
This is a custom Pine Script indicator designed to overlay the classic Point & Figure (P&F) pattern directly onto your standard candlestick or bar chart. While Pine Script offers built-in, dedicated P&F charts, this indicator was created as a challenging and experimental project to satisfy the goal of visualizing the P&F X's and O's directly on the price bars.
❶. How to Use This Code on TradingView
1. Copy the Code: Copy the entire Pine Script code provided above.
2. Open Pine Editor: On TradingView, click the "Pine Editor" tab at the bottom of your chart.
3. Replace Content: Delete any existing code in the editor and paste this P&F script.
4. Add to Chart: Click the "Add to Chart" button (usually located near the top right of the Pine Editor).
5. Access Settings: The indicator, named "P&F Label Overlay: The Wizard's Challenge," will appear on your chart. You can click the gear icon ( ) next to its name on the chart to adjust the inputs.
❷. 🎛️ Key Settings & Customization (Inputs)
The indicator provides core P&F settings that you can customize to fit your analysis style:
✅ Enable Auto Box Size (Default: True): When enabled, the box size is automatically calculated as a percentage of the current price, making it dynamic.
・Auto Box Size Basis (%): Sets the percentage used to calculate the dynamic box size. (e.g., 2% of the price).
・Fixed Box Size (Price Units): When "Enable Auto Box Size" is disabled, this value is used as the static box size (e.g., a value of 5.0 for a $5 box).
・Reversal Count (Default: 3): This is the crucial P&F parameter (the Reversal Factor). It determines how many boxes the price must move in the opposite direction to trigger a column reversal (e.g., 3 means price must reverse by 3 \times \text{BOX\_SIZE}).
Calculation Source: Allows you to choose the price data used for calculations (e.g., close, hl2 (High/Low/2), etc.).
❸. 🎯 The Challenge: Why an Overlay?
This indicator represents an experimental and challenging endeavor made in collaboration with an AI. It stems from the strong desire to visualize P&F patterns overlaid on a conventional chart, which is not a native function in Pine Script's standard indicator plotting system.
・Leveraging Drawing Objects: The core of this challenge relies on cleverly using Pine Script's label.new() drawing objects to represent the "X" and "O" symbols. This is a highly non-standard way to draw a P&F chart, as it requires complex logic to manage the drawing coordinates, price levels, and column spacing on the time-based chart.
・The Current Status: We've successfully achieved the initial goal: visualizing the X and O patterns as an overlay. Achieving a perfectly aligned, full-featured P&F chart (where columns align precisely, and price rounding is fully consistent across all columns) is far more complex, but this code provides a strong foundation.
❹. 🛠️ Technical Highlights
Tick-Precision Rounding: The custom function f_roundToTick() is critical. It ensures that the calculated box size and the lastPrice are always rounded to the nearest minimum tick size (syminfo.mintick) of the asset. This maintains high precision and accuracy relative to the market's price movements.
・Column Indexing: The currentColumnIndex variable is used to simulate the horizontal movement of P&F columns by adding a fractional offset to the bar_index when drawing the labels. This is what makes the pattern appear as distinct columns.
・Garbage Collection: The activeLabels array and the MAX_LABELS limit ensure that old labels are deleted (label.delete()) as new ones are drawn. This is a crucial performance optimization to prevent TradingView's label limit (500) from being exceeded and to maintain a smooth experience.
❺. 🚀 A Platform for Deep Customization
While TradingView's built-in indicators are excellent, every trader has their "personal best settings." View this code as a starting point for your own analytical environment. You can use it as a base to pursue deeper custom features, such as:
・Different drawing styles or colors based on momentum.
・Automated detection and signaling of specific P&F patterns (e.g., Double Top Buy, Triple Bottom Sell).
Please feel free to try it on your chart! We welcome any feedback you might have as we continue to refine this experimental overlay.
I do not speak English at all. Please understand that if you send me a message, I may not be able to reply, or my reply may have a different meaning. Thank you for your understanding.
Adaptive Support & Resistance ProAdaptive Support & Resistance Pro – Description
Adaptive Support & Resistance Pro is an advanced S/R tool designed to automatically identify key support and resistance zones based on a combination of RSI, CMO dynamics, and pivot logic. This indicator provides precise and reactive levels that form only when specific technical conditions are met, filtering out noise and delivering more reliable S/R signals.
It is ideal for technical traders who want to understand where price naturally pauses, reverses, or consolidates—without the need to manually draw lines on every chart.
🔍 Key Features
1. Automatic Support & Resistance Detection
The indicator uses:
RSI (9)
CMO logic based on HMA
Pivot structure (len = 2)
to generate valid Support and Resistance zones.
A level is drawn only when all required conditions align, preventing false or weak signals.
2. Multi-Timeframe Analysis (MTF)
You can view the chart on one timeframe (e.g., 5m)
and display Support/Resistance levels from another timeframe (e.g., 1H, 4H, D) at the same time.
This allows for:
viewing higher-timeframe structures on lower charts,
better planning of entries and exits,
avoiding trades inside strong zones that may not be visible on the current timeframe.
All of this is controlled through the input:
S/R Timeframe
3. Adjustable Line Thickness (visual enhancement)
Using the input:
Line Width
you can increase the thickness of support/resistance lines to:
make important zones more visible,
improve chart readability,
emphasize S/R levels according to your visual preference.
This is especially useful on fast markets (Forex, Crypto) and on higher timeframes where clarity of levels is essential.
4. Clear distinction between Support and Resistance
Support lines have their own customizable color (default: green)
Resistance lines have their own customizable color (default: red)
You can freely adjust the colors to match your personal TradingView layout or theme.
5. Alerts (Notification System)
The built-in alert:
"New S/R line"
triggers whenever a new support or resistance level is detected.
This helps you:
monitor important levels without constantly watching the chart,
react quickly to new structure signals,
stay aware of market changes in real time.
🎯 How to Use the Indicator
Support levels often indicate potential reversals or long-entry opportunities.
Resistance levels highlight areas where price may reverse downward or form short setups.
The best performance is achieved when combining this indicator with:
price action,
EMA structure,
confirmation zones,
breakout logic,
trend filters.
MTF usage is highly recommended:
Analyze higher-timeframe S/R while trading lower-timeframe setups.
⚠️ Disclaimer
This indicator does not generate direct buy or sell signals.
Its purpose is to assist in market analysis and highlight areas where price is likely to react.
📌 Conclusion
Adaptive Support & Resistance Pro combines the strongest elements of automated S/R mapping: precision, reduced noise, multi-timeframe flexibility, and advanced logic based on RSI, CMO, and pivot structure.
It is perfect for traders who want:
clean and accurate S/R levels,
higher-timeframe insight while trading lower charts,
customizable and visually enhanced structure mapping.
Grok/Claude Turtle Trend Pro Strategy Turtle Trend Pro Strategy: A Modern Implementation of the Legendary Turtle Trading System
Historical Background: The Original Turtle Experiment
In 1983, legendary commodities trader Richard Dennis made a bet with his partner William Eckhardt: could successful trading be taught, or was it an innate skill? To settle the debate, Dennis recruited and trained a group of novices—whom he called "Turtles" (inspired by turtle farms he'd visited in Singapore)—teaching them a complete mechanical trading system. The results were remarkable: over the next four years, the Turtles reportedly earned over $175 million, proving that systematic, rule-based trading could be taught and replicated.
The strategy you've shared is a faithful modern adaptation of those original Turtle rules, enhanced with contemporary technical filters.
Core Turtle Principles Preserved in This Strategy
1. Donchian Channel Breakouts (The Heart of Turtle Trading)
The original Turtles used Donchian Channels—a simple concept where you track the highest high and lowest low over a specific lookback period. This strategy implements both original Turtle systems:
System 1 (Default): 20-period entry breakout, 15-period exit
System 2 (Optional): 55-period entry breakout, 20-period exit
The logic is elegantly simple:
Go long when price breaks above the highest high of the last 20 (or 55) periods
Go short when price breaks below the lowest low of the last 20 (or 55) periods
This captures the Turtle philosophy of trend-following through momentum breakouts—the idea that markets trending strongly in one direction tend to continue.
2. ATR-Based Position Sizing and Stops
The Turtles were pioneers in using Average True Range (ATR) for risk management. This strategy preserves that approach:
Stop Loss: Set at 2× ATR from entry (the original Turtle rule)
ATR Period : 20 days (matching the original)
The ATR stop adapts to market volatility—wider stops in volatile markets, tighter stops in calm ones—preventing premature exits while still protecting capital.
3. Opposite Channel Exit
Rather than using arbitrary profit targets, the Turtles exited positions when price broke the opposite channel:
Exit longs when price breaks below the 15-period (or 20-period) low
Exit shorts when price breaks above the 15-period (or 20-period) high
This allows winning trades to run while providing a systematic exit that doesn't rely on prediction.
Modern Enhancements Beyond the Original System
While the core mechanics remain true to 1983, this strategy adds sophisticated filters the original Turtles didn't have access to:
Trend Filter (200 EMA)
Only takes long trades when price is above the 200-period moving average (and the MA is sloping up), and vice versa for shorts. This aligns trades with the major trend, reducing whipsaws in choppy markets. Set of off by default and fully adjustable in settings.
ADX Filter (Trend Strength)
The Average Directional Index ensures trades are only taken when the market is actually trending (ADX > 20 threshold). The original Turtles suffered significant drawdowns in ranging markets—this filter addresses that weakness.
Optional RSI Filter
Adds overbought/oversold confirmation to entries, though this is disabled by default to stay closer to the original system.
Volume Confirmation
Optional requirement for volume surges on breakouts, adding conviction to signals.
The Strategy's Risk Management Framework
Parameter Setting Turtle Origin Position Size 10% of equity. Turtles used volatility-adjusted sizing.
Stop Loss2× ATR.
Original Turtle rule Commission 0.075%. Modern crypto exchange rate.
Pyramiding Disabled.
Turtles did pyramid, but simplified here.
Visual Elements and Regime Detection
The strategy includes a "Neural Fusion Pro" styled display that would make the original Turtles jealous:
Color-coded Donchian Channels: Green (bullish), Red (bearish), Yellow (neutral)
Trend Strength Meter: Combines ADX, price vs. MA distance, channel position, and DI spread
Regime Classification : Automatically identifies Bull, Bear, or Neutral market conditions
Information Panel: Real-time display of all key metrics
Why Turtle Trading Still Works
The genius of the Turtle system lies in its mechanical discipline. It removes emotion from trading by providing explicit rules for:
What to trade (anything with sufficient liquidity and volatility)
When to enter (channel breakouts)
How much to trade (volatility-adjusted position sizing)
When to exit (opposite breakout or ATR stop)
This strategy faithfully preserves that mechanical approach while adding modern filters to improve the win rate in today's markets.
Smart MACD Divergence ScannerOriginal Base Indicator: "CM_MacD_Ult_MTF" by ChrisMoody
This indicator builds upon ChrisMoody's excellent multi-timeframe MACD foundation and transforms it into a professional divergence scanner with advanced quality assessment and filtering capabilities. The original MACD visualization and MTF functionality have been preserved while adding completely new divergence detection, scoring, and filtering systems.
🎯 What Makes This Indicator Unique:
Smart MACD Divergence Scanner is a professional tool for detecting MACD-based divergences with an advanced filtering system and signal quality assessment. Unlike standard divergence indicators, this version includes innovative features:
Adaptive Quality Scoring System — each signal receives a score from 0 to 100 based on multiple factors
Volatility Filter — automatic signal suppression during low market volatility periods
Multi-Timeframe Confirmation — divergence verification on higher timeframe for increased reliability
Divergence Strength Analysis — calculation of percentage difference between price and indicator movement
Information Dashboard — detailed real-time signal statistics
Cooldown System — prevention of multiple consecutive signals
💡 How It Works:
The indicator uses the classic divergence concept — the divergence between price movement and the MACD oscillator. However, instead of simple pivot detection, the algorithm:
Scans the market for local extremes (pivots) on price and MACD histogram
Searches for divergences — when price updates low/high while MACD shows opposite movement
Assesses quality — analyzes divergence strength, volatility, higher timeframe confirmation
Filters noise — eliminates weak signals through threshold system and cooldown
Generates signal — only when all quality criteria are met
🔧 Key Parameters:
MACD Settings: Fast Length (12), Slow Length (26), Signal Length (9)
Divergence Detection: Pivot Lookback (5), Max Lookback Range (60), Min Divergence Strength (15%)
Quality Filters: Min Quality Score (60), Volatility Filter, MTF Confirmation, Signal Cooldown (5)
📊 How to Use:
Add indicator to chart — it will automatically start scanning
Configure filters — start with default settings, then adapt to your trading style
Watch for signals: 🟢 Green "BUY" label = bullish divergence, 🔴 Red "SELL" label = bearish divergence
Check quality score on labels (Q: XX)
Use information panel to monitor statistics and current market conditions
⚙️ Settings Guide:
For swing trading (4H-Daily): Increase Pivot Lookback to 7-10, set Min Quality Score to 70+
For day trading (15m-1H): Keep default settings, enable all filters
For scalping (1m-5m): Decrease Min Quality Score to 50, disable MTF Confirmation
For volatile markets (crypto): Increase Min Divergence Strength to 20-25%, enable Volatility Filter
⚠️ Important Notes:
Divergences are probabilistic signals, not guaranteed reversals
Use additional confirmation (support/resistance levels, volume, price action)
Adjust parameters for specific asset and timeframe
Signals appear with Pivot Lookback bars delay (retrospective confirmation)
On volatile markets, increase Min Quality Score to reduce false signals
DeepClean Linear indicator 1. Indicator Name
DeepClean Linear indicator
2. One-Line Introduction
A trend-recognition indicator that overlays a “transparent wave” on price, removing noise and revealing directional bias and trend intensity in a highly intuitive visual form.
3. Overall Summary
The DeepClean Linear indicator calculates trend direction using changes in linear regression slope and determines trend strength by comparing how consistently the regression line moves over a defined lookback window.
Rather than merely identifying trend direction, the indicator applies a triple-layer noise-filtering process (EMA → SMA → RMA) to produce a clean, wave-shaped data line that filters out unnecessary market noise.
This transparent wave sits directly on top of price, allowing traders to visually compare price movement and trend strength at the same time.
A stronger trend results in a taller, thicker wave, while weakening momentum causes the wave to thin, making it easier to spot trend continuation, exhaustion, or upcoming reversal.
Color automatically shifts based on trend:
Bright cyan/teal during bullish conditions
Reddish tones during bearish conditions
Transparency dynamically adjusts depending on strength
The indicator excels at identifying the true underlying trend by ignoring minor fluctuations and is well suited for scalping, swing trading, and position trading.
It also significantly reduces false signals in ranging markets, making it ideal for trend-following strategies.
4. Advantages
① Ultra-Clean Noise-Reduced Wave
Utilizes a 3-stage smoothing filter (EMA → SMA → RMA) to produce a much cleaner wave than standard moving averages, highlighting only core trend movement.
② Trend Direction & Strength at a Glance
Based on comparative linear regression behavior, the indicator quantifies both direction and strength, making convergence/divergence highly visible.
③ Intuitive Price Overlay Visualization
The semi-transparent wave sits directly on price action, allowing traders to instantly see divergence from price, trend weakening, or early turning points.
④ Dynamic Transparency Coloring
Strong trends appear bold and intense, while weaker trends fade visually—making signal interpretation effortless.
⑤ Excellent Range Filtering
During low-direction phases (state = 0), the wave turns neutral, preventing forced or premature entries.
⑥ Multi-Timeframe Compatibility
The wave remains stable from 1-minute to weekly charts, making it suitable for trend analysis, execution, and risk control across all timeframes.
📌 Core Concept Overview
The indicator evaluates the relative comparison of linear regression values over the last n periods.
A positive trend value indicates bullish bias
A negative trend value indicates bearish bias
Intensity represents strength and controls wave height
waveTop / waveBot define the visual wave area relative to price
State Values
1 = Bullish Trend
-1 = Bearish Trend
0 = Neutral / Weak Direction
⚙️ Settings Overview
Option Description
Trend Lookback (n) Comparison window for regression slope. Higher = bigger trend focus.
Range Tolerance (%) Strength threshold to classify bullish/bearish movement. Higher = more conservative.
Source Price source for regression calculations.
Linear Reg Length Length of the linear regression.
Noise Filter Strength (smoothK) Controls the smoothing intensity. Higher = smoother wave.
Wave Amplitude (amp) Adjusts the height/thickness of the wave.
Bull/Bear Color Colors for bullish/bearish waves.
Base Transparency Base opacity level; modified dynamically by trend strength.
📈 Bullish Timing Recognition Examples
Wave begins turning brighter teal and more opaque, indicating strengthening upward pressure.
waveTop expands above price, signaling early trend expansion.
State flips to 1, often marking a trend restart or early reversal phase.
A steadily rising wave height suggests sustained bullish momentum.
📉 Bearish Timing Recognition Examples
Wave shifts into red tones, showing bearish dominance.
waveBot expands below price, indicating rising downside volatility.
State stays at -1 while intensity increases, signaling entry into strong downtrend conditions.
A shift from weak → strong bearish intensity can provide short-entry timing cues.
🧪 Recommended Usage
Use as a core component in trend-following systems
Adjust position size based on wave thickness (trend strength)
Combine with RSI/MACD to reduce false signals during overbought/oversold zones
Sudden wave expansion during volatility increases helps detect trend acceleration
In sideways markets, frequent state = 0 readings help avoid low-probability trades
🔒 Important Notes
As a trend-based indicator, it may misread choppy/ranging markets
Because of smoothing, signals may appear slightly delayed
Extreme news volatility can temporarily distort trend clarity
Student Wyckoff Target Shooter
**Target Shooter — Equal Move Target Tool (Larry Williams idea)**
**1. What this indicator does**
Target Shooter is a tool that measures the last meaningful price swing and projects an **equal move target** in the direction of the breakout.
The logic is simple:
* The market makes a move from point A to point B (a swing high to a swing low, or vice versa).
* Then price breaks out above or below this swing range.
* Target Shooter takes the size of that swing and **adds it in the direction of the breakout**, showing a logical **price target zone** where the move may:
* slow down,
* react,
* or potentially reverse.
This is a practical implementation of the “Equal Moves” idea often referenced by Larry Williams.
---
**2. Core idea (example)**
Example from the classic explanation:
* Price drops from **80 down to 20** → the move is **60 points**.
* The swing range is now: **High = 80, Low = 20**.
* Later, price **breaks above 80**.
Target Shooter assumes:
> “If the market could move 60 points in one direction, after a breakout it may travel another 60 points in the opposite direction.”
So the upside target becomes:
* Move size: 80 − 20 = 60
* Breakout above 80
* **Target = 80 + 60 = 140**
The indicator finds such swings automatically and draws:
* **UT (Upper Target)** on upside breakouts
* **DT (Down Target)** on downside breakouts
---
**3. What you see on the chart**
1. **Target lines**
* When price breaks **above** a previous swing range, the indicator plots a horizontal **UT (Upper Target)** line — the projected equal move target.
* When price breaks **below** the previous swing range, it plots a **DT (Down Target)** line — the downside target.
* Each line is drawn from the breakout bar and extended to the right for a user-defined number of bars.
2. **Price labels**
* A small label “UT” or “DT” is shown at the end of the line with the exact target price.
* This makes it easy to see where the projected target is without checking the scale.
3. **Optional swing range (debug view)**
* There is an option to display the **swing range** that the target is based on (similar to a Donchian channel on previous bars).
* This shows the upper (swing high) and lower (swing low) boundaries the indicator used to define the last move.
---
**4. Key inputs (plain language)**
* **Swing window length (bars)**
How many bars back the indicator looks to find the last meaningful swing (highest high and lowest low).
This is like the length of a Donchian channel used to define the previous range.
Smaller values → more frequent, shorter targets.
Larger values → bigger swings and more distant targets.
* **Minimum move size (in ticks)**
This is a noise filter.
If the distance between the swing high and swing low is smaller than this threshold, no targets are drawn.
The indicator will only react to moves that are big enough to matter for your trading.
* **Breakout type: Close vs High/Low**
* **Breakout by Close**:
The target appears only when the **bar closes** above/below the swing range.
More conservative and fewer false signals.
* **Breakout by High/Low**:
The target appears as soon as the **high** or **low** of the bar breaks the swing range.
Faster and more aggressive, but more sensitive to noise.
* **Target line length (bars)**
How far to the right the UT/DT lines should be extended.
Shorter length → local target zones.
Longer length → important levels visible far into the future.
* **Appearance settings**
* Separate color, width and style for **UT** and **DT** lines.
* Option to show or hide labels with price and “UT/DT” text.
---
**5. How to use Target Shooter in trading**
> Important: this is **not** an entry signal indicator.
> Target Shooter is a **targeting and context tool**, not a standalone system.
Typical uses:
1. **Planning take-profit zones**
* You already have an entry signal from your own strategy (Wyckoff, Larry Williams patterns, levels, volume, whatever you use).
* Target Shooter shows a **logical equal move target** where the current wave can reasonably “shoot”.
* You can:
* place your main take-profit around the target,
* scale out part of the position,
* tighten stops when price approaches the target.
2. **Finding potential reaction / reversal areas**
* Equal move targets often act as **zones of interest**.
* If price reaches a UT/DT level and then shows weakness/absorption/volume spikes or reversal candles, this might be a good place to take profits or look for counter-trend opportunities (for experienced traders).
3. **Assessing trend strength**
* If price **easily exceeds** the equal move target and keeps going without any reaction, it suggests a very strong trend.
* If price **fails to reach** the target and reverses early, the move is weaker than expected.
---
**6. Timeframes**
Target Shooter can be used on:
* **Intraday** (M5, M15, M30, H1) — for shorter-term targets within the day,
* **Higher timeframes** (H4, D1 and above) — for swing and position trades.
General rule:
The **higher the timeframe and the larger the swing**, the **more important** the target level tends to be.
---
**7. Notes and limitations**
* The indicator does **not** predict the future.
It simply projects a geometric equal move from the last swing.
* It should be combined with your own trading framework:
* support/resistance,
* Wyckoff / VSA,
* trend tools,
* volume/flow, etc.
* Always keep proper risk management.
A target is a **scenario**, not a guarantee.
.
BPR (Ballanced price range) DetectorHow This BPR Detector Works
This indicator is designed to detect and visualize balanced price ranges (BPRs) on price charts. The indicator has two main components:
Regular FVG Detection - The indicator first detects regular Fair Value Gaps in price action, which are spaces where price has moved quickly leaving a gap. This is necessary because BPRs are derived from regular FVGs.
BPR Detection - When the price action inverts and moves through a regular FVG in the opposite direction, the indicator identifies this as a BPR. This concept is important in Inner Circle Trader (ICT) methodology as it can signal potential changes in trend direction. Additionally the detection logic is refined by incorporating displacement.
The main functionality preserved includes:
Detection of regular FVGs (required to find BPRs)
Conversion of regular FVGs to BPRs when price moves through them creating a FVG in the opposite direction
Visual display of both FVG and BPR zones
Mitigation tracking for both types of imbalances
Displacement visualization that helps identify energetic price moves
Key Settings
FVG Settings - Control the appearance and behaviour of regular Fair Value Gaps
BPR Settings - Control the appearance of Breaker Price Ranges (which have different colours by default)
Mitigation Settings - Define how the indicator determines when an imbalance has been filled
Displacement Settings - Optional highlighting of energetic price moves that may lead to imbalances
G-BOT ENGULFING CANDLE - FIXED SL & TP // Description:
This Pine Script strategy identifies bullish and bearish engulfing candle patterns over a defined lookback period and places trades based
on recent market highs and lows. It calculates stop loss and take profit levels using the Average True Range (ATR) multiplied by a user-defined factor, with the ability to adjust the risk-to-reward ratio for each trade.
Grok/Claude AI Neural Fusion Pro * Grok/Claude X SeriesGrok/Claude AI Neural Fusion Pro
This is a TradingView indicator that combines multiple technical analysis methods into a unified scoring system to identify trading opportunities. Despite the "Neural" and "AI" branding, it's not actually using machine learning — it's a sophisticated blend of traditional indicators weighted together to produce a single decision-aiding score.
Core Philosophy
The indicator attempts to answer the question: "How bullish or bearish is the current market environment, and when should I consider entering a trade?"
It does this by calculating a "GXS Score" (ranging from -1 to +1) that aggregates five different market dimensions: trend strength, momentum, volume, price structure, and price action quality. Each dimension contributes to the final score based on user-defined weights.
The Dynamic Bands System
Rather than using standard Bollinger Bands, this indicator creates adaptive bands that expand and contract based on market conditions. The bands are built around a midpoint calculated from Heikin Ashi candles (smoothed price bars that filter out noise), then extended outward using ATR (Average True Range) multiplied by a dynamic factor.
What makes these bands "dynamic" is that the multiplier adjusts based on two factors: the Chaikin Oscillator (which measures buying/selling pressure through accumulation/distribution) and ADX (trend strength). When there's strong directional pressure or a powerful trend, the bands widen to accommodate larger price swings. In quieter markets, they tighten.
The Five Scoring Components
The GXS Score is built from five weighted components:
ComponentDefault WeightWhat It MeasuresTrend Strength30%ADX direction and magnitude — is there a real trend, and which way?Momentum25%RSI, MACD, Stochastic, CCI, Rate of Change, plus divergence detectionVolume20%On-Balance Volume slope and whether volume confirms price movementPrice Structure15%Where price sits within the bands, plus volatility regimePrice Action10%Ratio of bullish vs bearish candles over recent bars
Trend Strength Component
This component only contributes to the score when ADX indicates a trending market (above the threshold, default 24). If DI+ exceeds DI-, the score tilts bullish; if DI- dominates, it tilts bearish. In ranging markets, this component essentially zeros out, preventing false trend signals during choppy conditions.
Momentum Component
This is the most complex component, combining six sub-indicators. RSI is normalized around the 50 level. MACD histogram is standardized against its own volatility. Stochastic and CCI contribute bonus points at extreme levels (oversold/overbought). Rate of Change adds directional bias for strong moves. Finally, divergence detection looks for situations where price makes new highs/lows but RSI doesn't confirm — a classic reversal warning.
Volume Component
The indicator tracks On-Balance Volume (a cumulative measure of buying vs selling pressure) and compares it to its moving average. When OBV is rising above its average during an uptrend, that's confirmation. The volume rate of change also contributes — surging volume adds conviction to signals.
Price Structure Component
This measures where the current price sits within the dynamic bands. If price is in the bottom 20% of the band range, that's bullish (potential bounce zone). If it's in the top 20%, that's bearish (potential resistance). The component also factors in volatility regime — low volatility environments get a slight bullish bias (breakouts tend to follow compression), while high volatility gets a bearish bias (exhaustion risk).
Price Action Component
A simple measure of recent candle character. If 70%+ of the last 10 candles were bullish (closed higher than they opened), the score tilts positive. Heavy bearish candle dominance tilts it negative.
Signal Generation
Buy and sell signals are generated when price touches or breaches the dynamic bands, but only if several filters pass:
ADX Filter (optional): Requires the market to be trending, avoiding signals in choppy conditions
RSI Filter (optional): For buys, RSI must be oversold (below 30); for sells, RSI must be overbought (above 70)
Cooldown Period: Prevents signal spam by requiring a minimum number of bars between signals (default 6)
The indicator also tracks "zones" based purely on the GXS Score. When the score exceeds the buy threshold (default 0.12) during a trending market, a green cloud appears between the bands. When it drops below the sell threshold (default -0.12), a red cloud appears. These zones indicate favorable conditions even without a specific band-touch signal.
Trend Strength Meter
Separate from the GXS Score, the indicator calculates a "Trend Strength" percentage (0-100%) displayed in the info table. This combines ADX strength (40% weight), slope consistency (30% — how steady is the price direction), volume alignment (20% — is volume confirming the move), and momentum agreement (10% — are multiple indicators pointing the same direction). This helps traders gauge how reliable the current trend is.
Visual Elements
The indicator provides multiple visual layers that can be toggled on or off:
Dynamic bands (blue midline, red upper, green lower)
Signal clouds between the bands when in buy/sell zones
Background shading indicating bullish (green) or bearish (red) regime
Triangle arrows at signal points with configurable sizes
Price labels showing exact entry prices at signals
ADX strength dots at the bottom (white = weak, orange = moderate, blue = strong)
Info table with current readings for all key metrics
Debug panel (optional) showing individual component scores
Summary
This is essentially a "committee voting" system where multiple technical indicators each cast votes on market direction, and those votes are weighted and summed into a single score. The dynamic bands provide context for where price is relative to recent volatility, while the various filters help avoid low-quality signals. It's designed for traders who want a synthesized view of market conditions rather than watching a dozen separate indicators.
Gap-Up Momentum Screener (S.S)
ENGLISH-VERSION
1) TradingView Gap Screener (for US stocks)
➤ Conditions
Gap-Up ≥ +3% (large gaps indicate institutional pressure)
Pre-market volume ≥ 150% of the 20-day average
RS line > 50
Price > 50 SMA
Market cap ≥ 1 billion USD
No penny stocks
2) Minervini Gap-Entry Strategy (Swing Trading)
This is a variant specifically optimized for gaps + momentum.
A) Setup Criteria
The stock must meet the following conditions:
Gap-Up ≥ +3%
First retracement ≤ 30% of the gap
High relative strength (RS line rising)
Volume on the gap day > 2× average
Price above 20 EMA, 50 SMA, 150 SMA, 200 SMA
No immediate resistance within 2–5%
B) Entry Setups
Entry 1: First Pullback Entry (FPE)
Wait for the first 1–3 day consolidation.
Entry → Breakout of the small range.
Stop → Below the low of the pullback.
Rule: No entry on the gap day itself.
Entry 2: High Tight Flag above the Gap
Stock rises > 10% after the gap
Then forms a 3–8 day sideways phase
Entry → Break above the flag’s high
Stop → Below the flag base
Entry 3: ORB Entry (Opening Range Breakout, 30 minutes)
Very effective for strong gaps.
Wait 30 minutes after the market opens
Entry → Break above the high of these first 30 minutes
Stop → Below the 30-minute low
C) Stop Levels
For FPE: 4–8%
For ORB: 1–2 × ATR(14)
For flags: 3–5%
D) Add Rules
Only if the stock continues showing strong volume:
Add on every new 3–5 day high
Add only above half-range levels
Maximum 3 adds
3) Early-Warning Module (Setup forming but not ready for entry)
This module marks stocks that are forming a setup but are not yet buyable.
➤ Criteria
Gap-Up ≥ 3%
Strong volume
Stock pulls back and consolidates (1–5 bars)
BUT no breakout yet
4) Exact Entry Checklist (Minervini-style, optimized for gaps)
Checklist before entry:
Gap ≥ +3%
20 EMA rising
Volume > 2× average
RS line rising
Price > 50 SMA
Pullback not deeper than 30% of the gap
3+ green signals from the Early-Warning diamonds
If all 7 are fulfilled → green light.
5) How to apply the strategy in daily practice
Morning (08:00–09:00)
Check the screener
Build your watchlist
Identify gaps
US Market Open (15:30)
Monitor the Early-Warning module
Sort gap momentum opportunities
16:00–17:00
Enter: First Pullback / ORB / Flag
Set stops
Determine position size based on risk
After 20:00
Check volume strength
If momentum fades → no more adds
SMB Master Hub Pro1 Bull Flag Strong uptrend, small consolidation, breakout above flag high
2 Range Breakout Consolidation range, breakout with volume
3 VWAP Reclaim Price crosses above VWAP after being below
4 EMA9 Bounce Price bounces off EMA9 in uptrend
5 Pre-market Gap Stock gaps up or down with momentum, looks for continuation
Smart Bottom Catcher @ Le DReversal strategy using recent lowest lows and a fast RSI. Long entries trigger on extreme drops, exits occur when RSI crosses a set threshold. Includes optional SMA55 filter and allows up to 3 pyramids.
Mustang Algo - Momentum Trend Zone Backtest🐎 MUSTANG ALGO - Momentum Trend Zone Strategy
A complete trading system combining MACD momentum analysis with visual trend zones, full backtesting capabilities, and advanced risk management tools.
══════════════════════════════════════════════════════════════════════════
🔹 OVERVIEW
Mustang Algo transforms traditional MACD analysis into a powerful visual trading system. It instantly identifies market bias through colored background zones and provides clear entry/exit signals with customizable stop loss and take profit management.
══════════════════════════════════════════════════════════════════════════
🔹 KEY FEATURES
✅ Visual Trend Zones (Green = Bullish | Red = Bearish)
✅ Clear Buy/Sell Triangles on Chart
✅ Full Backtesting Engine
✅ Multiple Stop Loss Types
✅ Multiple Take Profit Types
✅ Trailing Stop Option
✅ Time Filter for Backtesting
✅ Real-time Info Panel
✅ Customizable Alerts
══════════════════════════════════════════════════════════════════════════
🔹 HOW IT WORKS
The strategy uses a smoothed MACD system to detect trend changes:
- MACD Line (White): Fast EMA minus Slow EMA - shows raw momentum
- Signal Line (Yellow): EMA of MACD - shows smoothed trend direction
- Trend Zone: Changes when the smoothed signal line crosses zero
- Entry Signals: Generated at zone transitions
When the trend line crosses above zero → GREEN zone → BUY signal 🔺
When the trend line crosses below zero → RED zone → SELL signal 🔻
══════════════════════════════════════════════════════════════════════════
🔹 STOP LOSS OPTIONS
🛑 Percentage: Fixed percentage from entry price
🛑 ATR-Based: Dynamic SL based on market volatility
🛑 Fixed Points: Set number of points/pips
🛑 Swing Low/High: Uses recent swing levels as stops
══════════════════════════════════════════════════════════════════════════
🔹 TAKE PROFIT OPTIONS
🎯 Percentage: Fixed percentage target
🎯 ATR-Based: Dynamic TP based on volatility
🎯 Fixed Points: Set number of points/pips
🎯 Risk Reward: Automatic TP based on R:R ratio (e.g., 2:1, 3:1)
══════════════════════════════════════════════════════════════════════════
🔹 TRAILING STOP
📈 Percentage-Based: Trail by a fixed percentage
📈 ATR-Based: Trail using ATR multiplier for dynamic adjustment
══════════════════════════════════════════════════════════════════════════
🔹 SETTINGS
MACD Parameters:
- Fast Length (default: 12)
- Slow Length (default: 26)
- Signal Length (default: 9)
- Trend Smoothing (default: 5)
Risk Management:
- Enable/Disable Stop Loss
- Enable/Disable Take Profit
- Enable/Disable Trailing Stop
- Customize all SL/TP parameters
Visual Options:
- Show/Hide Buy/Sell Triangles
- Show/Hide SL/TP Lines
- Show/Hide Labels
Time Filter:
- Set Start Date for backtest
- Set End Date for backtest
══════════════════════════════════════════════════════════════════════════
🔹 SIGNALS EXPLAINED
🟢 GREEN TRIANGLE (Below Bar):
Bullish zone detected - Consider LONG entry
🔴 RED TRIANGLE (Above Bar):
Bearish zone detected - Consider SHORT entry
🟢 GREEN BACKGROUND:
Currently in bullish trend zone
🔴 RED BACKGROUND:
Currently in bearish trend zone
══════════════════════════════════════════════════════════════════════════
🔹 INFO PANEL
The real-time info panel (top right) displays:
- Current Trend Zone status
- MACD value
- Signal Line value
- Active SL Type
- Active TP Type
══════════════════════════════════════════════════════════════════════════
🔹 ALERTS
Set up alerts for:
🔔 Buy Signals: "🐎 Mustang Algo: BUY Signal on {ticker} at {price}"
🔔 Sell Signals: "🐎 Mustang Algo: SELL Signal on {ticker} at {price}"
══════════════════════════════════════════════════════════════════════════
🔹 BEST PRACTICES
1. Use higher timeframes (1H, 4H, Daily) for more reliable signals
2. Combine with price action and support/resistance levels
3. Adjust ATR multipliers based on asset volatility
4. Use Risk Reward ratio for consistent risk management
5. Backtest on your preferred asset before live trading
══════════════════════════════════════════════════════════════════════════
🔹 RECOMMENDED TIMEFRAMES
⏱️ Scalping: 5M, 15M (more signals, more noise)
⏱️ Day Trading: 1H, 4H (balanced signals)
⏱️ Swing Trading: Daily, Weekly (fewer but stronger signals)
══════════════════════════════════════════════════════════════════════════
🔹 MARKETS
Works on all markets:
📈 Forex
📈 Crypto
📈 Stocks
📈 Indices
📈 Commodities
📈 Futures
══════════════════════════════════════════════════════════════════════════
🐎 RIDE THE TREND WITH MUSTANG ALGO!
══════════════════════════════════════════════════════════════════════════
⚠️ DISCLAIMER
This indicator/strategy is for educational and informational purposes only. It is not financial advice. Trading involves substantial risk of loss and is not suitable for all investors. Past performance is not indicative of future results. Always use proper risk management, do your own research, and consider consulting a financial advisor before making any trading decisions. Use at your own risk.
══════════════════════════════════════════════════════════════════════════
📝 VERSION HISTORY
v1.0 - Initial Release
- MACD-based trend detection
- Visual trend zones
- Multiple SL/TP options
- Full backtesting support
- Trailing stop functionality
- Time filter
- Info panel
- Alert system
══════════════════════════════════════════════════════════════════════════
💬 FEEDBACK
If you find this strategy useful, please leave a comment or suggestion!
Your feedback helps improve future updates.
🐎 Happy Trading!
Grok/Claude MoneyLine Fusion * Grok/Claude X SeriesMoneyLine Fusion Indicator
This is a technical analysis indicator designed to help traders identify potential buy and sell opportunities in the market. It combines several well-known trading concepts into one unified tool, displaying visual bands on the chart and generating signals when multiple conditions align.
The Core Concept: The "Money Line"
At the heart of this indicator is something called the Money Line, which is essentially a smoothed trend line calculated using linear regression over the last 16 bars (by default). Think of it as a "best fit" line through recent prices that shows you the general direction the market is heading. The indicator colors this line green when the trend is rising, red when it's falling, and yellow when it's essentially flat or undecided.
The Dynamic Bands
Surrounding the Money Line are upper and lower bands that expand and contract based on market volatility. These bands use the ATR (Average True Range) to measure how much the price typically moves. Here's where it gets clever: the bands also factor in the ADX indicator (which measures trend strength). When the market is trending strongly, the bands widen more aggressively to account for bigger price swings. When the trend is weak, they stay tighter. This adaptive behavior helps the indicator adjust to different market conditions automatically.
The area between the bands is shaded in the trend color (green, red, or yellow) to give you a quick visual of the current market bias.
How Buy and Sell Signals Are Generated
The indicator doesn't just look at one thing — it requires multiple conditions to align before triggering a signal. This is designed to filter out false signals and only alert you when several factors agree.
Signal TypeRequired ConditionsBUYFisher Transform is below -2.0 (oversold), Aroon Up is low (below 20), Aroon Down is high (above 80), and optionally a positive TA ScoreSELLFisher Transform is above +2.0 (overbought), Aroon Up is high (above 80), Aroon Down is low (below 20), and optionally a negative TA Score
Fisher Transform is a mathematical technique that converts price data into a bell curve distribution, making extreme readings (overbought/oversold) easier to spot.
Aroon measures how long it's been since the highest high or lowest low. When Aroon Down is high and Aroon Up is low, it suggests recent price action has been dominated by lows — a potential reversal setup for a buy.
The indicator also prevents signal spam by requiring at least 5 bars between signals of the same type.
The TA Scoring System
Behind the scenes, the indicator calculates a composite score based on four different technical indicators:
MACD — Momentum and trend direction (scores -2 to +2)
DMI — Directional movement comparing buyers vs sellers (scores -2 to +2)
MFI — Money Flow Index, similar to RSI but incorporates volume (scores -2 to +2)
RSI — Classic overbought/oversold measure (scores -1 to +1)
These scores are added together, and the result is displayed in the info panel with labels like "very bullish," "slightly bearish," or "neutral." You can optionally require a minimum TA score before signals trigger, adding another layer of confirmation.
Visual Display Elements
The indicator offers several optional display features:
Shaded bands between upper and lower lines
Buy/Sell labels directly on the chart showing the entry price
Bright blue candle highlighting when a signal fires
Info panel in the corner showing the Money Line value, volatility percentile, RSI, and TA score
Score dots at the bottom of the chart (green for bullish, red for bearish, yellow for neutral)
Debug table for troubleshooting that shows real-time values of Fisher, Aroon, and signal conditions
In Summary
This indicator is essentially a multi-factor confirmation system. Rather than relying on a single indicator that might give many false signals, it waits until the trend direction (Money Line), momentum extremes (Fisher Transform), price cycle position (Aroon), and overall technical picture (TA Score) all point in the same direction. The adaptive bands help visualize where price "should" be trading given current volatility and trend strength. It's designed for traders who prefer fewer but higher-conviction signals.
4H Bias: Previous Candle FocusStructural Bias Confirmation Checklist
Has price broken a significant swing high/low on the 4HR?
Has price held beyond this level for at least one complete 4HR
candle?
Does the candle anatomy (OHLC vs OLHC pattern) confirm
directional intent?
Are subsequent 4HR candles showing continued momentum in
the bias direction?
Has a liquidity sweep occurred into the previous structure before
the continuation?
Session Markers - JDK AnalysisSession Markers is a tool designed to study how markets behave during specific, recurring time windows. Many traders know that price behaves differently depending on the day of the week, the time of the day, or particular market sessions such as the weekly open, the London session, or the New York open. This indicator makes those recurring windows visible on the chart and then analyzes what price typically does inside them. The result is a clear statistical understanding of how a chosen session behaves, both in direction and in strength.
The script works by allowing the trader to define any time window using a start day and time and an end day and time. Every time this window occurs on the chart, the indicator highlights it with a full-height vertical band. These visual markers reveal patterns that are otherwise difficult to detect manually, such as whether certain sessions tend to trend, reverse, consolidate, or create large imbalances. They also help the trader quickly scan through historical price action to see how the market has behaved under similar conditions.
For every completed session window, the indicator measures how much price changed from the moment the window began to the moment it ended. Instead of using raw price differences, it converts these changes into percentage moves. This makes the measurement consistent across different price ranges and market regimes. A one-percent move always has the same meaning, whether the asset is trading at 100 or 50,000. These percentage moves are collected for a user-selected number of past sessions, creating a dataset of how the market has behaved in the chosen time window.
Based on this dataset, the indicator generates several statistics. It counts how many past sessions closed higher and how many closed lower, producing a directional tendency. It also computes the probability of an upward session by dividing the number of positive sessions by the total. More importantly, it calculates the average percentage movement for all sessions in the lookback period. This average move reflects not just the direction but also the magnitude of price changes. A session with frequent small upward moves but occasional large downward moves will show a negative average movement, even if more sessions ended positive. This creates a more realistic representation of true market behavior.
Using this average movement, the script determines a “Bias” for the session. If the average percentage move is positive, the bias is considered bullish. If it is negative, the bias is bearish. If the values are very close to zero, the bias is neutral. This way, the indicator takes both frequency and impact into account, producing a magnitude-aware assessment instead of one that only counts wins and losses. A sequence such as +5%, –1% results in a bullish bias because the overall impact is strongly positive. On the other hand, a series of small gains followed by a large drop produces a bearish bias even if more sessions ended positive, because the large move dominates the average. This provides a far more truthful picture of what the market tends to do during the chosen window.
All relevant statistics are displayed neatly in a small panel in the top-right corner of the chart. The panel updates in real time as new sessions complete and older ones fall out of the lookback range. It shows how many sessions were analyzed, how many ended up or down, the probability of an upward move, the average percentage change, and the final bias. The background color of the panel instantly reflects that bias, making it easy to interpret at a glance.
To use the tool effectively, the trader simply needs to define a time window of interest. This could be something like the weekly opening window from Sunday to Monday, the London open each day, or even a unique custom window. After selecting how many past sessions to analyze, the indicator takes care of the rest. The vertical session markers reveal the structure visually. The statistics summarize the historical behavior objectively. The magnitude-weighted bias provides a realistic indication of whether the window tends to produce upward or downward movement on average.
Session Markers is helpful because it translates repeated market timing behavior into measurable data. It exposes hidden tendencies that are easy to feel intuitively but hard to quantify manually. By analyzing both direction and magnitude, it prevents misleading interpretations that can arise from looking only at win rates. It helps traders understand whether a session typically produces meaningful moves or just small noise, whether it tends to trend or reverse, and whether its behavior has recently changed. Whether used for bias building, session filtering, or deeper market research, it offers a structured framework for understanding the market through time-based patterns.






















