Clock&Flow – Market Pulse IndicatorClock&Flow – Market Pulse Indicator
1) General Purpose
The Market Pulse Indicator is designed to visualize the strength and direction of market flow in a clear, intuitive way.
Unlike common volume or momentum indicators, it blends three essential dimensions — price velocity, normalized volume, and volatility (ATR) — to highlight when market pressure is truly meaningful.
It helps identify genuine liquidity inflows/outflows, potential exhaustion zones, and moments of compression or expansion within the price structure.
2) Data Sources
All data is directly taken from the current chart’s feed on TradingView:
Price (close): to measure relative price change.
Volume: to detect the intensity of market participation (normalized to average).
ATR (Average True Range): to evaluate volatility relative to price levels.
No external data or off-platform sources are used.
3) Logic and Calculation Steps
Price Velocity: calculates the percentage change between the current close and the close N bars ago.
priceChange = (close - close ) / close
Normalized Volume: compares current volume to its moving average over the same period.
volNorm = volume / sma(volume, length)
Normalized Volatility: ATR divided by price to adjust for instrument scale.
atrNorm = atr(length) / close
Combination : multiplies the three components into one raw value that represents market pulse intensity.
rawPulse = priceChange * volNorm * (1 + atrNorm)
Smoothing: a moving average (smoothLen) is applied to create a cleaner and more readable oscillator line.
flowPulse = sma(rawPulse * multiplier, smoothLen)
4) Parameters (Default Settings)
length (20): analysis period for price change, volume, and ATR.
smoothLen (5): smoothing factor; higher values reduce noise.
multiplier (100): scales the output for readability; adjust to fit chart scale.
5) How to Read the Indicator
Market Pulse > 0 (green): net inflow of liquidity; buying pressure dominates.
Market Pulse < 0 (red): net outflow of liquidity; selling pressure dominates.
Near 0: neutral phase; market balance or consolidation.
Sudden peaks: strong bursts of flow — often coincide with news releases or session overlaps.
Confirmations: use as a second-level filter before entering trades or to confirm momentum behind a breakout.
6) Divergences
Divergences between price and Market Pulse are key signals of weakening flow strength:
Bullish divergence: price forms lower lows while Market Pulse forms higher lows → selling pressure is fading; potential reversal or bounce.
Bearish divergence: price forms higher highs while Market Pulse fails to confirm → buying momentum is losing strength; potential correction ahead.
For reliability, look for divergences on higher timeframes (H4, Daily).
On lower timeframes, treat them as early warnings.
7) Typical Use Cases
Breakout confirmation: price breaks resistance with a rising Market Pulse → confirms genuine participation.
False signal filter: price breaks a level but Market Pulse remains flat/negative → likely fake breakout.
Pullback entry: after a breakout, wait for a short retracement and a new positive pulse → safer entry point.
Exit signal: if you’re long and Market Pulse suddenly turns negative with strong volume → consider partial exit or tighter stops.
8) Recommended Timeframes
Intraday / Scalping: 5–30 min charts with length 10–14, smoothLen 3–5.
Swing trading: 1h–4h charts with length 20–50.
Position trading: Daily charts with larger length (50–100) for smoother data.
Always optimize parameters to the specific asset — there are no universal settings.
9) Limitations
This indicator is not a trading system — it’s a decision-support tool.
Results depend on the quality of the volume data available for the symbol.
Performance and sensitivity are influenced by length, smoothing, and multiplier values — always test before live trading.
Use alongside sound risk and money management.
10) Disclaimer
This script is provided for educational purposes only and does not constitute financial advice.
Trading and investing involve significant risk, including the potential loss of capital.
Always test indicators in simulation environments and make independent decisions based on your own analysis and risk tolerance.
Italiano
1) Scopo generale
Flow Pulse è un oscillatore pensato per visualizzare la forza e la direzione del flusso di mercato in modo immediato. Non è un semplice indicatore di volume né una copia di RSI/MACD: combina tre dimensioni fondamentali — variazione di prezzo, volume normalizzato e volatilità — per mettere in evidenza i momenti in cui la pressione dei partecipanti è realmente significativa.
È ideale per identificare: entrate guidate da flussi reali, potenziali esaurimenti, momenti di compressione/espansione del movimento e segnali di conferma per breakout o rimbalzi.
2) Dati utilizzati
L’indicatore usa esclusivamente dati disponibili sulla piattaforma TradingView del grafico corrente:
price (close) — per calcolare la variazione percentuale del prezzo;
volume per misurare l’intensità degli scambi (normalizzato su media);
ATR (Average True Range) — per normalizzare la volatilità rispetto al prezzo;
Tutti i feed (prezzo e volume) sono quelli forniti dall’exchange/fornitore dati collegato al simbolo sul grafico.
3) Logica e passaggi di calcolo
Velocità del prezzo: calcolo della variazione percentuale tra la chiusura corrente e la chiusura N barre fa:
priceChange = (close - close ) / close
— misura la direzione e magnitudine del movimento in termine relativo.
Volume normalizzato: rapporto tra il volume corrente e la media mobile semplice del volume su length barre:
volNorm = volume / sma(volume, length)
— evidenzia volumi anomali rispetto alla media.
Volatilità normalizzata (ATR): rapporto ATR/close per rendere la volatilità comparabile across price levels:
atrNorm = atr(length) / close
Combinazione: il prodotto di questi fattori (con un piccolo offset su ATR) genera un valore grezzo:
rawPulse = priceChange * volNorm * (1 + atrNorm)
— se priceChange e volNorm sono positivi e l’ATR è presente, il rawPulse sarà significativamente positivo.
Smoothing: media mobile semplice (SMA) applicata al rawPulse e moltiplicazione per un fattore scalare (multiplier) per portare il range su livelli leggibili:
flowPulse = sma(rawPulse * multiplier, smoothLen)
4) Parametri esposti (default consigliati)
length (periodo analisi) — default 20: influenza calcolo Δ% e media volumi; allunga la finestra storica.
smoothLen (smussamento) — default 5: smoothing del segnale per ridurre rumore.
multiplier — default 100: fattore di scala per rendere l’oscillatore più leggibile.
5) Interpretazione pratica dei valori
FlowPulse > 0 (verde): predominanza di flusso d’ingresso — pressione d’acquisto. Maggiore il valore, più forte la convinzione (volume + movimento + volatilità).
FlowPulse < 0 (rosso): predominanza di flusso in uscita — pressione di vendita.
Vicino a 0: assenza di flussi netti chiari; mercato piatto o bilanciato.
Picchi repentini: indicano accelerate di flusso — spesso coincidono con rotture, open/close session, news.
Sostegno al trade: usa FlowPulse come conferma prima di entrare su breakout o come avviso di attenzione su esaurimenti.
6) Divergenze (come leggerle)
Le divergenze tra prezzo e FlowPulse sono segnali importanti:
Divergenza rialzista (bullish divergence): prezzo fa nuovi minimi mentre FlowPulse non fa nuovi minimi (o forma minimo relativo più alto) → indica che la spinta di vendita non è supportata da volume/volatilità, possibile inversione/rimbalzo.
Divergenza ribassista (bearish divergence): prezzo fa nuovi massimi mentre FlowPulse non li conferma (o forma massimo relativo più basso) → la spinta d’acquisto è “debole”, possibile esaurimento e inversione.
Note pratiche: cercare divergenze su timeframe maggiori (H4, D) per maggiore attendibilità; sui timeframe minori prendere solo come early warning.
7) Esempi d’uso operativo
Conferma breakout: prezzo rompe resistenza + FlowPulse positivo e crescente → breakout più probabile e con volumi reali.
Filtro per falsi segnali: prezzo rompe ma FlowPulse è piatto/negativo → alto rischio di false breakout.
Entrata per pullback: dopo breakout, attendere un pullback con FlowPulse che torna positivo → ingresso più prudente.
Gestione delle uscite: se sei long e FlowPulse improvvisamente si inverte in negativo su volumi elevati → considerare riduzione posizione o stop.
8) Timeframe consigliati
Intraday / Scalping: M5–M30 con length ridotto (es. 10–14) e smoothLen piccolo.
Swing trading: H1–H4 con length 20–50.
Position trading: D1 con length maggiore per filtrare rumore.
Testa i parametri sul tuo asset e timeframe; nessun parametro è universale.
9) Limitazioni e avvertenze
L’indicatore non è un sistema di trading completo: è un tool di informazione e timing.
Dipende dalla qualità dei dati di volume del simbolo: su alcuni titoli/mercati (es. alcuni ETF, Forex su certi broker) il volume può essere parziale o non rappresentativo.
I valori di margine/multiplier e smoothing influenzano sensibilmente sensibilità e falsi segnali: backtest e ottimizzazione sono raccomandati.
Non usare il solo FlowPulse per entrare su leva elevata senza gestione del rischio12) Disclaimer da inserire
Disclaimer: Questo indicatore è fornito solo a scopo didattico e non costituisce consulenza finanziaria. L’uso comporta rischi: valuta sempre la gestione del rischio e testa su conto demo prima dell’applicazione in reale.
วัฏจักร
BTC Power-Law Support 2025BTC Power-Law Calculation by Robert.
Shaded area resembles an uncertainty calculation.
Extrapolated data (in the future) only works in the daily chart.
Disclaimer: This is my own calculation and no investing advice! Use at your own risk.
WaleedGhuman SMT/MSS/OF/ModelsAt the core of the WaleedGhuman SMT/MSS/OF/Models indicator lies a sophisticated Smart Money Technique (SMT) Divergence Engine that operates across specific distinct timeframes simultaneously. The result is a comprehensive market analysis tool that bridges the gap between macro market structure and micro price action, delivering institutional-grade divergence analysis in an accessible, visually intuitive format.
BullTrader - ParabolicSARFlipSignals(NonRepainting)TP/SL🧠 Purpose & Concept
This indicator refines Wilder’s Parabolic SAR into a simple, non‑repainting alert and visualization system that marks each confirmed trend flip with a clear buy or sell signal.
It also auto‑generates dynamic, ATR‑based Take‑Profit (TP) and Stop‑Loss (SL) levels, keeps them updating with price in real time, and displays the current market bias in an on‑chart table.
The goal: clarity and automation without complexity — see exactly when a new bullish or bearish phase begins, what your current TP/SL targets are, and receive a single clean alert for every new flip.
⚙️ How It Works
1. The built‑in ta.sar() function tracks the Parabolic SAR dots.
2. When a candle closes across the SAR line, a trend‑change is confirmed:
• Price crossing above a SAR dot → Buy Flip (green triangle).
• Price crossing below a SAR dot → Sell Flip (red triangle).
3. On each flip, the indicator calculates dynamic ATR‑based TP / SL targets:
TP = entry ± (ATR × tpMult) and SL = entry ∓ (ATR × slMult)
These values move automatically as the trend develops.
4. A small floating label beside the latest bar shows live‑updated TP / SL numbers.
5. A color‑coded table in the upper‑right corner displays the current trend: Lime = Bullish, Red = Bearish, Yellow = Neutral.
6. Each new flip triggers an easy‑to‑use Buy / Sell alert after the bar closes—no repainting.
🔔 Alerts
Alert Name Triggers When Message
SAR Buy Flip Alert Green triangle (bullish reversal) “BUY Flip — Parabolic SAR on {{ticker}} ({{interval}})”
SAR Sell Flip Alert Red triangle (bearish reversal) “SELL Flip — Parabolic SAR on {{ticker}} ({{interval}})”
📈 Chart Elements
Element Meaning
🟠 Orange cross Standard Parabolic SAR trail.
🟢 / 🔴 Triangles Confirmed buy / sell flips (non‑repainting).
Bright lime/red TP‑SL box Live ATR targets that move with price.
Trend table (top‑right) Instant status of bullish/bearish bias.
✅ Features & Highlights
Non‑repainting — all signals confirm on closed bars.
Visual clarity — single pair of bright triangles for flips.
Dynamic ATR‑based TP / SL values that auto‑trail with trend.
Always‑visible trend summary table.
Two ready‑made alert types (Buy / Sell).
Lightweight and optimized for any timeframe or symbol.
💡 Best Use
Ideal for traders who prefer clean trend‑based entries and volatility‑adaptive exits without signal clutter:
Pair it with your existing strategy or use it standalone for reversal‑based swing and intraday trading.
neeson vegas proIndicator Name: neeson vegas pro
Overview:
neeson vegas pro is an advanced multi-timeframe trend analysis tool that provides clear trend direction and entry signals through a unique moving average system combined with volume analysis.
Core Mechanism:
Trend Detection System: Uses 140/165 period EMAs as fast lines and 580/670 period EMAs as slow lines. Trend is confirmed when the fast line group completely breaks through the slow line group.
Volume Confirmation: Detects abnormal volume activity, triggering visual alerts when volume exceeds 3.5 standard deviations of the 55-period average, with differentiation between bullish and bearish volume strength.
Signal Filtering: Combines 14-period EMA and SMA as short-term filters, with VWAP as dynamic support/resistance reference.
Technical Implementation:
Employs state tracking algorithm to avoid frequent signal switching near trend boundaries
Uses dynamic percentage calculation to display volume anomaly degree
Implements multi-layer confirmation mechanism to reduce false signals
Provides comprehensive visual feedback system
Usage Instructions:
Trend Identification: Blue bars indicate bullish trend, orange bars indicate bearish trend
Entry Signals: BUY/SELL labels show major moving average crossover points
Volume Confirmation: Blue boxes indicate bullish volume anomalies, orange boxes indicate bearish volume anomalies
Parameter Adjustment: All period parameters can be adjusted based on trading instrument and timeframe
Unique Value:
Compared to traditional Vegas tunnel indicators, neeson vegas pro introduces volume confirmation mechanism, multi-timeframe filters, and intelligent trend state tracking, significantly improving signal accuracy and reliability.
Realtime Squeeze Box [CHE] Realtime Squeeze Box — Detects lowvolatility consolidation periods and draws trimmed price range boxes in realtime to highlight potential breakout setups without clutter from outliers.
Summary
This indicator identifies "squeeze" phases where recent price volatility falls below a dynamic baseline threshold, signaling potential energy buildup for directional moves. By requiring a minimum number of consecutive bars in squeeze, it reduces noise from fleeting dips, making signals more reliable than simple threshold crosses. The core innovation is realtime box visualization: during active squeezes, it builds and updates a box capturing the price range while ignoring extreme values via quantile trimming, providing a cleaner view of consolidation bounds. This differs from static volatility bands by focusing on trimmed ranges and suppressing overlapping boxes, which helps traders spot genuine setups amid choppy markets. Overall, it aids in anticipating breakouts by combining volatility filtering with visual containment of price action.
Motivation: Why this design?
Traders often face whipsaws during brief volatility lulls that mimic true consolidations, leading to premature entries, or miss setups because standard volatility measures lag in adapting to changing market regimes. This design addresses that by using a hold requirement on consecutive lowvolatility bars to denoise signals, ensuring only sustained squeezes trigger visuals. The core idea—comparing rolling standard deviation to a smoothed baseline—creates a responsive yet stable filter for lowenergy periods, while the trimmed box approach isolates the core price cluster, making it easier to gauge breakout potential without distortion from spikes.
What’s different vs. standard approaches?
Reference baseline: Traditional squeeze indicators like the Bollinger Band Squeeze or TTM Squeeze rely on fixed multiples of bands or momentum oscillators crossing zero, which can fire on isolated bars or ignore range compression nuances.
Architecture differences:
Realtime box construction that updates barbybar during squeezes, using arrays to track and trim price values.
Quantilebased outlier rejection to define box bounds, focusing on the bulk of prices rather than full range.
Overlap suppression logic that skips redundant boxes if the new range intersects heavily with the prior one.
Hold counter for consecutive bar validation, adding persistence before signaling.
Practical effect: Charts show fewer, more defined orange boxes encapsulating tight price action, with a horizontal line extension marking the midpoint postsqueeze—visibly reducing clutter in sideways markets and highlighting "coiled" ranges that standard plots might blur with full highs/lows. This matters for quicker visual scanning of multitimeframe setups, as boxes selflimit to recent history and avoid piling up.
How it works (technical)
The indicator starts by computing a rolling average and standard deviation over a userdefined length on the chosen source price series. This deviation measure is then smoothed into a baseline using either a simple or exponential average over a longer window, serving as a reference for normal volatility. A squeeze triggers when the current deviation dips below this baseline scaled by a multiplier less than one, but only after a minimum number of consecutive bars confirm it, which resets the counter on breaks.
Upon squeeze start, it clears a buffer and begins collecting source prices barbybar, limited to the first few bars to keep computation light. For visualization, if enabled, it sorts the buffer and finds a quantile threshold, then identifies the minimum value at or below that threshold to set upper and lower box bounds—effectively clamping the range to exclude tails above the quantile. The box draws from the start bar to the current one, updating its right edge and levels dynamically; if the new bounds overlap significantly with the last completed box, it suppresses drawing to avoid redundancy.
Once the hold limit or squeeze ends, the box freezes: its final bounds become the last reference, a midpoint line extends rightward from the end, and a tiny circle label marks the point. Buffers and states reset on new squeezes, with historical boxes and lines capped to prevent overload. All logic runs on every bar but uses confirmed historical data for calculations, with realtime updates only affecting the active box's position—no future peeking occurs. Initialization seeds with null values, building states progressively from the first bars.
Parameter Guide
Source: Selects the price series (e.g., close, hl2) for deviation and box building; influences sensitivity to wicks or bodies. Default: close. Tradeoffs/Tips: Use hl2 for balanced range view in volatile assets; stick to close for pure directional focus—test on your timeframe to avoid oversmoothing trends.
Length (Mean/SD): Sets window for average and deviation calculation; shorter values make detection quicker but noisier. Default: 20. Tradeoffs/Tips: Increase to 30+ for stability in higher timeframes, reducing false starts; below 10 risks overreacting to singlebar noise.
Baseline Length: Defines smoothing window for the deviation baseline; longer periods create a steadier reference, filtering regime shifts. Default: 50. Tradeoffs/Tips: Pair with Length at 1:2 ratio for calm markets; shorten to 30 if baselines lag during fast volatility drops, but watch for added whips.
Squeeze Multiplier (<1.0): Scales the baseline downward to set the squeeze threshold; lower values tighten criteria for rarer, stronger signals. Default: 0.8. Tradeoffs/Tips: Tighten to 0.6 for highvol assets like crypto to cut noise; loosen to 0.9 in forex for more frequent but shallower setups—balances hit rate vs. depth.
Baseline via EMA (instead of SMA): Switches baseline smoothing to exponential for faster adaptation to recent changes vs. equalweighted simple average. Default: false. Tradeoffs/Tips: Enable in trending markets for quicker baseline drops; disable for uniform history weighting in rangebound conditions to avoid overreacting.
SD: Sample (len1) instead of Population (len): Adjusts deviation formula to divide by length minus one for smallsample bias correction, slightly inflating values. Default: false. Tradeoffs/Tips: Use sample in short windows (<20) for more conservative thresholds; population suits long looks where bias is negligible, keeping signals tighter.
Min. Hold Bars in Squeeze: Requires this many consecutive squeeze bars before confirming; higher denoise but may clip early setups. Default: 1. Tradeoffs/Tips: Bump to 35 for intraday to filter ticks; keep at 1 for swings where quick consolidations matter—trades off timeliness for reliability.
Debug: Plot SD & Threshold: Toggles lines showing raw deviation and threshold for visual backtesting of squeeze logic. Default: false. Tradeoffs/Tips: Enable during tuning to eyeball crossovers; disable live to declutter—great for verifying multiplier impact without alerts.
Tint Bars when Squeeze Active: Overlays semitransparent color on bars during open box phases for quick squeeze spotting. Default: false. Tradeoffs/Tips: Pair with low opacity for subtlety; turn off if using boxes alone, as tint can obscure candlesticks in dense charts.
Tint Opacity (0..100): Controls background tint strength during active squeezes; higher values darken for emphasis. Default: 85. Tradeoffs/Tips: Dial to 60 for light touch; max at 100 risks hiding price action—adjust per chart theme for visibility.
Stored Price (during Squeeze): Price series captured in the buffer for box bounds; defaults to source but allows customization. Default: close. Tradeoffs/Tips: Switch to high/low for wider boxes in gappy markets; keep close for midline focus—impacts trim effectiveness on outliers.
Quantile q (0..1): Fraction of sorted prices below which tails are cut; higher q keeps more data but risks including spikes. Default: 0.718. Tradeoffs/Tips: Lower to 0.5 for aggressive trim in noisy assets; raise to 0.8 for fuller ranges—tune via debug to match your consolidation depth.
Box Fill Color: Sets interior shade of squeeze boxes; semitransparent for layering. Default: orange (80% trans.). Tradeoffs/Tips: Soften with more transparency in multiindicator setups; bold for standalone use—ensures boxes pop without overwhelming.
Box Border Color: Defines outline hue and solidity for box edges. Default: orange (0% trans.). Tradeoffs/Tips: Match fill for cohesion or contrast for edges; thin width keeps it clean—helps delineate bounds in zoomed views.
Keep Last N Boxes: Limits historical boxes/lines/labels to this count, deleting oldest for performance. Default: 10. Tradeoffs/Tips: Increase to 50 for weekly reviews; set to 0 for unlimited (risks lag)—balances history vs. speed on long charts.
Draw Box in Realtime (build/update): Enables live extension of boxes during squeezes vs. waiting for end. Default: true. Tradeoffs/Tips: Disable for confirmedonly views to mimic backtests; enable for proactive trading—adds minor repaint on live bars.
Box: Max First N Bars: Caps buffer collection to initial squeeze bars, freezing after for efficiency. Default: 15. Tradeoffs/Tips: Shorten to 510 for fast intraday; extend to 20 in dailies—prevents bloated arrays but may truncate long squeezes.
Reading & Interpretation
Squeeze phases appear as orange boxes encapsulating the trimmed price cluster during lowvolatility holds—narrow boxes signal tight consolidations, while wider ones indicate looser ranges within the threshold. The box's top and bottom represent the quantilecapped high and low of collected prices, with the interior fill shading the containment zone; ignore extremes outside for "true" bounds. Postsqueeze, a solid horizontal line extends right from the box's midpoint, acting as a reference level for potential breakout tests—drifting prices toward or away from it can hint at building momentum. Tiny orange circles at the line's start mark completion points for easy scanning. Debug lines (if on) show deviation hugging or crossing the threshold, confirming hold logic; a persistent hug below suggests prolonged calm, while spikes above reset counters.
Practical Workflows & Combinations
Trend following: Enter long on squeezeend close above the box top (or midpoint line) confirmed by higher high in structure; filter with rising 50period average to avoid countertrend traps. Use boxes as support/resistance proxies—short below bottom in downtrends.
Exits/Stops: Trail stops to the box midpoint during postsqueeze runs for conservative holds; go aggressive by exiting on retest of opposite box side. If debug shows repeated threshold grazes, tighten stops to curb drawdowns in ranging followups.
Multiasset/MultiTF: Defaults work across stocks, forex, and crypto on 15min+ frames; scale Length proportionally (e.g., x2 on hourly). Layer with highertimeframe boxes for confluence—e.g., daily squeeze + 1H box for entry timing. (Unknown/Optional: Specific multiTF scaling recipes beyond proportional adjustment.)
Behavior, Constraints & Performance
Repaint/confirmation: Core calculations use historical closes, confirming on bar close; active boxes repaint their right edge and levels live during squeezes if enabled, but freeze irrevocably on hold limit or end—mitigates via barbybar buffer adds without future leaks. No lookahead indexes.
security()/HTF: None used, so no external timeframe repaints; all native to chart resolution.
Resources: Caps at 300 boxes/lines/labels total; small arrays (up to 20 elements) and short loops in sorting/minfinding keep it light—suitable for 10k+ bar charts without throttling. Persistent variables track state across bars efficiently.
Known limits: May lag on ultrasharp volatility spikes due to baseline smoothing; gaps or thin markets can skew trims if buffer hits cap early; overlaps suppress visuals but might hide chained squeezes—(Unknown/Optional: Edge cases in nonstandard sessions).
Sensible Defaults & Quick Tuning
Start with defaults for most liquid assets on 1Hdaily: Length 20, Multiplier 0.8, Hold 1, Quantile 0.718—yields balanced detection without excess noise. For too many false starts (choppy charts), increase Hold to 3 and Baseline Length to 70 for stricter confirmation, reducing signals by 3050%. If squeezes feel sluggish or miss quick coils, shorten Length to 14 and enable EMA baseline for snappier adaptation, but monitor for added flips. In highvol environments like options, tighten Multiplier to 0.6 and Quantile to 0.6 to focus on core ranges; reverse for calm pairs by loosening to 0.95. Always backtest tweaks on your asset's history.
What this indicator is—and isn’t
This is a volatilityfiltered visualization tool for spotting and bounding consolidation phases, best as a signal layer atop price action and trend filters—not a standalone predictor of direction or strength. It highlights setups but ignores volume, momentum, or news context, so pair with discreteness rules like higher highs/lows. Never use it alone for entries; always layer risk management, such as 12% stops beyond box extremes, and position sizing based on account drawdown tolerance.
Disclaimer
The content provided, including all code and materials, is strictly for educational and informational purposes only. It is not intended as, and should not be interpreted as, financial advice, a recommendation to buy or sell any financial instrument, or an offer of any financial product or service. All strategies, tools, and examples discussed are provided for illustrative purposes to demonstrate coding techniques and the functionality of Pine Script within a trading context.
Any results from strategies or tools provided are hypothetical, and past performance is not indicative of future results. Trading and investing involve high risk, including the potential loss of principal, and may not be suitable for all individuals. Before making any trading decisions, please consult with a qualified financial professional to understand the risks involved.
By using this script, you acknowledge and agree that any trading decisions are made solely at your discretion and risk.
Do not use this indicator on HeikinAshi, Renko, Kagi, PointandFigure, or Range charts, as these chart types can produce unrealistic results for signal markers and alerts.
Best regards and happy trading
Chervolino
مستويات الاتزان السعري (Equilibrium Price Levels)Equilibrium Price Levels is an educational tool that helps traders quantify “fair value” and key extension zones based on a single reference swing.
The script uses two manual inputs (reference High and Low) to compute a structured set of equilibrium and extension levels, rather than scanning swings automatically. This gives full control over which range the calculations are based on.
Calculated levels include:
• Retracement / equilibrium band from the selected range: 38.2%, 50.0%, 61.8%
• Upside extension targets from the same range: 125%, 1.618, 1.80, 2.50, 3.10, 3.86, 4.236
Features:
• Separate toggles for supports, targets, and reference high/low
• Per-level visibility switches for each extension (e.g., only show 1.618 and 2.50)
• Customizable colors for supports, targets, and reference lines
• Optional labels with configurable size and offset to keep the chart clean
• Multiple line extension modes (left, both sides, or no extension)
Typical use cases:
• Marking an equilibrium zone inside a major swing to watch for reaction or trend continuation
• Building a consistent “price map” of where mean-reversion vs. extension behavior is likely
• Combining with other tools (price action, volume, order blocks, etc.) to refine trade plans
This script is for educational and analytical purposes only and does not constitute financial advice, trade signals, or performance guarantees.
مستويات الاتزان السعري هي أداة تعليمية تساعد المتداول على قياس “السعر العادل” ومناطق التمدد المحتملة اعتمادًا على نطاق سعري واحد يحدده بنفسه.
المؤشر لا يختار القمم والقيعان آليًا، بل يعتمد على إدخال قمّة وقاع مرجعيين يدويًا، مما يعطي تحكمًا كاملًا في النطاق المستخدم في الحسابات.
المؤشر يحسب ما يلي:
• نطاق الاتزان/التراجع من القمة إلى القاع: 38.2%، 50.0%، 61.8%
• أهداف وتمددات سعرية أعلى النطاق: 125%، 1.618، 1.80، 2.50، 3.10، 3.86، 4.236
المزايا:
• مفاتيح تشغيل/إخفاء مستقلة لمستويات الدعم، الأهداف، والقمة/القاع المرجعيين
• إمكانية تفعيل/إلغاء كل هدف بشكل منفصل (مثل إظهار 1.618 و 2.50 فقط)
• تخصيص ألوان خطوط الدعم، الأهداف، وخطوط القمة والقاع
• ملصقات توضيحية اختيارية مع تحكم في حجمها وموقعها على الشارت
• خيارات امتداد للخطوط: لليسار فقط، أو يمين ويسار، أو بدون امتداد
الاستخدامات الشائعة:
• تحديد منطقة الاتزان داخل موجة رئيسية لمراقبة احتمالات الارتداد أو استمرار الاتجاه
• بناء “خريطة سعرية” ثابتة لمناطق التوازن والتمدد على مدى زمني واسع
• دمج المستويات مع أدوات أخرى مثل السلوك السعري أو الحجم أو مناطق التجميع/التصريف لتحسين قرارات الدخول والخروج
هذا السكربت موجه لأغراض تعليمية وتحليلية فقط، ولا يُعتبر نصيحة استثمارية أو توصية بيع/شراء، ولا يضمن أي أداء مستقبلي للأسعار أو النتائج.
Victoria Overlay - HTF 200 + VWAP + ATR Stop + MA TrioConsolidated road to minions
Buy Setup:
EMA1 crosses above SMA3.
RSI confirms above 50.
Volume increasing (confirming momentum).
Candle closes above SMA1 base.
Sell Setup:
EMA1 crosses below SMA3.
RSI drops below 50 or exits overbought.
Volume confirms (declining or reversing).
Candle closes below SMA1 base.
Tips:
Think of EMA1 as the scalper’s trigger.
SMA3 is your momentum check.
SMA1 (base) = short-term bias.
Avoid entries during low-volume chop.
Use for day trades or tight scalps; exits happen fast.
Overlay (Smoothed Heikin Ashi + Swing + VWAP + ATR Stop + 200-SMA)
Purpose: Multi-layer trend confirmation + clean structure.
Type: Swing alignment tool.
🟩 BUY / CALL Conditions
Green “Buy (Gated)” arrow appears.
Price is above VWAP, above 200-SMA, and above ATR stop.
ATR stop (green line) sits under price → support confirmed.
Heikin-Ashi candles are green/lime.
Bias label says “Above VWAP | Above 200 | Swing Up”.
🟥 SELL / PUT Conditions
Red “Sell (Gated)” arrow appears.
Price is below VWAP, below 200-SMA, and below ATR stop.
ATR stop (red line) sits above price → resistance confirmed.
Heikin-Ashi candles are red.
Bias label says “Below VWAP | Below 200 | Swing Down”.
Exit / Risk Control:
Close position when price crosses ATR stop.
If Heikin candles flip color, momentum is reversing.
Best Use Cases:
For next-day or multi-hour swing entries.
Use ATR Stop for dynamic stop loss.
Stay out when the bias label is mixed (e.g. “Above VWAP | Below 200 | Swing Down”).
Pro Tip:
On big news days, let VWAP reset post-open before acting on arrows — filters fake signals.
RSI Panel Pro (v6)
Purpose: Strength + exhaustion confirmation.
Type: Momentum filter.
Key Levels:
Overbought: 80+ → take profits soon.
Oversold: 20– → watch for bounce setups.
Bull regime: RSI above 60 = momentum strong.
Bear regime: RSI below 40 = weakness.
Buy / Entry Signals:
RSI crosses up from below 40 or 20.
RSI line is above RSI-EMA (gray line).
Higher timeframe RSI (if used) is also rising.
Trim / Exit:
RSI drops under 60 after being strong.
RSI crosses below its EMA.
Sell / Put Setup:
RSI fails at 60 or drops below 40.
RSI crosses under EMA after a bounce.
Tips:
Pair RSI panel with Victoria Overlay — only take gated buys when RSI confirms.
RSI < 40 but above 20 = “loading zone” for reversals.
RSI > 70 = overextended → wait for confirmation before entering.
Combined Execution Rules
Goal What to Watch Action
Entry (CALL) EMA1 > SMA3, Buy (Gated) arrow, RSI rising > 50 Buy call / open long
Entry (PUT) EMA1 < SMA3, Sell (Gated) arrow, RSI < 50 Buy put / open short
Exit Early Price crosses ATR stop or RSI flips under EMA Exit trade / protect gains
Trend Filter VWAP + 200-SMA alignment Only trade in that direction
Avoid Trades Conflicting bias label or low volume Stay flat
Pro Tips
VWAP → Intraday mean: above = bullish control, below = bearish control.
ATR Stop → Dynamic trailing stop: never widen it manually.
Smoothed Heikin-Ashi → filters noise: trend stays until color flips twice.
RSI Panel → confirms whether to hold through pullbacks.
If RSI and Overlay disagree — wait, not trade.
Elliott Wave Expert AdvisorElliott Wave Expert Advisor - Professional Wave Analysis Tool
OVERVIEW
--------
The Elliott Wave Expert Advisor is a comprehensive Pine Script indicator designed for TradingView that automates Elliott Wave analysis and generates high-probability trading signals. Built on Ralph Nelson Elliott's Wave Principle, this indicator identifies impulse wave patterns, validates them against strict Elliott Wave rules, and provides precise entry points with calculated risk management levels.
CORE FUNCTIONALITY
------------------
1. TREND DETECTION
- Dual Moving Average system (Fast/Slow MA)
- MACD confirmation for trend strength
- Automatic trend classification (Uptrend/Downtrend/Sideways)
- Only generates signals aligned with main trend
2. SWING POINT DETECTION
- Automatic pivot high/low identification
- Configurable sensitivity (lookback periods)
- Minimum swing size filtering to reduce noise
- ZigZag visualization connecting swing points
3. WAVE IDENTIFICATION
- 5-wave impulse pattern recognition (1-2-3-4-5)
- 3-wave corrective pattern detection (A-B-C)
- Wave labels displayed on chart
- Color-coded validation status (Blue = Valid, Orange = Pending)
4. ELLIOTT WAVE RULES VALIDATION
Strictly enforces three cardinal rules:
- Rule 1: Wave 2 never retraces more than 100% of Wave 1
- Rule 2: Wave 3 is never the shortest impulse wave
- Rule 3: Wave 4 never overlaps Wave 1 price territory
5. FIBONACCI ANALYSIS
- Automatic Fibonacci retracement calculations (23.6%, 38.2%, 50%, 61.8%, 78.6%)
- Fibonacci extension projections (100%, 161.8%, 261.8%)
- Wave 3 and Wave 5 target projections
- Fibonacci-based Take Profit levels
6. SIGNAL GENERATION
- Entry signals at Wave 2 completion (catch Wave 3)
- Entry signals at Wave 4 completion (catch Wave 5)
- Automatic Stop Loss placement below/above pivot points
- Multiple Take Profit targets (TP1 at 1.618 extension, TP2 at Wave 5 projection)
- Risk/Reward ratio calculation and filtering
- Minimum R:R threshold (default 1.5:1)
7. VISUAL ELEMENTS
- Pivot markers (H/L) showing swing highs and lows
- ZigZag lines connecting swing points
- Wave number labels (1-2-3-4-5) with validation colors
- Entry signal arrows (Green = BUY, Red = SELL)
- Stop Loss lines (Red dashed)
- Take Profit lines (Green dashed and dotted)
- Real-time status dashboard showing:
* Number of pivots detected
* Wave count progress (X/5)
* Pattern validation status
* Market trend direction
* Signal active status
* Helpful tips and guidance
OPTIMAL USAGE
-------------
• Timeframes: H1, H4, D1 (avoid M1-M5 due to noise)
• Markets: Forex majors (EUR/USD, GBP/USD), Gold (XAU/USD), Major Cryptocurrencies
• Market Conditions: Strong trending markets (avoid ranging/sideways conditions)
• Risk Management: Never risk more than 1-2% per trade
• Position Sizing: Based on calculated Stop Loss distance
CONFIGURATION PARAMETERS
------------------------
Trend Detection:
- MA Fast Period (default: 20)
- MA Slow Period (default: 50)
- MACD settings (12/26/9)
Swing Detection:
- Pivot Lookback Left/Right (default: 10/10, reduce to 5/5 for M15)
- Min Swing Size % (default: 0.1%, reduce to 0.05% for M15)
Wave Detection:
- Min Wave Size % (default: 0.5%, reduce to 0.2-0.3% for smaller timeframes)
Risk Management:
- SL Buffer % (default: 0.1%)
- TP1 Fibonacci Ratio (default: 1.618)
- Min Risk/Reward (default: 1.5)
Visualization:
- Toggle visibility for MAs, ZigZag, Wave Labels, Signals, SL/TP
- Customizable colors for all elements
- Optional trend background coloring
IMPORTANT NOTES
---------------
• Elliott Wave analysis is subjective - this indicator implements one specific interpretation
• Works best in trending markets; automatically suppresses signals in sideways conditions
• Signals are NOT repainting after pivot confirmation
• Not a "holy grail" - combine with other analysis and proper risk management
• Requires patience - quality setups are infrequent but high-probability
• Always backtest on historical data before live trading
ELLIOTT WAVE THEORY BACKGROUND
------------------------------
Elliott Wave Theory, developed by Ralph Nelson Elliott in the 1930s, proposes that market prices move in predictable wave patterns driven by investor psychology. An impulse wave consists of five sub-waves (three in the trend direction, two corrections), followed by a three-wave correction. This indicator automates the identification of these patterns and validates them against Elliott's original rules.
DISCLAIMER
----------
This indicator is for educational and informational purposes only. Past performance does not guarantee future results. Always conduct your own analysis and never trade with money you cannot afford to lose. The indicator provides signals based on technical analysis patterns and does not constitute financial advice.
VERSION
-------
v1.0 - Initial Release
Pine Script v5
Created: 2024
SUPPORT
-------
For detailed usage instructions, refer to the included documentation:
- usage_guide.md - Complete user manual with examples
- elliott_rules.md - Elliott Wave theory reference and implementation details
ADR levels+// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org
// © notprofessorgreen
//@version=5
indicator("ADR levels", shorttitle = 'ADR', overlay=true, max_bars_back=5000, max_lines_count=500)
// Error catching
if (timeframe.in_seconds() >= timeframe.in_seconds('D'))
runtime.error('Timeframe cannot be greater than Daily')
// Inputs
adr_days = input.int(10, title = 'Days', maxval=250, minval = 1)
std_x = input.float(1.0, "Scale Factor")
width = input.int(1, "Line Width")
// ADR line inputs
adr_color = input.color(color.gray, "ADR Color")
adr_style = input.string("solid", "ADR Style", options= )
// Standard deviation inputs
std_dev_0_5 = input.float(0.5, "Std Dev 1 Multiplier", minval=0.1, maxval=5.0)
std_0_5_show = input.bool(true, "Show Std Dev 1", inline="std1")
std_0_5_color = input.color(color.gray, "Std Dev 1 Color", inline="std1")
std_0_5_style = input.string("dotted", "Std Dev 1 Style", options= , inline="std1")
std_dev_1 = input.float(1.0, "Std Dev 2 Multiplier", minval=0.1, maxval=5.0)
std_1_show = input.bool(true, "Show Std Dev 2", inline="std2")
std_1_color = input.color(color.gray, "Std Dev 2 Color", inline="std2")
std_1_style = input.string("dotted", "Std Dev 2 Style", options= , inline="std2")
std_dev_2 = input.float(2.0, "Std Dev 3 Multiplier", minval=0.1, maxval=5.0)
std_2_show = input.bool(true, "Show Std Dev 3", inline="std3")
std_2_color = input.color(color.gray, "Std Dev 3 Color", inline="std3")
std_2_style = input.string("dotted", "Std Dev 3 Style", options= , inline="std3")
// Fibonacci inputs
fib_1_level = input.float(0.3, "Fib Level 1", minval=0, maxval=2.0)
fib_1_show = input.bool(true, "Show Fib 1", inline="fib1")
fib_1_color = input.color(color.blue, "Fib 1 Color", inline="fib1")
fib_1_style = input.string("dashed", "Fib 1 Style", options= , inline="fib1")
fib_2_level = input.float(0.5, "Fib Level 2", minval=0, maxval=2.0)
fib_2_show = input.bool(true, "Show Fib 2", inline="fib2")
fib_2_color = input.color(color.blue, "Fib 2 Color", inline="fib2")
fib_2_style = input.string("dashed", "Fib 2 Style", options= , inline="fib2")
fib_3_level = input.float(0.7, "Fib Level 3", minval=0, maxval=2.0)
fib_3_show = input.bool(true, "Show Fib 3", inline="fib3")
fib_3_color = input.color(color.blue, "Fib 3 Color", inline="fib3")
fib_3_style = input.string("dashed", "Fib 3 Style", options= , inline="fib3")
show_labels = input.bool(true, "Show Labels")
// Stats table inputs
show_stats = input.bool(true, "Show Table")
sample_size = input.bool(true, "Show Sample Sizes")
tbl_loc = input.string('Bottom Right', "Table", options = )
tbl_size = input.string('Tiny', "", options = )
rch_color = input.color(color.rgb(3, 131, 99, 70), "Reached ")
csd_color = input.color(color.rgb(127, 1, 185, 70), "Closed Through ")
// Function to convert style string to line style
get_line_style(string style) =>
switch style
"solid" => line.style_solid
"dashed" => line.style_dashed
"dotted" => line.style_dotted
// Variables
reset = session.islastbar_regular
var float track_highs = 0.00
var float track_lows = 0.00
var float today_adr = 0.00
var adrs = array.new_float(adr_days, 0.00)
var line adr_pos = na
var line adr_neg = na
var line fib_1_pos = na
var line fib_1_neg = na
var line fib_2_pos = na
var line fib_2_neg = na
var line fib_3_pos = na
var line fib_3_neg = na
var line std_0_5_pos = na
var line std_0_5_neg = na
var line std_1_pos = na
var line std_1_neg = na
var line std_2_pos = na
var line std_2_neg = na
var label fib_1_pos_lbl = na
var label fib_1_neg_lbl = na
var label fib_2_pos_lbl = na
var label fib_2_neg_lbl = na
var label fib_3_pos_lbl = na
var label fib_3_neg_lbl = na
var label adr_pos_lbl = na
var label adr_neg_lbl = na
var label std_0_5_pos_lbl = na
var label std_0_5_neg_lbl = na
var label std_1_pos_lbl = na
var label std_1_neg_lbl = na
var label std_2_pos_lbl = na
var label std_2_neg_lbl = na
// ADR calculation
track_highs := reset ? high : math.max(high, track_highs )
track_lows := reset ? low : math.min(low, track_lows )
if reset
array.unshift(adrs, math.round_to_mintick(track_highs - track_lows ))
if array.size(adrs) > adr_days
array.pop(adrs)
today_adr := math.round_to_mintick(array.avg(adrs))
// Delete previous lines and labels
line.delete(adr_pos )
line.delete(adr_neg )
line.delete(fib_1_pos )
line.delete(fib_1_neg )
line.delete(fib_2_pos )
line.delete(fib_2_neg )
line.delete(fib_3_pos )
line.delete(fib_3_neg )
line.delete(std_0_5_pos )
line.delete(std_0_5_neg )
line.delete(std_1_pos )
line.delete(std_1_neg )
line.delete(std_2_pos )
line.delete(std_2_neg )
label.delete(fib_1_pos_lbl )
label.delete(fib_1_neg_lbl )
label.delete(fib_2_pos_lbl )
label.delete(fib_2_neg_lbl )
label.delete(fib_3_pos_lbl )
label.delete(fib_3_neg_lbl )
label.delete(adr_pos_lbl )
label.delete(adr_neg_lbl )
label.delete(std_0_5_pos_lbl )
label.delete(std_0_5_neg_lbl )
label.delete(std_1_pos_lbl )
label.delete(std_1_neg_lbl )
label.delete(std_2_pos_lbl )
label.delete(std_2_neg_lbl )
// Draw ADR lines
adr_pos := line.new(bar_index, open + today_adr, bar_index+50, open + today_adr,
width=width, color=adr_color, style=get_line_style(adr_style))
adr_neg := line.new(bar_index, open - today_adr, bar_index+50, open - today_adr,
width=width, color=adr_color, style=get_line_style(adr_style))
// Draw ADR labels
if show_labels
adr_pos_lbl := label.new(bar_index+50, open + today_adr, "ADR High (" + str.tostring(adr_days) + "D)",
xloc=xloc.bar_index, textalign=text.align_left, textcolor=adr_color, color=color.new(color.blue, 90), style=label.style_none)
adr_neg_lbl := label.new(bar_index+50, open - today_adr, "ADR Low (" + str.tostring(adr_days) + "D)",
xloc=xloc.bar_index, textalign=text.align_left, textcolor=adr_color, color=color.new(color.red, 90), style=label.style_none)
// Calculate deviations
var float half_dev = na
var float one_dev = na
var float two_dev = na
half_dev := today_adr * std_dev_0_5
one_dev := today_adr * std_dev_1
two_dev := today_adr * std_dev_2
// Draw standard deviation lines (with show/hide options)
if std_0_5_show
std_0_5_pos := line.new(bar_index, (open + today_adr) + half_dev, bar_index+50, (open + today_adr) + half_dev,
width=width, color=std_0_5_color, style=get_line_style(std_0_5_style))
std_0_5_neg := line.new(bar_index, (open - today_adr) - half_dev, bar_index+50, (open - today_adr) - half_dev,
width=width, color=std_0_5_color, style=get_line_style(std_0_5_style))
if show_labels
std_0_5_pos_lbl := label.new(bar_index+50, (open + today_adr) + half_dev, "Std " + str.tostring(std_dev_0_5),
xloc=xloc.bar_index, textalign=text.align_left, textcolor=std_0_5_color, color=color.new(#000000,100), style=label.style_none)
std_0_5_neg_lbl := label.new(bar_index+50, (open - today_adr) - half_dev, "Std -" + str.tostring(std_dev_0_5),
xloc=xloc.bar_index, textalign=text.align_left, textcolor=std_0_5_color, color=color.new(#000000,100), style=label.style_none)
if std_1_show
std_1_pos := line.new(bar_index, (open + today_adr) + one_dev, bar_index+50, (open + today_adr) + one_dev,
width=width, color=std_1_color, style=get_line_style(std_1_style))
std_1_neg := line.new(bar_index, (open - today_adr) - one_dev, bar_index+50, (open - today_adr) - one_dev,
width=width, color=std_1_color, style=get_line_style(std_1_style))
if show_labels
std_1_pos_lbl := label.new(bar_index+50, (open + today_adr) + one_dev, "Std " + str.tostring(std_dev_1),
xloc=xloc.bar_index, textalign=text.align_left, textcolor=std_1_color, color=color.new(#000000,100), style=label.style_none)
std_1_neg_lbl := label.new(bar_index+50, (open - today_adr) - one_dev, "Std -" + str.tostring(std_dev_1),
xloc=xloc.bar_index, textalign=text.align_left, textcolor=std_1_color, color=color.new(#000000,100), style=label.style_none)
if std_2_show
std_2_pos := line.new(bar_index, (open + today_adr) + two_dev, bar_index+50, (open + today_adr) + two_dev,
width=width, color=std_2_color, style=get_line_style(std_2_style))
std_2_neg := line.new(bar_index, (open - today_adr) - two_dev, bar_index+50, (open - today_adr) - two_dev,
width=width, color=std_2_color, style=get_line_style(std_2_style))
if show_labels
std_2_pos_lbl := label.new(bar_index+50, (open + today_adr) + two_dev, "Std " + str.tostring(std_dev_2),
xloc=xloc.bar_index, textalign=text.align_left, textcolor=std_2_color, color=color.new(#000000,100), style=label.style_none)
std_2_neg_lbl := label.new(bar_index+50, (open - today_adr) - two_dev, "Std -" + str.tostring(std_dev_2),
xloc=xloc.bar_index, textalign=text.align_left, textcolor=std_2_color, color=color.new(#000000,100), style=label.style_none)
// Draw Fibonacci lines
if fib_1_show
fib_1_pos := line.new(bar_index, open + today_adr * fib_1_level, bar_index+50, open + today_adr * fib_1_level,
width=width, color=fib_1_color, style=get_line_style(fib_1_style))
fib_1_neg := line.new(bar_index, open - today_adr * fib_1_level, bar_index+50, open - today_adr * fib_1_level,
width=width, color=fib_1_color, style=get_line_style(fib_1_style))
if show_labels
fib_1_pos_lbl := label.new(bar_index+50, open + today_adr * fib_1_level, "Fib " + str.tostring(fib_1_level),
xloc=xloc.bar_index, textalign=text.align_left, textcolor=fib_1_color, color=color.new(#000000,100), style=label.style_none)
fib_1_neg_lbl := label.new(bar_index+50, open - today_adr * fib_1_level, "Fib -" + str.tostring(fib_1_level),
xloc=xloc.bar_index, textalign=text.align_left, textcolor=fib_1_color, color=color.new(#000000,100), style=label.style_none)
if fib_2_show
fib_2_pos := line.new(bar_index, open + today_adr * fib_2_level, bar_index+50, open + today_adr * fib_2_level,
width=width, color=fib_2_color, style=get_line_style(fib_2_style))
fib_2_neg := line.new(bar_index, open - today_adr * fib_2_level, bar_index+50, open - today_adr * fib_2_level,
width=width, color=fib_2_color, style=get_line_style(fib_2_style))
if show_labels
fib_2_pos_lbl := label.new(bar_index+50, open + today_adr * fib_2_level, "Fib " + str.tostring(fib_2_level),
xloc=xloc.bar_index, textalign=text.align_left, textcolor=fib_2_color, color=color.new(#000000,100), style=label.style_none)
fib_2_neg_lbl := label.new(bar_index+50, open - today_adr * fib_2_level, "Fib -" + str.tostring(fib_2_level),
xloc=xloc.bar_index, textalign=text.align_left, textcolor=fib_2_color, color=color.new(#000000,100), style=label.style_none)
if fib_3_show
fib_3_pos := line.new(bar_index, open + today_adr * fib_3_level, bar_index+50, open + today_adr * fib_3_level,
width=width, color=fib_3_color, style=get_line_style(fib_3_style))
fib_3_neg := line.new(bar_index, open - today_adr * fib_3_level, bar_index+50, open - today_adr * fib_3_level,
width=width, color=fib_3_color, style=get_line_style(fib_3_style))
if show_labels
fib_3_pos_lbl := label.new(bar_index+50, open + today_adr * fib_3_level, "Fib " + str.tostring(fib_3_level),
xloc=xloc.bar_index, textalign=text.align_left, textcolor=fib_3_color, color=color.new(#000000,100), style=label.style_none)
fib_3_neg_lbl := label.new(bar_index+50, open - today_adr * fib_3_level, "Fib -" + str.tostring(fib_3_level),
xloc=xloc.bar_index, textalign=text.align_left, textcolor=fib_3_color, color=color.new(#000000,100), style=label.style_none)
else
today_adr := today_adr
line.set_x2(adr_pos, bar_index+50)
line.set_x2(adr_neg, bar_index+50)
if show_labels
label.set_x(adr_pos_lbl, bar_index+50)
label.set_x(adr_neg_lbl, bar_index+50)
if std_0_5_show
line.set_x2(std_0_5_pos, bar_index+50)
line.set_x2(std_0_5_neg, bar_index+50)
if show_labels
label.set_x(std_0_5_pos_lbl, bar_index+50)
label.set_x(std_0_5_neg_lbl, bar_index+50)
if std_1_show
line.set_x2(std_1_pos, bar_index+50)
line.set_x2(std_1_neg, bar_index+50)
if show_labels
label.set_x(std_1_pos_lbl, bar_index+50)
label.set_x(std_1_neg_lbl, bar_index+50)
if std_2_show
line.set_x2(std_2_pos, bar_index+50)
line.set_x2(std_2_neg, bar_index+50)
if show_labels
label.set_x(std_2_pos_lbl, bar_index+50)
label.set_x(std_2_neg_lbl, bar_index+50)
if fib_1_show
line.set_x2(fib_1_pos, bar_index+50)
line.set_x2(fib_1_neg, bar_index+50)
if show_labels
label.set_x(fib_1_pos_lbl, bar_index+50)
label.set_x(fib_1_neg_lbl, bar_index+50)
if fib_2_show
line.set_x2(fib_2_pos, bar_index+50)
line.set_x2(fib_2_neg, bar_index+50)
if show_labels
label.set_x(fib_2_pos_lbl, bar_index+50)
label.set_x(fib_2_neg_lbl, bar_index+50)
if fib_3_show
line.set_x2(fib_3_pos, bar_index+50)
line.set_x2(fib_3_neg, bar_index+50)
if show_labels
label.set_x(fib_3_pos_lbl, bar_index+50)
label.set_x(fib_3_neg_lbl, bar_index+50)
// Stats calculation
var float d_hi = high
var float d_lo = low
var float d_open = open
var float d_range = array.new_float()
var float adr_val = na
var float d_adr_hi = na
var float d_adr_lo = na
type adr_stats
int hit_adr_hi = 0
int hit_adr_lo = 0
int hit_adr_both = 0
int thru_adr_hi = 0
int thru_adr_lo = 0
int hit_fib_1_hi = 0
int hit_fib_1_lo = 0
int hit_fib_2_hi = 0
int hit_fib_2_lo = 0
int hit_fib_3_hi = 0
int hit_fib_3_lo = 0
int hit_std_0_5_hi = 0
int hit_std_0_5_lo = 0
int hit_std_1_hi = 0
int hit_std_1_lo = 0
int hit_std_2_hi = 0
int hit_std_2_lo = 0
int d_count = 0
var adr_sun = adr_stats.new()
var adr_mon = adr_stats.new()
var adr_tue = adr_stats.new()
var adr_wed = adr_stats.new()
var adr_thu = adr_stats.new()
var adr_fri = adr_stats.new()
var adr_sat = adr_stats.new()
if timeframe.change("D")
x = adr_mon
dow = dayofweek(time , "America/New_York")
if dow == dayofweek.tuesday
x := adr_tue
else if dow == dayofweek.wednesday
x := adr_wed
else if dow == dayofweek.thursday
x := adr_thu
else if dow == dayofweek.friday
x := adr_fri
else if dow == dayofweek.saturday
x := adr_sat
else if dow == dayofweek.sunday
x := adr_sun
if not na(adr_val)
x.d_count += 1
if d_hi > d_adr_hi
x.hit_adr_hi += 1
if d_lo < d_adr_lo
x.hit_adr_lo += 1
if d_hi > d_adr_hi and d_lo < d_adr_lo
x.hit_adr_both += 1
if close > d_adr_hi
x.thru_adr_hi += 1
if close < d_adr_lo
x.thru_adr_lo += 1
if fib_1_show
if d_hi > d_open + (adr_val * fib_1_level)
x.hit_fib_1_hi += 1
if d_lo < d_open - (adr_val * fib_1_level)
x.hit_fib_1_lo += 1
if fib_2_show
if d_hi > d_open + (adr_val * fib_2_level)
x.hit_fib_2_hi += 1
if d_lo < d_open - (adr_val * fib_2_level)
x.hit_fib_2_lo += 1
if fib_3_show
if d_hi > d_open + (adr_val * fib_3_level)
x.hit_fib_3_hi += 1
if d_lo < d_open - (adr_val * fib_3_level)
x.hit_fib_3_lo += 1
if std_0_5_show
if d_hi > d_adr_hi + (adr_val * std_dev_0_5)
x.hit_std_0_5_hi += 1
if d_lo < d_adr_lo - (adr_val * std_dev_0_5)
x.hit_std_0_5_lo += 1
if std_1_show
if d_hi > d_adr_hi + (adr_val * std_dev_1)
x.hit_std_1_hi += 1
if d_lo < d_adr_lo - (adr_val * std_dev_1)
x.hit_std_1_lo += 1
if std_2_show
if d_hi > d_adr_hi + (adr_val * std_dev_2)
x.hit_std_2_hi += 1
if d_lo < d_adr_lo - (adr_val * std_dev_2)
x.hit_std_2_lo += 1
if timeframe.change("D")
d_open := open
array.unshift(d_range, d_hi - d_lo)
if array.size(d_range) > adr_days
array.pop(d_range)
if array.size(d_range) == adr_days
adr_val := array.avg(d_range)
d_adr_hi := open + (adr_val*std_x)/2
d_adr_lo := open - (adr_val*std_x)/2
d_hi := high
d_lo := low
else
d_hi := math.max(high, d_hi)
d_lo := math.min(low, d_lo)
// Table functions
get_table_pos(pos) =>
switch pos
"Bottom Center" => position.bottom_center
"Bottom Left" => position.bottom_left
"Bottom Right" => position.bottom_right
"Middle Center" => position.middle_center
"Middle Left" => position.middle_left
"Middle Right" => position.middle_right
"Top Center" => position.top_center
"Top Left" => position.top_left
"Top Right" => position.top_right
var _loc = get_table_pos(tbl_loc)
get_table_size(size) =>
switch size
'Tiny' => size.tiny
'Small' => size.small
'Normal' => size.normal
'Large' => size.large
'Huge' => size.huge
'Auto' => size.auto
var _size = get_table_size(tbl_size)
fmt_sample(s, float pct, int count) =>
str.format("{0,number,percent}", pct) + (sample_size ? " ("+str.tostring(count)+")" : "")
// Draw table
if barstate.islast and show_stats
var tbl = table.new(_loc, 100, 100, chart.bg_color, chart.fg_color, 2, chart.fg_color, 1)
// Column headers (days + empty first cell)
table.cell(tbl, 0, 0, "Level", text_size = _size)
table.cell(tbl, 1, 0, "Mon", bgcolor = rch_color, text_size = _size)
table.cell(tbl, 2, 0, "Tue", bgcolor = rch_color, text_size = _size)
table.cell(tbl, 3, 0, "Wed", bgcolor = rch_color, text_size = _size)
table.cell(tbl, 4, 0, "Thu", bgcolor = rch_color, text_size = _size)
table.cell(tbl, 5, 0, "Fri", bgcolor = rch_color, text_size = _size)
// Row headers and data
var row = 1
table.cell(tbl, 0, row, "ADR High", text_size = _size)
table.cell(tbl, 1, row, fmt_sample(adr_mon.d_count, adr_mon.hit_adr_hi / adr_mon.d_count, adr_mon.hit_adr_hi), bgcolor = rch_color, text_size = _size)
table.cell(tbl, 2, row, fmt_sample(adr_tue.d_count, adr_tue.hit_adr_hi / adr_tue.d_count, adr_tue.hit_adr_hi), bgcolor = rch_color, text_size = _size)
table.cell(tbl, 3, row, fmt_sample(adr_wed.d_count, adr_wed.hit_adr_hi / adr_wed.d_count, adr_wed.hit_adr_hi), bgcolor = rch_color, text_size = _size)
table.cell(tbl, 4, row, fmt_sample(adr_thu.d_count, adr_thu.hit_adr_hi / adr_thu.d_count, adr_thu.hit_adr_hi), bgcolor = rch_color, text_size = _size)
table.cell(tbl, 5, row, fmt_sample(adr_fri.d_count, adr_fri.hit_adr_hi / adr_fri.d_count, adr_fri.hit_adr_hi), bgcolor = rch_color, text_size = _size)
row := row + 1
table.cell(tbl, 0, row, "ADR Low", text_size = _size)
table.cell(tbl, 1, row, fmt_sample(adr_mon.d_count, adr_mon.hit_adr_lo / adr_mon.d_count, adr_mon.hit_adr_lo), bgcolor = rch_color, text_size = _size)
table.cell(tbl, 2, row, fmt_sample(adr_tue.d_count, adr_tue.hit_adr_lo / adr_tue.d_count, adr_tue.hit_adr_lo), bgcolor = rch_color, text_size = _size)
table.cell(tbl, 3, row, fmt_sample(adr_wed.d_count, adr_wed.hit_adr_lo / adr_wed.d_count, adr_wed.hit_adr_lo), bgcolor = rch_color, text_size = _size)
table.cell(tbl, 4, row, fmt_sample(adr_thu.d_count, adr_thu.hit_adr_lo / adr_thu.d_count, adr_thu.hit_adr_lo), bgcolor = rch_color, text_size = _size)
table.cell(tbl, 5, row, fmt_sample(adr_fri.d_count, adr_fri.hit_adr_lo / adr_fri.d_count, adr_fri.hit_adr_lo), bgcolor = rch_color, text_size = _size)
row := row + 1
table.cell(tbl, 0, row, "ADR High (Close)", text_size = _size)
table.cell(tbl, 1, row, fmt_sample(adr_mon.d_count, adr_mon.thru_adr_hi / adr_mon.d_count, adr_mon.thru_adr_hi), bgcolor = csd_color, text_size = _size)
table.cell(tbl, 2, row, fmt_sample(adr_tue.d_count, adr_tue.thru_adr_hi / adr_tue.d_count, adr_tue.thru_adr_hi), bgcolor = csd_color, text_size = _size)
table.cell(tbl, 3, row, fmt_sample(adr_wed.d_count, adr_wed.thru_adr_hi / adr_wed.d_count, adr_wed.thru_adr_hi), bgcolor = csd_color, text_size = _size)
table.cell(tbl, 4, row, fmt_sample(adr_thu.d_count, adr_thu.thru_adr_hi / adr_thu.d_count, adr_thu.thru_adr_hi), bgcolor = csd_color, text_size = _size)
table.cell(tbl, 5, row, fmt_sample(adr_fri.d_count, adr_fri.thru_adr_hi / adr_fri.d_count, adr_fri.thru_adr_hi), bgcolor = csd_color, text_size = _size)
row := row + 1
table.cell(tbl, 0, row, "ADR Low (Close)", text_size = _size)
table.cell(tbl, 1, row, fmt_sample(adr_mon.d_count, adr_mon.thru_adr_lo / adr_mon.d_count, adr_mon.thru_adr_lo), bgcolor = csd_color, text_size = _size)
table.cell(tbl, 2, row, fmt_sample(adr_tue.d_count, adr_tue.thru_adr_lo / adr_tue.d_count, adr_tue.thru_adr_lo), bgcolor = csd_color, text_size = _size)
table.cell(tbl, 3, row, fmt_sample(adr_wed.d_count, adr_wed.thru_adr_lo / adr_wed.d_count, adr_wed.thru_adr_lo), bgcolor = csd_color, text_size = _size)
table.cell(tbl, 4, row, fmt_sample(adr_thu.d_count, adr_thu.thru_adr_lo / adr_thu.d_count, adr_thu.thru_adr_lo), bgcolor = csd_color, text_size = _size)
table.cell(tbl, 5, row, fmt_sample(adr_fri.d_count, adr_fri.thru_adr_lo / adr_fri.d_count, adr_fri.thru_adr_lo), bgcolor = csd_color, text_size = _size)
row := row + 1
if fib_1_show
table.cell(tbl, 0, row, "Fib " + str.tostring(fib_1_level), text_size = _size)
table.cell(tbl, 1, row, fmt_sample(adr_mon.d_count, adr_mon.hit_fib_1_hi / adr_mon.d_count, adr_mon.hit_fib_1_hi), bgcolor = rch_color, text_size = _size)
table.cell(tbl, 2, row, fmt_sample(adr_tue.d_count, adr_tue.hit_fib_1_hi / adr_tue.d_count, adr_tue.hit_fib_1_hi), bgcolor = rch_color, text_size = _size)
table.cell(tbl, 3, row, fmt_sample(adr_wed.d_count, adr_wed.hit_fib_1_hi / adr_wed.d_count, adr_wed.hit_fib_1_hi), bgcolor = rch_color, text_size = _size)
table.cell(tbl, 4, row, fmt_sample(adr_thu.d_count, adr_thu.hit_fib_1_hi / adr_thu.d_count, adr_thu.hit_fib_1_hi), bgcolor = rch_color, text_size = _size)
table.cell(tbl, 5, row, fmt_sample(adr_fri.d_count, adr_fri.hit_fib_1_hi / adr_fri.d_count, adr_fri.hit_fib_1_hi), bgcolor = rch_color, text_size = _size)
row := row + 1
table.cell(tbl, 0, row, "Fib -" + str.tostring(fib_1_level), text_size = _size)
table.cell(tbl, 1, row, fmt_sample(adr_mon.d_count, adr_mon.hit_fib_1_lo / adr_mon.d_count, adr_mon.hit_fib_1_lo), bgcolor = rch_color, text_size = _size)
table.cell(tbl, 2, row, fmt_sample(adr_tue.d_count, adr_tue.hit_fib_1_lo / adr_tue.d_count, adr_tue.hit_fib_1_lo), bgcolor = rch_color, text_size = _size)
table.cell(tbl, 3, row, fmt_sample(adr_wed.d_count, adr_wed.hit_fib_1_lo / adr_wed.d_count, adr_wed.hit_fib_1_lo), bgcolor = rch_color, text_size = _size)
table.cell(tbl, 4, row, fmt_sample(adr_thu.d_count, adr_thu.hit_fib_1_lo / adr_thu.d_count, adr_thu.hit_fib_1_lo), bgcolor = rch_color, text_size = _size)
table.cell(tbl, 5, row, fmt_sample(adr_fri.d_count, adr_fri.hit_fib_1_lo / adr_fri.d_count, adr_fri.hit_fib_1_lo), bgcolor = rch_color, text_size = _size)
row := row + 1
if fib_2_show
table.cell(tbl, 0, row, "Fib " + str.tostring(fib_2_level), text_size = _size)
table.cell(tbl, 1, row, fmt_sample(adr_mon.d_count, adr_mon.hit_fib_2_hi / adr_mon.d_count, adr_mon.hit_fib_2_hi), bgcolor = rch_color, text_size = _size)
table.cell(tbl, 2, row, fmt_sample(adr_tue.d_count, adr_tue.hit_fib_2_hi / adr_tue.d_count, adr_tue.hit_fib_2_hi), bgcolor = rch_color, text_size = _size)
table.cell(tbl, 3, row, fmt_sample(adr_wed.d_count, adr_wed.hit_fib_2_hi / adr_wed.d_count, adr_wed.hit_fib_2_hi), bgcolor = rch_color, text_size = _size)
table.cell(tbl, 4, row, fmt_sample(adr_thu.d_count, adr_thu.hit_fib_2_hi / adr_thu.d_count, adr_thu.hit_fib_2_hi), bgcolor = rch_color, text_size = _size)
table.cell(tbl, 5, row, fmt_sample(adr_fri.d_count, adr_fri.hit_fib_2_hi / adr_fri.d_count, adr_fri.hit_fib_2_hi), bgcolor = rch_color, text_size = _size)
row := row + 1
table.cell(tbl, 0, row, "Fib -" + str.tostring(fib_2_level), text_size = _size)
table.cell(tbl, 1, row, fmt_sample(adr_mon.d_count, adr_mon.hit_fib_2_lo / adr_mon.d_count, adr_mon.hit_fib_2_lo), bgcolor = rch_color, text_size = _size)
table.cell(tbl, 2, row, fmt_sample(adr_tue.d_count, adr_tue.hit_fib_2_lo / adr_tue.d_count, adr_tue.hit_fib_2_lo), bgcolor = rch_color, text_size = _size)
table.cell(tbl, 3, row, fmt_sample(adr_wed.d_count, adr_wed.hit_fib_2_lo / adr_wed.d_count, adr_wed.hit_fib_2_lo), bgcolor = rch_color, text_size = _size)
table.cell(tbl, 4, row, fmt_sample(adr_thu.d_count, adr_thu.hit_fib_2_lo / adr_thu.d_count, adr_thu.hit_fib_2_lo), bgcolor = rch_color, text_size = _size)
table.cell(tbl, 5, row, fmt_sample(adr_fri.d_count, adr_fri.hit_fib_2_lo / adr_fri.d_count, adr_fri.hit_fib_2_lo), bgcolor = rch_color, text_size = _size)
row := row + 1
if fib_3_show
table.cell(tbl, 0, row, "Fib " + str.tostring(fib_3_level), text_size = _size)
table.cell(tbl, 1, row, fmt_sample(adr_mon.d_count, adr_mon.hit_fib_3_hi / adr_mon.d_count, adr_mon.hit_fib_3_hi), bgcolor = rch_color, text_size = _size)
table.cell(tbl, 2, row, fmt_sample(adr_tue.d_count, adr_tue.hit_fib_3_hi / adr_tue.d_count, adr_tue.hit_fib_3_hi), bgcolor = rch_color, text_size = _size)
table.cell(tbl, 3, row, fmt_sample(adr_wed.d_count, adr_wed.hit_fib_3_hi / adr_wed.d_count, adr_wed.hit_fib_3_hi), bgcolor = rch_color, text_size = _size)
table.cell(tbl, 4, row, fmt_sample(adr_thu.d_count, adr_thu.hit_fib_3_hi / adr_thu.d_count, adr_thu.hit_fib_3_hi), bgcolor = rch_color, text_size = _size)
table.cell(tbl, 5, row, fmt_sample(adr_fri.d_count, adr_fri.hit_fib_3_hi / adr_fri.d_count, adr_fri.hit_fib_3_hi), bgcolor = rch_color, text_size = _size)
row := row + 1
table.cell(tbl, 0, row, "Fib -" + str.tostring(fib_3_level), text_size = _size)
table.cell(tbl, 1, row, fmt_sample(adr_mon.d_count, adr_mon.hit_fib_3_lo / adr_mon.d_count, adr_mon.hit_fib_3_lo), bgcolor = rch_color, text_size = _size)
table.cell(tbl, 2, row, fmt_sample(adr_tue.d_count, adr_tue.hit_fib_3_lo / adr_tue.d_count, adr_tue.hit_fib_3_lo), bgcolor = rch_color, text_size = _size)
table.cell(tbl, 3, row, fmt_sample(adr_wed.d_count, adr_wed.hit_fib_3_lo / adr_wed.d_count, adr_wed.hit_fib_3_lo), bgcolor = rch_color, text_size = _size)
table.cell(tbl, 4, row, fmt_sample(adr_thu.d_count, adr_thu.hit_fib_3_lo / adr_thu.d_count, adr_thu.hit_fib_3_lo), bgcolor = rch_color, text_size = _size)
table.cell(tbl, 5, row, fmt_sample(adr_fri.d_count, adr_fri.hit_fib_3_lo / adr_fri.d_count, adr_fri.hit_fib_3_lo), bgcolor = rch_color, text_size = _size)
row := row + 1
if std_0_5_show
table.cell(tbl, 0, row, "Std " + str.tostring(std_dev_0_5), text_size = _size)
table.cell(tbl, 1, row, fmt_sample(adr_mon.d_count, adr_mon.hit_std_0_5_hi / adr_mon.d_count, adr_mon.hit_std_0_5_hi), bgcolor = rch_color, text_size = _size)
table.cell(tbl, 2, row, fmt_sample(adr_tue.d_count, adr_tue.hit_std_0_5_hi / adr_tue.d_count, adr_tue.hit_std_0_5_hi), bgcolor = rch_color, text_size = _size)
table.cell(tbl, 3, row, fmt_sample(adr_wed.d_count, adr_wed.hit_std_0_5_hi / adr_wed.d_count, adr_wed.hit_std_0_5_hi), bgcolor = rch_color, text_size = _size)
table.cell(tbl, 4, row, fmt_sample(adr_thu.d_count, adr_thu.hit_std_0_5_hi / adr_thu.d_count, adr_thu.hit_std_0_5_hi), bgcolor = rch_color, text_size = _size)
table.cell(tbl, 5, row, fmt_sample(adr_fri.d_count, adr_fri.hit_std_0_5_hi / adr_fri.d_count, adr_fri.hit_std_0_5_hi), bgcolor = rch_color, text_size = _size)
row := row + 1
table.cell(tbl, 0, row, "Std -" + str.tostring(std_dev_0_5), text_size = _size)
table.cell(tbl, 1, row, fmt_sample(adr_mon.d_count, adr_mon.hit_std_0_5_lo / adr_mon.d_count, adr_mon.hit_std_0_5_lo), bgcolor = rch_color, text_size = _size)
table.cell(tbl, 2, row, fmt_sample(adr_tue.d_count, adr_tue.hit_std_0_5_lo / adr_tue.d_count, adr_tue.hit_std_0_5_lo), bgcolor = rch_color, text_size = _size)
table.cell(tbl, 3, row, fmt_sample(adr_wed.d_count, adr_wed.hit_std_0_5_lo / adr_wed.d_count, adr_wed.hit_std_0_5_lo), bgcolor = rch_color, text_size = _size)
table.cell(tbl, 4, row, fmt_sample(adr_thu.d_count, adr_thu.hit_std_0_5_lo / adr_thu.d_count, adr_thu.hit_std_0_5_lo), bgcolor = rch_color, text_size = _size)
table.cell(tbl, 5, row, fmt_sample(adr_fri.d_count, adr_fri.hit_std_0_5_lo / adr_fri.d_count, adr_fri.hit_std_0_5_lo), bgcolor = rch_color, text_size = _size)
row := row + 1
if std_1_show
table.cell(tbl, 0, row, "Std " + str.tostring(std_dev_1), text_size = _size)
table.cell(tbl, 1, row, fmt_sample(adr_mon.d_count, adr_mon.hit_std_1_hi / adr_mon.d_count, adr_mon.hit_std_1_hi), bgcolor = rch_color, text_size = _size)
table.cell(tbl, 2, row, fmt_sample(adr_tue.d_count, adr_tue.hit_std_1_hi / adr_tue.d_count, adr_tue.hit_std_1_hi), bgcolor = rch_color, text_size = _size)
table.cell(tbl, 3, row, fmt_sample(adr_wed.d_count, adr_wed.hit_std_1_hi / adr_wed.d_count, adr_wed.hit_std_1_hi), bgcolor = rch_color, text_size = _size)
table.cell(tbl, 4, row, fmt_sample(adr_thu.d_count, adr_thu.hit_std_1_hi / adr_thu.d_count, adr_thu.hit_std_1_hi), bgcolor = rch_color, text_size = _size)
table.cell(tbl, 5, row, fmt_sample(adr_fri.d_count, adr_fri.hit_std_1_hi / adr_fri.d_count, adr_fri.hit_std_1_hi), bgcolor = rch_color, text_size = _size)
row := row + 1
table.cell(tbl, 0, row, "Std -" + str.tostring(std_dev_1), text_size = _size)
table.cell(tbl, 1, row, fmt_sample(adr_mon.d_count, adr_mon.hit_std_1_lo / adr_mon.d_count, adr_mon.hit_std_1_lo), bgcolor = rch_color, text_size = _size)
table.cell(tbl, 2, row, fmt_sample(adr_tue.d_count, adr_tue.hit_std_1_lo / adr_tue.d_count, adr_tue.hit_std_1_lo), bgcolor = rch_color, text_size = _size)
table.cell(tbl, 3, row, fmt_sample(adr_wed.d_count, adr_wed.hit_std_1_lo / adr_wed.d_count, adr_wed.hit_std_1_lo), bgcolor = rch_color, text_size = _size)
table.cell(tbl, 4, row, fmt_sample(adr_thu.d_count, adr_thu.hit_std_1_lo / adr_thu.d_count, adr_thu.hit_std_1_lo), bgcolor = rch_color, text_size = _size)
table.cell(tbl, 5, row, fmt_sample(adr_fri.d_count, adr_fri.hit_std_1_lo / adr_fri.d_count, adr_fri.hit_std_1_lo), bgcolor = rch_color, text_size = _size)
row := row + 1
if std_2_show
table.cell(tbl, 0, row, "Std " + str.tostring(std_dev_2), text_size = _size)
table.cell(tbl, 1, row, fmt_sample(adr_mon.d_count, adr_mon.hit_std_2_hi / adr_mon.d_count, adr_mon.hit_std_2_hi), bgcolor = rch_color, text_size = _size)
table.cell(tbl, 2, row, fmt_sample(adr_tue.d_count, adr_tue.hit_std_2_hi / adr_tue.d_count, adr_tue.hit_std_2_hi), bgcolor = rch_color, text_size = _size)
table.cell(tbl, 3, row, fmt_sample(adr_wed.d_count, adr_wed.hit_std_2_hi / adr_wed.d_count, adr_wed.hit_std_2_hi), bgcolor = rch_color, text_size = _size)
table.cell(tbl, 4, row, fmt_sample(adr_thu.d_count, adr_thu.hit_std_2_hi / adr_thu.d_count, adr_thu.hit_std_2_hi), bgcolor = rch_color, text_size = _size)
table.cell(tbl, 5, row, fmt_sample(adr_fri.d_count, adr_fri.hit_std_2_hi / adr_fri.d_count, adr_fri.hit_std_2_hi), bgcolor = rch_color, text_size = _size)
row := row + 1
table.cell(tbl, 0, row, "Std -" + str.tostring(std_dev_2), text_size = _size)
table.cell(tbl, 1, row, fmt_sample(adr_mon.d_count, adr_mon.hit_std_2_lo / adr_mon.d_count, adr_mon.hit_std_2_lo), bgcolor = rch_color, text_size = _size)
table.cell(tbl, 2, row, fmt_sample(adr_tue.d_count, adr_tue.hit_std_2_lo / adr_tue.d_count, adr_tue.hit_std_2_lo), bgcolor = rch_color, text_size = _size)
table.cell(tbl, 3, row, fmt_sample(adr_wed.d_count, adr_wed.hit_std_2_lo / adr_wed.d_count, adr_wed.hit_std_2_lo), bgcolor = rch_color, text_size = _size)
table.cell(tbl, 4, row, fmt_sample(adr_thu.d_count, adr_thu.hit_std_2_lo / adr_thu.d_count, adr_thu.hit_std_2_lo), bgcolor = rch_color, text_size = _size)
table.cell(tbl, 5, row, fmt_sample(adr_fri.d_count, adr_fri.hit_std_2_lo / adr_fri.d_count, adr_fri.hit_std_2_lo), bgcolor = rch_color, text_size = _size)
Multi-Method Candle Repainter by Mustang Algo# 🎯 Candle Repainter - Price Direction by Mustang Algo
## Overview
A powerful and intuitive indicator that repaints candles in real-time based on price direction detection. This tool helps traders quickly identify market trends by coloring candles according to bullish, bearish, or neutral momentum using multiple proven technical analysis methods.
## 🌟 Key Features
### 5 Detection Methods
Choose from multiple sophisticated algorithms to detect price direction:
1. **EMA Trend** - Compares price against Exponential Moving Average with momentum confirmation (price above EMA + upward movement)
2. **Price vs SMA** - Classic crossover method using Simple Moving Average (price position relative to SMA)
3. **Momentum** - Pure momentum-based detection for aggressive signals (rate of price change)
4. **Higher High/Lower Low** - Structure-based analysis identifying swing points and price patterns
5. **Supertrend** - Popular ATR-based trend following system for reliable trend identification
### Visual Features
- 🟢 **Green Candles** - Bullish trend detected
- 🔴 **Red Candles** - Bearish trend detected
- ⚪ **Gray Candles** - Neutral/indecisive market
- 🔺 **Triangle Signals** - Mark trend changes (optional, clean by default)
- 📊 **Background Coloring** - Subtle background highlighting for zones
- 📈 **Overlay Indicators** - Display the chosen MA/Supertrend line for reference
### Smart Signal System
- **Default Mode**: Shows triangles ONLY on trend changes (cleaner charts, less noise)
- **All Candles Mode**: Display signals on every bullish/bearish candle (more aggressive)
- Fully customizable signal visibility
- Real-time statistics dashboard
## ⚙️ Customizable Parameters
### Method-Specific Settings
- **EMA Length** (default: 20) - For EMA Trend method - adjust based on your timeframe
- **SMA Length** (default: 50) - For Price vs SMA method - classic period for trend detection
- **Momentum Period** (default: 14) - For Momentum method - sensitivity control
- **HH/LL Lookback** (default: 10) - For Higher High/Lower Low method - swing detection range
- **ATR Period** (default: 10) - For Supertrend method - volatility measurement period
- **ATR Multiplier** (default: 3.0) - For Supertrend method - trend sensitivity control
### Visual Controls
- Toggle signal display on/off
- Choose between change signals or all candles
- Background highlighting control
- Clean, minimalist interface
## 📊 Real-Time Dashboard
A compact information table displays:
- Current trend direction (BULLISH 🔼 / BEARISH 🔽 / NEUTRAL ➡️)
- Active detection method
- Creator credit (Mustang Algo)
- Real-time status updates
## 🔔 Built-in Alerts
Set up automated alerts for:
- Bullish trend changes - "Switch to BULLISH trend"
- Bearish trend changes - "Switch to BEARISH trend"
- Get notified on any device when market direction changes
## 💡 How to Use
### For Day Traders
- Use **EMA Trend** with shorter periods (10-20)
- Enable "Show on all candles" for continuous feedback
- Combine with volume for confirmation
- Best on 5m-15m timeframes
### For Swing Traders
- Use **Supertrend** or **Price vs SMA** with longer periods (50-200)
- Keep default "changes only" mode for cleaner entries
- Perfect for multi-timeframe analysis
- Best on 1H-4H-Daily timeframes
### For Scalpers
- Use **Momentum** method for fastest signals
- Lower timeframes (1m-5m)
- Combine with support/resistance levels
- Quick entries on trend changes
### For Position Traders
- Use **Higher High/Lower Low** on higher timeframes
- Weekly or Daily charts
- Focus on structural changes in the market
## 🎨 Best Practices
1. **Multiple Timeframes**: Always confirm direction on a higher timeframe before entering
2. **Combine Methods**: Test different detection methods for your specific asset and timeframe
3. **Risk Management**: Always use stop-losses - don't rely solely on color changes
4. **Backtesting**: Test parameters on historical data before live trading
5. **Context Matters**: Use with support/resistance, volume, and market structure
6. **No Holy Grail**: This is a tool to assist your analysis, not a standalone trading system
## ⚠️ Important Notes
- This is a **repainting indicator** - signals may adjust as new price data arrives (by design for real-time trend following)
- Best used for **trend confirmation and direction bias**, not as standalone entry/exit signals
- Different methods work better in different market conditions (trending vs ranging)
- Always combine with proper risk management and position sizing
- No indicator is perfect - false signals can occur, especially in choppy/ranging markets
## 📈 Recommended Settings by Market
### Crypto (High Volatility)
- Method: **Supertrend**
- ATR Period: 10
- ATR Multiplier: 3.0
- Timeframe: 15m - 4H
- Works well in trending crypto markets
### Forex (Trending Markets)
- Method: **EMA Trend** or **Price vs SMA**
- Period: 20-50
- Timeframe: 1H - Daily
- Excellent for major pairs
### Stocks (Moderate Volatility)
- Method: **Higher High/Lower Low**
- Lookback: 10-15
- Timeframe: Daily - Weekly
- Great for swing trading stocks
### Indices (Clear Trends)
- Method: **Price vs SMA**
- SMA Length: 50-200
- Timeframe: 4H - Daily
- Classic trend following on indices
### Commodities
- Method: **Supertrend**
- ATR Period: 10-14
- Timeframe: 1H - Daily
- Adapts well to commodity volatility
## 🚀 Quick Start Guide
1. Add indicator to your chart
2. Select your preferred detection method from the dropdown
3. Adjust parameters based on your timeframe and market
4. Observe candle colors for trend direction
5. Look for triangle signals on trend changes
6. Set up alerts for automated notifications
7. Combine with your existing trading strategy
## 🔧 Advanced Tips
- **Combining with other indicators**: Works great with RSI, MACD, or volume indicators
- **Filter false signals**: Use on higher timeframe to filter lower timeframe noise
- **Trend confirmation**: Wait for 2-3 consecutive colored candles before entry
- **Exit strategy**: Consider exiting when candle color changes or use fixed targets
- **Avoid ranging markets**: This indicator performs best in trending conditions
## 📚 Educational Value
This indicator teaches:
- How different technical methods identify trends
- The concept of trend following vs momentum trading
- The importance of trend direction in trading decisions
- How to combine multiple timeframes for better analysis
## 🏆 Credits
**Created by Mustang Algo**
Version 1.0 - November 2025
For the trader who values simplicity, clarity, and effective trend detection.
## 📞 Support & Feedback
If you find this indicator useful:
- Leave a comment with your feedback
- Share your results and optimal settings
- Suggest improvements or additional features
- Report any bugs or issues
---
## Tags
`trend` `candles` `repainter` `moving-average` `supertrend` `momentum` `signals` `alerts` `price-action` `trend-following` `daytrading` `swingtrading` `multi-method` `beginner-friendly`
## Category
**Trend Analysis / Candles**
## License
Open source - Free to use and modify for personal trading
---
*Remember: Trading involves risk. Always use proper risk management and never risk more than you can afford to lose. This indicator is a tool to assist your analysis, not financial advice.*
BTC Bull/Bear marketThis indicator plots the 350-period Simple Moving Average (SMA) calculated on the Daily ("D") timeframe.
he color of the SMA line is determined by the closing price of the 2-Week ("2W") timeframe.
1. It fetches the 350-day SMA value (`sma350_daily`).
2. It checks where the *last closed* 2-Week candle finished relative to this SMA line.
3. If the 2W candle closed *above* the 350 SMA, the line is colored GREEN.
4. If the 2W candle closed *below* the 350 SMA, the line is colored RED.
This helps to visualize the long-term trend (350 SMA) confirmed by a higher (2W) timeframe bias, using non-repainting logic (`close `) for the color signal.
OTHERS Power-Law Support 2025OTHERS Power-Law Calculation by Robert.
I took the BTC-Power-Law & Decay-Top and applied it to the OTHERS index.
This indicator is very experimental/in an early state.
Disclaimer: This is my own calculation and no investing advice! Use at your own risk.
Alpha Trader University - Average Session SolatilityBast Indictor
You will need this indicator in your daily life, use it properly and make money.
Relative Strength vs Benchmark SPYRelative Strength vs Benchmark (SPY)
This indicator compares the performance of the charted symbol (stock or ETF) against a benchmark index — by default, SPY (S&P 500). It plots a Relative Strength (RS) ratio line (Symbol / SPY) and its EMA(50) to visualize when the asset is outperforming or underperforming the market.
Key Features
📈 RS Line (blue): Shows how the asset performs relative to SPY.
🟠 EMA(50): Smooths the RS trend to highlight sustained leadership.
🟩 Green background: Symbol is outperforming SPY (RS > EMA).
🟥 Red background: Symbol is underperforming SPY (RS < EMA).
🔔 Alerts: Automatic notifications when RS crosses above/below its EMA — signaling new leadership or weakness.
How to Use
Apply to any stock or ETF chart.
Keep benchmark = SPY, or switch to another index (e.g., QQQ, IWM, XLK).
Watch for RS crossovers and trends:
Rising RS → money flowing into the asset.
Falling RS → rotation away from the asset.
Perfect for sector rotation, ETF comparison, and momentum analysis workflows.
5m Hammer Detector Pro (Clean View)//@version=5
indicator("5m Hammer Detector Pro (Clean View)", overlay=true)
// ===== Inputs =====
tf_detect = input.timeframe("5", "Detection timeframe (keep 5 for 5-min)")
min_lower_to_body = input.float(2.0, "Min lower-wick / body ratio", step=0.1)
max_upper_to_body = input.float(0.5, "Max upper-wick / body ratio", step=0.1)
max_body_to_range = input.float(0.30, "Max body / total-range ratio", step=0.01)
min_lower_to_range = input.float(0.45, "Min lower-wick / total-range ratio", step=0.01)
use_bullish_only = input.bool(true, "Only bullish hammer (close > open)?")
vol_mult = input.float(1.5, "Volume threshold multiplier (x avg volume)", step=0.1)
confirm_next_candle = input.bool(true, "Require next bullish candle for confirmation?")
// ===== Hammer Logic =====
f_is_hammer(o, h, l, c) =>
body = math.abs(c - o)
lower = math.min(o, c) - l
upper = h - math.max(o, c)
rng = h - l
body := body == 0 ? 0.0000001 : body
rng := rng == 0 ? 0.0000001 : rng
cond1 = (lower / body) >= min_lower_to_body
cond2 = (upper / body) <= max_upper_to_body
cond3 = (body / rng) <= max_body_to_range
cond4 = (lower / rng) >= min_lower_to_range
cond5 = use_bullish_only ? (c > o) : true
cond1 and cond2 and cond3 and cond4 and cond5
// ===== 5-Min Data =====
= request.security(syminfo.tickerid, tf_detect, )
vol_avg = ta.sma(rv, 20)
vol_ok = rv > (vol_avg * vol_mult)
hammer_raw = f_is_hammer(ro, rh, rl, rc)
hammer_with_vol = hammer_raw and vol_ok
= request.security(syminfo.tickerid, tf_detect, [open , high , low , close ])
confirmed = confirm_next_candle ? (hammer_with_vol and rc > ro and nc > rh) : hammer_with_vol
new_candle_5m = ta.change(rc) != 0
hammer_final = confirmed and new_candle_5m
// ===== Plot hammer mark only =====
plotshape(hammer_final, title="Hammer Signal", location=location.belowbar,
style=shape.labelup, text="✅ HAMMER 5m", color=color.new(color.green, 0),
textcolor=color.white, size=size.tiny)
bgcolor(hammer_final ? color.new(color.green, 85) : na)
// ===== Alert =====
alertcondition(hammer_final, title="5m Hammer Confirmed Alert",
message="🔥 {{ticker}} | 5m Confirmed Hammer at {{time}} | Vol OK | Close: {{close}}")
VSA No Supply by MashrabNo Supply Signal created by Mashrab
Hi everyone! This indicator helps you find low-risk entry points during an existing uptrend.
Its main job is to spot "quiet" pauses in a stock's advance, right before it's ready to continue its upward move.
What's the Big Idea?
Think of a stock in an uptrend like someone climbing a staircase. They can't sprint to the top all at once! Eventually, they need to pause, catch their breath, and then continue climbing.
This indicator helps you find that "catch your breath" moment. It looks for a specific signal that shows all the sellers are gone (what we call "No Supply"). When there's no one left to sell, the stock is much more likely to go up.
How It Works (The Signals)
The indicator gives you two simple signals on your chart:
1. The "Get Ready" Signal (Grey Dot)
The indicator is always checking to make sure the stock is in a general uptrend. When it spots a Grey Dot, it's telling you: "Hey, the stock just had a quiet pullback day. Pay attention!"
This dot only appears if the bar meets four conditions:
It's a "down" bar (closed lower than it opened).
It has low volume (this is key! It shows sellers aren't interested).
It has a narrow range (it was a quiet, low-volatility bar).
It closed in the top half of its range (buyers easily stepped in).
When you see a Grey Dot, you don't buy yet. You just add the stock to your watchlist.
2. The "Go" Signal (Blue Triangle)
This is your entry trigger! A Blue Triangle appears on the next bar only if it confirms the upward move. This bar must be:
An "up" bar (closed higher than it opened).
It has high volume (showing that buyers and "big money" are now back and pushing the price up with conviction).
How to Use This Indicator
Grey Dot: See this? The setup looks good. Time to watch this stock.
Blue Triangle: See this? This is your entry confirmation. The move is now "on."
Red Line: This is your safety net. The indicator automatically draws your Stop-Loss at the low of the "Grey Dot" bar. This helps you define your risk on the trade right from the start.
Settings
Uptrend MA Period: (Default: 50) This is just the moving average used to make sure the stock is in an uptrend.
Volume/Range Lookback: (Default: 20) This is how many bars the indicator looks back at to decide what "average" volume or "average" range is.
That's it! I hope this tool helps you find great setups. As always, this isn't a magic crystal ball. It's a tool to help you react to the market. Test it out, and happy trading!
RSI Divergence 1-20 Candlesthis is a rsi divergence indicator used to mark divergence on the candle for knowing the trend
Candle Repainter - Price Direction # 🎯 Candle Repainter - Price Direction by Mustang Algo
## Overview
A powerful and versatile indicator that repaints candles in real-time based on price direction detection. This tool helps traders quickly identify market trends by coloring candles according to bullish, bearish, or neutral momentum.
## 🌟 Key Features
### 5 Detection Methods
Choose from multiple sophisticated algorithms to detect price direction:
1. **EMA Trend** - Compares price against Exponential Moving Average with momentum confirmation
2. **Price vs SMA** - Classic crossover method using Simple Moving Average
3. **Momentum** - Pure momentum-based detection for aggressive signals
4. **Higher High/Lower Low** - Structure-based analysis identifying swing points
5. **Supertrend** - Popular ATR-based trend following system
### Visual Features
- 🟢 **Green Candles** - Bullish trend detected
- 🔴 **Red Candles** - Bearish trend detected
- ⚪ **Gray Candles** - Neutral/indecisive market
- 🔺 **Triangle Signals** - Mark trend changes (optional)
- 📊 **Background Coloring** - Subtle background highlighting
- 📈 **Overlay Indicators** - Display the chosen MA/Supertrend line
### Smart Signal System
- **Default Mode**: Shows triangles ONLY on trend changes (cleaner charts)
- **All Candles Mode**: Display signals on every bullish/bearish candle
- Customizable signal visibility
- Real-time statistics table
## ⚙️ Customizable Parameters
### Method-Specific Settings
- **EMA Length** (default: 20) - For EMA Trend method
- **SMA Length** (default: 50) - For Price vs SMA method
- **Momentum Period** (default: 14) - For Momentum method
- **HH/LL Lookback** (default: 10) - For Higher High/Lower Low method
- **ATR Period** (default: 10) - For Supertrend method
- **ATR Multiplier** (default: 3.0) - For Supertrend method
### Visual Controls
- Toggle signal display on/off
- Choose between change signals or all candles
- Background highlighting control
## 📊 Real-Time Dashboard
A compact table displays:
- Current trend direction (Bullish/Bearish/Neutral)
- Active detection method
- Creator credit (Mustang Algo)
## 🔔 Built-in Alerts
Set up automated alerts for:
- Bullish trend changes
- Bearish trend changes
## 💡 How to Use
### For Day Traders
- Use **EMA Trend** with shorter periods (10-20)
- Enable "Show all candles" for continuous feedback
- Combine with volume for confirmation
### For Swing Traders
- Use **Supertrend** or **Price vs SMA** with longer periods (50-200)
- Keep default "changes only" mode for cleaner entries
- Perfect for multi-timeframe analysis
### For Scalpers
- Use **Momentum** method for fastest signals
- Lower timeframes (1m-5m)
- Combine with support/resistance levels
## 🎨 Best Practices
1. **Multiple Timeframes**: Confirm direction on higher timeframe
2. **Combine Methods**: Test different detection methods for your asset
3. **Risk Management**: Use stop-losses, don't rely solely on color changes
4. **Backtesting**: Test parameters on historical data before live trading
## ⚠️ Important Notes
- This is a **repainting indicator** - signals may change as new data arrives
- Best used for **trend confirmation**, not as standalone entry/exit signals
- Different methods work better on different market conditions
- Always combine with proper risk management
## 📈 Recommended Settings by Market
### Crypto (High Volatility)
- Method: Supertrend
- ATR Period: 10
- ATR Multiplier: 3.0
### Forex (Trending Markets)
- Method: EMA Trend or Price vs SMA
- Period: 20-50
### Stocks (Moderate Volatility)
- Method: Higher High/Lower Low
- Lookback: 10-15
## 🏆 Credits
**Created by Mustang Algo**
Version 1.0 - November 2025
## 📞 Support
For questions, suggestions, or bug reports, please contact Mustang Algo.
---
### Tags
`trend` `candles` `repainter` `moving-average` `supertrend` `momentum` `signals` `alerts` `multi-method` `daytrading` `swingtrading`
### Category
Trend Analysis
### License
This indicator is open source. Feel free to modify and adapt to your needs.
Seasonality Range Marker For better Seasonality Analysation. To see Seasionality patterns in the chart.
OPTION DOMOPTION DOM
This script tell you abot option max pain where dealer needs to reverse and give direction of optio buy and sel plus option dom.
3HH/3LL → Next Bar Inside = Signal (Neon)Detects 3 consecutive Higher Highs or 3 consecutive Lower Lows.
Signals only when the very next candle is an Inside Bar.
Uses your Neon Lime (HH case) and Neon Pink (LL case) colors.
Stockbee 8% 4% 9M + MA CrossoversThis is another version of my Stockbee 9% 4% 9M script, now enhanced with moving average crossovers to highlight trend shifts more effectively.
The crossovers are displayed in the same visual style as the 9 million volume indicator from the original script but use different shapes and forms for better distinction.
All crossover visuals can be customized to your liking—you can adjust their appearance to fit your charting style or preference.






















