Major S/R Levels Filtered v.1 BETA
This indicator automatically identifies and plots major support and resistance (S/R) levels on your chart based on swing highs and swing lows across multiple timeframes. It also intelligently merges nearby levels to avoid clutter and displays price labels to the right of the levels.
Features:
Detects monthly, weekly, and daily swing highs and lows.
Merges nearby levels automatically based on a customizable minimum distance (%), producing cleaner and more meaningful S/R zones.
Daily levels can be filtered by the number of touches to ensure significance.
Lines are drawn fully extended to the right, providing a clear view of historical S/R.
Price labels are displayed to the right of each level, stacked to prevent overlapping. Labels include the timeframe and price, with customizable text templates.
Transparent label backgrounds improve visibility without cluttering the chart.
Customizable parameters: pivot length, minimum touches, label offset, minimum distance for merging, and label text template.
Usage:
Select which timeframes to display: Monthly, Weekly, Daily.
Adjust pivot length and filter settings to match your trading style.
Observe merged S/R levels with clearly labeled prices on the right side of the chart.
This indicator is perfect for traders who want a clean, historical S/R framework for intraday, swing, and long-term analysis.
Motifs graphiques
Futures Sizing Calculator (Greg.Trading)📐 Futures Sizing Calculator
by Greg.Trading
🔍 Overview
The Futures Sizing Calculator is a visual risk-management tool built for futures traders who demand precision.
It allows you to define your entry, stop-loss, and maximum dollar risk, then instantly calculates optimal contract sizing—directly on the chart.
No spreadsheets. No mental math. Just clear, actionable risk data.
🎯 What This Indicator Does
This indicator combines trade visualization with dynamic position sizing:
✔ Draws Entry and Stop-Loss levels on the chart
✔ Highlights the risk area between entry and stop
✔ Automatically detects LONG or SHORT direction
✔ Calculates stop distance in points
✔ Determines contract size for multiple futures
✔ Displays exact dollar risk per contract size
✔ Updates instantly as prices change
📊 Supported Contracts
The calculator currently supports the most commonly traded CME micro futures:
MNQ – Micro Nasdaq
MES – Micro S&P 500
MGC – Micro Gold
Each contract is calculated using its true point value for accurate risk sizing.
🧮 How the Calculations Work (Conceptually)
The script uses a fixed-risk position sizing model, commonly used by professional traders:
1️⃣ You define a maximum dollar risk per trade
2️⃣ The script measures the distance between Entry and Stop
3️⃣ That distance is multiplied by each contract’s point value
4️⃣ Contract size is calculated to stay within your risk limit
You are shown two sizing options:
Conservative → rounded down (risk stays below limit)
Aggressive → rounded up (risk slightly exceeds limit)
This lets you choose the exposure that best fits your trading plan.
🧭 Visual Trade Mapping
To improve clarity and execution speed, the indicator provides:
🟩 Green / Red dotted lines for Entry and Stop
📦 A transparent risk box between those levels
🔁 A centered LONG or SHORT label inside the risk area
📌 A floating panel displaying all sizing calculations
Everything is placed where your eyes already are—on the chart.
⚙️ How to Use
Add the indicator to any futures chart
Set your Account Size and Risk Amount
Enter your Entry price
Enter your Stop-Loss price
Review:
Trade direction
Risk box
Contract sizing panel
Adjust entry or stop at any time and the calculations update instantly.
⭐ Why This Indicator Is Different
Unlike basic sizing calculators or static tools, this indicator:
✅ Is fully chart-based
✅ Shows real dollar risk, not estimates
✅ Supports multiple contracts at once
✅ Combines numbers with visual confirmation
✅ Is built for live execution and planning
It’s designed to be used during real trades, not just before them.
⚠️ Important Notes
• This is a risk-management tool, not a trading strategy
• It does not generate buy or sell signals
• Always confirm calculations align with your broker’s specifications
BK AK-King Quazi🦁👑 BK AK–KING QUAZI — MEASURED HAND, CLEAN BLADE. 👑🦁
All glory to Gd — the true source of wisdom, restraint, and endurance.
AK is honor — my mentor’s standard: clarity, patience, no shortcuts, no gambling.
Update / Record: A previous version of this publication was hidden by PineCoders moderation due to insufficient description. This republish includes a fully self-contained explanation of what the script does, how it works, and how to use it.
1) What this script does (outputs)
BK AK–King Quazi is a Quasimodo (QM) structure manager that turns the pattern into a permissioned process:
PROTO → BOS proof → RETEST → CONFIRM → resolve or invalidate
On-chart you get:
Stage labels: P↑ / P↓ (PROTO), R↑ / R↓ (RETEST), C↑ / C↓ (CONFIRM), X (INVALIDATED), ✓ (TARGET HIT)
Execution map lines: QM, BOS, INV (invalidation)
Optional projection extension forward (QM/BOS/INV + optional T1/T2)
Optional entry zone around QM (ATR buffer)
MTF “War Room” table: 5 timeframes showing STATE and NOW (recent events)
This is not a “pattern sticker.” It’s a workflow + object lifecycle so outcomes are visible and charts stay clean.
2) Definitions (what each stage means)
PROTO (P): “Sweep + BOS candidate.” Early awareness that a QM setup is forming.
BOS (Break of Structure): requires a body displacement vs ATR (proof filter).
RETEST (R): price returns to the QM level and holds it (permission test).
CONFIRM (C): full QM geometry is complete (structure + proof + timing aligned).
INV: invalidation level. If breached, the pattern is failed and marked X.
Targets: optional T1/T2 mapped from selected target mode.
3) How it works (actual logic in plain English)
A) Swing engine (how structure is built)
The script uses a ZigZag-style swing detector based on lookbacks:
A “to_up” swing trigger occurs when high reaches the highest high over zz_len
A “to_down” swing trigger occurs when low reaches the lowest low over zz_len
Trend flips on those triggers and the script stores the last 3 swing points:
Highs: h2 → h1 → h0
Lows: l2 → l1 → l0
This creates repeatable swing structure without manual drawing.
B) BOS displacement filter (proof of intent)
A BOS is only accepted if the candle body displacement is large enough:
Displacement condition: abs(close - open) ≥ disp_used * ATR(atr_len)
disp_used can be:
Manual, or
Auto (TF Map), or
Auto (ATR%)
This is the “no wick theater” filter.
C) PROTO detection (sweep + BOS)
Bull PROTO fires when:
structure suggests a sweep (higher swing high behavior) and
price sweeps below a prior swing low, then BOS closes above h1 with displacement
Bear PROTO is the mirror:
sweep above a prior swing high, then BOS closes below l1 with displacement
On PROTO, the script defines the key levels:
Bull: QM = l1, BOS = h1, INV = current low
Bear: QM = h1, BOS = l1, INV = current high
D) RETEST + CONFIRM
RETEST checks the return to QM with a hold:
Bull retest: low ≤ QM and close ≥ QM
Bear retest: high ≥ QM and close ≤ QM
CONFIRM triggers only when the full swing sequence meets the “QM complete” rules (the script’s bu_conf / be_conf conditions).
E) Targets / projection math (if enabled)
Targets are optional:
Measured (1.0 / 1.618): uses the distance |BOS − QM| times multipliers
BOS + prior swing: uses BOS + prior swing extreme
Neck→Head (H&S projection): projects neck/head distance from BOS
F) Object lifecycle (keeps chart honest and readable)
If opposite PROTO appears, you can:
do nothing, or
clear projections, or
mark X + clear the prior campaign
On invalidation, the script replaces the existing P/C label with X (no overlapping junk)
On target hit, it can resolve the campaign and optionally remove projections/tags
4) MTF War Room (what the table means)
The table shows 5 user-selectable timeframes (TF1–TF5) with:
STATE: current posture on that TF (P↑, C↑, P↓, C↓, —)
NOW: highlights recent PROTO/CONFIRM events on that TF
Implementation note (what’s original here):
It computes zigzag + displacement inside each TF context
“NOW” flash timing is measured in that TF (not chart TF)
It packs NOW + RECENT + STAGE into one request.security() call per TF (performance-aware)
5) How to use it (clean execution workflow)
Suggested workflow (AK standard):
Use MTF first: don’t fight higher court structure
Treat PROTO as awareness, not permission
Require BOS displacement (proof)
Execute only on RETEST of QM or on your CONFIRM rules
Stop is INV (if INV breaks, mark X and stand down)
Use mapped T1/T2 for planning + resolution (no improvising mid-trade)
Label key:
P = Proto (sweep + BOS)
R = Retest (QM hold)
C = Confirm (full QM)
X = Invalidated (broke INV)
✓ = Target hit (T1/T2 resolution)
6) What’s original (why it’s not “another QM clone”)
Quasimodo is public. The originality here is the system around it:
staged sequencing (PROTO → BOS proof → RETEST → CONFIRM) instead of “shape = signal”
ATR displacement proof filter to cut fake BOS
standardized level mapping (QM/BOS/INV + targets + entry zone)
object lifecycle management (replace labels with X, clear/gray projections, remove on target)
MTF packed engine (one call per TF; “NOW” measured on that TF)
controlled alert routing by event type (PROTO vs CONFIRM)
7) Limitations (important)
This is bar-based structure logic; it can change during an unclosed realtime candle.
ZigZag swings are lookback-based, not a broker “official” swing definition.
It’s a structure/permission tool, not a guarantee engine.
🧑🏫 BK / AK / Faith
BK is the mark I’m building.
AK is honor — discipline, patience, clean execution.
All glory to Gd — the true source of wisdom and endurance.
🗡️ King David Lens (Deep — Discipline Under Fire)
David’s power wasn’t impulse. It was governed force — strength that answers to law.
He learned early that the most dangerous trap is moving before you’re sent.
That’s why his life is full of the same pattern traders ignore:
He was anointed long before he was crowned.
Meaning: truth can be real before it’s allowed to manifest.
He fought Goliath with a weapon people mocked — not because it was flashy, but because it was mastered.
Meaning: edge isn’t what looks impressive — it’s what’s trained and repeatable.
He had Saul in his hands and still refused the shortcut.
Meaning: opportunity is not permission; proximity is not assignment.
He waited through wilderness seasons where nothing “looked like progress.”
Meaning: silence isn’t rejection — sometimes it’s preparation.
That is the trader’s war.
Price will always offer motion.
But motion without permission is bait.
David didn’t survive by chasing what was available.
He survived by waiting until the moment was proved, the ground was chosen, and the strike was clean.
That’s what King Quazi enforces:
PROTO is the rumor.
BOS displacement is the proof.
Retest is the test of legitimacy.
Confirm is permission to strike.
Invalidation is humility — stand down immediately.
A lion doesn’t chase every shadow.
A lion waits until the prey is committed — then ends it.
🦁👑 BK AK–KING QUAZI — execute with proof. 👑🦁
Gd bless. 🙏
Fibonacci Stochastic + HMA + EMA Fibonacci Stochastic + HMA + EMA
This indicator is designed to help identify trends and entry timing by combining three main indicators.
It filters out false signals and increases the accuracy of decision-making.
Key Components of the Indicator:
Hull Moving Average (HMA)
Shows the main price trend.
Green = Uptrend
Red = Downtrend
Used to confirm that the trade is following the market direction (Trend Following).
Fibonacci Stochastic
Measures the buying and selling pressure of the market.
Uses Fibonacci levels:
0.236 / 0.382 / 0.5 / 0.618 / 0.786
The system will interpret this as a Bullish/Bearish signal.
Used to find "entry points," not to predict highs or lows.
Display Results:
Green candlestick → Buy momentum
Red candlestick → Sell momentum
EMA Short/Long (Multi-Timeframe)
Uses EMA values from a smaller timeframe (e.g., 1 minute).
Compares short-term and long-term EMAs.
Used to confirm trend strength and short-term reversals.
EMA values are hidden by default for a cleaner chart.
Signal Conditions
BUY Signal
The system will give a BUY signal when:
The HMA trend is upward.
The short-term EMA is above the EMA average.
The Stochastic is in the bullish zone.
Display:
The word BUY is below the candlestick.
SELL Signal
The system will give a SELL signal when:
The HMA trend is downward.
The short-term EMA is below the EMA average.
The Stochastic is in the bearish zone.
Display:
The word SELL is above the candlestick.
Recommended Usage Approach
Suitable Timeframe
Scalping: 1m – 5m
Intraday: 5m – 15m
Trend Trade: 15m – 1h
Notes
Should be used in conjunction with:
Support / Resistance
Price Action
Risk Management
Magnitude of MovementThie calculase the ratio between Mod of Open Price-Current Price and Mod of Open Volume and current volume
Chip Distribution Pro// This source code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org
// Enhanced Position Cost Distribution - Auto-adaptive with improved visualization
// Works with ETFs, commodities, forex, crypto, stocks - any instrument
// @version=5
indicator('Chip Distribution Pro', overlay = true, max_lines_count = 500, max_bars_back = 500)
//#region Inputs
string GRP_GENERAL = "General Settings"
int LOOKBACK = input.int(1000, 'Lookback Bars', maxval = 20000, minval = 500, step = 250, group = GRP_GENERAL)
int CHART_X_OFFSET = input.int(100, 'Chart Offset', step = 10, group = GRP_GENERAL)
int LABEL_X_OFFSET = CHART_X_OFFSET + 4
int CHART_MAX_WIDTH = input.int(80, 'Max Width', maxval = 500, minval = 10, step = 10, group = GRP_GENERAL)
int NUM_BUCKETS = input.int(400, 'Price Buckets', maxval = 500, minval = 50, step = 50, group = GRP_GENERAL)
string GRP_AUTO = "Auto-Tuning"
bool AUTO_TUNE = input.bool(true, 'Enable Auto-Tuning', group = GRP_AUTO,
tooltip = 'Automatically adjusts turnover rate based on volatility and volume characteristics')
float MANUAL_DECAY = input.float(0.1, 'Manual Turnover Rate', minval = 0.01, maxval = 0.5, step = 0.01, group = GRP_AUTO,
tooltip = 'Only used when Auto-Tuning is disabled')
int VOLATILITY_PERIOD = input.int(20, 'Volatility Period', minval = 5, maxval = 100, group = GRP_AUTO)
string GRP_VISUAL = "Visualization"
string COLOR_SCHEME = input.string("Rainbow", "Color Scheme", options = , group = GRP_VISUAL)
color PROFIT_COLOR_LIGHT = input.color(#26a69a, 'Profit Light', group = GRP_VISUAL)
color PROFIT_COLOR_DARK = input.color(#004d40, 'Profit Dark', group = GRP_VISUAL)
color LOSS_COLOR_LIGHT = input.color(#ef5350, 'Loss Light', group = GRP_VISUAL)
color LOSS_COLOR_DARK = input.color(#b71c1c, 'Loss Dark', group = GRP_VISUAL)
color CURRENT_PRICE_COLOR = input.color(color.yellow, 'Current Price', group = GRP_VISUAL)
color AVG_PRICE_COLOR = input.color(#2196F3, 'Average Cost', group = GRP_VISUAL)
color PEAK_COLOR = input.color(#FF9800, 'Peak Concentration', group = GRP_VISUAL)
color STATS_COLOR = input.color(#434651, 'Stats Background', group = GRP_VISUAL)
string GRP_LEVELS = "Key Levels"
bool SHOW_SUPPORT_RESISTANCE = input.bool(true, 'Show Support/Resistance Zones', group = GRP_LEVELS)
bool SHOW_PEAK = input.bool(true, 'Show Peak Concentration', group = GRP_LEVELS)
float SR_THRESHOLD = input.float(0.7, 'S/R Detection Threshold', minval = 0.3, maxval = 0.95, step = 0.05, group = GRP_LEVELS,
tooltip = 'Minimum concentration (relative to peak) to mark as support/resistance')
string GRP_SIGNALS = "Signals Panel"
bool SHOW_SIGNALS = input.bool(true, 'Show Signal Panel', group = GRP_SIGNALS)
bool SHOW_KEY_LEVELS = input.bool(true, 'Show Key Price Levels', group = GRP_SIGNALS)
bool SHOW_TREND_ARROW = input.bool(true, 'Show Trend Arrow', group = GRP_SIGNALS)
bool SHOW_PRESSURE_BAR = input.bool(true, 'Show Pressure Bar', group = GRP_SIGNALS)
// Colors for key levels
color SUPPORT_COLOR = input.color(#00E676, 'Support Level', group = GRP_LEVELS)
color RESISTANCE_COLOR = input.color(#FF5252, 'Resistance Level', group = GRP_LEVELS)
color BREAKOUT_COLOR = input.color(#FFD600, 'Breakout Level', group = GRP_LEVELS)
//#endregion
//#region Candle Type
type Candle
int idx
float hi
float lo
float vol
float relativeVol
float atrPct
//#endregion
//#region PCD Type
type PCD
array candles
float minPrice
float maxPrice
float priceStep
array lines
label currentPriceLabel
label avgPriceLabel
label peakLabel
label statsLabel
label signalLabel
array srZones
float calculatedTurnover
// New visualization elements
line supportLine
line resistanceLine
line avgCostLine
label trendArrow
box pressureBar
box pressureFill
label pressureLabel
// Create a new price label
newPriceLabel(color bg, color txtColor) =>
label.new(0, 0, '', style = label.style_label_left, color = bg, textcolor = txtColor, size = size.small)
// Create a new PCD instance
newPCD() =>
array lns = array.new(NUM_BUCKETS)
for i = 0 to NUM_BUCKETS - 1
array.set(lns, i, line.new(0, 0, 0, 0))
PCD.new(
candles = array.new(0),
lines = lns,
currentPriceLabel = newPriceLabel(color.new(#00BCD4, 0), color.white),
avgPriceLabel = newPriceLabel(AVG_PRICE_COLOR, color.white),
peakLabel = newPriceLabel(PEAK_COLOR, color.white),
statsLabel = label.new(0, 0, '', style = label.style_label_up, size = size.small,
textalign = text.align_left, color = color.new(STATS_COLOR, 20), textcolor = color.white),
signalLabel = label.new(0, 0, '', style = label.style_label_left, size = size.small,
textalign = text.align_left, color = color.new(#1a1a2e, 20), textcolor = color.white),
srZones = array.new(0),
calculatedTurnover = 0.1,
minPrice = na,
maxPrice = na,
priceStep = na,
supportLine = line.new(0, 0, 0, 0, color = SUPPORT_COLOR, width = 2, style = line.style_dashed),
resistanceLine = line.new(0, 0, 0, 0, color = RESISTANCE_COLOR, width = 2, style = line.style_dashed),
avgCostLine = line.new(0, 0, 0, 0, color = AVG_PRICE_COLOR, width = 2, style = line.style_dotted),
trendArrow = label.new(0, 0, '', style = label.style_label_center, size = size.large, textcolor = color.white),
pressureBar = box.new(0, 0, 0, 0, bgcolor = color.new(#424242, 50), border_color = color.gray),
pressureFill = box.new(0, 0, 0, 0, bgcolor = color.green, border_color = na),
pressureLabel = label.new(0, 0, '', style = label.style_label_right, size = size.tiny, color = color.new(#000000, 100), textcolor = color.white))
// Auto-calculate turnover rate based on instrument characteristics
calcAdaptiveTurnover(float atrPct, float volRatio) =>
float safeAtrPct = na(atrPct) or atrPct <= 0 ? 0.02 : atrPct
float safeVolRatio = na(volRatio) or volRatio <= 0 ? 1.0 : volRatio
float volBasedTurnover = math.max(0.03, math.min(0.3, safeAtrPct * 3))
float volAdjustment = math.max(0.5, math.min(2.0, safeVolRatio))
float turnover = volBasedTurnover * volAdjustment
math.max(0.02, math.min(0.4, turnover))
// Store candle method
method storeCandle(PCD this, int barIdx, float hiPrice, float loPrice, float volVal, float avgVol, float atrPct) =>
if not na(hiPrice) and not na(loPrice) and not na(volVal) and volVal > 0
float safeAvgVol = na(avgVol) or avgVol <= 0 ? volVal : avgVol
float relVol = volVal / safeAvgVol
float safeAtrPct = na(atrPct) ? 0.02 : atrPct
bool modified = false
int candleSize = array.size(this.candles)
if candleSize > 0
Candle c = array.get(this.candles, candleSize - 1)
if c.idx == barIdx
c.hi := hiPrice
c.lo := loPrice
c.vol := volVal
c.relativeVol := relVol
c.atrPct := safeAtrPct
modified := true
if not modified
Candle c = Candle.new(barIdx, hiPrice, loPrice, volVal, relVol, safeAtrPct)
array.push(this.candles, c)
this.minPrice := na(this.minPrice) ? loPrice : math.min(this.minPrice, loPrice)
this.maxPrice := na(this.maxPrice) ? hiPrice : math.max(this.maxPrice, hiPrice)
float priceRange = this.maxPrice - this.minPrice
this.priceStep := priceRange > 0 ? priceRange / NUM_BUCKETS : 0.0001
// Get bucket index for price
method getBucketIndex(PCD this, float price) =>
if na(this.priceStep) or this.priceStep <= 0 or na(this.minPrice)
0
else
int idx = int(math.floor((price - this.minPrice) / this.priceStep))
math.max(0, math.min(idx, NUM_BUCKETS - 1))
// Get price for bucket index
method getBucketedPrice(PCD this, int bucketIdx) =>
int safeIndex = math.max(0, math.min(bucketIdx, NUM_BUCKETS - 1))
float safeStep = na(this.priceStep) or this.priceStep <= 0 ? 0.0001 : this.priceStep
float safeMin = na(this.minPrice) ? 0.0 : this.minPrice
(safeIndex + 0.5) * safeStep + safeMin
// Get rainbow color based on position (0.0 = bottom/red, 1.0 = top/violet)
getRainbowColor(float position, float intensityRatio) =>
float pos = math.max(0.0, math.min(1.0, position))
int transparency = int(math.round((1.0 - intensityRatio) * 50))
// Rainbow spectrum: red -> orange -> yellow -> green -> cyan -> blue -> violet
if pos < 0.166
color.new(color.from_gradient(pos, 0.0, 0.166, #FF0000, #FF7F00), transparency)
else if pos < 0.333
color.new(color.from_gradient(pos, 0.166, 0.333, #FF7F00, #FFFF00), transparency)
else if pos < 0.5
color.new(color.from_gradient(pos, 0.333, 0.5, #FFFF00, #00FF00), transparency)
else if pos < 0.666
color.new(color.from_gradient(pos, 0.5, 0.666, #00FF00, #00FFFF), transparency)
else if pos < 0.833
color.new(color.from_gradient(pos, 0.666, 0.833, #00FFFF, #0000FF), transparency)
else
color.new(color.from_gradient(pos, 0.833, 1.0, #0000FF, #8B00FF), transparency)
// Get color based on scheme and intensity
getColor(bool isProfitable, float intensity, float maxIntensity, int bucketIdx) =>
float safeMax = maxIntensity > 0 ? maxIntensity : 1.0
float ratio = math.max(0.0, math.min(1.0, intensity / safeMax))
float positionRatio = bucketIdx / math.max(1.0, NUM_BUCKETS - 1.0)
if COLOR_SCHEME == "Rainbow"
getRainbowColor(positionRatio, ratio)
else if COLOR_SCHEME == "Gradient"
if isProfitable
color.from_gradient(ratio, 0.0, 1.0, PROFIT_COLOR_DARK, PROFIT_COLOR_LIGHT)
else
color.from_gradient(ratio, 0.0, 1.0, LOSS_COLOR_DARK, LOSS_COLOR_LIGHT)
else if COLOR_SCHEME == "Heatmap"
color.from_gradient(ratio, 0.0, 1.0, #1a237e, #f44336)
else
if isProfitable
color.new(#5d606b, int(math.round((1.0 - ratio) * 70)))
else
color.new(#e91e63, int(math.round((1.0 - ratio) * 70)))
// Update method
method update(PCD this) =>
int candleCount = array.size(this.candles)
if candleCount > 0 and not na(this.priceStep) and this.priceStep > 0
// Create distribution array
array dist = array.new_float(NUM_BUCKETS, 0.0)
// Process each candle
for candleIdx = 0 to candleCount - 1
Candle candle = array.get(this.candles, candleIdx)
bool isFirstCandle = candleIdx == 0
float turnover = AUTO_TUNE ? calcAdaptiveTurnover(candle.atrPct, candle.relativeVol) : MANUAL_DECAY * candle.relativeVol
turnover := math.min(turnover, 0.95)
this.calculatedTurnover := turnover
int startIdx = this.getBucketIndex(candle.lo)
int endIdx = this.getBucketIndex(candle.hi)
int buckets = math.max(1, endIdx - startIdx + 1)
if isFirstCandle
float initialWeight = 1.0 / buckets
for i = startIdx to endIdx
array.set(dist, i, initialWeight)
else
float decayedAmount = 0.0
for i = 0 to NUM_BUCKETS - 1
float oldVal = array.get(dist, i)
float newVal = oldVal * (1.0 - turnover)
array.set(dist, i, newVal)
decayedAmount += oldVal - newVal
float addPerBucket = decayedAmount / buckets
for i = startIdx to endIdx
array.set(dist, i, array.get(dist, i) + addPerBucket)
// Normalize distribution
float totalWeight = 0.0
for i = 0 to NUM_BUCKETS - 1
totalWeight += array.get(dist, i)
if totalWeight > 0
for i = 0 to NUM_BUCKETS - 1
array.set(dist, i, array.get(dist, i) / totalWeight)
// Find peak
float maxWeight = array.max(dist)
if na(maxWeight) or maxWeight <= 0
maxWeight := 0.001
int peakIndex = array.indexof(dist, maxWeight)
if peakIndex < 0
peakIndex := 0
float peakPrice = this.getBucketedPrice(peakIndex)
// Find support/resistance zones
array srIndices = array.new(0)
if SHOW_SUPPORT_RESISTANCE
bool inZone = false
int zoneStart = 0
for i = 0 to NUM_BUCKETS - 1
bool isHighConcentration = array.get(dist, i) >= maxWeight * SR_THRESHOLD
if isHighConcentration and not inZone
inZone := true
zoneStart := i
else if not isHighConcentration and inZone
inZone := false
array.push(srIndices, int(math.floor((zoneStart + i) / 2)))
if inZone
array.push(srIndices, int(math.floor((zoneStart + NUM_BUCKETS - 1) / 2)))
// Clear old SR zones
int srZoneSize = array.size(this.srZones)
if srZoneSize > 0
for i = 0 to srZoneSize - 1
box b = array.get(this.srZones, i)
box.set_lefttop(b, 0, 0)
box.set_rightbottom(b, 0, 0)
// Draw the distribution
float lowestDisplayedPrice = na
float highestDisplayedPrice = na
for i = 0 to NUM_BUCKETS - 1
float weight = array.get(dist, i)
float price = (i + 0.5) * this.priceStep + this.minPrice
int width = int(math.round(weight / maxWeight * CHART_MAX_WIDTH))
line ln = array.get(this.lines, i)
if width > 0
if na(lowestDisplayedPrice)
lowestDisplayedPrice := price
highestDisplayedPrice := price
int x1 = bar_index + CHART_X_OFFSET
int x2 = x1 - width
bool isProfitable = price < close
color c = getColor(isProfitable, weight, maxWeight, i)
line.set_xy1(ln, x1, price)
line.set_xy2(ln, x2, price)
line.set_color(ln, c)
else
line.set_xy1(ln, 0, 0)
line.set_xy2(ln, 0, 0)
// Draw S/R zones
if SHOW_SUPPORT_RESISTANCE
int srCount = array.size(srIndices)
int leftBar = math.max(0, bar_index - LOOKBACK)
if srCount > 0
for i = 0 to srCount - 1
int idx = array.get(srIndices, i)
float zonePrice = this.getBucketedPrice(idx)
float zoneHalfHeight = this.priceStep * 3
box b = na
if i < array.size(this.srZones)
b := array.get(this.srZones, i)
box.set_lefttop(b, leftBar, zonePrice + zoneHalfHeight)
box.set_rightbottom(b, bar_index, zonePrice - zoneHalfHeight)
else
b := box.new(leftBar, zonePrice + zoneHalfHeight, bar_index, zonePrice - zoneHalfHeight, bgcolor = color.new(PEAK_COLOR, 85), border_color = color.new(PEAK_COLOR, 60))
array.push(this.srZones, b)
// Calculate cumulative distribution
array cumdist = array.copy(dist)
for i = 1 to NUM_BUCKETS - 1
array.set(cumdist, i, array.get(cumdist, i - 1) + array.get(cumdist, i))
// Highlight current price
int closeIndex = this.getBucketIndex(close)
if closeIndex >= 0 and closeIndex < NUM_BUCKETS
line.set_color(array.get(this.lines, closeIndex), CURRENT_PRICE_COLOR)
// Calculate stats
float totalShares = array.get(cumdist, NUM_BUCKETS - 1)
int profitIndex = math.min(closeIndex + 1, NUM_BUCKETS - 1)
float profitRatio = totalShares > 0 ? array.get(cumdist, profitIndex) / totalShares : 0.0
// Calculate average price
float avg = 0.0
for i = 0 to NUM_BUCKETS - 1
float weight = array.get(dist, i)
float price = this.getBucketedPrice(i)
avg += price * weight
int avgIndex = this.getBucketIndex(avg)
if avgIndex >= 0 and avgIndex < NUM_BUCKETS
line.set_color(array.get(this.lines, avgIndex), AVG_PRICE_COLOR)
// Peak concentration - highlight line
if SHOW_PEAK and peakIndex >= 0 and peakIndex < NUM_BUCKETS
line.set_color(array.get(this.lines, peakIndex), PEAK_COLOR)
// Smart label positioning - avoid overlaps
float priceRange = na(highestDisplayedPrice) or na(lowestDisplayedPrice) ? close * 0.01 : (highestDisplayedPrice - lowestDisplayedPrice)
float minLabelSpacing = priceRange * 0.025
// Sort prices and assign staggered X offsets
float currentY = close
float avgY = avg
float peakY = peakPrice
// Adjust avg label if too close to current
if math.abs(avgY - currentY) < minLabelSpacing
avgY := currentY > avgY ? avgY - minLabelSpacing : avgY + minLabelSpacing
// Adjust peak label if too close to current or avg
if SHOW_PEAK
if math.abs(peakY - currentY) < minLabelSpacing
peakY := currentY > peakY ? peakY - minLabelSpacing : peakY + minLabelSpacing
if math.abs(peakY - avgY) < minLabelSpacing
peakY := avgY > peakY ? peakY - minLabelSpacing : peakY + minLabelSpacing
// Position price labels - compact format, right side of distribution
label.set_text(this.currentPriceLabel, str.format('{0,number,#.##}', close))
label.set_xy(this.currentPriceLabel, bar_index + LABEL_X_OFFSET + 2, close)
label.set_style(this.currentPriceLabel, label.style_label_left)
label.set_size(this.currentPriceLabel, size.tiny)
label.set_text(this.avgPriceLabel, str.format('{0,number,#.##} AVG', avg))
label.set_xy(this.avgPriceLabel, bar_index + LABEL_X_OFFSET + 2, avgY)
label.set_style(this.avgPriceLabel, label.style_label_left)
label.set_size(this.avgPriceLabel, size.tiny)
if SHOW_PEAK
label.set_text(this.peakLabel, str.format('{0,number,#.##} PEAK', peakPrice))
label.set_xy(this.peakLabel, bar_index + LABEL_X_OFFSET + 2, peakY)
label.set_style(this.peakLabel, label.style_label_left)
label.set_size(this.peakLabel, size.tiny)
// Calculate ranges safely
float safeTotalShares = totalShares > 0 ? totalShares : 1.0
int idx05 = array.binary_search_leftmost(cumdist, safeTotalShares * 0.05)
int idx95 = array.binary_search_leftmost(cumdist, safeTotalShares * 0.95)
int idx15 = array.binary_search_leftmost(cumdist, safeTotalShares * 0.15)
int idx85 = array.binary_search_leftmost(cumdist, safeTotalShares * 0.85)
float ninetyPctLow = this.getBucketedPrice(idx05)
float ninetyPctHigh = this.getBucketedPrice(idx95)
float seventyPctLow = this.getBucketedPrice(idx15)
float seventyPctHigh = this.getBucketedPrice(idx85)
float rangeDenom = ninetyPctHigh - ninetyPctLow
float rangeOverlap = rangeDenom != 0 ? (seventyPctHigh - seventyPctLow) / rangeDenom : 0.0
// Calculate chip concentration
float concentration = rangeOverlap * 100
string concentrationDesc = concentration < 50 ? "High" : concentration < 70 ? "Medium" : "Dispersed"
// Pressure analysis
float safeAvg = avg > 0 ? avg : close
float priceVsAvg = ((close - safeAvg) / safeAvg) * 100
string pressure = priceVsAvg > 5 ? "Strong Bullish" : priceVsAvg > 1 ? "Bullish" :
priceVsAvg < -5 ? "Strong Bearish" : priceVsAvg < -1 ? "Bearish" : "Neutral"
// Price vs Peak
float safePeak = peakPrice > 0 ? peakPrice : close
float priceVsPeak = ((close - safePeak) / safePeak) * 100
string peakRelation = close > peakPrice ? "Above Peak" : close < peakPrice ? "Below Peak" : "At Peak"
// Stats panel - positioned at bottom, compact
float displayedRange = na(highestDisplayedPrice) or na(lowestDisplayedPrice) ? close * 0.02 : highestDisplayedPrice - lowestDisplayedPrice
label.set_text(this.statsLabel, str.format(
'90%: {0,number,#.##} - {1,number,#.##} | 70%: {2,number,#.##} - {3,number,#.##}',
ninetyPctLow, ninetyPctHigh, seventyPctLow, seventyPctHigh))
if not na(lowestDisplayedPrice) and displayedRange > 0
label.set_y(this.statsLabel, lowestDisplayedPrice - displayedRange * 0.05)
label.set_style(this.statsLabel, label.style_label_up)
label.set_x(this.statsLabel, bar_index + CHART_X_OFFSET - 30)
label.set_size(this.statsLabel, size.tiny)
// Signal panel - hidden (info moved to trend arrow and pressure bar)
label.set_text(this.signalLabel, "")
label.set_xy(this.signalLabel, bar_index, close)
// === NEW PROFESSIONAL VISUALIZATIONS ===
// 1. Key Level Lines - Support, Resistance, and Average Cost extending across chart
if SHOW_KEY_LEVELS
int chartLeft = math.max(0, bar_index - LOOKBACK)
int chartRight = bar_index + CHART_X_OFFSET - 5
// Average cost line (horizontal dotted blue line)
line.set_xy1(this.avgCostLine, chartLeft, avg)
line.set_xy2(this.avgCostLine, chartRight, avg)
line.set_color(this.avgCostLine, AVG_PRICE_COLOR)
// Find strongest support (highest concentration below current price)
float strongestSupport = na
float strongestSupportWeight = 0.0
float strongestResistance = na
float strongestResistanceWeight = 0.0
for i = 0 to NUM_BUCKETS - 1
float bucketPrice = this.getBucketedPrice(i)
float bucketWeight = array.get(dist, i)
if bucketPrice < close and bucketWeight > strongestSupportWeight
strongestSupport := bucketPrice
strongestSupportWeight := bucketWeight
if bucketPrice > close and bucketWeight > strongestResistanceWeight
strongestResistance := bucketPrice
strongestResistanceWeight := bucketWeight
// Support line (green dashed)
if not na(strongestSupport)
line.set_xy1(this.supportLine, chartLeft, strongestSupport)
line.set_xy2(this.supportLine, chartRight, strongestSupport)
line.set_color(this.supportLine, SUPPORT_COLOR)
else
line.set_xy1(this.supportLine, bar_index, close)
line.set_xy2(this.supportLine, bar_index, close)
line.set_color(this.supportLine, color.new(SUPPORT_COLOR, 100))
// Resistance line (red dashed)
if not na(strongestResistance)
line.set_xy1(this.resistanceLine, chartLeft, strongestResistance)
line.set_xy2(this.resistanceLine, chartRight, strongestResistance)
line.set_color(this.resistanceLine, RESISTANCE_COLOR)
else
line.set_xy1(this.resistanceLine, bar_index, close)
line.set_xy2(this.resistanceLine, bar_index, close)
line.set_color(this.resistanceLine, color.new(RESISTANCE_COLOR, 100))
// 2. Trend Direction Arrow
if SHOW_TREND_ARROW
string trendSymbol = priceVsAvg > 5 ? "▲▲" : priceVsAvg > 1 ? "▲" :
priceVsAvg < -5 ? "▼▼" : priceVsAvg < -1 ? "▼" : "◆"
color trendColor = priceVsAvg > 5 ? color.new(#00E676, 0) : priceVsAvg > 1 ? color.new(#4CAF50, 0) :
priceVsAvg < -5 ? color.new(#FF1744, 0) : priceVsAvg < -1 ? color.new(#EF5350, 0) : color.new(#9E9E9E, 0)
string trendText = trendSymbol + " " + pressure
label.set_text(this.trendArrow, trendText)
float arrowY = na(highestDisplayedPrice) ? close : highestDisplayedPrice + displayedRange * 0.12
label.set_xy(this.trendArrow, bar_index + CHART_X_OFFSET - 40, arrowY)
label.set_color(this.trendArrow, color.new(trendColor, 70))
label.set_textcolor(this.trendArrow, trendColor)
label.set_size(this.trendArrow, size.large)
// 3. Pressure Bar (Profit/Loss ratio visualization)
if SHOW_PRESSURE_BAR
float barWidth = 8.0
float barHeight = displayedRange * 0.25
float barX = bar_index + CHART_X_OFFSET + 5
float barTop = na(highestDisplayedPrice) ? close + barHeight/2 : highestDisplayedPrice - displayedRange * 0.02
float barBottom = barTop - barHeight
// Background bar
box.set_lefttop(this.pressureBar, int(barX), barTop)
box.set_rightbottom(this.pressureBar, int(barX + barWidth), barBottom)
box.set_bgcolor(this.pressureBar, color.new(#424242, 60))
// Fill based on profit ratio (green from bottom)
float fillHeight = barHeight * profitRatio
float fillTop = barBottom + fillHeight
color fillColor = profitRatio > 0.7 ? color.new(#00E676, 30) :
profitRatio > 0.5 ? color.new(#4CAF50, 30) :
profitRatio > 0.3 ? color.new(#FFC107, 30) : color.new(#FF5252, 30)
box.set_lefttop(this.pressureFill, int(barX), fillTop)
box.set_rightbottom(this.pressureFill, int(barX + barWidth), barBottom)
box.set_bgcolor(this.pressureFill, fillColor)
// Pressure label
string pressureText = str.format('{0,number,#}%', profitRatio * 100)
label.set_text(this.pressureLabel, pressureText)
label.set_xy(this.pressureLabel, int(barX - 1), barTop + displayedRange * 0.01)
label.set_textcolor(this.pressureLabel, fillColor)
//#endregion
//#region Main
= request.security(syminfo.tickerid, 'D', , lookahead = barmerge.lookahead_off)
float atrPercent = dailyClose > 0 ? dailyATR / dailyClose : 0.02
if timeframe.in_seconds(timeframe.period) <= timeframe.in_seconds('D')
var PCD pcd = newPCD()
if last_bar_index - bar_index < LOOKBACK
pcd.storeCandle(dailyBarIdx, dailyHigh, dailyLow, dailyVolume, avgVolume, atrPercent)
if barstate.islast
pcd.update()
//#endregion
FXWMarkets.comFXWMarkets.com is a next‑generation trading ecosystem built for traders who demand clarity, speed, and institutional‑grade insights. Our mission is to empower global traders with advanced analytics, multi‑asset research, and AI‑enhanced market intelligence — all delivered through a modern, intuitive platform designed for real‑world performance.
We combine professional‑level tools, transparent market analysis, and cutting‑edge technology to help traders navigate Forex, commodities, indices, and crypto with confidence.
At FXWMarkets.com, we believe in precision, reliability, and trader‑first innovation.
🚀 Join FXWMarkets.com — Be Part of the Launch
Become one of the first to join FXWMarkets.com and unlock exclusive early‑access benefits.
We’re preparing to launch a powerful new trading platform — and early members will receive priority access, premium insights, and a chance to earn a 100% bonus at launch.
Don’t miss the opportunity to be part of a platform built for serious traders.
👉 Join us today at FXWMarkets.com and secure your advantage before the doors open.
Neeson bitcoin Dynamic ATR Trailing SystemNeeson bitcoin Dynamic ATR Trailing System: A Comprehensive Guide to Volatility-Adaptive Trend Following
Introduction
The Dynamic ATR Trailing System (DATR-TS) represents a sophisticated approach to trend following that transcends conventional moving average or breakout-based methodologies. Unlike standard trend-following systems that rely on price pattern recognition or fixed parameter oscillators, this system operates on the principle of volatility-adjusted position management—a nuanced approach that dynamically adapts to changing market conditions rather than imposing rigid rules on market behavior.
Originality and Innovation
Distinct Methodological Approach
What sets DATR-TS apart from hundreds of existing trend-following systems is its dual-layered conditional execution framework. While most trend-following systems fall into one of three broad categories—moving average crossovers, channel breakouts, or momentum oscillators—this system belongs to the more specialized category of volatility-normalized trailing stop systems.
Key Original Contributions:
Volatility-Threshold Signal Filtering: Most trend systems generate signals continuously, leading to overtrading during low-volatility periods. DATR-TS implements a proprietary volatility filter that requires minimum market movement before generating signals, effectively separating high-probatility trend opportunities from market noise.
Self-Contained Position State Management: Unlike traditional systems that require external position tracking, DATR-TS maintains an internal position state that prevents contradictory signals and creates a closed-loop decision framework.
Dynamic Risk Parameter Adjustment: The system doesn't use fixed percentage stops or rigid ATR multiples. Instead, it implements a responsive adjustment mechanism that widens stops during high volatility and tightens them during low volatility, creating an optimal balance between risk protection and opportunity capture.
Trader-Centric Visualization Philosophy: Beyond mere signal generation, the system provides a comprehensive visual feedback system designed to align with human cognitive patterns, reducing emotional decision-making through consistent color coding and information hierarchy.
Technical Implementation and Functionality
Core Operational Mechanism
DATR-TS implements a volatility-adjusted trend persistence model that operates on the principle that trending markets exhibit characteristic volatility signatures. The system specifically targets medium-term directional movements (typically lasting 5-20 days) rather than short-term scalping opportunities or long-term position trades.
The Four-Pillar Architecture:
Volatility Measurement and Normalization
Calculates Average True Range (ATR) over a user-defined period
Converts absolute volatility to percentage terms relative to price
Compares current volatility against user-defined thresholds to filter suboptimal conditions
Dynamic Trailing Stop Algorithm
Establishes an initial stop distance based on current volatility
Implements a four-state adjustment mechanism that responds to price action
Maintains stop position during trend continuation while allowing for trend reversal detection
Conditional Signal Generation
Generates entry signals only when price action meets both directional and volatility criteria
Produces exit signals based on trailing stop penetration
Incorporates position state awareness to prevent conflicting signals
Comprehensive Feedback System
Provides multi-layer visual information including dynamic stop lines, signal labels, and color-coded price action
Displays real-time metrics through an integrated dashboard
Offers configurable visualization options for different trading styles
Specific Trend-Following Methodology
DATR-TS employs a volatility-normalized trailing stop breakout approach, which differs significantly from common trend identification methods:
Not a moving average crossover system (like MACD or traditional MA crosses)
Not a channel breakout system (like Bollinger Band or Donchian Channel breaks)
Not a momentum oscillator system (like RSI or Stochastic trend following)
Not a price pattern recognition system (like head-and-shoulders or triangle breaks)
Instead, it belongs to the more specialized category of volatility-adjusted stop-and-reverse systems that:
Wait for market volatility to reach actionable levels
Establish positions when price confirms directional bias through stop penetration
Manage risk dynamically based on evolving market conditions
Exit positions when the trend exhausts itself through stop violation
Practical Application and Usage
Market Environment Optimization
Ideal Conditions:
Trending markets with sustained directional movement
Medium volatility environments (neither excessively calm nor chaotic)
Timeframes: 4-hour to daily charts for optimal signal quality
Instruments: Forex majors, commodity futures, equity indices
Suboptimal Conditions:
Ranging or consolidating markets
Extreme volatility events or news-driven spikes
Very short timeframes (below 1-hour)
Illiquid or highly manipulated instruments
Parameter Configuration Strategy
Core Parameter Philosophy:
ATR Length (Default: 21 periods)
Controls the system's memory of volatility
Shorter lengths increase sensitivity but may cause overtrading
Longer lengths provide smoother signals but may lag during volatility shifts
ATR Multiplier (Default: 6.3x)
Determines the initial risk buffer
Lower values (4-5x) create tighter stops for conservative trading
Higher values (6-8x) allow for larger trends but increase drawdown risk
Volatility Threshold (Default: 1.5%)
Filters out low-quality trading environments
Adjust based on market characteristics (higher for volatile markets)
Acts as a quality control mechanism for signals
Trading Workflow and Execution
Signal Interpretation and Action:
Entry Protocol:
Wait for BLUE "BUY" signal label appearance
Confirm volatility conditions meet threshold requirements
Enter long position at market or next reasonable opportunity
Set initial stop at displayed dynamic stop level
Position Management:
Monitor dynamic stop line for position adjustment
Allow profits to run while stop protects capital
No manual adjustment required—system manages stop automatically
Exit Protocol:
Exit on ORANGE "SELL" signal label appearance
Alternative exit if price hits dynamic stop level
System will generate new entry signal if conditions warrant re-entry
Risk Management Integration:
Position sizing based on distance to dynamic stop
Volatility filter prevents trades during unfavorable conditions
Clear visual feedback on current risk exposure
Built-in protection against overtrading
Philosophical Foundation and Market Theory
Core Trading Principles
DATR-TS embodies several foundational market principles:
Volatility Defines Opportunity
Markets don't trend continuously—they alternate between trending and ranging phases
Volatility provides the energy for trends to develop and sustain
By measuring and filtering volatility, we can focus on high-probability trend phases
Risk Should Be Proportional
Fixed percentage stops ignore market context
Dynamic stops that adjust with volatility provide more appropriate risk management
Position sizing should reflect current market conditions, not arbitrary rules
Simplicity Through Sophistication
Complex systems often fail in real-world conditions
A simple core algorithm with intelligent filtering outperforms complex multi-indicator approaches
Clear visual feedback reduces cognitive load and emotional interference
Trends Persist Until Proven Otherwise
Markets exhibit momentum characteristics
Once a trend establishes itself, it tends to continue
The trailing stop methodology captures this persistence while providing exit mechanisms
Mathematical and Statistical Foundation
The system operates on several statistical market observations:
Volatility Clustering Phenomenon
High volatility periods tend to follow high volatility periods
Low volatility periods tend to follow low volatility periods
By filtering for adequate volatility, we increase the probability of capturing meaningful trends
Trend Magnitude Distribution
Most trends are small to medium in magnitude
Very large trends are rare but account for disproportionate returns
The dynamic stop methodology allows capture of varying trend magnitudes
Autocorrelation in Price Movements
Price movements exhibit short-term positive autocorrelation during trends
This persistence allows trailing stops to capture continued movement
The system leverages this characteristic without requiring explicit autocorrelation calculation
Performance Characteristics and Expectations
Typical System Behavior
Signal Frequency:
Low to moderate signal generation (prevents overtrading)
Signals concentrated during trending market phases
Extended periods without signals during ranging conditions
Risk-Reward Profile:
Win rate typically 40-60% in trending conditions
Average win larger than average loss
Risk-reward ratios of 1:2 to 1:3 achievable
Drawdown Patterns:
Controlled through volatility adjustment
Larger drawdowns during extended ranging periods
Recovery typically follows when trending conditions resume
Comparison with Alternative Approaches
Versus Moving Average Systems:
Less prone to whipsaws during ranging markets
Better adaptation to changing volatility conditions
Clearer exit signals through stop levels
Versus Channel Breakout Systems:
More responsive to emerging trends
Lower false breakout probability
Dynamic risk adjustment rather than fixed parameters
Versus Momentum Oscillator Systems:
Better trend persistence capture
Less susceptible to overbought/oversold false signals
Clearer position management rules
Educational Value and Skill Development
Learning Opportunities
DATR-TS serves as more than just a trading tool—it provides educational value through:
Market Condition Awareness
Teaches traders to distinguish between trending and ranging markets
Develops understanding of volatility's role in trading opportunities
Encourages patience and selectivity in trade execution
Risk Management Discipline
Demonstrates dynamic position sizing principles
Illustrates the importance of adaptive stops
Reinforces the concept of risk-adjusted returns
Psychological Skill Development
Reduces emotional trading through clear rules
Builds patience through conditional execution
Develops discipline through systematic approach
Customization and Evolution
The system provides a foundation for further development:
Beginner Level:
Use default parameters for initial learning
Focus on signal recognition and execution discipline
Develop understanding of system behavior across market conditions
Intermediate Level:
Adjust parameters based on specific market characteristics
Combine with complementary analysis techniques
Develop personal variations based on trading style
Advanced Level:
Integrate with portfolio management systems
Develop automated execution frameworks
Create derivative systems for specialized applications
Conclusion: The Modern Trend-Following Paradigm
The Dynamic ATR Trailing System represents a significant evolution in trend-following methodology. By moving beyond simple price pattern recognition or fixed parameter oscillators, it embraces the complex reality of financial markets where volatility, trend persistence, and risk management interact dynamically.
This system doesn't claim to predict market direction or identify tops and bottoms. Instead, it provides a systematic framework for participating in trends when they emerge, managing risk appropriately as conditions change, and preserving capital during unfavorable environments.
For traders seeking a methodology that combines mathematical rigor with practical execution, adapts to changing market conditions rather than fighting against them, and provides clear, actionable information without cognitive overload, DATR-TS offers a sophisticated yet accessible approach to modern trend following.
The true value lies not in any single signal or parameter setting, but in the comprehensive philosophy of volatility-aware, risk-adjusted, conditionally-executed trend participation that the system embodies—a philosophy that aligns with how markets actually behave rather than how we might wish them to behave.
High-volume buy and sell signals with OB and FVGBuy and sell signals on ob
Pivot Point Usage: Instead of detecting each candle of an opposite color, the script uses `ta.pivothigh/low`. This means it only marks a Pivot Point if the price has actually made a significant high or low relative to the 10 preceding and following candles.
Dynamic Cleanup (Mitigation): As soon as the price returns to "fill" the area (depending on your choice: simple contact or close), the box disappears from the chart. This keeps your view clean and focused on the remaining untouched areas.
Period Setting: You can increase the "Detection Period" (e.g., from 10 to 20) in the settings to filter out even more noise and keep only the major areas.
How to use it?
Pattern Pro [Josh]1. Overview
Pattern Pro is a hybrid technical analysis suite designed to bridge the gap between Classic Chart Patterns and Smart Money Concepts (SMC). Reimagined with a high-contrast "Alien HUD" visual style, this script helps traders identify structural breaks, reversal patterns, and institutional zones with clarity.
2. How it Works (Methodology & Calculations)
The core engine of this script relies on identifying significant market swings using ta.pivothigh and ta.pivotlow functions. These pivot points are stored in dynamic arrays to perform geometric calculations:
Geometric Pattern Recognition:
The script calculates the slope between historical pivots using linear regression logic.
Double Tops/Bottoms: Detects equal highs/lows within a user-defined tolerance (default 0.25%) and validates them with RSI Divergence logic.
Head & Shoulders: Validates the structural hierarchy (Left Shoulder < Head > Right Shoulder) relative to the neckline.
Wedges & Flags: Analyzes trendlines connecting multiple pivots. Converging slopes indicate Wedges, while parallel slopes indicate Flags.
Smart Money Concepts (SMC):
BOS (Break of Structure): Automatically draws lines where price closes beyond a key pivot, signaling trend continuation.
FVG (Fair Value Gaps): Scans for 3-candle price imbalances and projects the 50% equilibrium level.
Supply & Demand Zones: Highlights order blocks derived from the specific candles that formed a confirmed pivot.
Confidence Score: An internal algorithm assigns a percentage score based on pattern clarity and momentum divergence (RSI).
3. Visual Features (Alien HUD)
Neon & Glow Effects: Lines are rendered with multi-layered transparency to create a "glowing" effect, ensuring visibility on dark themes.
Fog/Smoke FX: Adds depth to critical levels without cluttering the chart.
Customization: Users can toggle specific patterns, adjust pivot sensitivity (Lookback), and customize colors.
Disclaimer: This indicator is developed strictly for educational purposes regarding chart behavior and algorithmic pattern recognition.
The signals and patterns generated do not guarantee profitability or future accuracy.
Past performance is not indicative of future results.
Trading involves significant risk. Users should always practice proper risk management and use their own judgment.
ICT Liquidity Purge + SMTSimple indicator.
Instructions
Speed Improvements:
Pivot Length: 5→3 - Detects liquidity levels faster (less bars needed to confirm a pivot)
SMT Pivot Length: 5→3 - Faster SMT divergence detection
Purge Buffer: 0.1%→0.05% - Triggers purges sooner when price touches the level
Removed debug markers - No more blue triangular dots
To make it even faster, you can:
Set Pivot Length to 2 (very aggressive, more noise)
Set Purge Buffer to 0.01% (triggers almost immediately)
Adjust these in the settings based on your timeframe:
Lower timeframes (1m, 3m): Use 2-3 pivot length
Higher timeframes (15m, 1h): Use 4-5 pivot length.
Small Body CandlesThis indicator helps you identify candles where the candle body is less than 50% of the total range (high to low). These candles often represent areas of indecision or absorption, where price is being rejected rather than driven aggressively.
Such candles are commonly associated with Supply and Demand zones, as they frequently appear at key levels where institutions accumulate or distribute positions.
By highlighting these candles directly on the chart, the indicator allows you to:
• Quickly spot potential supply and demand candles
• Identify areas of price imbalance and reaction
• Improve higher-timeframe context and zone refinement
The indicator is universal and works across all markets and all timeframes, making it suitable for both intraday and swing analysis.
Mayor Trend Phase Schedule PAI (2025-2026) - Close 23:00 + TableA proprietary time-based analytical tool designed to identify predetermined cyclical windows where major market movements exhibit heightened statistical probability. This indicator synthesizes chronological patterns with price structure confirmation to provide traders with temporally optimized decision frameworks.
Core Components
1. Chronological Phase Mapping
Pre-calibrated 3-day windows across 2025-2026 identified through historical cyclical analysis
Visual background highlighting of active phase periods
Systematic scheduling of potential volatility expansion periods
2. Dynamic Session Reference
Real-time tracking of critical session closing levels (configurable time zone)
Continuous plotting of reference price levels that adapt to market conditions
Integration of temporal price behavior into phase analysis
3. Multi-Timeframe Context Framework
Proprietary EMA combination (157, 200, 257 periods) representing institutional, macro, and intermediate trend perspectives
Visual trend structure assessment during active phases
Confluence verification between temporal and technical factors
4. Informative Dashboard
Real-time phase status monitoring
Active schedule visualization
Reference level tracking with timestamp verification
Analytical Methodology
Phase-Confluence Trading Approach
The indicator operates on the principle of temporal-technical confluence, where trades are considered only when multiple analytical dimensions align:
Primary Conditions:
Temporal Alignment - Active phase window confirmation
Structural Alignment - Price positioned relative to institutional trend framework
Session Alignment - Price interaction with critical session reference levels
Operational Logic
Identification: Automatic detection of active phase windows
Verification: Multi-factor confirmation of trading environments
Visualization: Clear graphical representation of confluence conditions
Monitoring: Real-time tracking of phase progression and price interaction
Application Framework
Strategic Implementation
Phase Awareness - Monitor upcoming windows for preparation
Confluence Verification - Confirm multiple alignment conditions
Reference Level Analysis - Assess price behavior relative to session dynamics
Context Integration - Evaluate within broader market structure
Risk Management Considerations
Temporal-based position sizing adjustments
Phase-duration aware trade management
Confluence-level dependent risk parameters
Technical Specifications
Customization Options
Adjustable session time references
Configurable visual display parameters
Selective component activation/deactivation
Table presentation customization
Compatibility
Multi-asset class applicability
Various timeframe adaptability
Integration with existing trading frameworks
Theoretical Foundation
Underlying Principles
Cyclical market behavior patterns
Institutional trading periodicity
Session-based price memory effects
Multi-timeframe confluence significance
Analytical Value Proposition
Reduced temporal uncertainty
Enhanced timing precision
Structured decision frameworks
Objective phase identification
Usage Guidelines
Optimal Implementation
As a Timing Filter - Primary use for trade timing optimization
As a Context Tool - Supplementary market condition assessment
As a Planning Aid - Forward schedule awareness and preparation
Integration Recommendations
Combine with price action analysis
Correlate with fundamental catalysts
Align with broader market cycles
Validate with volume and volatility metrics
Performance Characteristics
Analytical Strengths
Objective temporal identification
Clear visual communication
Systematic approach to timing
Historical pattern recognition
Practical Limitations
Requires supplementary technical analysis
Not a standalone trading system
Dependent on proper interpretation
Historical performance not indicative of future results
Professional Applications
Institutional Use Cases
Portfolio rebalancing timing
Option expiration planning
Risk window identification
Strategic entry/exit scheduling
Retail Trader Applications
Trade timing optimization
Market condition awareness
Risk period identification
Planning and preparation tool
Conclusion
The Mayor Trend Phase Schedule indicator represents a sophisticated approach to temporal market analysis, providing traders with structured frameworks for identifying statistically significant time windows. By focusing on chronological patterns and their interaction with price structure, the tool offers a unique perspective on market timing that complements traditional technical analysis methods.
Note: This tool is designed for analytical purposes and should be used as part of a comprehensive trading methodology with appropriate risk management protocols.
CVD-MACD### CVD-MACD (Research)
The CVD-MACD is a research-oriented indicator that combines Cumulative Volume Delta (CVD) with the classic MACD framework to provide insights into market momentum and potential reversals. Unlike a standard MACD based on price, this version uses CVD (the running total of buy vs. sell volume delta) as its input source, offering a volume-driven perspective on trend strength and divergences.
Key Features:
- **CVD-Based MACD Calculation**: Computes MACD using CVD instead of price, highlighting volume imbalances that may precede price moves.
- **Dual Divergence Detection**: Identifies bullish/bearish divergences on both the MACD line and histogram, with configurable pivot lookbacks and filters (e.g., momentum decay and zero-side consistency).
- **Visual Flexibility**: Toggle divergences in the indicator pane or overlaid on the main chart, with optional raw CVD line for reference.
- **Alerts**: Built-in conditions for bullish and bearish divergences to notify users of potential setups.
###This indicator is designed for research and experimentation—it's not financial advice. It performs best on liquid assets with reliable volume data (e.g., stocks, futures). I've shared this to gather community feedback: please test it thoroughly and point out any bugs, inefficiencies, or improvements! For example, if you spot issues with divergence detection on certain timeframes or symbols, let me know in the comments. Your input will help refine it.
Inspired by volume analysis techniques; open to collaborations or forks.
## User Manual for CVD-MACD (Research)
### Overview
The CVD-MACD indicator transforms traditional MACD by using Cumulative Volume Delta (CVD) as the base input. CVD accumulates the net delta between estimated buy and sell volume per bar, providing a volume-centric view of momentum. The indicator plots a MACD line, signal line, and histogram, while also detecting divergences on both the MACD line and histogram for potential reversal signals.
This manual covers setup, interpretation, and troubleshooting.
Note: This is a research tool—backtest and validate on your own data before using in live trading.
### Installation and Setup
1. **Add to Chart**: Search for "CVD-MACD (Research)" in TradingView's indicator library or paste the script into the Pine Editor and add it to your chart.
2. **Compatibility**: Works on any timeframe and symbol with volume data. Best on daily/intraday charts for stocks, forex, or futures. Avoid illiquid symbols where volume may be unreliable.
3. **Customization**: All inputs are configurable via the indicator's settings panel. Defaults are optimized for general use but can be tuned based on asset volatility.
### Input Parameters
The inputs are grouped for ease of use:
#### MACD Settings
- **Fast EMA (CVD)** (default: 12): Length of the fast EMA applied to CVD. Shorter values make it more responsive to recent volume changes.
- **Slow EMA (CVD)** (default: 26): Length of the slow EMA on CVD. Longer values smooth out noise for trend identification.
- **Signal EMA** (default: 9): Smoothing period for the signal line (EMA of the MACD line).
#### Divergence Logic (MACD Line)
- **Pivot Lookback (MACD Line)** (default: 5): Bars to look left/right for detecting pivots on the MACD line. Higher values detect larger swings but may miss smaller divergences.
- **Max Lookback Range (MACD Line)** (default: 50): Maximum bars between two pivots to consider a divergence valid. Prevents detecting outdated signals.
- **Enable Momentum Decay Filter (Histogram)** (default: false): When enabled, requires the histogram to show decaying momentum (absolute value decreasing) for MACD-line divergences to trigger.
#### Histogram Divergence
- **Pivot Lookback (Histogram)** (default: 5): Similar to above, but for histogram pivots.
- **Max Lookback Range (Histogram)** (default: 50): Max bars for histogram divergence detection.
- **Show Histogram Divergences in Indicator Pane** (default: true): Displays dashed lines and "H" labels for histogram divergences in the sub-window.
- **Show Histogram Divergences on Main Chart** (default: true): Overlays histogram divergences on the price chart with semi-transparent lines and labels.
- **Require Histogram to Stay on Same Side of Zero** (default: true): Filters divergences to only those where the histogram doesn't cross zero between pivots, ensuring consistent momentum direction.
#### Visuals (Dual View)
- **Show MACD-Line Divergences (Indicator Pane)** (default: true): Draws solid lines and "L" labels for MACD-line divergences in the sub-window.
- **Show MACD-Line Divergences (Main Chart)** (default: true): Overlays MACD-line divergences on the price chart.
- **Show Raw CVD Line** (default: false): Plots the underlying CVD as a faint gray line for reference.
### How to Interpret the Indicator
1. **Core Plots**:
- **MACD Line** (blue): Difference between fast and slow CVD EMAs. Above zero indicates building buy volume momentum; below zero shows sell dominance.
- **Signal Line** (orange): EMA of the MACD line. Crossovers can signal potential entries/exits (e.g., MACD above signal = bullish).
- **Histogram** (columns): MACD minus signal. Green shades for positive/expanding bars (bullish momentum); red for negative/contracting (bearish). Fading colors indicate weakening momentum.
- **Zero Line** (gray horizontal): Reference for bullish (above) vs. bearish (below) territory.
- **Raw CVD** (optional gray line): The cumulative buy-sell delta. Rising = net buying; falling = net selling.
2. **Divergences**:
- **Bullish (Green Lines/Labels)**: Occur when price makes lower lows, but MACD line or histogram makes higher lows. Suggests weakening downside momentum and potential reversal up. Look for "L" (MACD line) or "H" (histogram) labels.
- **Bearish (Red Lines/Labels)**: Price higher highs vs. MACD/histogram lower highs. Indicates fading upside and possible downturn.
- **Dual View**: Divergences appear in the indicator pane (sub-window) for clean analysis and overlaid on the main chart for price context. Histogram divergences use dashed lines to distinguish from MACD-line (solid).
- **Filters**: Momentum decay ensures only "hidden" or weakening divergences trigger. Zero-side filter prevents false signals from oscillating histograms.
3. **Alerts**:
- **Bullish Divergence (L or H)**: Triggers on either MACD-line or histogram bullish divergence. Message: "CVD-MACD Bullish Divergence detected on {{ticker}}".
- **Bearish Divergence (L or H)**: Similar for bearish. Use TradingView's alert setup to notify via email/SMS/webhook.
- Tip: Combine with price action (e.g., support/resistance) for confirmation.
### Usage Tips and Strategies
- **Trend Confirmation**: Use in uptrends for bullish divergences (pullback buys) or downtrends for bearish (short entries).
- **Timeframe Selection**: Higher timeframes (e.g., daily) for swing trading; lower (e.g., 15-min) for intraday. Adjust pivot lookbacks accordingly (shorter for faster charts).
- **Combination Ideas**: Pair with RSI for overbought/oversold confirmation or VWAP for intraday volume context.
- **Risk Management**: Divergences are probabilistic—not guarantees. Always use stop-losses based on recent swings.
- **Performance Notes**: Backtest on historical data via TradingView's Strategy Tester. CVD relies on accurate volume; test on exchanges like NYSE/NASDAQ.
### Known Limitations and Troubleshooting
- **Volume Dependency**: CVD estimation assumes linear buy/sell distribution based on bar position—may be less accurate on thin markets or during gaps.
- **Repainting**: Pivots and divergences can repaint as new data arrives (common in pivot-based indicators). Use on closed bars for reliability.
- **Resource Usage**: High max_bars_back (5000) ensures deep history; reduce if chart loads slowly.
- **No Signals on Low-Volume Bars**: If CVD flatlines, check symbol volume—some crypto/forex pairs have inconsistent data.
- **Community Feedback**: If you encounter bugs (e.g., false divergences on specific symbols/timeframes), missing alerts, or calculation errors, please comment below with details like symbol, timeframe, and screenshots. Suggestions for enhancements (e.g., more filters or visuals) are welcome!
If you have questions or find issues, drop a comment—let's improve this together!
Gold Pin Bar Pivot Alerts - FixedThis script is designed for the high volatility of Gold (XAU/USD). It identifies Pin Bars with body less than 30% of the candle's total range, and the candle occuring at a structural Pivot High or Pivot Low
Trappp's Advanced Multi-Timeframe Trading ToolkitTrappp's Advanced Multi-Timeframe Trading Toolkit
This comprehensive trading script by Trappp provides a complete market analysis framework with multiple timeframe support and resistance levels. The indicator features:
Key Levels:
· Monthly (light blue dashed) and Weekly (gold dashed) levels for long-term context
· Previous day high/low (yellow) with range display
· Pivot-based support/resistance (pink dashed)
· Premarket levels (blue) for pre-market activity
Intraday Levels:
· 1-minute opening candle (red)
· 5-minute (white), 15-minute (green), and 30-minute (purple) session levels
· All intraday levels extend right throughout the trading day
Technical Features:
· EMA 50/200 cross detection with alert labels
· Candlestick pattern recognition near key levels
· Smart proximity detection using ATR
· Automatic daily/weekly/monthly updates
Trappp's script is designed for traders who need immediate visual reference of critical price levels across multiple timeframes, helping identify potential breakouts, reversals, and pattern-based setups with clear, color-coded visuals for quick decision-making.
Gtradingviewtradingviewtradingviewtradingviewtradingviewtradingviewtradingviewtradingviewtradingviewtradingviewtradingviewtradingviewtradingviewtradingviewtradingviewtradingviewtradingviewtradingviewtradingviewtradingviewtradingviewtradingviewtradingviewtradingviewtradingviewtradingviewtradingviewtradingviewtradingviewtradingviewtradingviewtradingviewtradingviewtradingviewtradingviewtradingviewtradingviewtradingviewtradingviewtradingviewtradingviewtradingviewtradingviewtradingviewtradingviewtradingviewtradingviewtradingviewtradingviewtradingviewtradingviewtradingviewtradingviewtradingviewtradingviewtradingviewtradingviewtradingviewtradingviewtradingviewtradingview
KAPISH Professional Trend Re-entry SystemThe Professional Trend Re-entry System is a high-precision momentum-trading tool designed to identify high-probability entries within established trends. Unlike standard lagging indicators, this system utilizes a 5-Point Multi-Data Consensus engine to verify trend health before issuing any signals. By combining the power of volatility-adjusted trend tracking with mean-reversion logic, it helps traders "buy the dip" in uptrends and "sell the rip" in downtrends with surgical timing.
Phantom UltimatePhantom Ultimate: The Professional’s Head-Up Display (HUD)
Headline: Clarity in a Chaotic Market.
The Problem: Modern markets are noisy. Most indicators are fragmented—you have one script for trends, one for divergences, and another for support/resistance. Your chart becomes a mess of conflicting lines, and you spend more time managing indicators than trading price.
The Solution: Phantom Ultimate isn't just an indicator; it is a complete trading operating system. It consolidates an entire institutional trading desk into a single, clean interface. It synthesizes Trend, Momentum, Volume, and Structure into one "Head-Up Display" so you can execute with precision.
Why You Need It:
Zero-Clutter "Smart-Line" Technology: Our dynamic engine keeps your chart pristine. Moving Averages and S&R lines only appear when price is interacting with them. If a line isn't relevant to the current price action, it vanishes. You trade what matters, not the noise.
Institutional Price Action & Alerts: Phantom doesn't just draw lines; it watches them for you. It automatically detects and alerts on high-probability interactions across every level (MAs, Fibs, and Fractal S&R):
Pin Bar Rejections: Catch "Perfect" rejections (Top 34% body rule) the moment a candle closes.
Level Retests: Know immediately when a broken level is being tested as support.
Zone Reclaims: Get alerted instantly when price reclaims a key level after a deviation.
The Market HUD: A professional dashboard pinned to your chart. Instantly see the trend status, signal strength, and RSI conditions for the 1H, 4H, and Daily timeframes simultaneously. Never flip tabs again to check the trend.
The "Wizard" Signal Engine: A composite algorithm that detects "Mega" entries by aligning Momentum (CCI), Trend (EMAs), and Volume (VFI). It doesn't guess; it calculates confluence.
🎁 Bonus: Full Discord Ecosystem Access Your license to Phantom Ultimate includes exclusive access to our Discord Community.
Get real-time server-side alerts (powered by Phantom God Mode).
Join a community of serious traders executing the same strategies.
Never miss a setup, even when you are away from your charts.
Upgrade your vision. Trade with Phantom Ultimate.
High Probability Trend Continuation (1:5 RR)this strategy is based on a high-probability trend continuation pattern, one of the most frequently occurring setups in financial markets. It uses EMA trend alignment to identify strong bullish or bearish conditions and waits for a controlled pullback before entering a trade in the direction of the trend.
Risk management is fully automated using ATR-based stop losses, ensuring the strategy adapts to market volatility. Each trade is executed with a fixed 1:5 risk-to-reward ratio, allowing profitability even with a modest win rate.
The strategy is designed to work across multiple markets and timeframes, including forex, stocks, indices, and crypto, making it suitable for both intraday and swing trading.
9-20 STRADDLE FOR INTRADAY TRADING9-20 STRADDLE FOR INTRADAY TRADING
The 9–20 Straddle Strategy is a popular intraday options trading setup that focuses on capturing volatility after the market opens. In this strategy, traders place a straddle at 9:20 AM by buying or selling both ATM Call and Put options of the same strike and expiry. The objective is to benefit from strong directional moves or time decay, depending on execution style. Risk management is crucial, with predefined stop-loss and profit targets to control losses. This strategy works best on high-liquidity indices like Nifty and Bank Nifty, especially on volatile trading days.






















