Volatility-Based Stop CalculatorVolatility-Based Stop Calculator
Daily volatility-based stop distance and target levels with regime awareness using VIX-derived stress features
Overview
Volatility-Based Stop Calculator is a daily risk-sizing helper that computes ATR-based stop distances and target levels using a volatility regime score built from VIX momentum, VIX acceleration, and SPY realized volatility. It is not a signal or entry tool; it provides a consistent stop distance and target ladder for the current session.
Key Features
Volatility Regime Scoring: Uses VIX momentum (5‑day change), VIX acceleration, and SPY realized volatility to create a daily severity score.
Quantile Buckets: Maps the severity score into 4 volatility buckets (LOW / NORMAL / ELEVATED / EXTREME).
Dynamic k Multiplier: Adjusts stop distance via VIX percentile, gap risk (ETFs only), realized vol ratio, and VIX9D term stress.
ATR-Based Stops: Final stop distance is ATR × k, rounded to tick size.
Targets Ladder: Plots TP1/TP2/TP3 and stop levels from a reference price (daily close or live price).
Overlap Consolidation: In Both mode, overlapping long/short levels are merged into a single line/label.
Live Lines + Labels: Uses dynamic lines and labels (not plot lines) for clean chart overlays.
Table Summary: Monospace table showing regime, k, ATR, stop distance, and volatility stats.
How It Works
Daily Data Pull: Uses daily bars for all volatility calculations to match the original daily model.
Severity Score: Ranks VIX momentum, VIX acceleration, and SPY realized vol, then blends them with weights.
Bucket Mapping: Converts severity into 4 quantile buckets and selects base k per bucket.
Dynamic Adjustments: Adds VIX percentile, ETF gap risk, asset vs market realized vol, and VIX9D term stress.
Stop + Targets: Computes stop distance and applies 1R/2R/3R targets from the reference price.
Use Cases
Stop Placement: Avoid stops that are too tight in high volatility or too wide in low volatility.
Risk Sizing: Use the stop distance with your own risk model to size positions.
Daily Context: Track volatility regime shifts without needing a separate regime model.
Consistent Execution: Standardize stop/target placement across sessions.
Settings
Volatility Inputs:
VIX Symbol, VIX9D Symbol
SPY Symbol (market baseline)
NQ/ES Baseline Symbols (futures baselines)
Stop Model:
ATR EMA Span
VIX Percentile Window
Severity Lookback
Bucket Lookback
Gap Lookback (ETFs)
Bucket Smoothing
Display:
Show Levels (Long/Short/Both)
Use Live Price (current chart) or Daily Close
Level Line Style/Width
Label Size and Position
Long/Short/Overlap colors
Table Styling:
Background, header, border, frame, and text settings
Table position and text size
Technical Notes
All volatility calculations are based on daily data; intraday charts use daily series under the hood.
Futures gap adjustment is disabled; ETFs include gap risk.
This is a risk sizing helper, not a trade signal generator.
Best Practices
Use daily regime output to set stops, then execute on your preferred timeframe.
Confirm symbol mappings for VIX/VIX9D/ES/NQ in your data feed.
If levels feel too wide or tight, adjust the k inputs rather than ATR length first.
A daily volatility‑based stop calculator that adapts stop distance and targets to the current regime.
Indicatori e strategie
HA EMA10.30 Pullback, Trend Bias, No ConsolidationThis script is a trend-bias + entry signal indicator built around the Heikin-Ashi pullback strategy you shared.
It does three main jobs:
Decides the market bias (LONG only, SHORT only, or NO TRADE)
Filters out consolidation / chop
Signals entries only when momentum aligns
Daily Pivot Points [Anatmart]Daily Pivot Points Indicator calculating the pivot points of previous day in a price chart. It shows support and resistance pivot points of today in Labels and Tables.
To calculate the standard, or floor, pivot point levels, we proceed this way:
H = maximum price of the previous day
L = minimum price of the previous day
C = close of the previous day
PP = (H + L + C) / 3
Level Formula
Resistance 3: R3 = R2 + (H - L)
Resistance 2: R2 = (PP - S1) + R1
Resistance 1: R1 = (2 * PP) - L
Support 1: S1 = (2 * PP) - H
Support 2: S2 = PP - (R1 - S1)
Support 3: S3 = S2 - (H - L)
stelaraX - Risk CalculatorstelaraX – Risk Calculator
stelaraX – Risk Calculator is a trade planning and risk management indicator that visualizes entry, stop loss, and up to three take profit levels directly on the chart. The script calculates risk amount and position size based on account size and risk percentage, and it supports both long and short trade scenarios.
For advanced AI-based chart analysis and automated trade planning tools, visit stelarax.com
Core logic
The indicator uses a manual signal lock to fix a trade setup:
* enable the signal lock
* input the entry price
* input the stop loss price
* select trade direction (Long or Short)
The script validates the trade direction:
* for Long, stop loss must be below entry
* for Short, stop loss must be above entry
Risk is calculated using account size and risk percentage:
* risk amount in currency is computed from account size and risk percent
* position size is derived from risk amount divided by the stop loss distance
Take profit levels are calculated using risk-to-reward multiples:
* TP1, TP2, TP3 can be enabled or disabled independently
* each TP level is calculated as a multiple of the stop loss distance based on the selected R:R value
Visualization
When the signal is active and valid, the indicator draws:
* entry line with price label
* stop loss line with risk amount label
* up to three take profit lines with R-multiple, price, and projected profit labels
* optional risk zone box between entry and stop loss
* optional info panel summarizing the full trade setup
Line length and display elements can be configured.
Alerts
Alert conditions are available for:
* entry level reached
* TP1 reached
* TP2 reached
* TP3 reached
* stop loss reached
Visual markers can also be displayed when any level is hit.
Use case
This indicator is intended for:
* fixed trade planning with manual entry and stop levels
* position sizing based on account risk
* defining multiple take profit targets using R:R
* visualizing risk and reward directly on the chart
* creating alert-based trade management workflows
For a fully automated AI-driven chart analysis solution, additional tools and insights are available at stelarax.com
Disclaimer
This indicator is provided for educational and technical analysis purposes only and does not constitute financial advice or trading recommendations. All trading decisions and risk management remain the responsibility of the user.
Wave 1-2-3 PRO (Typed NA + OTE + Confirm)//@version=5
indicator("Wave 1-2-3 PRO (Typed NA + OTE + Confirm)", overlay=true, max_lines_count=300, max_labels_count=300, max_boxes_count=100)
pivotLen = input.int(6, "Pivot Length", minval=2, maxval=30)
useOTE = input.bool(true, "Use OTE Zone (0.618-0.786)")
oteA = input.float(0.618, "OTE A", minval=0.1, maxval=0.95)
oteB = input.float(0.786, "OTE B", minval=0.1, maxval=0.95)
maxDeep = input.float(0.886, "Max Wave2 Depth", minval=0.5, maxval=0.99)
confirmByClose = input.bool(true, "Confirm Break By Close")
breakAtrMult = input.float(0.10, "Break Buffer ATR Mult", minval=0.0, maxval=2.0)
showEntryZone = input.bool(true, "Show Entry Zone")
entryAtrPad = input.float(0.10, "Entry Zone ATR Pad", minval=0.0, maxval=2.0)
showRetestZone = input.bool(true, "Show Retest Zone")
retestAtrMult = input.float(0.60, "Retest Zone ATR Mult", minval=0.1, maxval=5.0)
showTargets = input.bool(true, "Show Target (1.618)")
targetExt = input.float(1.618, "Target Extension", minval=0.5, maxval=3.0)
showLabels = input.bool(true, "Show Wave Labels")
showSignals = input.bool(true, "Show BUY/SELL Confirm Labels")
atr = ta.atr(14)
var float prices = array.new_float()
var int indexs = array.new_int()
var int types = array.new_int()
var box entryBox = na
var box retestBox = na
var line slLine = na
var line tpLine = na
var line breakLine = na
var label lb0 = na
var label lb1 = na
var label lb2 = na
var label sigLb = na
var int lastPivotBar = na
var bool setupBull = false
var bool setupBear = false
var float s_p0 = na
var float s_p1 = na
var float s_p2 = na
var int s_i0 = na
var int s_i1 = na
var int s_i2 = na
var float s_len = na
ph = ta.pivothigh(high, pivotLen, pivotLen)
pl = ta.pivotlow(low, pivotLen, pivotLen)
int pivotBar = na
float pivotPrice = na
int pivotType = 0
if not na(ph)
pivotBar := bar_index - pivotLen
pivotPrice := ph
pivotType := 1
if not na(pl)
pivotBar := bar_index - pivotLen
pivotPrice := pl
pivotType := -1
bool newPivot = not na(pivotBar) and (na(lastPivotBar) or pivotBar != lastPivotBar)
if newPivot
lastPivotBar := pivotBar
int sz = array.size(prices)
if sz == 0
array.push(types, pivotType)
array.push(prices, pivotPrice)
array.push(indexs, pivotBar)
else
int lastType = array.get(types, sz - 1)
float lastPrice = array.get(prices, sz - 1)
if pivotType == lastType
bool better = (pivotType == 1 and pivotPrice > lastPrice) or (pivotType == -1 and pivotPrice < lastPrice)
if better
array.set(prices, sz - 1, pivotPrice)
array.set(indexs, sz - 1, pivotBar)
else
array.push(types, pivotType)
array.push(prices, pivotPrice)
array.push(indexs, pivotBar)
if array.size(prices) > 12
array.shift(types), array.shift(prices), array.shift(indexs)
if not na(entryBox)
box.delete(entryBox)
entryBox := na
if not na(retestBox)
box.delete(retestBox)
retestBox := na
if not na(slLine)
line.delete(slLine)
slLine := na
if not na(tpLine)
line.delete(tpLine)
tpLine := na
if not na(breakLine)
line.delete(breakLine)
breakLine := na
if not na(lb0)
label.delete(lb0)
lb0 := na
if not na(lb1)
label.delete(lb1)
lb1 := na
if not na(lb2)
label.delete(lb2)
lb2 := na
if not na(sigLb)
label.delete(sigLb)
sigLb := na
setupBull := false
setupBear := false
s_p0 := na
s_p1 := na
s_p2 := na
s_i0 := na
s_i1 := na
s_i2 := na
s_len := na
int sz2 = array.size(prices)
if sz2 >= 3
int t0 = array.get(types, sz2 - 3)
int t1 = array.get(types, sz2 - 2)
int t2 = array.get(types, sz2 - 1)
float p0 = array.get(prices, sz2 - 3)
float p1 = array.get(prices, sz2 - 2)
float p2 = array.get(prices, sz2 - 1)
int i0 = array.get(indexs, sz2 - 3)
int i1 = array.get(indexs, sz2 - 2)
int i2 = array.get(indexs, sz2 - 1)
bool bullCandidate = (t0 == -1 and t1 == 1 and t2 == -1 and p2 > p0)
bool bearCandidate = (t0 == 1 and t1 == -1 and t2 == 1 and p2 < p0)
if bullCandidate
float len = p1 - p0
float depth = (p1 - p2) / len
bool okDepth = len > 0 and depth > 0 and depth <= maxDeep
float hiOTE = math.max(oteA, oteB)
float loOTE = math.min(oteA, oteB)
float zTop = p1 - len * loOTE
float zBot = p1 - len * hiOTE
bool okOTE = not useOTE or (p2 <= zTop and p2 >= zBot)
if okDepth and okOTE
setupBull := true
s_p0 := p0
s_p1 := p1
s_p2 := p2
s_i0 := i0
s_i1 := i1
s_i2 := i2
s_len := len
float pad = atr * entryAtrPad
if showEntryZone
entryBox := box.new(i1, zTop + pad, bar_index, zBot - pad)
slLine := line.new(i0, p0, bar_index + 200, p0)
breakLine := line.new(i1, p1, bar_index + 200, p1)
if showLabels
lb0 := label.new(i0, p0, "0")
lb1 := label.new(i1, p1, "1")
lb2 := label.new(i2, p2, "2")
if bearCandidate
float len = p0 - p1
float depth = (p2 - p1) / len
bool okDepth = len > 0 and depth > 0 and depth <= maxDeep
float hiOTE = math.max(oteA, oteB)
float loOTE = math.min(oteA, oteB)
float zBot = p1 + len * loOTE
float zTop = p1 + len * hiOTE
bool okOTE = not useOTE or (p2 >= zBot and p2 <= zTop)
if okDepth and okOTE
setupBear := true
s_p0 := p0
s_p1 := p1
s_p2 := p2
s_i0 := i0
s_i1 := i1
s_i2 := i2
s_len := len
float pad = atr * entryAtrPad
if showEntryZone
entryBox := box.new(i1, zTop + pad, bar_index, zBot - pad)
slLine := line.new(i0, p0, bar_index + 200, p0)
breakLine := line.new(i1, p1, bar_index + 200, p1)
if showLabels
lb0 := label.new(i0, p0, "0")
lb1 := label.new(i1, p1, "1")
lb2 := label.new(i2, p2, "2")
float buf = atr * breakAtrMult
bool bullBreak = false
bool bearBreak = false
if setupBull and not na(s_p1)
bullBreak := confirmByClose ? (close > s_p1 + buf) : (high > s_p1 + buf)
if setupBear and not na(s_p1)
bearBreak := confirmByClose ? (close < s_p1 - buf) : (low < s_p1 - buf)
if bullBreak
setupBull := false
if showTargets and not na(s_len)
float tp = s_p2 + s_len * targetExt
tpLine := line.new(s_i2, tp, bar_index + 200, tp)
if showRetestZone
float z = atr * retestAtrMult
retestBox := box.new(bar_index, s_p1 + z, bar_index + 120, s_p1 - z)
if showSignals
sigLb := label.new(bar_index, high, "BUY (W3 Confirm)", style=label.style_label_down)
if bearBreak
setupBear := false
if showTargets and not na(s_len)
float tp = s_p2 - s_len * targetExt
tpLine := line.new(s_i2, tp, bar_index + 200, tp)
if showRetestZone
float z = atr * retestAtrMult
retestBox := box.new(bar_index, s_p1 + z, bar_index + 120, s_p1 - z)
if showSignals
sigLb := label.new(bar_index, low, "SELL (W3 Confirm)", style=label.style_label_up)
Intrabar Delta Volume Bubbles [Absorption & Exhaustion]Visualizes aggressive buying/selling pressure using intrabar data to spot Absorption (Red Bubble on Green Candle) and Exhaustion (Green Bubble on Red Candle) on standard feeds.
Trading Sessions Highs & LowsFull Azia , London and New York Sessions Highs & Lows are shown until triggered.
Simple Trend + Signal (No Bug)//@version=5
indicator("Simple Trend + Signal (No Bug)", overlay=true)
// === INPUTS ===
fastEMA = input.int(20, "Fast EMA")
slowEMA = input.int(50, "Slow EMA")
lookback = input.int(20, "Zone Lookback")
// === TREND ===
emaFast = ta.ema(close, fastEMA)
emaSlow = ta.ema(close, slowEMA)
trendUp = emaFast > emaSlow
trendDown = emaFast < emaSlow
// === ZONES ===
highestHigh = ta.highest(high, lookback)
lowestLow = ta.lowest(low, lookback)
// === SIGNALS ===
buySignal = trendUp and close <= emaFast
sellSignal = trendDown and close >= emaFast
// === PLOTS ===
plot(emaFast, color=color.green, linewidth=2)
plot(emaSlow, color=color.red, linewidth=2)
plot(highestHigh, color=color.new(color.blue, 70))
plot(lowestLow, color=color.new(color.orange, 70))
plotshape(buySignal, title="BUY", location=location.belowbar, color=color.green, style=shape.labelup, text="BUY")
plotshape(sellSignal, title="SELL", location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL")
@subitrades AIO IndicatorAll In One Indicator by @subitrades
-Initial Balance
-Trading Sessions
-Monday High
-Monday Low
-VAH
-VAL
-POC
-Fibonacci
-VWAP
Retail Stop-Loss PredictorThe Psychology of Retail Stop-Loss Placement
The "Safe" Buffer Trap
Retail traders are taught to find a recent high or low and place their stop "just a few pips away" to avoid being wicked out.
The Reality: Institutions know exactly where these "buffers" are. They look for clusters of these orders to create the volume they need to fill their large positions.
The Indicator Solution: The SL Predictor automatically calculates these clusters by identifying "Pivots" and applying a Buffer Offset to show the actual zone where the "pain" is felt.
2. Detailed Description of the SL Predictor
A. Multi-Timeframe (MTF) Anchoring
The indicator doesn't just look at your current chart. It "anchors" zones from Higher Timeframes (HTF) like the 4-Hour or Daily.
Why it matters: A stop-loss cluster on a 1-minute chart is a "speed bump." A stop-loss cluster on a Daily chart is a Liquidity Ocean.
Visuals: These zones are drawn as shaded boxes that stay locked to the candle index, ensuring they don't move or repaint when you scroll.
B. Round Number "Magnet" Logic
Retailers have a psychological bias toward Round Numbers (e.g., $100.00, $1.2500).
The Feature: The script identifies these psychological levels and marks them as secondary stop-loss zones. Institutions often "front-run" these levels or sweep them entirely to trigger mass liquidations.
C. Mitigation & Clearing
Once price enters a predicted stop-loss zone, the indicator changes the color to gray or removes the label.
What this means: The "Fuel" has been used. The stops have been triggered. The market has found the liquidity it was looking for and is now ready to reverse or move to the next "pool."
3. Best Use Case: The "Liquidity Hunt" Strategy
Step 1: Identify "Engineered" Liquidity
Look for Equal Highs (Double Tops) or Equal Lows (Double Bottoms). Retailers see these as "Strong Resistance/Support" and pile their stops behind them.
The Indicator: Will highlight these areas with a Red (Short Stops) or Green (Long Stops) shaded box.
Step 2: Wait for the "Stop Run"
Do not enter a trade when price is inside the zone. Wait for price to pierce the zone and then show a sign of rejection (like a long wick).
Institutional Secret: This is the moment the "Smart Money" has finished buying from the retail sellers or selling to the retail buyers.
Step 3: Execution (The "Reverse" Entry)
Once the "Probable Stop" label disappears or the zone turns gray:
Short Entry: If price swept a Red Zone and closed back below it.
Long Entry: If price swept a Green Zone and closed back above it.
Target: The Opposite stop-loss zone. You are trading from one pool of retail "fuel" to the next.
SMC One Candle + AMD Bias (CT Focus)This indicator is a specialized Smart Money Concepts (SMC) tool designed for QQQ on the 5-minute chart. It fuses Tony Trades' "One Candle Rule" execution with the AMD (Accumulation, Manipulation, Distribution) cycle logic found in your previous CRT Pro V2 script.
The primary goal of this indicator is to identify high-probability entries during the Purge Window (9:00 AM – 11:30 AM CT) by detecting when price manipulates morning liquidity before expanding in the direction of the daily bias.
## Core Components
### 1. Master Candle Range (Accumulation)
Timeframe: 05:00 AM – 09:00 AM CT.
Function: It automatically plots the Master High (CRH) and Master Low (CRL). This represents the "Accumulation" phase where orders are built up before the New York open.
### 2. The One Candle Zone (Execution)
Timeframe: 08:35 AM CT (The 5-minute candle immediately following the high-volatility open).
Function: It creates a blue "Value Zone" based on Tony Trades’ logic. This zone acts as the ultimate filter—price must reclaim or break this zone to confirm that the "Manipulation" phase is over and the "Distribution" has begun.
### 3. Multi-Timeframe Daily Bias
Calculation: It tracks the midpoint (Equilibrium) of the previous day's range.
Premium/Discount:
Bullish (Discount): Price is trading above the daily midpoint.
Bearish (Premium): Price is trading below the daily midpoint.
Logic: Signals are filtered by this bias to ensure you are always trading with the higher-timeframe flow.
## Signal Logic Descriptions
### SMC Long (Bullish Distribution)
A Long signal is generated when:
Bias: The Daily Bias is Bullish.
Manipulation: Price has ideally swept the Master Low (CRL) during the open.
The Trigger: A 5-minute candle closes above the 08:35 AM "One Candle" High.
Confirmation: This suggests shorts are trapped and Smart Money is distributing price toward the Previous Day High (PDH).
### SMC Short (Bearish Distribution)
A Short signal is generated when:
Bias: The Daily Bias is Bearish.
Manipulation: Price has ideally swept the Master High (CRH).
The Trigger: A 5-minute candle closes below the 08:35 AM "One Candle" Low.
Confirmation: This confirms a rejection of the opening range, signaling a move toward the Previous Day Low (PDL) or the current Low of Day.
## Visual Guide
Blue Box: The One Candle Zone (Tony Trades' "Line in the Sand").
Gray Stepline: The Master Candle Range (0500–0900 CT).
Yellow Background: The Purge Window (0900–1130 CT), where your logic dictates the highest probability of a successful trade.
Labels: Real-time Daily Bias updates in the top right corner.
Moonboys BTC Liquidation Heatmap═════════════════════════════════════════════════════════════
MoonBoys BTC LIQUIDATION HEATMAP
═════════════════════════════════════════════════════════════
Visualize high-probability liquidation zones across Bitcoin futures markets using multi-exchange data and algorithmic pivot detection.
═══ OVERVIEW ═══
This indicator tracks where leveraged positions cluster and highlights areas where cascading liquidations are likely to occur. By combining Open Interest data from major exchanges with volume-weighted pivot analysis, it shows you where the market's leverage is stacked before price gets there.
Perfect for:
• Anticipating volatility zones
• Identifying potential reversal areas
• Avoiding stop-hunt regions
• Confirming breakout/breakdown levels
═══ KEY FEATURES ═══
🎨 HEAT-MAPPED LIQUIDATION ZONES
└─ Green zones = Long liquidations (below price)
└─ Purple zones = Short liquidations (above price)
└─ Color intensity = Volume significance
⚡ SMART SIGNIFICANCE DETECTION
└─ Top 30% of levels automatically highlighted
└─ Lightning bolt icon (⚡) marks critical zones
└─ Enhanced with borders, brighter colors, and bold labels
└─ Weak levels stay subtle to reduce noise
📊 MULTI-EXCHANGE DATA
└─ Binance Futures Open Interest
└─ Bybit Futures Open Interest
└─ Coinbase Spot Volume
└─ Toggle exchanges individually
🕐 MULTI-TIMEFRAME COMPATIBLE
└─ Works on all timeframes: 1m to Monthly
└─ Auto-adjusts filters and aggregation per timeframe
└─ Consistent performance across different chart scales
🎯 CLEAN VISUAL DESIGN
└─ Labels positioned right of chart (off candles)
└─ Connector lines show which label belongs to which zone
└─ Hit levels fade automatically
└─ Only active zones are labeled
═══ HOW TO READ IT ═══
┌─────────────────────────────────────────────────────────┐
│ ZONE TYPE │ MEANING │
├─────────────────────────────────────────────────────────┤
│ 🟢 Green (below) │ Long liquidation cluster │
│ │ → Potential bounce/support zone │
├─────────────────────────────────────────────────────────┤
│ 🟣 Purple (above)│ Short liquidation cluster │
│ │ → Potential rejection/resistance │
├─────────────────────────────────────────────────────────┤
│ ⚡ With icon │ Top 30% most significant levels │
│ │ → Higher probability of reaction │
└─────────────────────────────────────────────────────────┘
═══ TRADING APPLICATIONS ═══
📈 TREND CONTINUATION
→ Price rejects from liquidation zone = trend strength
→ Watch for bounces at green zones in uptrends
→ Watch for rejections at purple zones in downtrends
🔄 REVERSAL SETUPS
→ Price diving into dense liquidation clusters
→ Heavy volume + liquidation zone = potential turning point
→ Combine with momentum divergence for confirmation
⚠️ RISK MANAGEMENT
→ Avoid entries near untouched significant levels
→ High probability of stop hunts and slippage
→ Wait for price to sweep and confirm before entry
🧩 CONFLUENCE TRADING
→ Layer with support/resistance
→ Combine with volume profile nodes
→ Use alongside order flow indicators
→ Validate with moving averages or trend tools
═══ SETTINGS GUIDE ═══
📡 DATA FEEDS
├─ Binance Futures OI: Toggle Binance data
├─ Bybit Futures OI: Toggle Bybit data
└─ Coinbase Spot Vol: Toggle Coinbase data
🔍 LIQUIDATION DETECTION
├─ Lookback Bars (100-2000): Historical scan range
├─ Pivot Width (1-20): Detection sensitivity
│ └─ Higher = fewer, stronger levels
├─ Target Leverage Tier: Distance from pivot
│ ├─ 25x-50x: 2-4% zones
│ ├─ 50x-100x: 0.8-2% zones (default)
│ └─ 100x+: 0.3-0.8% zones
├─ Min Activity Filter: Remove weak signals
└─ Extend Levels (0-200): Project zones forward
🎨 VISUAL OPTIONS
├─ Long/Short Colors: Customize zone colors
├─ Heat Contrast (0.1-3.0): Intensity scaling
├─ Significance Threshold (0.3-0.95): Top % to highlight
├─ Touched Transparency: Fade amount for hit levels
└─ Label Offset: Distance from chart edge
═══ HOW IT WORKS ═══
1. PIVOT IDENTIFICATION
Scans historical data for swing highs/lows using pivot detection
2. VOLUME AGGREGATION
Combines Open Interest + Volume at each pivot point
Creates weighted metric for liquidation probability
3. ZONE PROJECTION
Calculates liquidation bands based on selected leverage tier
Projects zones where stop losses are likely stacked
4. SIGNIFICANCE RANKING
Normalizes all levels against historical range
Top percentile gets enhanced visual treatment
5. REAL-TIME TRACKING
Monitors price interaction with each zone
Active zones extend forward | Hit zones fade and lock
Memory management removes outdated levels
═══ BEST PRACTICES ═══
✅ DO:
• Use on high-liquidity BTC pairs (BTCUSDT, BTCUSD)
• Combine with volume and order flow analysis
• Look for confluences with key technical levels
• Use higher timeframes for more reliable zones
• Adjust leverage tier based on market volatility
❌ DON'T:
• Trade liquidation zones blindly without confirmation
• Ignore broader market context and trend direction
• Overtrade every single level that appears
• Use as sole entry/exit criteria
• Forget proper position sizing and risk management
═══ TECHNICAL NOTES ═══
• Built with Pine Script v6
• Max 500 boxes, 100 labels for optimal performance
• Auto-scales for different timeframe data availability
• Uses request.security() for multi-exchange aggregation
• Dynamic memory management prevents chart lag
═══ DISCLAIMER ═══
This indicator visualizes potential liquidation zones based on historical volume and open interest data. It does NOT:
• Predict future price movements with certainty
• Guarantee reversals or continuations
• Provide buy/sell signals
• Replace proper risk management
Liquidation zones show where leverage is concentrated — not where price will definitely react. Always use this tool as part of a comprehensive trading strategy alongside technical analysis, risk management, and market context.
📚 EDUCATIONAL USE ONLY | NOT FINANCIAL ADVICE
═══ RESOURCES ═══
Pine Script Documentation
→ www.tradingview.com
Understanding Liquidations
→ academy.binance.com
Open Interest Data
→ www.coinglass.com
Leverage Trading Education
→ www.investopedia.com
═══════════════════════════════════════════════════════════
Built for the Bitcoin trading community 🚀
Because knowing where the leverage sits is half the battle 💎
═══════════════════════════════════════════════════════════
NADAN PD Level and 9 AMenthuta giri aetante setup
numma poliw alle machane
like share comment follow
like for like share for share
like my pro pic bro
27 support
freaky amal on floor
freaky adarsh on floor
Volume Structure Regime Engine (VSRE)Volume Structure Regime Engine (VSRE) is a professional, volume-based market analysis tool designed to help traders identify high-quality directional opportunities with clarity and discipline.
The indicator is built around a three-layer analytical framework, each serving a distinct purpose in the decision-making process:
🔹 Structure Layer
Uses Anchored VWAP to determine directional bias and identify which side of the market is in control. This layer defines the broader context and filters out low-probability trades.
🔹 Regime Layer
Analyzes volume-weighted participation to distinguish between expansion, compression, and distribution phases. This helps traders focus only on periods where meaningful activity is present.
🔹 Execution Layer
Detects short-term volume acceleration aligned with structure and regime, highlighting moments of aggressive participation.
📊 Signal Types
Strong Signals
Appear once per structural move and indicate the first high-quality opportunity aligned with both structure and participation.
Elite Signals
Appear selectively on the first meaningful pullback within an active move, offering refined entry opportunities.
Signals are state-based and non-repetitive, designed to reduce chart clutter and avoid signal overfitting.
✅ Key Features
Volume-driven (no lagging price averages)
Clean, minimal visuals
Non-repainting logic
Built-in signal throttling to reduce noise
Suitable for discretionary trading across intraday and swing timeframes
⚠️ Disclaimer
This indicator is intended for educational and analytical purposes only. It does not constitute financial advice or a recommendation to buy or sell any financial instrument. Trading involves risk, and users are responsible for their own trading decisions.
stelaraX - Order BlocksstelaraX – Order Blocks
stelaraX – Order Blocks is a technical analysis indicator designed to identify, visualize, and manage bullish and bearish order blocks based on swing structure and impulsive price movement. The indicator focuses on institutional price zones and tracks their lifecycle from creation to mitigation or invalidation.
Order blocks are detected using pivot highs and pivot lows and are only validated when followed by a minimum impulsive price move, ensuring structurally relevant zones.
Core logic
The indicator detects order blocks using swing-based market structure:
* bullish order blocks are formed from swing lows followed by an impulsive upward move
* bearish order blocks are formed from swing highs followed by an impulsive downward move
The originating candle of the order block can be defined using different calculation modes:
* Last Candle
* Wick to Wick
* Full Range
Each order block stores its full range, midpoint level, creation bar, and current state.
Mitigation and breaker blocks
Order blocks are monitored in real time for mitigation.
Mitigation can be defined as:
* first touch
* 50 percent retracement
* full fill of the order block
Once mitigation occurs, an order block can:
* remain visible in a mitigated state
* be removed automatically
* convert into a breaker block if price fully violates the zone
Breaker blocks represent structurally broken order blocks and are highlighted separately.
Visualization
Order blocks are displayed directly on the chart using colored zones:
* bullish order blocks are shown in green tones
* bearish order blocks are shown in red tones
* mitigated order blocks are faded
* breaker blocks are highlighted using a separate color
Optional features include:
* midpoint level line
* order block labels
* automatic extension of active blocks
* configurable maximum number and maximum age of blocks
All visual elements are fully customizable.
Dashboard
An optional on-chart dashboard provides a real-time overview of:
* total bullish and bearish order blocks
* mitigated order blocks
* active unmitigated blocks
* breaker blocks
* mitigation percentages
Dashboard position and text size are configurable.
Alerts
Alert conditions are available for:
* newly detected bullish order blocks
* newly detected bearish order blocks
Additional alerts are triggered when order blocks are mitigated or converted into breaker blocks.
Use case
This indicator is intended for:
* order block and supply and demand analysis
* institutional-style market structure trading
* identifying high-interest price zones
* multi-timeframe confluence analysis
Disclaimer
This indicator is provided for educational and technical analysis purposes only and does not constitute financial advice or trading recommendations. All trading decisions and risk management remain the responsibility of the user.
Fixed Range Line + EMA Cross Signals with Targetsfixed range lines generate buy sell signal and also we can set targets
SPX SPY 5Min Lock🔹 DESCRIPTION (Public Library)
This indicator overlays SPX price levels directly onto the SPY chart by converting SPX levels into SPY prices using a session-locked SPY/SPX ratio.
Instead of mentally translating SPX levels, you see them mapped precisely on SPY, where you actually trade.
How it works
• Calculates the SPY-to-SPX price ratio
• Locks the ratio at the first 5-minute RTH candle close (9:35am ET)
• Uses that fixed ratio for the entire session
• Converts SPX levels into accurate SPY-equivalent prices
• Draws clean labels (and optional short stubs) directly on SPY
Why the 5-minute lock
SPY and SPX can drift slightly during the day. Locking the ratio at 9:35am creates stable, non-moving levels that stay consistent throughout RTH, making them far more usable for intraday trading.
Best use cases
• SPY / SPX options traders
• Index-based level traders
• GEX, gamma, and macro level mapping
• Traders who think in SPX but execute in SPY
Customization
• Adjustable SPX level spacing (5 / 10 / 25)
• Number of levels above and below price
• Label size and offset
• Live or Locked ratio mode
• Optional short line stubs
• Info table with ratio and lock status
Volatility Expansion Indicator - D_QuantVolatility Expansion Indicator - D_Quant |V|C|E|
1. Concept & Overview
The Volatility Expansion Indicator (VCE) is a composite quantitative tool designed to identify robust trend states by aggregating signals from three distinct market dimensions: Relative Position (Volatility), Cyclical Momentum, and Price Velocity.
Unlike single-source indicators which often generate false positives during choppy markets, the VCE utilizes a "Consensus Engine." It normalizes signals from Bollinger %B, CCI, and ROC into a unified trend score (-1 to +1). This score drives the visual coloring of the price action and background, allowing traders to instantly gauge whether the market is in a state of volatility expansion (trending) or contraction (ranging).
2. Methodology & Calculation
The core logic relies on a weighted aggregation of three technical components. Users can toggle these components on or off in the settings to isolate specific market mechanics.
A. Component 1: Bollinger %B (Relative Positioning)
Logic: Measures where the price is located relative to the Bollinger Bands.
Bullish Condition: If %B > 0.5 (Price is operating in the upper hemisphere of the bands).
Bearish Condition: If %B < 0.0 (Price has broken below the lower band).
Purpose: Filters out weak trends by ensuring price is statistically significant relative to its recent volatility.
B. Component 2: CCI (Commodity Channel Index)
Logic: Measures current price levels relative to an average price level over a specific period.
Thresholds: A standard +100 / -100 threshold is used. Values above 100 add to the bullish score; values below -100 add to the bearish score.
Purpose: Identifies cyclical momentum extremes.
f_cci(_len) =>
cci_val = ta.cci(close, _len)
val = 0
if cci_val > 100
val := 1
if cci_val < -100
val := -1
val
C. Component 3: ROC (Rate of Change)
Logic: Calculates the percentage change between the current price and the price n periods ago.
Thresholds: Simple zero-line crossover. Positive ROC implies bullish velocity; negative implies bearish.
Purpose: Provides a raw directional bias based on pure price speed.
D. The Aggregation Engine: The script sums the active signals and divides by the number of active components.
Bullish Trend: Composite Score > 0 (Visualized as Deep Navy).
Bearish/Neutral: Composite Score ≤ 0 (Visualized as White).
E. Multi-Timeframe (MTF) Capability: The indicator includes a request.security module. This allows you to calculate the consensus trend on a higher timeframe (e.g., Daily) while viewing price action on a lower timeframe (e.g., 15-minute), ensuring you are trading in alignment with the macro trend.
// NEW: Timeframe Selection
tf_input = input.timeframe("", "VCE Timeframe", group=grp_sets, tooltip="Empty = Current Chart. Set to 'D' for fixed Daily trend.")
= request.security(syminfo.tickerid, tf_input, , lookahead=barmerge.lookahead_on)
3. Visualizations
The indicator overlays the following elements on the chart:
Trend SMMA: A central Smoothed Moving Average (SMMA 20) representing the mean.
Volatility Bands: Upper and Lower bands calculated at 2 Standard Deviations from the SMMA.
Bar Coloring:
Navy Blue: Indicates a confirmed Volatility Expansion (Bullish Confluence).
White: Indicates Neutrality, Retracement, or Bearish conditions.
Dynamic Fills: The space between the bands fills with color to highlight the strength of the current regime.
4. How to Use
Trend Following: Look for the bar color to switch to Navy. This indicates that momentum, volatility, and velocity have aligned bullishly. This is often an entry trigger for long positions.
Exits: When the bars switch from Navy back to White/Gray, the volatility expansion has ceased or momentum is diverging. This serves as a warning to tighten stops or take profits.
MTF Filter: Set the "VCE Timeframe" input to "D" (Daily). Trade on the H1 chart. Only take long positions when the Daily VCE paints the background/bands in the Bullish color.
5. Settings
Bollinger %B: Adjust Length and Multiplier (Default: 20, 2.0).
CCI: Adjust Length (Default: 23).
ROC: Adjust Length (Default: 50).
Signal Components: Toggle specific logic blocks on/off to customize the sensitivity of the composite score.
VCE Timeframe: Select the resolution for the calculation (Leave empty for current chart).
Disclaimer: This tool is for informational purposes only. Past performance of volatility expansion does not guarantee future results. Always manage risk appropriately.
CRR Bill Williams Neo System (Alligator, Fractals, AO, AC, MFI)CRR Bill Williams Neo System is an educational chart overlay that combines classic Bill Williams concepts into a single visual framework.
The script integrates Alligator (SMMA-based trend structure), confirmed Fractals, Awesome Oscillator (AO), Accelerator Oscillator (AC), and the Bill Williams Market Facilitation Index (MFI).
Signals Logic
BUY signals appear when the Alligator trend is bullish (Lips > Teeth > Jaw), the Awesome Oscillator (AO) is above zero, the Accelerator Oscillator (AC) is above zero, the MFI state is GREEN or SQUAT, and price closes above the Lips line.
SELL signals appear when the Alligator trend is bearish (Lips < Teeth < Jaw), the Awesome Oscillator (AO) is below zero, the Accelerator Oscillator (AC) is below zero, the MFI state is GREEN or SQUAT, and price closes below the Lips line.
Signals can be configured to appear only after bar close for confirmation.
Fractals Behavior
Fractals are detected using pivot confirmation.
A fractal is confirmed only after the selected number of right bars have closed.
Because of this, fractal markers appear with a delay.
This behavior is expected and does not represent repainting.
How to Use
This indicator is designed to help visualize trend direction, momentum, and market activity.
It should be used as a confirmation tool together with price action and proper risk management.
Disclaimer
This script is for educational purposes only.
It does not constitute financial advice.
Always apply your own analysis and risk management.
Supertrend with Keltner Channels ~ CharonQuantThe Supertrend with Keltner Channels Strategy is a trend-following and volatility indicator designed to filter noise and highlight high-quality directional opportunities.
Core Logic
The indicator is based on two complementary components:
• Supertrend defines the primary market regime (bullish or bearish)
• Keltner Channels define volatility expansion and contraction
Signals are only generated when both trend direction and volatility breakout agree.
Signal Conditions
A Buy signal is triggered when:
• Supertrend flips bullish
• Price breaks above the upper Keltner Channel
A Sell signal is triggered when:
• Supertrend flips bearish
• Price breaks below the lower Keltner Channel
If one condition is missing, no signal is produced. This design prioritizes signal quality over signal frequency.
Visual Structure
The indicator uses a clear visual hierarchy:
• Bar coloring reinforces directional bias
• Supertrend acts as the main directional spine
• Keltner Channels provide volatility context
• Buy and Sell labels mark execution points
All visual elements can be enabled or disabled from the Visual Settings panel.
Development and usage notes:
This indicator was developed and calibrated on the 1D INDEX:BTCUSD chart.
You must tweak the parameters to fit your market, timeframe, and trading style.
If you do not read this description or do not understand what the indicator is designed to do, do not use it.
Indicators amplify both discipline and mistakes.
Important reminder: No single indicator is sufficient on its own.
Mine Shaft + Drift + Ore Pocket Detector (Gap+Touch)Mine Shaft + Drift + Ore Pocket Detector (Gap+Touch) — Full Description (v1.6.1, Pine v6)
*Experimental - *Test Phase*
1) What this indicator is intended to do
This indicator attempts to algorithmically discover “mine shaft” price structure on a chart by:
Collecting structural anchor points (gaps and optionally pivots),
Generating candidate trend “rails” (centerline + parallel upper/lower borders) from pairs of anchors,
Fitting an optimal channel width around each candidate centerline,
Scoring candidates based on how well price action conforms to the channel (touches + containment),
Selecting and rendering:
the main shaft channel (primary),
additional drifts (secondary shafts per direction),
And then detecting Ore Pockets: time locations where multiple selected lines intersect (time confluence / intersection clustering).
The conceptual model is:
A shaft = a best-fit channel that price respects over time (the “main tunnel”).
Drifts = alternate channels close in quality to the main shaft (secondary tunnels).
Ore pockets = future/past time coordinates where multiple channels’ centerlines intersect densely (confluence in time, not necessarily in price).
2) What it is doing right now (current behavior)
In its current form, the script does a bounded, performance-limited scan:
It stores a limited number of anchor points in arrays.
It only considers a bounded number of recent anchors per direction.
It constructs candidate lines from anchor pairs and evaluates channel fitness using sampled bars.
On the last bar, it selects top candidates per direction and draws:
a “main” channel per mode (single best overall, or separate up/down),
plus optional drift channels,
plus ore pocket markers.
It is producing meaningful channels and drifts, but it is currently more likely to lock onto a strong “local” shaft than the one macro shaft spanning the entire market structure.
3) Core mechanics (how the script finds shafts)
3.1 Anchor generation (what points it uses)
Anchors are the “support points” used to build candidate shaft centerlines.
Two anchor families are supported:
A) Gap anchors (from your selected gap mode)
These attempt to capture “displacement events” and their boundaries/mids.
B) Pivot anchors (optional structural anchors)
These use pivots to inject macro structure points that are not strictly gap-based.
All anchors are stored as:
anchorX: bar_index of anchor
anchorY: price of anchor
anchorD: direction flag (+1 for up, -1 for down)
Anchors are capped by maxAnchors with FIFO trimming.
3.2 Candidate generation (how it produces centerlines)
For each direction (+1 and -1):
Collect “recent” anchors of that direction within lookbackBars (bounded to maxDirAnchors).
For each pair of anchors (x1,y1) and (x2,y2) that satisfy:
spacing within ,
slope sign consistent with direction,
Construct the line equation:
slope m and intercept b
Fit a channel width w around that line (via width mode).
Score it (touches + inside count minus width penalty).
Keep the top K rails (K = driftCount+1 typically).
3.3 Scoring model (what “best” means right now)
For a candidate centerline:
At sampled bars (stride sampling), compute:
channel top = y(x) + w
channel bot = y(x) - w
Evaluate:
Inside: candle range fits within the channel ± tolerance
Touches: high near top border, low near bottom border (within tolerance)
Score formula:
score = insideCount * insideWeight
+ touchCount * touchWeight
- (w / ATR) * widthPenalty
So:
Higher inside and touch counts increase score
Wider channels are penalized (in ATR units) to avoid “cheating” via enormous width
3.4 Width fitting (how the channel thickness is chosen)
Width is either:
Fit (scan widths): scans widths between a min width and a max deviation cap and selects the best scoring width.
Fixed ATR Envelope: uses a fixed width derived from ATR (currently hard-coded to a 2.0 ATR envelope in your present draft).
Fixed Max Deviation: width is max observed deviation from line in sampled window.
This matters because “macro shaft” detection is strongly influenced by whether the width-fitting is allowed to expand enough to contain large historical moves, without being penalized into losing to a smaller local shaft.
3.5 Rendering (what gets drawn)
For any selected rail, it draws:
Upper border line (top rail)
Lower border line (bottom rail)
Optional centerline (main only)
Optional fill between borders (main only)
Label at current bar with touches and inside count
Drifts render similarly but without main-only features (depending on flags).
3.6 Ore Pocket detection (time confluence)
Ore pockets are not “price zones” directly.
They are computed as follows:
Collect selected centerlines (m,b) for:
the main selected shaft(s),
and all drift centerlines (both directions if present)
For each pair of selected lines, compute intersection x-coordinate:
x* = (b2 - b1) / (m1 - m2)
Only keep intersections within:
Cluster intersections by time proximity (clusterBars)
Mark the strongest clusters (highest counts) as “Ore Pocket” vertical dotted lines with labels.
Interpretation:
A dense cluster indicates many selected rails converge around a similar time coordinate.
It is a “time confluence” hypothesis point.
4) Full settings reference (what each setting is for)
01) Gap Anchors
Gap Mode
FVG (3-candle)
Uses a classic 3-candle fair value gap pattern:
Up gap if low > high
Down gap if high < low
Anchors are derived from the gap boundaries.
Candle Gap (open-close)
Gap based on open vs close of the same bar with a tick threshold.
Candle Gap (open-prev close)
Gap based on open vs close with a tick threshold.
Gap Threshold (ticks)
Only used for the candle gap modes.
Controls the minimum gap size required to register an anchor.
Anchor Price
Boundary: anchors at one gap boundary (more “structural edge”)
Mid: anchors at midpoint of the gap (more “center of displacement”)
Include Pivot Anchors (structure)
When enabled, adds pivots as additional anchors to stabilize macro detection.
Pivot Length
Pivot sensitivity (how many bars left/right define a pivot).
Larger values = fewer, more structural pivots.
02) Channel Fit + Touch Scoring
Lookback Bars
The historical window used to:
filter which anchors are considered “recent enough”
evaluate channel fitness (sampled evaluation)
Larger lookback tends to favor macro shafts, but also increases computational risk (mitigated by evalBars and stride).
ATR Length
ATR period used for tolerance and width penalty scaling.
Tolerance (ATR mult)
Defines how close price must be to a rail to count as “touch” and how strict the “inside channel” containment is.
Higher tolerance = easier to score high on touch/inside.
Min Border Touches (keep rail)
Minimum number of border touches required before a candidate is even eligible.
Score: Inside Weight
Weight of inside count in score.
Score: Border Touch Weight
Weight of border touches in score.
This is a strong driver of “shaft-like” behavior.
Score: Width Penalty (in ATRs)
Penalizes wide channels relative to ATR.
Higher penalty biases toward narrow/local shafts.
03) Performance Controls
Max Stored Anchors (global)
Maximum anchor points kept in memory arrays.
Too low can cause loss of macro structure; too high increases candidate noise.
Max Anchors / Direction (scan)
Hard cap on how many anchors are used in candidate generation per direction.
Critical: this strongly influences whether macro shaft can be found, because if you only keep the most recent anchors, you lose the early-structure anchor points.
Eval Bars (max)
Maximum historical bars actually evaluated for scoring.
Even if lookbackBars is large, evaluation is capped here.
Eval Stride (sample every N bars)
Sampling step for evaluation.
Larger stride = faster but less accurate scoring.
04) Candidate Generation
Min Anchor Spacing (bars)
Minimum distance between the two anchors used to define a candidate line.
Prevents micro-noise lines from being evaluated.
Max Anchor Spacing (bars)
Maximum distance between the two anchors used to define a candidate line.
If this is too low, you cannot generate truly macro candidate lines.
05) Shaft + Drift Display
Main Shaft Mode
Best Overall (Single Shaft): chooses one best rail among Up/Down and draws it as main.
Up Only: show only the best upward rail.
Down Only: show only the best downward rail.
Up + Down: show both main up rail and main down rail simultaneously.
Show Ascending Shaft
Toggles rendering for the “up” main shaft (when mode allows it).
Show Descending Shaft
Toggles rendering for the “down” main shaft (when mode allows it).
Drifts per Direction
Number of additional top-ranked rails to draw per direction (after the best one).
Extend Lines
Right: extend lines to the right only.
Both: extend both left and right.
Fill Main Shaft Channel
Fill between upper and lower borders for main shaft.
Main Shaft Fill Transparency
Transparency level for main fill.
Show Main Shaft Centerline
Draw the dashed centerline for the main shaft.
06) Ore Pocket (Intersection-Time Confluence)
Show Ore Pockets (Time Confluence)
Enables ore pocket discovery and rendering.
Intersection Window Forward (bars)
How far into the future intersections are considered.
Intersection Window Backward (bars)
How far into the past intersections are considered.
Cluster Radius (bars)
How close in time intersections must be to merge into a cluster.
Min Intersections per Cluster
Minimum cluster count required before a pocket is shown.
Max Pocket Markers
Limit how many pocket clusters are drawn.
07) Visual Controls
Show Gap Anchors
Displays the gap anchor dots for debugging.
Show Pivot Anchors
Displays pivot anchor dots for debugging.
5) How to use it (practical workflow)
Step A — Confirm anchor behavior
Turn on Show Gap Anchors.
Choose your Gap Mode.
Verify you are seeing anchors where you expect (displacement boundaries).
If anchors are sparse:
Reduce gap threshold (ticks) for candle-gap modes
Enable pivots to inject structure
Increase lookbackBars and maxAnchors so early anchors are not dropped
Step B — Get stable main shaft candidate discovery
Enable Include Pivot Anchors with a medium pivotLen.
Use Fit (scan widths) initially.
Increase Max Anchors / Direction (scan) so you’re not only using recent anchors.
Increase Max Anchor Spacing so macro pairs are eligible.
If you keep getting only local shafts:
That is usually because the candidate pool does not include enough old anchors, or the maxSpacing prevents long-span lines.
Step C — Tune scoring so the “whole-structure” shaft wins
If the script picks a small local channel instead of the macro channel:
Increase insideWeight relative to touchWeight (macro channels tend to contain longer structure even with fewer perfect “touches”)
Reduce widthPenalty, because macro channels may need to be wider to accommodate historical volatility
Increase lookbackBars and evalBars to make “whole-structure fit” matter
Step D — Drifts as secondary shafts
Once main shaft is good:
Increase Drifts per Direction
Validate that drifts represent meaningful alternate sub-shafts rather than noisy duplicates.
If drifts look too similar:
This is expected if many candidates differ only slightly; future refinements should diversify drift selection (see “what still needs done”).
Step E — Ore pockets interpretation
Ore pockets indicate time confluence of multiple rails.
Use them as:
“Time windows to watch”
Not as deterministic price levels
Tune:
clusterBars (cluster tightness)
minClusterSize (signal strength)
6) What still needs done (explicit backlog)
The macro “main mining shaft channel” spanning the entire market structure, and
Smaller shafts/drifts nested inside the macro structure.
To accomplish that, the current algorithm needs additional architecture. Concretely:
A) True multi-scale / hierarchical discovery (primary missing feature)
Right now: one pass, one lookback, one score objective.
Still Needed:
Macro pass: discover a primary shaft using a very long evaluation window and anchor set.
Micro pass(es): discover drifts/secondary shafts using:
residuals (distance from macro centerline),
or segmented time windows (regime partitions),
or anchor subsets constrained to local regions.
This is the single biggest reason we are not consistently getting the full-structure shaft.
B) Anchor retention strategy for macro detection
Right now:
anchors are FIFO capped and direction scanning uses “recent anchors only.”
To reliably find 10-year shafts we need:
an option to store/retain representative anchors across the entire history, not only the most recent ones.
Examples of necessary improvements:
“Stratified anchor sampling” across time (keep some old anchors even when maxAnchors is hit)
“Macro anchor bank” (separate storage for pivots or major gaps)
C) Candidate generation constraints must support macro lines
If we want a shaft spanning the whole structure:
maxSpacing must allow it
the candidate pool must contain anchors far apart in time
So the algorithm needs:
better selection of anchor pairs for long-span candidates (e.g., include earliest/oldest anchors + newest anchors deliberately, not accidentally)
D) Drift diversification
Right now drifts are “next best by score,” which often yields near-duplicates.
We want:
“diverse” secondary shafts:
enforce minimum angular difference,
enforce minimum offset difference,
or penalize candidates too similar to the already-selected shaft.
E) Width fitting logic for macro channels
Macro channels often require:
either a higher width cap,
or a different penalty profile.
Current width penalty is simple and can bias against macro channels.
Needed:
width penalty that scales by timescale or by total evaluated bars,
or separate macro/micro scoring.
F) Ore pocket semantics enhancement (optional but aligned)
Currently pockets are time intersections only.
If you want “pocket zones,” improvements could include:
projecting intersection price and drawing a zone box,
clustering in (time, price) space instead of only time,
adding “importance” weighting based on which lines intersect (macro line intersections weighted higher).
7) Known limitations (current version)
Heavy compute only runs on last bar (good for performance), but means:
changes in anchors/parameters can reselect rails abruptly
Candidate set is bounded; macro shaft can be missed if not in pool
Drift selection can be redundant
Ore pockets are time clusters, not price clusters
Andra Algo//@version=5
indicator(title="Andra Algo V 1.2", shorttitle="Andra Algo V1.2", overlay=true)
// =====================
// INPUT
// =====================
src = input(defval=close, title="Source")
per = input.int(defval=100, minval=1, title="Sampling Period")
mult = input.float(defval=3.0, minval=0.1, title="Range Multiplier")
// =====================
// COLOR SET
// =====================
buyLineColor = color.white
sellLineColor = color.blue
midColor = #90bff9
buyBgColor = color.new(color.gray, 20)
sellBgColor = color.new(color.blue, 20)
// =====================
// SMOOTH RANGE
// =====================
smoothrng(x, t, m) =>
wper = t * 2 - 1
avrng = ta.ema(math.abs(x - x ), t)
ta.ema(avrng, wper) * m
smrng = smoothrng(src, per, mult)
// =====================
// RANGE FILTER
// =====================
rngfilt(x, r) =>
rf = x
rf := x > nz(rf ) ?
(x - r < nz(rf ) ? nz(rf ) : x - r) :
(x + r > nz(rf ) ? nz(rf ) : x + r)
rf
filt = rngfilt(src, smrng)
// =====================
// TREND DIRECTION
// =====================
upward = 0.0
upward := filt > filt ? nz(upward ) + 1 : filt < filt ? 0 : nz(upward )
downward = 0.0
downward := filt < filt ? nz(downward ) + 1 : filt > filt ? 0 : nz(downward )
// =====================
// MID LINE COLOR
// =====================
filtColor = upward > 0 ? buyLineColor : downward > 0 ? sellLineColor : midColor
plot(filt, title="Mid Line", color=filtColor, linewidth=2)
// =====================
// BUY & SELL CONDITIONS
// =====================
longCond = src > filt and upward > 0
shortCond = src < filt and downward > 0
CondIni = 0
CondIni := longCond ? 1 : shortCond ? -1 : CondIni
longCondition = longCond and CondIni == -1
shortCondition = shortCond and CondIni == 1
// =====================
// SIGNALS (FIXED BG COLOR)
// =====================
plotshape(longCondition, title="Buy Signal", text="BUY", style=shape.labelup, location=location.belowbar, size=size.small, textcolor=color.white, color=buyBgColor)
plotshape(shortCondition, title="Sell Signal", text="SELL", style=shape.labeldown, location=location.abovebar, size=size.small, textcolor=color.white, color=sellBgColor)
// =====================
// ALERTS
// =====================
alertcondition(longCondition, title="Buy Alert", message="Andra Algo V1.2 BUY")
alertcondition(shortCondition, title="Sell Alert", message="Andra Algo V1.2 SELL")






















