Asian Session / ExtensionMark a box on asian session and extend lines to see if manipulation occured.Pine Script®指標由kelesfx提供10
DAY+zigzagDevelop a trading strategy by calculating the average daily range (ADR) of previous days and integrating it with ZigZag (ZZ) structure lines.Pine Script®指標由FB141319提供32
Strategic Trend FilterStrategic Trend Filter (STF) | MisinkoMaster Strategic Trend Filter is a structurally weighted trend confirmation overlay designed to identify high-quality directional environments while filtering out low-volatility noise and weak structural movement. Rather than relying on traditional moving averages, STF constructs a dynamically weighted equilibrium level derived from multiple price components and structural factors. It then validates trend conditions only when price displacement is supported by sufficient volatility expansion. The result is a disciplined trend filter that emphasizes structural strength over simple price crossing behavior. Core Philosophy Many trend tools respond primarily to price direction. STF goes further by incorporating: • Structural correlation behavior • Statistical dispersion • Rate-of-change magnitude • Price range positioning • Volatility confirmation This multi-factor structure allows the filter to respond only when price movement demonstrates internal coherence and sufficient expansion. In short, STF is designed to confirm quality trends, not just directional movement. Key Features Multi-factor structural weighting model Dynamic equilibrium filter instead of traditional moving average Volatility-confirmed trend validation Volume-aware filter stabilization Median-based volatility confirmation Automatic trend coloring Optional on-chart long and short labels Overlay design for direct price interaction Reduced whipsaws in low-volatility environments Suitable as a directional bias filter for strategies How It Works (Conceptual) The indicator builds a composite equilibrium level using several internal components: Structural Correlation Measures how individual price components relate to the composite price structure over the lookback window. Statistical Dispersion Standard deviation measurements help evaluate how far price is distributing around equilibrium. Momentum Magnitude Absolute rate-of-change calculations measure directional displacement strength. These components are combined into weighted factors that influence how much each price dimension contributes to the final filter value. The resulting filter represents a dynamic structural equilibrium rather than a simple average. Additionally, a volatility confirmation layer compares current true range behavior against its median condition. Trend state changes are validated only when sufficient volatility is present. Proprietary weighting relationships remain protected in the invite-only implementation. Trend Logic Explained Bullish State Activated when price structure holds above the dynamic filter and volatility confirms expansion. This suggests sustained upward pressure supported by structural alignment. Bearish State Activated when price structure remains below the filter and volatility confirms expansion. This indicates organized downside movement rather than random fluctuation. If volatility contracts or price fails to maintain structural positioning, the filter avoids unnecessary state changes. Volume Stabilization Mechanism When volume declines relative to the previous bar, the filter stabilizes temporarily. This reduces sensitivity during participation drops, helping avoid false transitions caused by thin liquidity conditions. This feature improves robustness in lower-liquidity assets and during session transitions. Visual Components Dynamic Filter Line Represents structural equilibrium and adjusts continuously to price behavior. Color-Coded Environment Filter and candles change color to reflect bullish or bearish state. Shaded Region A filled zone between price and filter visually highlights directional dominance. Optional Long / Short Labels When enabled, transition points are clearly marked on the chart. Inputs Overview Lookback Period Controls the primary structural evaluation window. Higher values create smoother, more stable filters. Lower values increase responsiveness. Confirmation Length Defines the volatility median window used for expansion validation. Allow Labels? Enables or disables on-chart long and short markers. Parameter Tuning Guidance Shorter Lookback → Faster adaptation → More sensitive to structural shifts → Suitable for lower timeframes Longer Lookback → More stable equilibrium → Better for swing or position trading Shorter Confirmation Length → Faster volatility confirmation → More reactive signals Longer Confirmation Length → Stricter volatility validation → Fewer but stronger transitions Best Use Cases Directional bias filter for breakout systems Confirmation layer for momentum strategies Trend qualification before position scaling Volatility-aware trade filtering Multi-timeframe bias alignment Portfolio-level environment scanning Strategy Integration Ideas Use STF to: • Trade only in the direction of confirmed trend state • Avoid mean-reversion setups during strong structural expansion • Filter out low-volatility consolidation phases • Improve win rate by aligning entries with structural bias STF performs best when paired with entry triggers such as pullbacks, continuation patterns, or momentum expansions. Summary Strategic Trend Filter is a structurally weighted, volatility-confirmed overlay designed to detect organized directional movement while filtering weak or noisy price action. By combining correlation structure, dispersion metrics, momentum magnitude, and volatility validation, STF delivers a disciplined trend confirmation framework suitable for discretionary traders and systematic strategy developers alike.Pine Script®指標由MisinkoMaster提供已更新 99176
BK AK-Pivot Wolf🐺 BK AK–Momentum Pivot Wolf — Momentum / Pivots / Confluence 🐺 🙏 All glory to G-d. Built with standards and discipline passed down by my mentor AK— thank you for giving real instruction without being cheap about it — no holding back, no protecting secrets. Update / Record A previous version of this publication was hidden due to insufficient description. This republish is a complete, self-contained explanation of what the script does, how it works, what signals mean, what settings do, and key limitations. ✨ What this script does Pivot Wolf is a TSI-based momentum oscillator system that focuses on: extremes → pivots → confirmation, then adds confluence layers (VWAP, MTF alignment, SNR, volume, regime) to reduce chop and low-quality signals. It’s designed to help you: Identify momentum extremes using Dynamic or Static bands Detect oscillator pivots that form at extremes (main pivot signals) Mark divergences (regular + hidden) between price and oscillator Confirm/grade signals using a 0–100 scoring system (or legacy hard filters) Visualize context via VWAP gating, MTF dashboard, and regime state Project post-pivot expectation zones via T1 / T2 targets Optionally enable historical learning that only applies overrides when validation is strong 🧠 How it works 1) Momentum engine (TSI blend) Computes Fast TSI and Slow TSI Optional Adaptive Blend: volatility-weighted mixing using ATR% normalization over a lookback so momentum can be responsive in calm markets and less noisy in high volatility A Signal EMA smooths momentum to detect cross/shift 2) Bands define “extremes” Bands define statistically “stretched” momentum. Dynamic mode: uses StdDev (or robust MAD) over a lookback, multiplied by a factor Static mode: fixed ± level Optional band smoothing to reduce jitter “Extreme” is simply: momentum beyond the band (with optional tolerance rules) 3) Pivot detection (main signals) Detects oscillator pivot lows/highs using pivotLen A “strong” pivot signal is when: Pivot Low forms below the Lower Band (oversold) Pivot High forms above the Upper Band (overbought) Marker style/size/colors are configurable, and tooltips explain context Important: pivots are confirmed only after pivotLen bars to the right (this is normal pivot behavior). 4) Divergence logic (regular + hidden) Tracks the last two oscillator pivots and compares them with price pivots: Bullish divergence: price makes a lower low while oscillator makes a higher low Bearish divergence: price makes a higher high while oscillator makes a lower high Hidden bullish divergence: price higher low + oscillator lower low Hidden bearish divergence: price lower high + oscillator higher high Optional: Require extreme so divergences only count when pivots occur outside bands. 5) Confluence + scoring (0–100) Instead of relying only on hard rules, Pivot Wolf can compute bull/bear scores from multiple inputs: VWAP gate: position and/or slope logic (PositionOnly / SlopeOnly / Both / Either) MTF alignment: direction across up to 6 selected timeframes + dashboard visualization SNR (Signal-to-Noise Ratio): reduces signals during chop by comparing momentum gap vs recent noise Volume confirmation: bullish confirmation vs bearish exhaustion/spike logic Acceleration / deceleration: early warning + risk markers when momentum behavior changes rapidly Consolidation filter: ATR regime compression penalty Price structure: HH/LL checks to avoid fighting structure Whipsaw guard: enforces a minimum bar gap between opposite signals Signals can show as: Strong = passes gating + score threshold (or legacy rules) Weak (optional) = “scout” setups (score in 50–threshold range) 6) Targets / projections (T1 / T2) After confirmed pivots, it projects expectation zones based on recent run behavior: T1 = 0.618 projection T2 = 1.000 projection Targets can display continuously or only reveal when momentum approaches (to reduce clutter). 7) Optional historical learning (validation-gated) If enabled, the script: records pivot “outcomes” after mlForwardBars runs a simple train/validation pass only applies learned overrides when validation is strong and not overfit If validation fails, it reverts to manual settings. Note: This “learning” is heuristic optimization inside Pine (not external ML), and overrides are applied only when conditions are met. 🧭 How to use Check the MTF dashboard for alignment (avoid fighting the stack). Let momentum reach band extremes (OB/OS). Treat pivot signals as highest value when Score is strong + VWAP gate agrees. Use divergence as added weight, not as the sole trigger. Manage around T1/T2 as structured expectation zones. 📌 Signals & visuals (what you’ll see) Momentum line with optional gradient (strength/quality feel) Signal line (EMA) Upper/Lower bands + optional fills Extreme dots/edges at band breaks (optional) Cross stars on momentum/signal crosses (optional) Divergence markers (◆ regular, ◇ hidden) + optional connector lines MTF dashboard (direction + strength + confluence) Info panel meters (Bull, Bear, Net, Osc Position, MTF, Quality, Regime, VWAP Pressure) Optional stop suggestion markers (ATR/Swing/Pivot/Band methods) ⚙️ Key settings Core Momentum: TSI lengths, signal EMA, adaptive blend & volatility lookback Bands/Extremes: Dynamic vs Static bands, basis (StdDev/MAD), smoothing Pivots & Divergence: pivot sensitivity, max bars between pivots, line/marker toggles Filters: VWAP gate, MTF bias, SNR, volume, consolidation, structure, whipsaw Targets/ML: T1/T2 projection logic + optional historical learning validation Dashboards/Panels: MTF dashboard + Info panel positioning & styling Performance mode: reduces heavy visual updates if needed 🔔 Alerts included Bullish/Bearish signal alerts Divergence detected Early warning acceleration alerts Optional regime peak/valley switch alert (Alerts can be throttled via “Alert Settings”.) ✅ Repainting / confirmation notes (important) Pivot highs/lows confirm after pivotLen bars by design. Signals appear once the pivot is confirmed. MTF calculations use request.security(..., lookahead=barmerge.lookahead_off) to avoid forward-looking HTF values. Anything based on confirmed pivots is inherently delayed by the pivot confirmation window. ⚠️ Known limitations / best practices VWAP/Volume-based logic depends on reliable volume data. Some symbols/feeds may behave differently. The script is information-dense; if you hit resource limits, use: Limit labels Reduce divergence lines Turn off heavy visuals (fills, heatmap, dashboards) Enable Performance mode This tool is built for structure and confluence, not prediction. It will often stay quiet during chop—by design. 👁️🗨️ King Solomon Lens “Solomon didn’t predict. He judged. He built tests that made truth show itself. Pivot Wolf is that: pivots as boundary stones, momentum as witness, acceleration as the confession. No hammer in the Temple — rules are cut before entry. When it’s quiet, it’s saving you. When it speaks, it’s a ruling.” Disclaimer This script is for educational and informational purposes only. It does not provide financial advice, and it does not guarantee results. You are responsible for your own decisions, testing, and risk management. 🙏 All glory to G-d—the source of all wisdom and every true edge. 🙏Pine Script®指標由Ki11a_B提供14
Last 52 ClenowsLast 52 Clenow Momentum Ratings on a weekly basis. For backtesting purposes onlyPine Script®指標由deverdiermichael提供1
SwingSignal RSI Overlay AdvancedOVERVIEW A comprehensive MACD indicator displayed directly on the price chart (overlay mode) with an integrated mini dashboard panel. Combines traditional MACD visualization with a compact real time histogram panel for quick momentum assessment. ═══════════════════════════════════════════ MACD CALCULATION STANDARD MACD COMPONENTS - MACD Line: Difference between Fast EMA and Slow EMA - Signal Line: EMA of the MACD Line - Histogram: Difference between MACD and Signal lines CONFIGURABLE PARAMETERS - Fast Length (default: 12) - Slow Length (default: 26) - Signal Length (default: 9) OPTIONAL HEIKIN ASHI SOURCE - Toggle to calculate MACD using Heikin Ashi candle closes - Provides smoother signals in trending markets ═══════════════════════════════════════════ HISTOGRAM VISUALIZATION Four-state color coding shows momentum strength and direction: BULLISH MOMENTUM - Bright Green: Histogram positive AND increasing (strong bullish) - Faded Green: Histogram positive BUT decreasing (weakening bullish) BEARISH MOMENTUM - Bright Red: Histogram negative AND decreasing (strong bearish) - Faded Red: Histogram negative BUT increasing (weakening bearish) Optional smooth mode adjusts color transparency for cleaner visuals. ═══════════════════════════════════════════ MACD/SIGNAL FILL Visual fill between MACD and Signal lines: - Green fill when MACD is above Signal (bullish) - Red fill when MACD is below Signal (bearish) Provides instant visual feedback on momentum direction. ═══════════════════════════════════════════ MINI MACD PANEL Compact dashboard in the corner of the chart showing: CURRENT VALUES - MACD value - Signal value - Histogram value - Direction (Bull/Bear) MINI HISTOGRAM DISPLAY - Visual representation of last N bars of histogram - Color intensity shows relative strength - Configurable number of bars (10-100) - Quick visual of recent momentum history ═══════════════════════════════════════════ ALERTS Built-in alert conditions: - MACD Bull Cross: MACD crosses above Signal line - MACD Bear Cross: MACD crosses below Signal line ═══════════════════════════════════════════ SETTINGS MACD Parameters: - Fast/Slow/Signal lengths - Heikin Ashi source toggle - Smoother histogram colors toggle - Show/hide zero line Panel Parameters: - Show/hide mini panel - Number of histogram bars in panel (10-100) ═══════════════════════════════════════════ USE CASES - Quick momentum assessment without leaving price chart - Identify momentum shifts via histogram color changes - Spot MACD/Signal crossovers for entry/exit timing - Monitor recent momentum history via mini panel - Cleaner charts by having MACD overlaid rather than in separate pane ═══════════════════════════════════════════ ORIGINALITY STATEMENT This indicator was developed entirely from scratch by BFAS76. No third-party or open-source code was used. Key original features: - OVERLAY MACD DESIGN: Unlike standard MACD indicators that require a separate chart pane, this version overlays directly on the price chart, keeping the main chart area clean while still providing full MACD information. - FOUR-STATE HISTOGRAM COLORING: Distinguishes between strong momentum (histogram growing) and weakening momentum (histogram fading) in both bullish and bearish directions - more informative than simple positive/negative coloring. - INTEGRATED MINI DASHBOARD: Real-time MACD values displayed in a compact table with a visual mini-histogram showing recent momentum history - provides context without needing to analyze the full indicator. - HEIKIN ASHI SOURCE OPTION: Optional calculation using Heikin Ashi closes for smoother signals, with proper security call implementation to prevent lookahead bias. - DYNAMIC MINI-HISTOGRAM: The panel's histogram bars use relative scaling (each bar's intensity based on its value relative to the maximum in the displayed range), providing normalized visual feedback regardless of the instrument's typical MACD range. All code is original work by BFAS76. ═══════════════════════════════════════════ DISCLAIMER This indicator is for educational and informational purposes only. It does not constitute financial advice. MACD is a lagging indicator and should be used in conjunction with other analysis methods. Always use proper risk management.Pine Script®指標由BFAS76提供26
VWAP [crlmx] Flexible Volume Weighted Average Price (VWAP) for clean volume-weighted fair value benchmark and trend direction. Key Features - Adjustable VWAP Anchor - 30min, 1H, 2H, 4H, 8H, 12H, D, W, M, Q, Y - Sessions New York, London, Asia, with adjustable time - Clean session breaks, no skews in VWAP line - Period limit fearure (default 3) hides older periods - Streamlined inputs/UI brought to you by crlmx Trading Applications - Intraday anchors (30min-12H): scalping and day trading - Daily anchor: traditional intraday analysis - Weekly/Monthly/Quarterly: swing trading context - Yearly: long-term fair value - Configuration examples: Scalping: 30min-1H anchor | Limit: 5-10 | Bands: On | Multiplier: 1.0-1.5 Intraday: Day anchor | Limit: 3-5 | Bands: On | Multiplier: 1.0-2.0 Swing: Week-Month | Limit: 3-5 | Bands: Off | VWAP line only Position: Quarter-Year | Limit: 3 | Bands: Off | Fair value reference Version History v1.56 (Latest - 22 Feb 2026) - VWAP display limit feature: shows set amount of periods - Added Market Sessions - Streamlined input panel organisation Pine Script®指標由crlmx提供7
SwingSignal RSI Overlay AdvancedBFAS76 Charts - SwingSignal RSI Overlay Advanced ``` Description ``` OVERVIEW SwingSignal RSI Overlay Advanced is a market structure visualization tool that identifies swing highs and swing lows using RSI overbought/oversold transitions. It classifies each swing point as Higher High (HH), Lower High (LH), Lower Low (LL), or Higher Low (HL), providing clear visual feedback on market structure directly on the price chart. ═══════════════════════════════════════════ HOW IT WORKS RSI STATE DETECTION • Monitors RSI for overbought (default ≥70) and oversold (default ≤30) conditions • Tracks state transitions between overbought and oversold zones • Uses these transitions to anchor swing points SWING POINT IDENTIFICATION When RSI transitions from Oversold → Overbought: • A swing HIGH is forming • Star marker (★) placed above the highest bar during overbought period • Star moves to track the highest point while RSI remains overbought When RSI transitions from Overbought → Oversold: • A swing LOW is forming • Star marker (★) placed below the lowest bar during oversold period • Star moves to track the lowest point while RSI remains oversold ═══════════════════════════════════════════ SWING CLASSIFICATION Each swing point is automatically classified by comparing to the previous swing of the same type: SWING HIGHS (Stars above price): • RED ★ = Higher High (HH) - Current high exceeds previous swing high • YELLOW ★ = Lower High (LH) - Current high is below previous swing high SWING LOWS (Stars below price): • GREEN ★ = Lower Low (LL) - Current low is below previous swing low • BLUE ★ = Higher Low (HL) - Current low exceeds previous swing low ═══════════════════════════════════════════ STRUCTURE LINES The indicator draws connecting lines between swing points: • Lines connect each new swing high to the previous swing low • Lines connect each new swing low to the previous swing high • Creates a visual "zigzag" showing market structure flow ═══════════════════════════════════════════ INTERPRETING THE SIGNALS BULLISH STRUCTURE: • Series of HH (red stars) and HL (blue stars) • Higher highs + Higher lows = Uptrend BEARISH STRUCTURE: • Series of LH (yellow stars) and LL (green stars) • Lower highs + Lower lows = Downtrend POTENTIAL REVERSALS: • HL after series of LL = Possible bullish reversal • LH after series of HH = Possible bearish reversal ═══════════════════════════════════════════ SETTINGS • RSI Source: Price source for RSI calculation (default: close) • RSI Length: Period for RSI calculation (default: 7) • RSI Overbought: Threshold for overbought zone (default: 70) • RSI Oversold: Threshold for oversold zone (default: 30) Lower RSI length (e.g., 7) creates more responsive swing detection. Higher RSI length (e.g., 14) creates smoother, less frequent swings. ═══════════════════════════════════════════ USE CASES • Identify market structure at a glance • Confirm trend direction (HH/HL vs LH/LL sequences) • Spot potential reversal points (structure breaks) • Define swing-based support and resistance levels • Use with other indicators for confluence entries ═══════════════════════════════════════════ ORIGINALITY STATEMENT This indicator was developed entirely from scratch by BFAS76. No third-party or open-source code was used. Key original features: • RSI-ANCHORED SWING DETECTION: Uses RSI overbought/oversold state transitions to identify swing points, rather than traditional pivot or fractal methods. This creates swings that align with momentum extremes. • DYNAMIC SWING TRACKING: Stars move in real-time to track the extreme point while RSI remains in the overbought/oversold zone, ensuring the final swing point captures the true high/low. • AUTOMATIC STRUCTURE CLASSIFICATION: Each swing is automatically compared to the previous swing of the same type and classified as HH/LH or LL/HL with corresponding color coding. • STATE MACHINE ARCHITECTURE: Uses a state variable to track the current RSI regime (overbought vs oversold), ensuring clean transitions and preventing false swing detections. • VISUAL ZIGZAG STRUCTURE: Connecting lines between alternate swing highs and lows create an immediate visual representation of market structure flow. All code is original work by BFAS76. ═══════════════════════════════════════════ DISCLAIMER This indicator is for educational and informational purposes only. It does not constitute financial advice. It is designed to visualize market structure and should be used in conjunction with other analysis methods. Always use proper risk management. Pine Script®指標由BFAS76提供11
WSG SMC ChecklistBefore entering a trade check if this is the best yet scenarioPine Script®指標由WallStreet_GIrls提供19
VWAP Confluencia 3x (DIA, SEMANA, ANCORADA)VWAP Confluence 3x Daily · Weekly · Anchored Purpose A pragmatic VWAP suite for execution and risk management. It plots three institutional reference lines: Daily VWAP, Weekly VWAP, and an Anchored VWAP (AVWAP) starting from a user defined event (news, earnings, session open, swing high/low). Why it matters VWAP is the market’s “fair price” weighted by where volume actually traded. Confluence across timeframes and events turns noisy charts into actionable bias and clean levels. What it does Daily VWAP — resets each trading day; intraday “fair value.” Weekly VWAP — resets each week; swing context and larger player defense. Anchored VWAP — starts at a precise timestamp you set (e.g., news release). Price source toggle — Typical Price (𝐻+𝐿+𝐶)/3 (H+L+C)/3 or Close. Visibility switches — enable/disable each line independently. Anchor marker — labels the first bar of the AVWAP. Inputs Show Daily VWAP (on/off) Show Weekly VWAP (on/off) Show Anchored VWAP (on/off) Price Source: Typical (H+L+C)/3 or Close Anchor Time: timestamp of your event (uses the chart/exchange timezone) How to anchor to a news event Find the exact release time as shown in your chart’s timezone. Open the indicator settings → set Anchor Time to that minute. The AVWAP begins at that bar and accumulates forward. Playbook (examples, not signals) Strong long bias: price above Daily and Weekly VWAP; AVWAP reclaimed after news. Strong short bias: price below Daily and Weekly; AVWAP reject after news. Mean revert zones: price stretches far from the active VWAPs and snaps back; size around VWAP with tight risk. Targets: opposite VWAP, prior day/week highs/lows, or liquidity pools near AVWAP. Best used with Session highs/lows, liquidity sweeps, volume profile, and time-of-day filters. Notes & limitations Works best on markets with reliable volume (equities, futures, liquid crypto). FX spot uses synthetic volume interpret accordingly. Anchor Time respects the chart’s timezone. Convert news times before setting. This is an indicator, not a backtestable strategy. No trade advice. Disclaimer For educational purposes only. Trading involves risk. Do your own research and manage risk responsibly.Pine Script®指標由BFAS76提供5
XAUUSD 1M: Sweep + MSS + FVG//@version=5 indicator("XAUUSD 1M: Sweep + MSS + FVG", overlay=true, max_bars_back=500) // ============================================================================ // TOGGLES (ON/OFF SWITCHES) // ============================================================================ showSweeps = input.bool(true, "Show Liquidity Sweeps", group="Visibility") showMSS = input.bool(true, "Show Market Structure Shifts", group="Visibility") showFVG = input.bool(true, "Show Fair Value Gaps (Boxes)", group="Visibility") showSignals = input.bool(true, "Show BUY/SELL Signals", group="Visibility") // Strategy Settings lookback = input.int(20, "High/Low Lookback", minval=5, group="Strategy") fvgSize = input.float(2.0, "Min FVG Size (Pips)", step=0.5, group="Strategy") // ============================================================================ // LOGIC // ============================================================================ // 1. LIQUIDITY SWEEP // Bullish Sweep: Price dips below old low but closes above it (trapping sellers) oldLow = ta.lowest(low, lookback) bullSweep = low < oldLow and close > oldLow // Bearish Sweep: Price pokes above old high but closes below it (trapping buyers) oldHigh = ta.highest(high, lookback) bearSweep = high > oldHigh and close < oldHigh // 2. MARKET STRUCTURE SHIFT (MSS) // Bullish MSS: After a sweep, price breaks a recent swing high bullMSS = ta.crossover(close, ta.highest(high, 5) ) // Bearish MSS: After a sweep, price breaks a recent swing low bearMSS = ta.crossunder(close, ta.lowest(low, 5) ) // 3. FAIR VALUE GAP (FVG) bullFVG = low > high and (low - high ) > (fvgSize * syminfo.mintick * 10) bearFVG = high < low and (low - high) > (fvgSize * syminfo.mintick * 10) // ============================================================================ // SIGNAL TRACKING (The Sequence) // ============================================================================ var bool waitingForBullMSS = false var bool waitingForBearMSS = false if bullSweep waitingForBullMSS := true waitingForBearMSS := false if bearSweep waitingForBearMSS := true waitingForBullMSS := false // Final Signals buySignal = waitingForBullMSS and bullMSS and bullFVG sellSignal = waitingForBearMSS and bearMSS and bearFVG // Reset after signal if buySignal waitingForBullMSS := false if sellSignal waitingForBearMSS := false // ============================================================================ // VISUALS // ============================================================================ // Plot Sweeps plotshape(showSweeps and bullSweep, "Bull Sweep", shape.labelup, location.belowbar, color.new(color.green, 0), text="SWEEP", textcolor=color.white, size=size.tiny) plotshape(showSweeps and bearSweep, "Bear Sweep", shape.labeldown, location.abovebar, color.new(color.red, 0), text="SWEEP", textcolor=color.white, size=size.tiny) // Plot MSS plotshape(showMSS and bullMSS, "Bull MSS", shape.diamond, location.abovebar, color.new(color.blue, 0), text="MSS", textcolor=color.white, size=size.tiny) plotshape(showMSS and bearMSS, "Bear MSS", shape.diamond, location.belowbar, color.new(color.orange, 0), text="MSS", textcolor=color.white, size=size.tiny) // Plot FVG Boxes if showFVG and bullFVG box.new(bar_index , high , bar_index, low, bgcolor=color.new(color.green, 80), border_color=na) if showFVG and bearFVG box.new(bar_index , low , bar_index, high, bgcolor=color.new(color.red, 80), border_color=na) // BIG BUY/SELL SIGNALS plotshape(showSignals and buySignal, "BUY", shape.labelup, location.belowbar, color.new(color.green, 0), text="BUY", textcolor=color.white, size=size.normal) plotshape(showSignals and sellSignal, "SELL", shape.labeldown, location.abovebar, color.new(color.red, 0), text="SELL", textcolor=color.white, size=size.normal) // Alerts alertcondition(buySignal, "Buy Signal", "Sweep + MSS + FVG: BUY") alertcondition(sellSignal, "Sell Signal", "Sweep + MSS + FVG: SELL") Pine Script®指標由algotechzone提供47
CJ OI Sentiment BTCCJ OI Sentiment PRO analyzes market sentiment using Bitcoin Futures Open Interest through a Z-Score model to detect extreme leverage conditions. It identifies Greed and Fear zones based on institutional positioning. ⚠️ This is NOT an entry signal indicator; it is a complementary tool for market context and risk analysis.Pine Script®指標由CriptoJald提供2
Volume Profile Price AdjustedQ: What should the Volume Profile show? (Select all that apply) A: Volume bars per price level, High Volume Nodes (HVN) highlights, Value Area High/Low (VAH/VAL), Point of Control (POC) line Q: How should the profile be calculated? A: All history Q: What type of output do you want? A: Indicator onlyPine Script®指標由kassawat提供1
BB Machine Learning - Pattern Recognition🤖 ML-Enhanced Bollinger Band Pattern Recognition System Overview This is a Bollinger Bands-based trading indicator that uses K-Nearest Neighbors (KNN) machine learning and candlestick pattern recognition to generate buy/sell signals. It analyzes historical price behavior at Bollinger Band extremes, learns which patterns led to profitable outcomes, and applies that knowledge to current market conditions. Core Architecture 1. Bollinger Bands Engine The foundation is a standard Bollinger Band calculation: Middle Band: 20-period SMA (configurable) Upper/Lower Bands: ±2 standard deviations (configurable) Derived Metrics: BB Width = (Upper - Lower) / Middle × 100 → measures volatility %B = (Close - Lower) / (Upper - Lower) → price position within bands (0 = at lower, 1 = at upper, negative = below lower, >1 = above upper) 2. BB State Detection The indicator classifies the current market into four volatility states: State Condition Meaning SQUEEZE 🔴 BB Width < threshold OR width in bottom 20th percentile of recent range Volatility compression — breakout imminent EXPANDING 🟢 Width increasing and exceeding expansion rate Volatility expanding — trend in motion CONTRACTING 🟡 Width decreasing for 3+ bars Volatility declining — trend weakening NORMAL ⚪ None of the above No notable volatility pattern It also tracks squeeze duration (consecutive squeeze bars) and detects post-squeeze breakout direction (price above/below middle band when squeeze ends). Pattern Recognition System 8 Candlestick Patterns Detected at Band Extremes Bullish Patterns (at Lower Band): Pin Bar at Lower Band — Long lower wick (>60% of candle range) touching the lower band. Indicates rejection of lower prices. Bullish Engulfing at Lower Band — Current bullish candle fully engulfs previous bearish candle, with the previous candle touching the lower band. Doji at Lower Band — Tiny body (<10% of range) at the lower band. Indicates indecision/potential reversal. Rejection from Lower Band — Touches lower band but closes in the upper half of the band range. Shows buying pressure. Multiple Touch at Lower Band — 3+ touches of the lower band in the last 10 bars. Indicates strong support. Bearish Patterns (at Upper Band): Pin Bar at Upper Band — Long upper wick touching the upper band. Rejection of higher prices. Bearish Engulfing at Upper Band — Bearish candle engulfs previous bullish candle at the upper band. Rejection from Upper Band — Touches upper band but closes in the lower half. Neutral/Breakout: Band Walk — Price stays at/beyond a band for N consecutive bars (trend continuation). Breakout Candle — Large-bodied candle closing beyond the band (potential trend start). Strong Close at Band — Close beyond band with body >1.5× average body size. Machine Learning Engine (KNN) Feature Vector Each bar is described by 10 normalized features (scaled 0–1): Feature Weight What It Captures BB Width 0.25 Current volatility level %B Position 0.30 Where price is within the bands Squeeze Status 0.15 Whether volatility is compressed RSI(14) 0.15 Momentum/overbought/oversold Body Ratio 0.10 Candle structure (indecision vs conviction) Volume 0.05 Volume relative to 20-bar average Additional features tracked but used elsewhere: squeeze strength, expansion rate, trend (EMA 50), momentum. KNN Algorithm How it works: Trigger Condition: Only runs when price is near a band extreme (%B < 0.2 for longs, %B > 0.8 for shorts). Historical Search: Loops through the last 300 bars (configurable) looking for bars that were also at the same band extreme. Distance Calculation: For each historical match, computes a weighted Euclidean distance between the current feature vector and the historical feature vector. Filtering: Only keeps matches with distance < 0.5 (reasonably similar patterns). Outcome Measurement: For each matched historical bar, it looks forward N bars (default 10) and measures: Maximum upside from that point Maximum downside from that point Net return at bar N Weighted Voting: The K nearest neighbors (up to 20) vote on the outcome, weighted by inverse distance (closer matches have more influence): Success = the relevant return exceeded the success threshold (default 1.5%) Confidence = sum of success weights / total weights × 100 Pattern-Specific Learning Independently from KNN, the indicator also calculates historical win rates for each of the 8 specific candlestick patterns: For each pattern, it scans historical data Counts how many times that pattern appeared Checks what percentage led to profitable outcomes Displays results in the dashboard Combined Scoring text Final Confidence = KNN Confidence + Pattern Bonus Pattern Bonus (up to +70%): +15% if Pin Bar present AND its historical win rate > 50% +20% if Engulfing present AND its historical win rate > 50% +15% if Rejection present AND its historical win rate > 50% +5% if Doji present +10% if Squeeze favors direction +5% if Multiple touches present Signal Generation Entry Conditions Long Signal requires ALL of: Price near lower band (%B < 0.1, touching lower band, or pattern present) Final long confidence ≥ minimum threshold (default 60%) Sufficient historical samples (default ≥ 5) At least 5 bars since last long signal Short Signal is the mirror image at the upper band. Exit Conditions (Three-Way) Exit Type Long Short Mean Reversion Price crosses above middle band Price crosses below middle band Stop Loss Price drops below entry × (1 - SL%) Price rises above entry × (1 + SL%) Take Profit Price rises above entry × (1 + TP%) Price drops below entry × (1 - TP%) Default SL = 2%, TP = 4% (2:1 reward-to-risk ratio). Dashboard The top-right dashboard displays: BB State: Current squeeze/expansion/contraction status, width, %B ML Confidence: KNN scores for long/short, pattern bonuses, final scores, sample counts Pattern Win Rates: Historical success rates for each pattern type with sample counts Position Status: Current position (long/short/flat), unrealized P&L, SL/TP levels Visual Elements Element Description Blue band fill Bollinger Band area Green/Red triangles Long/Short entry signals Confidence labels Percentage confidence at each signal Green/Red background Active long/short position Red/Green horizontal lines Stop loss / Take profit levels Blue horizontal line Entry price X marks Exit signals (orange = mean reversion, red = stop loss, green = take profit) Yellow diamonds Squeeze bars Green/Red zones Entry zones near bands (shaded areas) Pattern labels "PIN", "ENG" markers on specific patterns (optional) Use Cases Use Case 1: Mean Reversion Trading Scenario: You trade range-bound markets where price tends to bounce between Bollinger Band extremes. How to use: Set BB Multiplier to 2.0–2.5 for wider bands Set Min Confidence to 65–70% for fewer but higher-quality signals Watch for LONG signals at the lower band with high confidence — these indicate the ML model has found historically profitable bounce setups in similar conditions Exit at the middle band (mean reversion target) The indicator automatically identifies which patterns (pin bars, engulfing, etc.) have worked best historically on YOUR specific chart/timeframe Example: On a 4H EUR/USD chart, price touches the lower band with a pin bar. The ML model scans the last 300 bars, finds 12 similar instances where price was at the lower band with similar BB width, %B, RSI, and volume profile. 9 of those 12 times, price rose at least 1.5% within 10 bars. Confidence = 75%. Signal fires. Use Case 2: Squeeze Breakout Trading Scenario: You want to catch explosive moves after volatility compression. How to use: Watch the dashboard for SQUEEZE state Note the squeeze duration — longer squeezes often lead to bigger breakouts Check the Squeeze Outlook — the ML calculates the historical bullish/bearish breakout ratio When the squeeze breaks (yellow diamonds stop, green/red triangle appears at bottom), the direction is indicated The ML adds +10% confidence bonus when a squeeze favors the signal direction Set higher Take Profit (6–8%) for squeeze breakouts as these tend to produce larger moves Example: BB Width drops to 1.2% (squeeze for 15 bars). Historically on this chart, 68% of squeezes broke bullish. When the squeeze ends with price above the middle band, a bullish breakout signal fires with squeeze bonus applied. Use Case 3: Pattern-Validated Entries Scenario: You're a candlestick pattern trader who wants statistical validation. How to use: Enable "Show Pattern Labels" to see PIN, ENG labels Check the Pattern Win Rates section of the dashboard Only trade patterns with >55% win rate AND sufficient samples (N > 10) The ML automatically adjusts signal confidence based on pattern-specific historical performance If engulfing patterns at the lower band have a 72% win rate on your chart but pin bars only have 45%, the indicator will boost engulfing signals and suppress pin bar signals Example: On AAPL daily chart, the dashboard shows: Pin Bar at lower: 58% win rate (N=14) Engulfing at lower: 71% win rate (N=8) Rejection at lower: 62% win rate (N=19) You know to trust engulfing and rejection patterns more than pin bars for this specific instrument. Use Case 4: Adaptive Risk Management Scenario: You want dynamic stop-loss and take-profit levels. How to use: The default 2% SL / 4% TP provides 1:2 risk-reward Adjust based on the BB Width — when bands are wide (high volatility), widen stops to avoid premature exits Use the Average Return from the ML model (shown in data window) to calibrate TP — if the ML shows average winning moves are 3.2%, set TP near that The three-exit system (mean reversion, SL, TP) ensures you always have a defined exit Use Case 5: Multi-Timeframe Confirmation Scenario: You trade on a lower timeframe and want higher-timeframe BB context. How to use: Apply the indicator on your higher timeframe (daily) to identify the BB state (squeeze, expansion) Apply again on your trading timeframe (1H/4H) for entry signals Only take long signals on the lower timeframe when the higher timeframe is in a squeeze about to break bullish, or when the higher timeframe %B is also near the lower band The ML confidence from the higher timeframe validates the lower timeframe setup Use Case 6: Crypto/Forex Volatility Trading Scenario: Trading volatile assets where Bollinger Band touches are frequent. How to use: Increase Min Samples to 8–10 (more data for volatile assets) Reduce Success Threshold to 1.0% (volatile assets move more) Increase ML Lookback to 500 bars for more training data Watch for Band Walk detection — in trending crypto markets, price can ride a band for extended periods. The indicator detects this and avoids counter-trend signals during band walks Use the Expansion Rate setting to fine-tune when the indicator recognizes a breakout vs. noise Key Strengths Adaptive: The ML model learns from the specific instrument and timeframe you apply it to — what works on BTC/USD 1H may differ from SPY daily, and the indicator adapts accordingly. Statistical Validation: Instead of blindly trading every pin bar at a band, it checks whether pin bars at bands have historically worked on THIS chart. Multi-Factor: Combines volatility state (squeeze detection), price position (%B), candlestick patterns, momentum (RSI), and volume into a unified confidence score. Risk-Defined: Every trade has a stop loss, take profit, and mean-reversion exit built in.Pine Script®指標由ZakAlgo_Trade提供162
Polynomial Regression Moving Average (PRMA)1. WHAT IS PRMA? PRMA is a non-repainting, smoothed moving average that uses the endpoint of polynomial regression as its core value. It generalizes the classic Linear Regression Moving Average (LSMA) to any polynomial degree — including fractional values — and adds a comprehensive multi-method, multi-iteration smoothing layer on top. In Simple Terms PRMA fits a mathematical curve (polynomial) to recent price history, takes the last point of that curve as the current value, then optionally smooths the result using your choice of 9 different smoothing algorithms — applied up to 10 times in sequence. 2. CORE ARCHITECTURE text ┌─────────────────────────────────────────────────────┐ │ PRMA PIPELINE │ │ │ │ Price Data ──► Polynomial Regression ──► Endpoint │ │ (OLS with degree d) Extraction │ │ │ │ │ ▼ │ │ Raw PRMA Value │ │ │ │ │ ▼ │ │ Smoothing Layer │ │ (Method × Iterations)│ │ │ │ │ ▼ │ │ Final PRMA Output │ │ │ │ │ ▼ │ │ Signal Generation │ │ (Direction Change) │ └─────────────────────────────────────────────────────┘ 3. MATHEMATICAL FOUNDATION 3.1 Polynomial Regression (OLS) For the last n bars, a polynomial of degree d is fitted: text ŷ(x) = β₀ + β₁x + β₂x² + ... + βₐxᵈ The coefficients are solved via the Normal Equation: text β = (XᵀX)⁻¹ · Xᵀ · y Where X is the Vandermonde matrix: text X = | 1 0 0² ... 0ᵈ | | 1 1 1² ... 1ᵈ | | 1 2 2² ... 2ᵈ | | . . . ... . | | 1 n-1 (n-1)² ... (n-1)ᵈ | 3.2 The Weight Kernel (Efficiency Innovation) Instead of solving full regression every bar, a fixed weight kernel is precomputed once: text Kernel K = x_last · (XᵀX)⁻¹ · Xᵀ Where x_last = Then each bar simply computes: text PRMA_raw = Σ K × price for i = 0 to n-1 This is a constant-time weighted sum — extremely efficient. 3.3 Fractional Degree Interpolation For degree = 3.7: text kernel_3 = compute_kernel(degree=3) kernel_4 = compute_kernel(degree=4) final_kernel = 0.3 × kernel_3 + 0.7 × kernel_4 This allows infinitely fine-grained control over responsiveness. 3.4 Smoothing Layer The raw PRMA value passes through a selectable smoothing function, applied iteratively: text smoothed₁ = smooth(raw_PRMA) smoothed₂ = smooth(smoothed₁) smoothed₃ = smooth(smoothed₂) ... smoothedₙ = smooth(smoothedₙ₋₁) Each iteration further reduces noise while adding controlled lag. 4. ALL PARAMETERS EXPLAINED 4.1 Core Parameters Parameter Default Range Description Source close Any price The price data fed into the regression Period 100 ≥ 2 Number of bars in the regression lookback window Degree 4.0 ≥ 1.0 (step 0.1) Polynomial degree — controls curve complexity 4.2 Color Parameters Parameter Default Description Up Green rgb(36,223,23) PRMA line color when rising Down Fuchsia PRMA line color when falling 4.3 Smoothing Parameters Parameter Default Range Description Smoothing Method EMA 10 options Type of smoothing filter applied Smoothing Length 5 ≥ 1 Lookback for the smoothing algorithm Smoothing Iterations 1 1–10 Number of sequential smoothing passes 4.4 Signal Parameters Parameter Default Description Show Signals true Toggle buy/sell labels on chart 5. SMOOTHING METHODS IN DETAIL 5.1 Complete Smoothing Method Comparison Method Formula Concept Lag Smoothness Best For None No smoothing Zero Raw Fastest response, noisy SMA Equal-weight average High Moderate Simple baseline smoothing EMA Exponential decay Medium Good General purpose WMA Linear weight decay Medium Good Recent-data emphasis RMA Wilder's smoothing High Very High Ultra-smooth trending HMA Hull method Low Good Low-lag smoothing DEMA Double EMA Low Good Lag reduction TEMA Triple EMA Very Low Moderate Minimum lag VWMA Volume-weighted mean Medium Good Volume-aware smoothing Gaussian Bell-curve kernel Medium Excellent Natural, artifact-free 5.2 Smoothing Method Formulas text SMA(n) = (P₁ + P₂ + ... + Pₙ) / n EMA(n) = α × P + (1-α) × EMA_prev where α = 2/(n+1) WMA(n) = (n×P₁ + (n-1)×P₂ + ... + 1×Pₙ) / (n×(n+1)/2) RMA(n) = (1/n) × P + (1 - 1/n) × RMA_prev HMA(n) = WMA(√n, 2×WMA(n/2) - WMA(n)) DEMA(n) = 2×EMA(n) - EMA(EMA(n)) TEMA(n) = 3×(EMA - EMA²) + EMA³ VWMA(n) = Σ(P×V) / Σ(V) Gaussian(n) = Σ(P × e^(-0.5×(i/σ)²)) / Σ(e^(-0.5×(i/σ)²)) where σ = n/3 5.3 Multi-Iteration Effects text Iterations: 1 2 3 4+ │ │ │ │ Noise: Low Very Low Minimal Near Zero Lag: Low Moderate Higher Highest Shape: Sharp Rounded Very Round Gaussian-like Iterations Equivalent Behavior 1 Standard single-pass filter 2 Similar to Butterworth 2nd-order 3 Approaching Gaussian response 4+ Ultra-smooth, trend-only extraction 6. SIGNAL LOGIC 6.1 Direction Detection text PRMA Rising → prma > prma → Bullish PRMA Falling → prma < prma → Bearish 6.2 Buy Signal (Long — "L") text Conditions (ALL must be true): ✅ PRMA turns UP (was falling on previous bar, now rising) ✅ Close > PRMA (price confirms above the moving average) ✅ Show Signals ON Displayed as: Green "L" label below the bar 6.3 Sell Signal (Short — "S") text Conditions (ALL must be true): ✅ PRMA turns DOWN (was rising on previous bar, now falling) ✅ Close < PRMA (price confirms below the moving average) ✅ Show Signals ON Displayed as: Fuchsia "S" label above the bar 6.4 Signal Flow Diagram text PRMA Direction │ ┌─────────┴──────────┐ ▼ ▼ Rising Falling │ │ │ Was Falling? │ Was Rising? │ │ │ │ ▼ ▼ ▼ ▼ Yes No Yes No │ └── No Signal │ └── No Signal │ │ ▼ ▼ Close > PRMA? Close < PRMA? │ │ Yes ──► BUY "L" Yes ──► SELL "S" No ──► No Signal No ──► No Signal 7. NON-REPAINTING GUARANTEE Why PRMA Never Repaints Factor Explanation Fixed kernel Weight matrix computed once on first bar, never recalculated Fixed lookback Each bar uses exactly length bars ending at length bars ago No future data Uses source through source — all confirmed Deterministic smoothing All smoothing methods are causal (backward-looking only) One value per bar Once a bar closes, its PRMA value is permanently locked Important Note The indicator uses source check, meaning the PRMA value is plotted with a length-bar delay from the source data. This ensures that ALL input data is from closed, confirmed bars — the ultimate non-repainting guarantee. Repainting vs Non-Repainting Comparison text REPAINTING Polynomial Regression Channel: Bar 100: Draws curve across bars 1-100 Bar 101: REDRAWS curve across bars 2-101 ← ALL previous values change! NON-REPAINTING PRMA: Bar 100: Computes endpoint of regression on bars 1-100 → single fixed value Bar 101: Computes endpoint of regression on bars 2-101 → new single fixed value Bar 100's value NEVER changes ✅ 8. USE CASES 8.1 Trend Following Goal: Identify and ride medium-to-long-term trends Setup: text Period: 150–200 Degree: 1.5–2.5 Smoothing: EMA, Length 10, Iterations 2 Strategy: Go Long when PRMA turns green (rising) + price above PRMA Go Short when PRMA turns fuchsia (falling) + price below PRMA Exit on opposite signal or when price crosses PRMA against position Example: text SELL signal ↓ Price: ──╱╲──╱╲──╱╲──╲╱──╲──╲╱──╲── PRMA: ────────╱──────╲────────╲──── Color: ████████GREEN███FUCHSIA██████ ↑ BUY signal Markets: Stocks, ETFs, Forex (trending pairs like EUR/USD, USD/JPY) Risk Management: Stop loss: Below PRMA line (for longs) or recent swing low Take profit: When opposite signal appears or fixed R:R ratio Position sizing: Based on ATR distance from PRMA 8.2 Swing Trading Goal: Capture medium-term price swings with clean entry/exit signals Setup: text Period: 50–100 Degree: 3.0–4.0 Smoothing: HMA, Length 5, Iterations 1 Strategy: Enter Long on "L" signal when price is above a higher-timeframe support Enter Short on "S" signal when price is below a higher-timeframe resistance Use PRMA direction color as bias filter Example — Multi-Timeframe Approach: text Daily PRMA (Period 100, Degree 2): Rising → BULLISH BIAS 4H PRMA (Period 50, Degree 4): "L" signal appears Action: Enter Long (aligned with daily bias) Markets: Stocks, Crypto (BTC, ETH), Commodities 8.3 Scalping / Day Trading Goal: Quick entries and exits on short timeframes Setup: text Period: 20–50 Degree: 1.0–2.0 Smoothing: TEMA, Length 3, Iterations 1 Strategy: Use on 1m–15m charts Enter on signal in direction of PRMA slope Exit quickly — target 1:1 or 1:1.5 R:R Avoid signals during consolidation (flat PRMA) Example — 5-Minute Chart: text 09:30 ─────────╱── PRMA turns green 09:35 ── "L" signal, price > PRMA → BUY 09:50 ── Target hit, close position 10:15 ──╲──── PRMA turns fuchsia → flat/reverse Markets: Futures (ES, NQ), Forex (major pairs), Crypto 8.4 Mean Reversion Goal: Trade pullbacks to the PRMA line Setup: text Period: 100–150 Degree: 2.0–3.0 Smoothing: Gaussian, Length 8, Iterations 2 Strategy: Identify trend direction via PRMA color Wait for price to pull back TO the PRMA line (touch or cross slightly) Enter in the direction of the PRMA trend when price bounces off PRMA Stop loss: Beyond the PRMA line Example: text Uptrend (PRMA green): Price: ──╱──╱──╲──╱──╱──╲──╱── PRMA: ────╱────╱────╱────╱──── ↑ ↑ Pullback Pullback to PRMA to PRMA = BUY = BUY Markets: Stocks with strong trends, Index ETFs (SPY, QQQ) 8.5 Volatility Regime Detection Goal: Determine if market is trending or ranging Setup: text Period: 100 Degree: 4.0 (high responsiveness) Smoothing: SMA, Length 15, Iterations 3 (ultra-smooth) Strategy: Flat PRMA (minimal direction changes) → Ranging market → Use mean reversion strategies Clearly sloped PRMA (consistent color) → Trending market → Use trend following strategies Frequent color changes → Choppy market → Reduce position size or stay out Example: text Trending Phase: Choppy Phase: Ranging Phase: PRMA: ────╱──╱── PRMA: ╱╲╱╲╱╲╱╲ PRMA: ────────── Color: GREEN GREEN Color: G F G F G F Color: GREEN (flat) Action: TREND FOLLOW Action: STAY OUT Action: MEAN REVERT Markets: All — this is a meta-strategy for selecting other strategies 8.6 Multi-PRMA System Goal: Use multiple PRMA instances for confluence-based trading Setup (3 PRMA instances on same chart): Instance Period Degree Smoothing Role Fast PRMA 30 3.0 TEMA, 3, 1 Entry trigger Medium PRMA 80 2.5 EMA, 5, 1 Trend filter Slow PRMA 200 1.5 SMA, 10, 2 Major trend direction Strategy: text STRONG BUY: ✅ Slow PRMA rising (major uptrend) ✅ Medium PRMA rising (confirmed trend) ✅ Fast PRMA gives "L" signal (entry timing) ✅ Price > all 3 PRMAs STRONG SELL: ✅ Slow PRMA falling (major downtrend) ✅ Medium PRMA falling (confirmed trend) ✅ Fast PRMA gives "S" signal (entry timing) ✅ Price < all 3 PRMAs AVOID: ❌ PRMAs disagree on direction ❌ Price between fast and slow PRMA Markets: All — particularly effective on Daily charts for position trading 8.7 Crossover System with Other Indicators Goal: Combine PRMA with traditional indicators for confirmation PRMA + RSI: text Setup: PRMA (100, 3.0, EMA 5) + RSI(14) Long Entry: ✅ PRMA "L" signal ✅ RSI > 50 (bullish momentum) ✅ RSI not overbought (< 70) Short Entry: ✅ PRMA "S" signal ✅ RSI < 50 (bearish momentum) ✅ RSI not oversold (> 30) PRMA + MACD: text Setup: PRMA (80, 2.5, HMA 5) + MACD(12,26,9) Long: PRMA "L" + MACD histogram positive + MACD above signal line Short: PRMA "S" + MACD histogram negative + MACD below signal line PRMA + Volume: text Setup: PRMA (100, 3.0, VWMA 5) — already volume-aware via VWMA smoothing Long: "L" signal + Volume > 1.5× average volume = HIGH CONVICTION Long: "L" signal + Volume < average = LOW CONVICTION (smaller position) 8.8 Crypto-Specific Use Case Goal: Navigate volatile crypto markets with adaptive smoothing Setup: text Chart: 4H BTC/USDT Period: 60 Degree: 3.5 Smoothing: Gaussian, Length 8, Iterations 2 Strategy: Crypto moves fast → higher degree (3.5) catches reversals quickly Crypto is noisy → Gaussian smoothing + 2 iterations removes whipsaws Only trade signals aligned with Daily PRMA direction Use wider stops (crypto volatility is 3-5× traditional markets) Example — BTC Bull Run: text $40,000 ──────╱── PRMA green, "L" signal → ENTER LONG $45,000 ──╱───── PRMA still green → HOLD $48,000 ──╲───── PRMA turns fuchsia, "S" signal → EXIT $44,000 ──╲───── PRMA still fuchsia → SHORT or FLAT $42,000 ──╱───── PRMA green, "L" → ENTER LONG again 8.9 Portfolio / Asset Allocation Goal: Use PRMA as a filter for risk-on/risk-off decisions Setup: text Asset: SPY (S&P 500 ETF) Period: 200 Degree: 1.5 Smoothing: RMA, Length 20, Iterations 3 Strategy: text Weekly PRMA Rising (Green): → 100% Equities allocation → Overweight growth stocks → Risk-on positioning Weekly PRMA Falling (Fuchsia): → Reduce to 50% Equities → Increase bonds / cash → Risk-off positioning Weekly PRMA Flat / Choppy: → 70% Equities → Diversified allocation → Neutral positioning 8.10 Adaptive Degree Selection Guide Goal: Choose the right degree for current market conditions text Market Condition → Recommended Degree ───────────────────────────────────────────── Strong linear trend → 1.0 - 1.5 Gradual curve/acceleration→ 2.0 - 2.5 Trend with pullbacks → 3.0 - 3.5 Complex / oscillating → 4.0 - 5.0 Very choppy → 1.0 (with heavy smoothing) 9. PARAMETER OPTIMIZATION TABLE Trading Style Timeframe Period Degree Smooth Method Smooth Length Iterations Scalping 1m–5m 20–30 1.0–2.0 TEMA 3 1 Day Trading 5m–15m 30–60 2.0–3.0 HMA 5 1 Swing Trading 1H–4H 50–100 3.0–4.0 EMA 5–8 1–2 Position Trading Daily 100–200 2.0–3.0 Gaussian 8–12 2 Investing Weekly 50–100 1.0–2.0 RMA 10–20 2–3 Crypto Trading 4H 50–80 3.0–4.0 Gaussian 8 2 Forex 1H 60–120 2.0–3.0 DEMA 5 1 Futures 5m–30m 30–60 2.0–3.0 HMA 5 1 Low Noise Any Any 1.5–2.5 SMA 15–20 3–4 Fast Response Any 20–50 4.0–5.0 None – – 10. DEGREE COMPARISON VISUAL text Degree 1.0 (Linear): Price: ╱╲╱──╱╲──╱╲╱╲──╱╲ PRMA: ────────╱────────── Very smooth, slow to turn Signals: ▲ Rare signals Degree 2.0 (Quadratic): Price: ╱╲╱──╱╲──╱╲╱╲──╱╲ PRMA: ──────╱──────╲──── Moderate curvature Signals: ▲ ▼ Balanced signals Degree 3.0 (Cubic): Price: ╱╲╱──╱╲──╱╲╱╲──╱╲ PRMA: ────╱──╱──╲──╲╱─── Catches inflections Signals: ▲ ▲ ▼ ▲ More signals Degree 4.0 (Quartic): Price: ╱╲╱──╱╲──╱╲╱╲──╱╲ PRMA: ──╱╲─╱╲──╲╱╲─╱╲── Very responsive Signals: ▲▼ ▲▼ ▼▲▼ ▲▼ Many signals (may whipsaw) Degree 4.0 + Smoothing (EMA 5, Iter 2): Price: ╱╲╱──╱╲──╱╲╱╲──╱╲ PRMA: ───╱───╱───╲───╲── Responsive but clean Signals: ▲ ▲ ▼ ▼ Filtered, reliable signals ✅ 11. SMOOTHING ITERATIONS VISUAL text Raw PRMA (No Smoothing): ╱╲╱╲╱──╱╲──╲╱╲╱╲──╱╲ Noisy, many direction changes 1 Iteration (EMA 5): ─╱╲╱───╱╲───╲╱╲───╱─ Some noise removed 2 Iterations (EMA 5): ──╱─────╱─────╲────╱─ Much cleaner 3 Iterations (EMA 5): ───╱─────╱──────╲───╱ Very smooth, clear trend 5 Iterations (EMA 5): ────╱──────╱───────╲─ Ultra-smooth, trend only 12. STRENGTHS & LIMITATIONS ✅ Strengths Feature Benefit Non-repainting Reliable for backtesting and live trading — what you see is what you get Fractional degree Unprecedented fine-tuning between integer polynomial degrees 10 smoothing methods Adapt to any market condition or trading style Multi-iteration smoothing Cascaded filtering for noise-free output Precomputed kernel Computationally efficient — fixed weights, simple weighted sum Generalizes LSMA Degree 1 = LSMA; higher degrees capture curves Confirmed signals Price must be on the correct side of PRMA for signal validation Visual clarity Color-coded direction makes trend identification instant ⚠️ Limitations Limitation Mitigation Lag (inherent in all MAs) Use lower period, higher degree, or TEMA/HMA smoothing Overfitting (high degree + short period) Keep degree ≤ period/20 as rule of thumb Whipsaws in ranging markets Increase smoothing iterations or add trend filter No prediction — shows current state, not forecast Combine with leading indicators (RSI, MACD) Runge's phenomenon at extreme degrees Stay below degree 8–10 for practical use Fixed lag offset of length bars This ensures non-repainting — a deliberate trade-off Over-smoothing possible with high iterations Start with 1–2 iterations, increase only if needed 13. QUICK-START RECOMMENDATIONS Beginner Setup (Start Here) text Period: 100 | Degree: 2.0 | Smooth: EMA | Length: 5 | Iterations: 1 → Clean, balanced, works on most markets and timeframes Intermediate Setup text Period: 80 | Degree: 3.0 | Smooth: HMA | Length: 5 | Iterations: 1 → More responsive to curves, low-lag smoothing Advanced Setup text Period: 60 | Degree: 3.5 | Smooth: Gaussian | Length: 8 | Iterations: 2 → Captures complex patterns with natural noise reduction 14. SUMMARY PRMA bridges the gap between simple moving averages and complex curve-fitting analysis. It transforms polynomial regression from a repainting analytical overlay into a practical, non-repainting trading tool with: Fractional polynomial degrees for precision tuning 9 smoothing methods + multi-iteration for adaptive noise reduction Clean directional signals validated by price confirmation Zero repainting guaranteed by fixed kernel architecture Whether you're scalping crypto on a 1-minute chart or managing a portfolio on weekly timeframes, PRMA's configurable parameters can be optimized for your specific trading style and market conditions.Pine Script®指標由ZakAlgo_Trade提供35
Wars & Economic Conflicts Timeline## Wars & Economic Conflicts Timeline (1861–Present) This indicator overlays **31 major wars and geopolitical conflicts** directly onto your chart, from the U.S. Civil War in 1861 through ongoing modern conflicts. It is designed to help traders and researchers visually correlate historical market behavior with periods of armed conflict and geopolitical stress. --- ### How to use it Each conflict is drawn as a pair of vertical lines: - **Solid line** → Start of conflict - **Transparent line (same color)**Pine Script®指標由Badcharts提供3
Wars & Economic Conflicts Timeline## Wars & Economic Conflicts Timeline (1861–Present) This indicator overlays **31 major wars and geopolitical conflicts** directly onto your chart, from the U.S. Civil War in 1861 through ongoing modern conflicts. It is designed to help traders and researchers visually correlate historical market behavior with periods of armed conflict and geopolitical stress. --- ### How to use it Each conflict is drawn as a pair of vertical lines: - **Solid line** → Start of conflict - **Transparent line (same color)**Pine Script®指標由Badcharts提供4
RSI Range ShiftQ: What should the RSI Range Shift indicator do? (Select all that apply) A: Generate buy/sell signals on range shift, Plot RSI with colored zones, Highlight overbought/oversold zones with custom ranges Q: What type of output do you want? A: Signals + Alerts Q: Which RSI length do you want as default? A: 14 (standard)Pine Script®指標由kassawat提供21
Liquidity Bands1. CONCEPT & PURPOSE Liquidity Bands is a volume-weighted volatility envelope indicator. Unlike standard Bollinger Bands that use a Simple Moving Average and equal-weighted standard deviation, this indicator weights every price observation by its liquidity (volume × true range). This means: High-volume, high-volatility bars have a stronger influence on the bands Low-volume, quiet bars contribute less to the calculation The bands naturally gravitate toward price levels where real trading activity occurred This makes the bands more responsive to institutional activity and genuine supply/demand zones rather than treating every bar equally. 2. CORE CALCULATIONS 2.1 Liquidity Proxy text liquidity = volume × true_range Each bar's "weight" is determined by multiplying its volume by its true range. This captures dollar-flow intensity — a bar with high volume AND wide range represents significant market participation. If volume is unavailable (e.g., some crypto pairs), it defaults to 1 so the indicator still functions. 2.2 Liquidity-Weighted Moving Average (LMA) text LMA = Σ(price × liquidity, n) / Σ(liquidity, n) Instead of a simple average where each bar counts equally, the LMA is a weighted mean where high-liquidity bars pull the average toward their price level more strongly. This is the center line (basis) of the bands. Interpretation: LMA represents the fair value based on where the most trading activity occurred Price above LMA → bullish bias Price below LMA → bearish bias 2.3 Liquidity-Weighted Standard Deviation text variance = Σ(price² × liquidity, n) / Σ(liquidity, n) − LMA² std_dev = √variance The standard deviation is also liquidity-weighted, meaning volatility is measured relative to where liquidity actually participated, not just raw price swings. 2.4 Band Construction Band Formula Purpose Upper Band LMA + (mult × std_dev) Overbought / resistance zone Lower Band LMA − (mult × std_dev) Oversold / support zone Inner Upper LMA + (inner_mult × std_dev) First standard deviation — early warning Inner Lower LMA − (inner_mult × std_dev) First standard deviation — early warning Default multipliers: Outer = 2.0, Inner = 1.0 This creates four zones: Above upper band → extreme overbought Upper band to inner upper → overbought zone Inner upper to inner lower → neutral / fair value zone Inner lower to lower band → oversold zone Below lower band → extreme oversold 3. SIGNAL MODES 3.1 Mean Reversion Mode Philosophy: Price tends to return to the mean after touching extremes. Signal Condition Logic LONG Previous close was at or below the lower band, current close is back above it Price was rejected at the lower extreme and is recovering — buy the bounce SHORT Previous close was at or above the upper band, current close is back below it Price was rejected at the upper extreme and is fading — sell the rejection Best used in: Ranging/sideways markets, mean-reverting instruments, when squeeze is active. 3.2 Breakout Mode Philosophy: When price breaks through the bands with conviction, momentum follows. Signal Condition Logic LONG Price crosses above the upper band Bullish momentum breakout — buy the strength SHORT Price crosses below the lower band Bearish momentum breakdown — sell the weakness Best used in: Trending markets, after a squeeze, high-momentum instruments. 3.3 Both Mode Fires signals from either mode. Useful for scanning all opportunities but requires additional context/filtering to avoid conflicting signals. 3.4 LMA Cross Signals (Optional) Signal Condition Cross Up Price crosses above the LMA basis line Cross Down Price crosses below the LMA basis line These are secondary/confirmation signals — a diamond shape appears. Useful for: Confirming a mean reversion signal (price bounced off band AND crossed back above LMA) Identifying trend direction shifts 4. BAND WIDTH & SQUEEZE DETECTION 4.1 Band Width text band_width = (upper_band − lower_band) / LMA × 100 Expressed as a percentage of the LMA, this normalizes volatility across different price levels and instruments. A 5% band width means the bands span 5% of the current price level. 4.2 Squeeze Detection text squeeze = band_width < lowest(band_width, 50) × 1.05 A squeeze is detected when the current band width is within 5% of the lowest band width in the last 50 bars. This means volatility has contracted to near-historic lows for the recent window. What it means: Energy is building — a large move is likely coming Direction is unknown — wait for breakout confirmation Displayed as a soft orange/yellow background tint across the chart 4.3 Expansion Detection text expansion = band_width > highest(band_width , 20) × 0.95 Bands are expanding when width is near the 20-bar high. This confirms an active trend/momentum move is underway. 4.4 Price Position Ratio text ratio = (close − lower_band) / (upper_band − lower_band) Gives a 0–100% reading of where price sits within the bands: 0% = at the lower band 50% = at the LMA 100% = at the upper band >100% = above upper band <0% = below lower band Displayed as a visual gauge bar ████░░░░░░ 40% in the dashboard. 5. VISUAL SYSTEM 5.1 Color Themes Theme Character Upper Lower Best For Cyber Futuristic neon Cyan #00e5ff Pink #ff006e Dark charts Ocean Cool aquatic Teal #00b4d8 Deep blue #0077b6 Clean look Lava Hot aggressive Orange #ff6b35 Red #d90429 High energy Frost Soft pastel Light blue #a2d2ff Pale blue #bde0fe Light charts Neon Maximum contrast Green #39ff14 Red #ff073a Visibility Each theme defines a coordinated 7-color palette (upper, lower, basis, bull, bear, squeeze, accent) so everything matches. 5.2 Glow Effect Three concentric layers are drawn behind each band line: Layer Opacity Width Effect Outer glow 92% transparent 6px Soft ambient halo Mid glow 82% transparent 4px Intermediate diffusion Inner glow 60% transparent 2px Concentrated glow Core line 0% transparent 1px Sharp band edge This creates a neon light tube effect around each band. 5.3 Zone Fills Five separate fill regions create depth: Zone Between Opacity Meaning Upper zone Upper band → Inner upper 88% Overbought territory Lower zone Lower band → Inner lower 88% Oversold territory Core zone Inner upper → Inner lower 95% Fair value area Upper half Upper band → LMA 94% Subtle upper bias tint Lower half Lower band → LMA 94% Subtle lower bias tint 5.4 Dynamic Basis Color The LMA line color shifts in real-time based on price position: When price is near the lower band → basis turns lower band color When price is near the upper band → basis turns upper band color This creates an instant visual read of where price sits 5.5 Signal Visualization (Triple-Layer) Each signal has three visual layers for maximum clarity: Layer Element Purpose Primary Large ▲/▼ triangle with bold "LONG"/"SHORT" text Unmissable directional signal Accent Small circle dot at the same location Adds visual weight and layering Context Dotted horizontal line spanning ±1 bar Marks the exact price level of the signal Background Full-bar bgcolor tint (green/red) Makes signal bars visible even when zoomed out 5.6 Band Touch Markers Small xcross shapes appear when price first touches a band without triggering a full signal. These serve as early warnings that price is testing an extreme. 5.7 LMA Dot Trail (Optional) When enabled, alternating dots • appear on the LMA line every other bar, creating a stylized beaded line effect instead of a solid line. 6. DASHBOARD A real-time information panel displayed in the corner with alternating dark row backgrounds: Row Left Column Right Column Color Logic Header ⚡ LIQUIDITY BANDS ━━━━━━ Theme accent Theme Theme Active theme name + ● Upper band color Mode Mode Active signal mode Accent color Width Width Band width as % Orange if squeeze, green if expanding, gray if normal Status Status ⊘ SQUEEZE / ⊕ EXPANDING / ◎ NORMAL Contextual color Price Price ▲ ABOVE / ▼ BELOW / ◈ INSIDE Green/red/white Ratio Ratio ████░░░░░░ 40% gauge bar Gradient from lower to upper band color 7. ALERTS Alert Fires When Long Signal Any long condition triggers (based on selected mode) Short Signal Any short condition triggers (based on selected mode) LMA Cross Up Price crosses above the LMA LMA Cross Down Price crosses below the LMA Squeeze Band width hits squeeze threshold All alert messages include the ticker symbol via {{ticker}}. 8. INPUT REFERENCE Input Default Range Description Lookback Length 20 1+ Number of bars for LMA and std dev calculation StdDev Multiplier 2.0 0.1+ Width of outer bands (higher = wider) Price Source Close Any Which price to use for calculations Inner Band Multiplier 1.0 0.1+ Width of inner bands Signal Mode Mean Reversion 3 options Which signal logic to use Show Signals ✓ Toggle Display signal markers Show LMA Cross ✗ Toggle Display LMA cross diamonds Color Theme Cyber 5 options Visual color scheme Band Glow Effect Pine Script®指標由ZakAlgo_Trade提供31
VIX High/Low Zones ProThis Pine Script indicator, "VIX High/Low Zones Pro," plots the VIX (or VXN) directly on a separate pane beneath your chart, giving you a real-time read on market volatility conditions. The VIX line is color-coded dynamically — shifting from lime green at the calmest levels below 16, through orange in the 18–25 range, and into red and dark maroon as fear intensifies above 25 and 32 respectively. A set of key horizontal levels at 16, 18, 20, 22, 25, and 28 are drawn as dashed or dotted reference lines, and an optional moving average (default 50-period SMA) is overlaid on the VIX to help identify the broader trend in volatility. The VIX data can also be smoothed using a short-period SMA, EMA, or WMA to reduce noise, and a small label in the upper right displays the current VIX value along with a momentum arrow showing whether volatility is rising or falling. The most actionable feature for trade filtering is the background shading, which turns red when VIX is above its moving average and green when it's below. This gives you a simple, visual bias signal — a red background suggests volatility is expanding and the market may be in a risk-off or trending-down environment, while a green background indicates volatility is contracting or subdued, favoring calmer, range-bound conditions. For MNQ traders, this crossover relationship between VIX and its MA can serve as a quick regime filter to adjust strategy selection or position sizing without having to manually interpret the raw VIX number on every bar.Pine Script®指標由averagejoe_1919提供已更新 6
Session Bar CounterA bar counter indicator allowing font size, color, offset position. Hourly close are set to different color for easier reference. Pine Script®指標由kwota提供已更新 4
BTC Stack Tracker🚀 BTC Stack Tracker Overview The BTC Stack Tracker is a professional portfolio management tool designed for Bitcoiners who want to visualize their accumulation journey directly on the chart. Unlike standard indicators, this script allows you to input your actual trade history to calculate your personal Average Acquisition Price (Break-Even) and track your portfolio's performance in real-time. 📈 🌟 Key Features Historical Visualization: Displays a gapless step-line representing your average cost basis over time. 🛤️ Transaction Markers: Automatically places Green Up-Arrows (▲) for buys and Red Down-Arrows (▼) for sells on the exact date of the transaction. Multi-Currency Support: Native support for EUR and USD, with a "Custom" option for any other currency (e.g., CHF, GBP). 🌍 Live Portfolio Metrics: A clean on-screen table displaying: Total Stack: Current BTC balance. 💰 Invested: Total fiat capital committed (adjusted for sells). Value: Current market value of your holdings. PNL: Unrealized profit/loss percentage. 📊 ⚙️ How it Works 1. Data Input The script parses data from two text areas (Buys and Sells). Format : YYYY-MM-DD, Price, Sats, Note; Price: The BTC price at the time of purchase/sale. Sats : The amount of Satoshis (1 BTC = 100,000,000 Sats). 2. Calculation Logic The indicator uses a Floating Average Cost methodology: When Buying: The cost (Sats multiplied by Price) is added to your total investment, and the Sats are added to your stack. When Selling: The script reduces your total stack. Crucially, it reduces the "Invested" capital proportionally. This ensures the Average Price remains stable during a sale—accurately reflecting your break-even point for the remaining coins. ⚖️ 3. Seamless Plotting To ensure a continuous line, the script carries the portfolio state forward from the very first bar. Even if no trades occur for months, the indicator maintains your last known average price across the entire timeline. ⛓️ 🛠️ Settings Currency Settings: Choose your display currency (EUR, USD, or Custom). Visuals: Customize the color and opacity of the Avg Price line and markers. 🎨 Toggle Notes: Enable or disable your personal notes (e.g., "Bot Profit") next to the chart markers. 📝Pine Script®指標由AlexTrading2022提供已更新 36
Liquidity Voids - Pine V6This TradingView script identifies and visualizes liquidity voids directly on the chart. Liquidity voids are areas where price moves aggressively, leaving behind inefficient price zones with little to no trading activity. These zones often act as magnets for future price action, as the market tends to revisit them to rebalance liquidity. The script automatically detects these liquidity voids and displays them clearly on the chart, making them easy to identify during analysis. It works on all timeframes, allowing traders to use it consistently whether they are scalping on lower timeframes or analyzing higher-timeframe market structure. The indicator is written in Pine Script version 6, ensuring compatibility with the latest TradingView features and optimal performance. Feel free to use it for your own purpose!Pine Script®指標由TheoSmits提供12