Trend/Range Composite (Single-Line) v1.4🔹 Step 1: Add it to your chart
Copy the whole script.
In TradingView → Pine Editor → paste it.
Click Add to chart.
It will show a white line in a subwindow, plus thresholds at 40 and 60, and a colored background.
Optional: You’ll see a status box (top-right of chart) with details like ADX, ATR, slope, etc.
🔹 Step 2: Understand the Score
The indicator compresses all signals into a 0–100 “Trend Strength Score”:
≥ 60 = TREND (teal background)
→ Market is trending, consider trend strategies like vertical spreads, runners, breakouts.
≤ 40 = RANGE (orange background)
→ Market is choppy/sideways, consider range strategies like butterflies, condors, mean-reversion fades.
40–60 = MIXED (gray background)
→ Indecision / chop. Best to reduce size or wait for clarity.
🔹 Step 3: Use with Your Trading Plan
Intraday (5m, 15m, 30m)
Score < 40 → play support/resistance bounces, fade extremes.
Score > 60 → play momentum breakouts or pullback continuations.
Daily chart
Good for swing context (is this month trending or just chopping?).
🔹 Step 4: Alerts
You can set TradingView alerts:
Cross above 60 → market entering trend mode.
Cross below 40 → market entering range mode.
Useful if you don’t want to watch constantly.
🔹 Step 5: Confirm with Price Levels
The score tells you “trend vs range”, but you still need levels:
If score < 40 → mark PDH / PDL (previous day high/low), VAH/VAL, VWAP. Expect rejections/fades.
If score > 60 → watch for breakouts beyond PDH/PDL or supply/demand zones.
Wskaźniki i strategie
Market Bias (CEREBR)Market Bias (CEREBR) — quick read of who’s in control
What it does, in one line:
It builds a clean, smoothed Heikin-Ashi view (optionally from a higher timeframe) and an oscillator that says: bullish, bearish, or cooling off. You use it to decide directional bias and to avoid trading against that bias.
What you see on the chart
Smoothed HA candles (optional): green = bullish bias, red = bearish bias.
A soft fill band around the HA body:
Brighter = bias is strengthening.
Faded = bias is weakening.
(In Data Window) “Bias High / Low / Average” = the smoothed HA range and midline.
If you only look at one thing: green means look for longs, red means look for shorts. Faded color = be picky or trim.
How to use it (simple playbook)
Pick your higher timeframe (HTF) for the bias.
On a 4H chart, try HTF = 12H or 1D.
Rule: HTF must be equal to or higher than your chart TF.
Trade with the bias at real levels.
Longs only when the bias is green.
Shorts only when the bias is red.
Take entries at location: Volume Profile v3.2 levels (VAH/VAL/POC/LVNs) or Anchored VWAP.
Quality check (optional but strong):
Before clicking, glance at CVDv1.
Green bias + CVD Alignment OK and no Absorption = better odds.
If CVD shows Absorption against you, skip or wait for a retest.
When to pass:
Color flips every other bar (chop) → do less.
Color is fading (weakening) into your entry → size down or wait.
Timeframe guidance
Scalps (1–5m): HTF = 15m/30m. Use bias to filter direction; enter on pullbacks at AVWAP/VA edges.
Intraday (15m–1H): HTF = 4H. Buy dips in green / sell pops in red at VP levels.
Swing (2H–4H): HTF = 12H/1D. First pullback after a fresh flip is usually the best.
Position (1D–1W): HTF = 1W. Hold while color stays consistent; reduce on weakening near HVNs.
Entries, exits, and stops
Entry with trend:
Bias green, price pulls back to AVWAP / VAL / prior HA mid, then holds.
Click the long. Reverse for shorts in red.
Exit / reduce:
When “Trend Weakens” alert fires, or color fades while hitting your POC/HVN target.
Hard exit on opposite flip (green→red or red→green) if your idea was pure trend-follow.
Stops:
Behind structure/level (not just on color).
If the next bar flips bias against you and CVD also disagrees, cut it early.
Inputs that matter (keep these simple)
Timeframe (HA Market Bias): your HTF. Must be ≥ chart TF.
Period (default 100): smoothing for the base OHLC. Higher = steadier.
Smoothing (default 100): extra smoothing for the HA feed. Higher = fewer flips.
Oscillator Period (default 7): affects how fast strengthening/weakening shows in the fill color. Lower = quicker.
Tip: If you see too many flips, raise Period/Smoothing or pick a higher HTF. If it feels slow, lower them one notch.
Alerts (plain meaning)
Bullish Trend Switch: bias turned bearish → bullish.
Bullish Trend Strengthens / Weakens: same direction, momentum building / cooling.
Bearish Trend Switch: bullish → bearish.
Bearish Trend Strengthens / Weakens: same idea for shorts.
Use “Switch” to prepare for new setups; use “Strengthens/Weakens” to add/trim or tighten risk.
How it works (one paragraph, no math)
The script smooths price, builds Heikin-Ashi values on your chosen HTF, smooths those again, and doesn’t repaint on closed bars. From the HA open/close difference it creates a simple bias oscillator: above zero = bullish, below zero = bearish. The fill brightness tells you if that bias is getting stronger or weaker right now.
Good combos (optional, but recommended)
Volume Profile v3.2 : use VAH/VAL/POC/LVNs as your battleground.
Anchored VWAP : use reclaims/rejections for timing.
CVDv1 : sanity-check flow quality before entry.
FAQ (quick)
Does it repaint?
No on closed bars. HTF values are requested with a safe offset.
Best starting setup?
4H chart, HTF = 1D, Period/Smoothing 100/100, Oscillator 7.
Can I hide the HA candles?
Yes—toggle “Show HA Candles.” Keep only the bias fill if you want a cleaner price chart.
Short disclaimer
Educational tool, not advice. Markets carry risk. Test first, size small, and trade with your plan.
Elliott Wave Oscillator [JopAlgo]Elliott Wave Oscillator — a simple impulse meter that tells you when the move has “real push”
If price is the story, impulse is the emotion behind each chapter. The Elliott Wave Oscillator (EWO) is a clean way to see that emotion: it’s just the difference between a fast and a slow moving average. When the fast MA pulls away from the slow MA, the histogram grows; when they come back together, it shrinks. Above zero = bullish impulse; below zero = bearish impulse.
EWO keeps the math honest and the read effortless:
Choose SMA, EMA, or a volume-weighted average for each side (the “VWAP” option here uses a rolling VWMA over the chosen length).
A zero line anchors the read (bull vs bear).
Bars color by slope: rising = building momentum, falling = momentum fading.
(For screenshots: image #1 label the zero line, rising/falling bars, and a zero cross. Image #2 show a strong impulse leg hugging one side of zero, then fading into a pullback.)
What you’re seeing (and how it’s built)
Short MA (default 5) and Long MA (default 35) are computed using your selected MA Type (SMA, EMA, or rolling volume-weighted).
EWO = Short MA − Long MA.
EWO > 0: fast MA above slow → bullish impulse.
EWO < 0: fast MA below slow → bearish impulse.
Histogram colors:
Green bar: EWO increasing vs previous bar (momentum building).
Red bar: EWO decreasing (momentum waning).
Alerts: fire when EWO crosses the zero line (bullish or bearish “trend shift” heads-up).
New to this? Think of EWO as a throttle: above zero the engine is pushing forward; below zero it’s pushing backward. The height shows how hard it’s pushing; the color shows if that push is growing or fading right now.
How to use EWO on any timeframe
Same framework everywhere—what changes is your location and targets (from your other tools).
Scalping (1–5m)
Breakout confirmation: Only chase a micro-break if EWO flips above zero and grows green as price leaves a level (VAL/LVN/AVWAP). If it flips then immediately shrinks red, that’s your “don’t chase” warning.
Pullback timing: In a quick trend, wait for EWO to dip but stay above zero, then turn green again. That flip is often your pullback end.
Intraday (15m–1H)
Continuation filter: After a level break, ride as long as EWO stays on your side of zero. The first red bar while still above zero is a cue to partial or tighten stops.
Failed break tell: A poke through VAH/VAL with EWO still near zero (no expansion) is often a trap. Prefer retest/reclaim trades.
Swing (2H–4H)
Impulse leg ID: Strong trends show an EWO “bulge” (wide, mostly green bars above zero for longs). When that bulge shrinks back toward zero, look for mean-reversion to AVWAP/POC before the next leg.
Divergence (lightweight): Price makes a higher high, but EWO tops at a lower peak → impulse is weaker; plan for retrace to value.
Position (1D–1W)
Regime bias: Weeks where EWO lives above zero are net constructive; below zero are net distributive. Use that as a backdrop for adds/reductions at your higher-TF levels (Weekly AVWAP, composite VAL/VAH).
Entries, exits, and risk (simple rules)
Entry: At your level (from VP/AVWAP), take the side where EWO is on the correct side of zero and turning green (for longs) or red→green below zero for shorts? Careful—below zero, red means waning bear impulse. For shorts, you want EWO < 0 and increasing in magnitude (i.e., more negative) which still paints red in this script? Here’s the practical translation:
Longs: EWO > 0 and rising (green bar).
Shorts: EWO < 0 and falling (more negative vs prior bar). In this script, that also paints red—which is correct for building bearish impulse.
Manage: If your long was driven by EWO above zero, consider reducing when bars turn red repeatedly or EWO rolls back toward zero at your target node.
Invalidation: A zero cross against you after entry is a hard warning—tighten or exit unless higher-TF context strongly favors holding.
Stops: Place beyond the price level/structure you used, not on an EWO flip alone.
Settings that actually matter (and how to tune them)
MA Type (SMA / EMA / VWAP):
EMA: most responsive; great for scalping/fast intraday.
SMA: smoother; better for swings where you want fewer false wiggles.
VWAP (rolling VWMA): weights price by volume over your length—nice on pairs where volume behavior matters. (Note: this is a rolling VWMA, not an anchored session VWAP.)
Short/Long Lengths (default 5/35):
Shorter/faster (e.g., 4/20) → earlier flips, more noise.
Longer/slower (e.g., 8/50) → fewer but stronger signals.
Keep the ratio—something like 1:4 to 1:6—so the “bulge” is meaningful.
Zero-cross alerts: leave them on but treat as heads-up, not entries in isolation. You still want location + flow.
What to look for (pattern cheatsheet)
Impulse bulge: Wide, consecutive bars above zero (mostly green) → trend leg in progress. Expect shallow pullbacks only.
Pullback reset: After a leg, EWO shrinks but stays above zero, then flips green again → pullback likely done.
No-juice breakout: Price pokes the level but EWO stays near zero / flips red quickly → skip the chase; look for reclaim setups.
Divergence at extremes: New price high with lower EWO peak → risk of fade to value (POC/AVWAP).
Combining EWO with other tools
Cumulative Volume Delta v1 (CVDv1):
Use EWO for impulse, CVDv1 for quality. Best trades line up as:
EWO > 0 and increasing + CVDv1 ALIGN = OK + Imbalance strong + Absorption ≠ red → take the breakout/retest.
If EWO says “go” but CVDv1 flags Absorption, don’t chase.
Volume Profile v3.2:
Use VAH/VAL/LVNs/POC as where. EWO tells you if the push has fuel to leave/enter value.
Example: VAL retest with EWO turning up → rotate to POC/HVN.
Anchored VWAP:
Reclaims are higher quality when EWO flips above zero on the reclaim bar and holds green on the first pullback.
(Optional mention in screenshots: show a VAH break where EWO bulges and CVDv1 shows Alignment OK—clean continuation.)
Common pitfalls EWO helps you avoid
Buying a break with no impulse: Zero-line hugs and shrinking bars tell you the fast MA isn’t pulling away—skip.
Fading a real leg: Wide, persistent bars on one side of zero = don’t fight; use pullbacks to value instead.
Confusing volume-weighted vs anchored VWAP: The “VWAP” choice here is a rolling VWMA over the lookback, not a session/event AVWAP. Use Anchored VWAP when you need the true event-anchored line.
Practical defaults to start with
MA Type: EMA
Short/Long: 5 / 35
Timeframes: works out of the box on 15m–4H; for 1–5m try 4/20; for daily swings try 8/50.
Keep zero-cross alerts on as an attention ping; still require location + flow.
Alerts (what they mean)
Bullish EWO Signal: EWO crossed above zero → bullish impulse engaged. Look for a retest at your level with CVDv1 quality before entry.
Bearish EWO Signal: EWO crossed below zero → bearish impulse.
Open source & disclaimer
This indicator is published open source so traders can study it, tweak it, and build rules they trust. Tools inform decisions, but risk management decides outcomes.
Disclaimer — Not Financial Advice.
The “Elliott Wave Oscillator ” indicator and this description are provided for educational purposes only and do not constitute financial or investment advice. Trading involves risk, including possible loss of capital. makes no warranties and assumes no responsibility for any trading decisions or outcomes resulting from the use of this script. Past performance is not indicative of future results.
Use EWO to judge when there’s real push, Volume Profile v3.2 and Anchored VWAP for where to act, and CVDv1 to verify who’s actually pushing. That trio keeps you selective on any timeframe.
MARA / mNAV=1 (x)What it does
This script overlays two signals on the MARA chart:
mNAV=1 fair-value line — the MARA price implied by Bitcoin NAV:
mNAV1 = (BTC price × BTC holdings) / MARA shares
Premium/Discount ratio — how far MARA trades vs. its NAV fair value:
Ratio = Close / mNAV1 (1.00 = fair; >1 = premium; <1 = discount)
Inputs
Shares outstanding (default: 370,460,000)
BTC holdings (official or estimated; you can roll forward +25 BTC/day if you want)
BTC symbol used for pricing (e.g., BTCUSD, BTCUSDT, BTCUSDTPERP)
How to use
When Price < mNAV=1 and Ratio < 1.00 → MARA trades at a discount to BTC NAV (potential mean-reversion if BTC is stable).
When Price > mNAV=1 and Ratio > 1.00 → premium (premium often compresses during BTC chop/weakness).
Rule of thumb (with ~53k BTC and 370.46M shares): +$1,000 BTC ≈ +$0.14 on the mNAV=1 line.
Visuals
Blue line = mNAV=1 (fair value) plotted directly on the MARA chart.
Purple line = Ratio (×) on a separate right-hand scale centered around 1.00.
Optional shading: green when Ratio > 1.05 (+5% premium), red when Ratio < 0.95 (−5% discount).
Alerts (suggested)
Premium > +5%: Ratio > 1.05
Discount < −5%: Ratio < 0.95
Notes
This is a proxy for NAV parity; it assumes your BTC holdings input is correct (official last report or your estimate).
Choice of BTC symbol matters; use the feed that best matches your workflow (spot, perp, or index).
The ratio is most informative when BTC is range-bound; during fast BTC moves MARA can overshoot temporarily.
3 Red Heikin Ashi with Higher Lows3 Red Heikin Ashi with Higher Lows will give Buy signal when 3 Red Heikin Ashi with Higher Lows is formed
RUDWAN OSMAN MUHUMED redsco trader
this indicator will help you to use ema 9 and ema 20 together with one indicator.
3SMA (1H only) by tophengzkyThis script plots three Simple Moving Averages (SMA 10, 20, 50), but they are only visible when the chart timeframe is set to 1 hour (1H).
It helps traders focus on higher timeframe trend direction without cluttering charts on other timeframes.
SMA1 = 10 (white)
SMA2 = 20 (yellow)
SMA3 = 200 (red)
Works only on 1H timeframe
Useful for swing traders and intraday traders who rely on hourly trend confirmation.
why 1 hr only? the only purpose of this is just to know the bias of the market weather it will reverse or it will continue the trend. As long as the price action did not cross this 3 SMA's the trend will continue.
as a trend trader it is very useful this strategy.. make it simple!
Bollinger Breakout MarkersSubtle triangle markers that indicate when price extends out of the Bollinger bands to indicate overbought and oversold conditions
Enhanced Std Dev Oscillator (Z-Score)Enhanced Std Dev Oscillator (Z-Score)
Overview
The Enhanced Std Dev Oscillator (ESDO) is a refined Z-Score indicator that normalizes price deviations from a moving mean using standard deviation, smoothed for clarity and equipped with divergence detection. This oscillator shines in identifying extreme overbought/oversold conditions and potential reversals, making it ideal for mean-reversion strategies in stocks, forex, or crypto. By highlighting when prices stray too far from the norm, it helps traders avoid chasing trends and focus on high-probability pullbacks.
Key Features
Customisable Mean & Deviation: Choose SMA or EMA for the mean (default: SMA, length 14); opt for Population or Sample standard deviation for precise statistical accuracy.
Smoothing for Clarity: Apply a simple moving average (default: 3) to the raw Z-Score, reducing noise without lagging signals excessively.
Zone Highlighting: Background colours flag extreme zones—red tint above +2 (overbought), green below -2 (oversold)—for quick visual scans.
Divergence Alerts: Automatically detects bullish (price lows lower, Z-Score higher) and bearish (price highs higher, Z-Score lower) divergences using pivot points (default length: 5), with labeled shapes for easy spotting.
Built-in Alerts: Notifications for Z-Score crossovers into OB/OS zones and divergence events to keep you informed without constant monitoring.
How It Works
Core Calculation: Computes the mean (SMA/EMA) over the specified length, then standard deviation (Population or adjusted Sample formula for N>1). Z-Score = (Source - Mean) / Std Dev, handling edge cases like zero deviation.
Smoothing: Averages the Z-Score with an SMA to create a cleaner plot oscillating around zero.
Levels & Zones: Plots horizontal lines at ±1 (orange dotted) and ±2 (red dashed) for reference; backgrounds activate in extreme zones.
Divergence Logic: Scans for pivot highs/lows in price and Z-Score; flags divergences when price extremes diverge from oscillator extremes (looking back 2 pivots for confirmation).
Visualisation: Blue line for the smoothed Z-Score; green/red labels for bull/bear divergences.
Usage Tips
Buy Signal: Z-Score crosses below -2 (oversold) or bullish divergence forms—pair with volume spike for confirmation.
Sell Signal: Z-Score crosses above +2 (overbought) or bearish divergence—watch for resistance alignment.
Customisation: Use EMA mean for trendier assets; enable Sample std dev for smaller datasets. Increase pivot length (7-10) in volatile markets to filter false signals.
Timeframes: Excels on daily/4H for swing trades; test smoothing on lower frames to avoid over-smoothing. Always combine with trend filters like a 200-period MA.
This open-source script is licensed under Mozilla Public License 2.0. Backtest thoroughly—past performance isn't indicative of future results. Trade with discipline! 📈
© HighlanderOne
Advanced Directional Stoch RSIAdvanced Directional Stochastic RSI
Overview
The Advanced Directional Stochastic RSI (Adv Stoch RSI Dir) is a powerful oscillator that combines the classic Stochastic RSI with John Ehlers' SuperSmoother filter for ultra-smooth signals and reduced noise. Unlike traditional Stoch RSI, this indicator incorporates directional coloring based on price action relative to a smoothed trend line, helping traders quickly spot bullish or bearish momentum. It's designed for swing traders and scalpers looking for clearer overbought/oversold conditions in volatile markets.
Key Features
Directional Coloring: %K line turns green when price is above the trend MA (bullish) and red when below (bearish), providing instant visual bias.
Multi-Pass SuperSmoothing: Apply Ehlers' SuperSmoother filter up to 5 times for customizable noise reduction—dial in passes (default: 2) to balance responsiveness and smoothness.
Trend-Aware Baseline: Uses a cascaded smoothed moving average (default length: 20) to gauge overall direction, making the oscillator more context-aware.
Classic Stoch RSI Core: Built on RSI (default: 14) and Stochastic (default: 14), with SMA smoothing for %K (3) and %D (3).
Visual Aids: Includes overbought (80), oversold (20), and midline (50) levels, plus a subtle blue fill between OB/OS zones for easy reference.
How It Works
Source Smoothing: The input source (default: close) is passed through the SuperSmoother filter multiple times to create a trend MA.
Stoch RSI Calculation: Computes RSI on the source, then applies Stochastic to the RSI values, followed by SMA smoothing for base %K and %D.
Advanced Smoothing: Extra SuperSmoother layers are applied to %K and %D based on your chosen passes, minimizing whipsaws.
Directional Logic: Compares current close to the trend MA to color %K dynamically.
Plotting: %K (thick line, colored) and %D (thin orange) oscillate between 0-100, highlighting crossovers and divergences.
Usage Tips
Buy Signal: Green %K crosses above %D below 50, or bounces off oversold (20) in uptrends.
Sell Signal: Red %K crosses below %D above 50, or rejects overbought (80) in downtrends.
Customization: Increase smoothing passes (3-5) for choppy markets; reduce for faster signals. Pair with volume or support/resistance for confirmation.
Timeframes: Best on 1H-4H charts for stocks/crypto; adjust lengths for forex.
This open-source script is licensed under Mozilla Public License 2.0. Backtest thoroughly—past performance isn't indicative of future results. Enjoy trading smarter with less noise! 🚀
© HighlanderOne
SM OTC style Supply/Demand Zones Lite+//@version=6
indicator("OTC SD MTF Lite+", "OTCSDmtf+", overlay=true, max_boxes_count=200, max_labels_count=200)
// ================= Inputs =================
useH4 = input.bool(true, "Show 4H zones")
useD1 = input.bool(true, "Show 1D zones")
useW1 = input.bool(true, "Show 1W zones")
useM1 = input.bool(false, "Show 1M zones")
baseLen = input.int(2, "Base length (HTF bars)", 1, 5)
wickPctMax = input.float(35.0, "Max wick % in base", 0, 100)
impulseX = input.float(1.5, "Departure body vs ATR (x)", 0.5, 5.0)
atrLen = input.int(14, "ATR length (HTF)")
extendBars = input.int(2000, "Extend bars on chart", 200, 10000)
maxPerTF = input.int(12, "Max zones per TF", 3, 30)
showLegend = input.bool(true, "Show tiny legend (4H/1D/1W/1M)")
onlyNearest = input.bool(false, "Show ONLY nearest zone above/below")
hideOverlapTF = input.bool(true, "Hide overlapping zones within each TF (keep newest)")
showNearestLabels = input.bool(false, "Show distance labels to nearest above/below")
// --- Hard cap for future drawing with xloc.bar_index ---
FUTURE_CAP = 500
// Colors (Demand hues per TF). Supply uses red for contrast.
colH4 = color.new(color.teal, 78)
colD1 = color.new(color.blue, 78)
colW1 = color.new(color.orange, 78)
colM1 = color.new(color.purple, 78)
colSup= color.new(color.red, 78)
// ================= Helpers =================
wickiness(h, l, o, c) =>
rng = math.max(h - l, syminfo.mintick)
topW = h - math.max(o, c)
botW = math.min(o, c) - l
100.0 * (topW + botW) / rng
// Returns: (dTrig, dProx, dDist, sTrig, sProx, sDist)
f_htfSignals(baseBars, wickMax, xImpulse, aLen) =>
float _o = open
float _h = high
float _l = low
float _c = close
float _atr = ta.atr(aLen)
bool ok = true
for i = 1 to baseBars
ok := ok and (wickiness(_h , _l , _o , _c ) <= wickMax)
bool bullDepart = _c > _o and (_c - _o) > xImpulse * _atr
bool bearDepart = _c < _o and (_o - _c) > xImpulse * _atr
float dTrig = 0.0
float dProx = na
float dDist = na
float sTrig = 0.0
float sProx = na
float sDist = na
if ok and bullDepart
float hi = ta.highest(_h, baseBars)
float lo = ta.lowest(_l, baseBars)
dTrig := 1.0
dProx := lo
dDist := hi
if ok and bearDepart
float hi2 = ta.highest(_h, baseBars)
float lo2 = ta.lowest(_l, baseBars)
sTrig := 1.0
sProx := hi2
sDist := lo2
// ================= Pull HTF signals =================
= request.security(syminfo.tickerid, "240", f_htfSignals(baseLen, wickPctMax, impulseX, atrLen))
= request.security(syminfo.tickerid, "D", f_htfSignals(baseLen, wickPctMax, impulseX, atrLen))
= request.security(syminfo.tickerid, "W", f_htfSignals(baseLen, wickPctMax, impulseX, atrLen))
= request.security(syminfo.tickerid, "M", f_htfSignals(baseLen, wickPctMax, impulseX, atrLen))
// ================= Storage per TF =================
var zH4 = array.new_box()
var aH4 = array.new_bool()
var lH4 = array.new_label()
var sH4 = array.new_int() // 1 = Demand, -1 = Supply
var zD1 = array.new_box()
var aD1 = array.new_bool()
var lD1 = array.new_label()
var sD1 = array.new_int()
var zW1 = array.new_box()
var aW1 = array.new_bool()
var lW1 = array.new_label()
var sW1 = array.new_int()
var zM1 = array.new_box()
var aM1 = array.new_bool()
var lM1 = array.new_label()
var sM1 = array.new_int()
// ================= Overlap utils =================
overlap(topA, botA, topB, botB) =>
not (topA < botB or botA > topB)
purgeOverlaps(arrB, arrA, arrL, newTop, newBot) =>
if hideOverlapTF and array.size(arrB) > 0
for i = 0 to array.size(arrB) - 1
if array.get(arrA, i)
box bOld = array.get(arrB, i)
float t = box.get_top(bOld)
float btm = box.get_bottom(bOld)
if overlap(newTop, newBot, t, btm)
box.delete(bOld)
label.delete(array.get(arrL, i))
array.set(arrA, i, false)
// ================= Add zone =================
addZone(arrB, arrA, arrL, arrS, topV, botV, baseColor, isDemand) =>
purgeOverlaps(arrB, arrA, arrL, topV, botV)
int leftX = bar_index - 1
int rightX = bar_index + math.min(extendBars, FUTURE_CAP) // respect +500 cap
box b = box.new(leftX, topV, rightX, botV, xloc=xloc.bar_index, bgcolor=baseColor, border_color=color.new(color.black, 0))
float ly = isDemand == 1 ? topV : botV
st = isDemand == 1 ? label.style_label_down : label.style_label_up
string tagTxt = isDemand == 1 ? "Demand" : "Supply"
label l = label.new(leftX, ly, tagTxt, xloc=xloc.bar_index, style=st, textcolor=color.white, color=color.new(color.black, 0), size=size.tiny)
array.push(arrB, b)
array.push(arrA, true)
array.push(arrL, l)
array.push(arrS, isDemand)
if array.size(arrB) > maxPerTF
box.delete(array.shift(arrB))
array.shift(arrA)
label.delete(array.shift(arrL))
array.shift(arrS)
// ================= Maintain / Invalidate =================
extendAll(arrB, arrA) =>
if array.size(arrB) > 0
for i = 0 to array.size(arrB) - 1
if array.get(arrA, i)
box.set_right(array.get(arrB, i), bar_index + math.min(extendBars, FUTURE_CAP)) // respect +500 cap
invalidate(arrB, arrA, arrL) =>
if array.size(arrB) > 0
for i = 0 to array.size(arrB) - 1
if array.get(arrA, i)
box b = array.get(arrB, i)
float t = box.get_top(b)
float btm = box.get_bottom(b)
// Close outside band → remove
if close > t or close < btm
box.delete(b)
label.delete(array.get(arrL, i))
array.set(arrA, i, false)
// ================= New HTF bar flags (strict booleans) =================
int chH4 = ta.change(time("240"))
int chD1 = ta.change(time("D"))
int chW1 = ta.change(time("W"))
int chM1 = ta.change(time("M"))
bool newBarH4 = useH4 and (not na(chH4)) and (chH4 != 0)
bool newBarD1 = useD1 and (not na(chD1)) and (chD1 != 0)
bool newBarW1 = useW1 and (not na(chW1)) and (chW1 != 0)
bool newBarM1 = useM1 and (not na(chM1)) and (chM1 != 0)
// ================= Create zones on new HTF bar =================
if newBarH4
if d4t > 0 and not na(d4p) and not na(d4d)
addZone(zH4, aH4, lH4, sH4, d4d, d4p, colH4, 1)
if s4t > 0 and not na(s4p) and not na(s4d)
addZone(zH4, aH4, lH4, sH4, s4p, s4d, colSup, -1)
if newBarD1
if d1t > 0 and not na(d1p) and not na(d1d)
addZone(zD1, aD1, lD1, sD1, d1d, d1p, colD1, 1)
if s1t > 0 and not na(s1p) and not na(s1d)
addZone(zD1, aD1, lD1, sD1, s1p, s1d, colSup, -1)
if newBarW1
if w1t > 0 and not na(w1p) and not na(w1d)
addZone(zW1, aW1, lW1, sW1, w1d, w1p, colW1, 1)
if swt > 0 and not na(swp) and not na(swd)
addZone(zW1, aW1, lW1, sW1, swp, swd, colSup, -1)
if newBarM1
if m1t > 0 and not na(m1p) and not na(m1d)
addZone(zM1, aM1, lM1, sM1, m1d, m1p, colM1, 1)
if smt > 0 and not na(smp) and not na(smd)
addZone(zM1, aM1, lM1, sM1, smp, smd, colSup, -1)
// ================= Maintain & Invalidate (every bar) =================
extendAll(zH4, aH4)
extendAll(zD1, aD1)
extendAll(zW1, aW1)
extendAll(zM1, aM1)
invalidate(zH4, aH4, lH4)
invalidate(zD1, aD1, lD1)
invalidate(zW1, aW1, lW1)
invalidate(zM1, aM1, lM1)
// ================= Nearest across all TFs =================
tfNearest(arrB, arrA) =>
int upIdx = -1
int dnIdx = -1
float upDist = 1e10
float dnDist = 1e10
float upBtm = na
float dnTop = na
if array.size(arrB) > 0
for i = 0 to array.size(arrB) - 1
if array.get(arrA, i)
box b = array.get(arrB, i)
float t = box.get_top(b)
float btm = box.get_bottom(b)
if btm >= close
float d = btm - close
if d < upDist
upDist := d
upIdx := i
upBtm := btm
if t <= close
float d2 = close - t
if d2 < dnDist
dnDist := d2
dnIdx := i
dnTop := t
= tfNearest(zH4, aH4)
= tfNearest(zD1, aD1)
= tfNearest(zW1, aW1)
= tfNearest(zM1, aM1)
float upBest = 1e10, dnBest = 1e10
int upArr = -1, upIdxSel = -1, dnArr = -1, dnIdxSel = -1
color upColor = color.new(color.white, 100), dnColor = color.new(color.white, 100)
if (not na(uh4y)) and uh4d < upBest
upBest := uh4d, upArr := 0, upIdxSel := uh4i, upColor := colH4
if (not na(ud1y)) and ud1d < upBest
upBest := ud1d, upArr := 1, upIdxSel := ud1i, upColor := colD1
if (not na(uw1y)) and uw1d < upBest
upBest := uw1d, upArr := 2, upIdxSel := uw1i, upColor := colW1
if (not na(um1y)) and um1d < upBest
upBest := um1d, upArr := 3, upIdxSel := um1i, upColor := colM1
if (not na(dh4y)) and dh4d < dnBest
dnBest := dh4d, dnArr := 0, dnIdxSel := dh4i, dnColor := colH4
if (not na(dd1y)) and dd1d < dnBest
dnBest := dd1d, dnArr := 1, dnIdxSel := dd1i, dnColor := colD1
if (not na(dw1y)) and dw1d < dnBest
dnBest := dw1d, dnArr := 2, dnIdxSel := dw1i, dnColor := colW1
if (not na(dm1y)) and dm1d < dnBest
dnBest := dm1d, dnArr := 3, dnIdxSel := dm1i, dnColor := colM1
// ================= Nearest-only visibility (optional) =================
hideAll(arrB, arrA) =>
if array.size(arrB) > 0
for i = 0 to array.size(arrB) - 1
if array.get(arrA, i)
box.set_bgcolor(array.get(arrB, i), color.new(color.white, 100))
box.set_border_color(array.get(arrB, i), color.new(color.white, 100))
showOne(arrB, arrA, arrS, idx, demColor) =>
if idx >= 0 and idx < array.size(arrB)
if array.get(arrA, idx)
bool isDemand = array.get(arrS, idx) == 1
color c = isDemand ? demColor : colSup
box.set_bgcolor(array.get(arrB, idx), c)
box.set_border_color(array.get(arrB, idx), color.new(color.black, 0))
if onlyNearest
hideAll(zH4, aH4), hideAll(zD1, aD1), hideAll(zW1, aW1), hideAll(zM1, aM1)
if upArr == 0
showOne(zH4, aH4, sH4, upIdxSel, upColor)
if upArr == 1
showOne(zD1, aD1, sD1, upIdxSel, upColor)
if upArr == 2
showOne(zW1, aW1, sW1, upIdxSel, upColor)
if upArr == 3
showOne(zM1, aM1, sM1, upIdxSel, upColor)
if dnArr == 0
showOne(zH4, aH4, sH4, dnIdxSel, dnColor)
if dnArr == 1
showOne(zD1, aD1, sD1, dnIdxSel, dnColor)
if dnArr == 2
showOne(zW1, aW1, sW1, dnIdxSel, dnColor)
if dnArr == 3
showOne(zM1, aM1, sM1, dnIdxSel, dnColor)
// ================= Nearest distance labels (optional) =================
var label nearUp = na
var label nearDn = na
makeNearLabel(y, txt) =>
label.new(bar_index, y, txt, xloc=xloc.bar_index, style=label.style_label_left, color=color.new(color.black, 0), textcolor=color.white, size=size.tiny)
if showNearestLabels
if not na(nearUp)
label.delete(nearUp)
if not na(nearDn)
label.delete(nearDn)
if upArr != -1
box bUp = upArr == 0 ? array.get(zH4, upIdxSel) : upArr == 1 ? array.get(zD1, upIdxSel) : upArr == 2 ? array.get(zW1, upIdxSel) : array.get(zM1, upIdxSel)
float upBtm = box.get_bottom(bUp)
float pctUp = math.round(10000.0 * (upBtm - close) / close) / 100.0
nearUp := makeNearLabel(upBtm, "Nearest Above ~ " + str.tostring(pctUp) + "%")
if dnArr != -1
box bDn = dnArr == 0 ? array.get(zH4, dnIdxSel) : dnArr == 1 ? array.get(zD1, dnIdxSel) : dnArr == 2 ? array.get(zW1, dnIdxSel) : array.get(zM1, dnIdxSel)
float dnTop = box.get_top(bDn)
float pctDn = math.round(10000.0 * (close - dnTop) / close) / 100.0
nearDn := makeNearLabel(dnTop, "Nearest Below ~ " + str.tostring(pctDn) + "%")
// ================= Tiny legend (dots) =================
var table legend = na
if showLegend and na(legend)
legend := table.new(position.top_left, 4, 1)
if showLegend and not na(legend)
table.cell(legend, 0, 0, "● 4H", text_color=color.white, bgcolor=color.new(color.black, 0))
table.cell(legend, 1, 0, "● 1D", text_color=color.white, bgcolor=color.new(color.black, 0))
table.cell(legend, 2, 0, "● 1W", text_color=color.white, bgcolor=color.new(color.black, 0))
table.cell(legend, 3, 0, "● 1M", text_color=color.white, bgcolor=color.new(color.black, 0))
table.cell_set_bgcolor(legend, 0, 0, color.new(color.teal, 70))
table.cell_set_bgcolor(legend, 1, 0, color.new(color.blue, 70))
table.cell_set_bgcolor(legend, 2, 0, color.new(color.orange, 70))
table.cell_set_bgcolor(legend, 3, 0, color.new(color.purple, 70))
Basic ICT PD Array MarkerIt focuses on OBs and FVGs on your chosen timeframe (e.g., H1 for /NQ). This is open-source friendly and based on ICT logic from community scripts.
90min + Daily + Weekly Cycles + Alerts [Final]Quarterly theory indicator
Customizable indicator 90m cycles, daily, and weekly
WRAMA (with alerts)Updated the original WRAMA indicator to include alerts when the background changes colors.
aaa sibilio 5.5 New Due## **Le Caratteristiche Fondamentali delle Medie: Principi Teorici e Applicazioni Strategiche**
### **Il Principio della Non-Parallelità: Fondamento Matematico**
Il primo principio fondamentale che governa le medie mobili stabilisce che **qualsiasi media non può mai essere parallela alla sua regressione lineare**. Questo non è un caso o un'anomalia, ma una conseguenza diretta della natura matematica delle medie mobili.
**Spiegazione teorica:** Una media mobile è un filtro passa-basso che rimuove le frequenze ad alta velocità dai dati di prezzo, mentre una regressione lineare rappresenta la tendenza lineare ottimale nel periodo considerato. Poiché la media mobile mantiene traccia delle oscillazioni attorno al trend (seppur attenuate), mentre la regressione elimina completamente queste oscillazioni per fornire solo la direzione generale, le due curve non possono mai essere identiche o parallele.
**Implicazione cruciale:** Questa caratteristica certifica che **le medie hanno sempre un andamento curvilineo** rispetto alla loro regressione. La curvatura non è un'imperfezione del calcolo, ma la manifestazione della dinamica intrinseca dei dati di mercato filtrati attraverso la media mobile.
### **L'Energia del Sistema: Derivazione dalla Curvatura**
È proprio questa caratteristica curvilinea che ci consente di determinare parametri fondamentali come **l'energia del sistema**.
**Base fisica:** In fisica, l'energia potenziale di un sistema curvilineo è proporzionale alla deviazione dalla traiettoria di equilibrio (rappresentata dalla regressione lineare). Nel nostro contesto:
- **Energia potenziale** = Distanza tra media mobile e sua regressione
- **Energia cinetica** = Velocità di avvicinamento o allontanamento tra le due curve
- **Energia totale del sistema** = Somma di energia potenziale e cinetica
**Applicazione pratica:** Quando la media si allontana dalla sua regressione, accumula energia potenziale che deve essere rilasciata. Quando si avvicina rapidamente, manifesta energia cinetica che può portare a overshooting del punto di equilibrio.
### **Il Principio dell'Arrotolamento Gerarchico**
Il secondo principio fondamentale stabilisce che **le curve si arrotolano tra loro partendo dai periodi più lunghi verso quelli più piccoli**. Questo fenomeno ha radici profonde nella teoria dei sistemi dinamici.
**Spiegazione teorica:** Le medie con periodi più lunghi hanno maggiore inerzia e resistenza al cambiamento (analogamente alla massa in fisica). Quando si verifica un cambiamento di tendenza, questo si propaga prima nelle medie a periodo lungo (che rappresentano le forze dominanti del sistema), per poi diffondersi progressivamente verso le medie a periodo più breve.
**Meccanismo di propagazione:**
1. **Livello macro** (medie lunghe): Cambio di direzione delle forze principali
2. **Livello medio** (medie intermedie): Trasmissione del segnale
3. **Livello micro** (medie brevi): Manifestazione finale del cambiamento
### **Formazioni Strategiche Derivate**
Questo arrotolamento gerarchico ci consente di identificare **formazioni importanti** per la strategia:
**Confluenza di Arrotolamento:** Quando più medie di diversi periodi iniziano simultaneamente il processo di arrotolamento, si crea una zona di alta probabilità di inversione.
**Cascata di Allineamento:** La sequenza temporale con cui le medie si arrotolano fornisce informazioni sulla forza e persistenza del movimento imminente.
**Zone di Resistenza Dinamica:** I punti dove l'arrotolamento incontra resistenza indicano livelli critici dove le forze opposte si equilibrano temporaneamente.
### **Implicazioni per la Strategia**
Questi principi teorici si traducono in vantaggi operativi concreti:
1. **Prevedibilità dell'energia:** Possiamo quantificare l'energia accumulata nel sistema e prevedere la forza dei movimenti futuri
2. **Timing degli ingressi:** L'arrotolamento gerarchico fornisce una sequenza temporale per ottimizzare i punti di ingresso
3. **Gestione del rischio:** La comprensione dell'energia del sistema permette di dimensionare correttamente le posizioni
La combinazione di questi due principi - non-parallelità e arrotolamento gerarchico - trasforma le medie mobili da semplici indicatori di trend in strumenti sofisticati per l'analisi energetica e dinamica dei mercati finanziari.
versione inglese
## **The Fundamental Characteristics of Moving Averages: Theoretical Principles and Strategic Applications**
### **The Non-Parallelism Principle: Mathematical Foundation**
The first fundamental principle governing moving averages establishes that **any moving average can never be parallel to its linear regression**. This is not coincidental or anomalous, but a direct consequence of the mathematical nature of moving averages.
**Theoretical explanation:** A moving average is a low-pass filter that removes high-frequency components from price data, while a linear regression represents the optimal linear trend over the considered period. Since the moving average maintains trace of oscillations around the trend (albeit attenuated), while the regression completely eliminates these oscillations to provide only the general direction, the two curves can never be identical or parallel.
**Crucial implication:** This characteristic certifies that **moving averages always have a curvilinear pattern** relative to their regression. The curvature is not an imperfection in the calculation, but the manifestation of the intrinsic dynamics of market data filtered through the moving average.
### **System Energy: Derivation from Curvature**
It is precisely this curvilinear characteristic that allows us to determine fundamental parameters such as **system energy**.
**Physical basis:** In physics, the potential energy of a curvilinear system is proportional to the deviation from the equilibrium trajectory (represented by the linear regression). In our context:
- **Potential energy** = Distance between moving average and its regression
- **Kinetic energy** = Speed of approach or separation between the two curves
- **Total system energy** = Sum of potential and kinetic energy
**Practical application:** When the moving average moves away from its regression, it accumulates potential energy that must be released. When it approaches rapidly, it manifests kinetic energy that can lead to overshooting the equilibrium point.
### **The Hierarchical Rolling Principle**
The second fundamental principle establishes that **curves roll around each other starting from longer periods toward shorter ones**. This phenomenon has deep roots in dynamical systems theory.
**Theoretical explanation:** Moving averages with longer periods have greater inertia and resistance to change (analogous to mass in physics). When a trend change occurs, it propagates first in long-period averages (which represent the dominant forces of the system), then progressively diffuses toward shorter-period averages.
**Propagation mechanism:**
1. **Macro level** (long averages): Change in direction of principal forces
2. **Medium level** (intermediate averages): Signal transmission
3. **Micro level** (short averages): Final manifestation of the change
### **Derived Strategic Formations**
This hierarchical rolling allows us to identify **important formations** for the strategy:
**Rolling Confluence:** When multiple averages of different periods simultaneously begin the rolling process, a high-probability reversal zone is created.
**Alignment Cascade:** The temporal sequence with which averages roll provides information about the strength and persistence of the imminent movement.
**Dynamic Resistance Zones:** Points where rolling encounters resistance indicate critical levels where opposing forces temporarily balance.
### **Strategic Implications**
These theoretical principles translate into concrete operational advantages:
1. **Energy predictability:** We can quantify the energy accumulated in the system and predict the strength of future movements
2. **Entry timing:** Hierarchical rolling provides a temporal sequence to optimize entry points
3. **Risk management:** Understanding system energy allows proper position sizing
The combination of these two principles - non-parallelism and hierarchical rolling - transforms moving averages from simple trend indicators into sophisticated tools for energetic and dynamic analysis of financial markets.
Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)Repeater Integer Levels (…999, …888, …777)
Volume PivotOVERVIEW
Volume Pivot is a technical analysis tool for TradingView designed to identify key turning points in the market by focusing on volume rather than price. It detects peaks and troughs (pivots) in trading volume to pinpoint moments of maximum market interest or exhaustion.
This indicator performs its analysis on both the Current Timeframe (CTF) and a user-defined Higher Timeframe (HTF). This dual-perspective approach allows traders to simultaneously grasp short-term market reactions and long-term structural shifts, leading to more informed and high-conviction trading decisions.
FEATURES
Automatic Pivot Detection
Automatically identifies and plots Volume Pivot Highs (peaks) and Pivot Lows (troughs) based on a user-defined Lookback Length.
Dual Timeframe Display
- CTF Signals : Plotted as tiny circles directly above the corresponding volume bars for immediate, short-term context.
- HTF Signals : Plotted as slightly larger circles at the bottom of the indicator pane, making them easy to distinguish as signals of higher significance.
Flexible HTF Configuration
Customize which higher timeframe to use for analysis based on your current chart timeframe. For example, you can set the indicator to reference the 1-hour chart as the HTF when you are on the 5-minute chart, and the Daily chart as the HTF when you are on the 1-hour chart.
Intuitive Volume Bars
The volume bars are color-coded to show whether volume is increasing (bullish color) or decreasing (bearish color) compared to the previous bar, offering a quick visual gauge of market momentum.
Full Customization
Easily toggle the visibility of CTF and HTF signals and customize the colors for bullish and bearish pivots to match your charting preferences.
RD-DynamicTSMADescription of the RD-DynamicTSMA Pine Script Indicator:
This single indicator dynamically adjusts the three SMAs to key periods used by professional traders across timeframes:
Daily: 10, 21, 50 periods (standard for swing trading trends).
Weekly+: 10, 21, 30 periods (optimized for positional & longer-term views).
Lengths auto-update on timeframe switches.
Pivot MoChiThis uses Current Day opening in place of previous day close
More Dynamic than Traditional Pivots
Horizontal Lines [Yellow]The Horizontal Lines indicator is a simple yet powerful visual tool designed for traders in forex, options, and other financial markets. It allows users to mark and track key price levels directly on their chart with clear, bright yellow lines.