Daily Buy/Sell Triggers + ATR TargetsThis tool gives you a once-per-day, objective ATR map: Buy Trigger above the open, Sell Trigger below the open, clean ATR targets, and FULL ATR extremes. It’s designed for clarity, precision, and zero intraday repainting so you can plan the session and execute with confidence.
This indicator prints a new, static grid of intraday levels every New York 18:00 (end of the NY trading day). The grid is anchored at the day’s open and spaced by the Daily ATR so you get tick-precise Buy Trigger, Sell Trigger, intermediate ATR targets, and the FULL ATR bounds for the session.
The levels act as objective support/resistance and intraday measuring sticks for continuation, mean-reversion, and range expansion trades.
What you see on the chart
A thin midline at the Daily Open (anchor).
Green lines above, red lines below, spaced at your chosen ATR multiples.
Text at the far right for:
Buy trigger
Sell trigger
FULL ATR (both sides)
Intermediate targets are unlabeled to keep the chart clean (they’re still tradable S/R).
Indicatori e strategie
LevelsThis Indicator is meant to plot some of the most common levels that traders use.
The display of these levels is highly customizable, as you can choose the line type , color , thickness and whether it shows you no label, price only, reduced label or full label next to the line. All labels (except for "no Label") will show the price at this level.
Also You have the option to mark the start on each timeframe with either a individually colored background or a vertical line where you can choose the line style and color.
Full List of available Levels and Optional inputs to these levels:
Previous HTF Candle Levels:
• Previous HTF Candle Open
• Previous HTF Candle High
• Previous HTF Candle Low
• Previous HTF Candle Close
Optional:
• Choose any higher timeframe
• Mark start of new HTF candle
Session Levels:
• Session Open
• Session High
• Session Low
• Session Close
Optional:
• Choose any time as start and end of your session
• Mark start of session
• Mark full session
Daily Levels:
• Current Day Open
• Current Day High
• Current Day Low
• Previous Day Open
• Previous Day High
• Previous Day Low
• Previous Day Close
Optional:
• Choose start of day (standard, NY Midnight, custom start time)
• Mark start of day
Weekly Levels:
• Current Week Open
• Current Week High
• Current Week Low
• Previous Week Open
• Previous Week High
• Previous Week Low
• Previous Week Close
Optional:
• Mark start of Week
Monthly Levels:
• Current Month Open
• Current Month High
• Current MonthLow
• Previous Month Open
• Previous Month High
• Previous Month Low
• Previous Month Close
Optional:
• Mark start of Month
ICT Structure Levels (ST/IT/LT) - v7 (by Jonas E)ICT Structure Levels (ST/IT/LT) – Neighbor-Wick Pivots
This indicator is designed for traders following ICT-style market structure analysis. It identifies Short-Term (ST), Intermediary (IT), and Long-Term (LT) swing highs and lows, but with a stricter filter that reduces false signals.
Unlike standard pivot indicators, this script requires not only that a bar makes a structural high/low, but also that the neighboring bars’ extremes are formed by wicks rather than flat-bodied candles. This wick condition helps confirm that the level is a true liquidity sweep and not just random price action.
How it works (conceptual):
Detects pivots based on user-defined left/right bars.
Validates that extremes on both sides of the pivot are wick-driven (high > body for highs, low < body for lows).
Marks valid STH/STL, ITH/ITL, and LTH/LTL directly on the chart with optional price labels.
Uses ATR offset for better label readability.
Alerts can be enabled to notify when a new structural level is confirmed.
How to use it:
Map market structure across multiple layers (ST/IT/LT).
Identify true liquidity grabs and avoid false highs/lows.
Integrate with Break of Structure (BOS) and Change of Character (CHoCH) strategies.
Combine with other ICT concepts (Order Blocks, Fair Value Gaps, Liquidity Pools).
What makes it unique:
Most pivot indicators mark every high/low indiscriminately. This script filters pivots using wick validation, which significantly reduces noise and focuses only on the levels most relevant to liquidity-based trading strategies.
Realized Volatility (StdDev of Returns, %)📌 Realized Volatility (StdDev of Returns, %)
This indicator measures realized volatility directly from price returns, instead of the common but misleading approach of calculating standard deviation around a moving average.
🔹 How it works:
Computes close-to-close log returns (the most common way volatility is measured in finance).
Calculates the standard deviation of these returns over a chosen lookback period (default = 200 bars).
Converts results into percentages for easier interpretation.
Provides three key volatility measures:
Daily Realized Vol (%) – raw standard deviation of returns.
Annualized Vol (%) – scaled by √250 trading days (market convention).
Horizon Vol (%) – volatility over a custom horizon (default = 5 days, i.e. weekly).
🔹 Why use this indicator?
Shows true realized volatility from historical returns.
More accurate than measuring deviation around a moving average.
Useful for traders analyzing risk, position sizing, and comparing realized vs implied volatility.
⚠️ Note:
It is best used on the Daily Chart!
By default, this uses log returns (which are additive and standard in quant finance).
If you prefer, you can easily switch to simple % returns in the code.
Volatility estimates depend on your chosen lookback length and may vary across timeframes.
Control Point System📊 Control Zone Strategy - Trading System Summary
🎯 Core Concept
Trade based on control zone breaks where buyers take over seller zones (bullish) or sellers take over buyer zones (bearish).
📍 Key Levels Setup
Seller Control Zones (Resistance)
PMH (Pre Market High) - Where sellers stopped buyers
YDH (Yesterday High) - Where sellers stopped buyers
Buyer Control Zones (Support)
PML (Pre Market Low) - Where buyers stopped sellers
YDL (Yesterday Low) - Where buyers stopped sellers
📈 EMA System
200 EMA (Purple) - Trend Filter: Above = Bullish bias | Below = Bearish bias
48 EMA (Red) - Last line of defense for pullbacks/shorts
13 EMA (Green) - Pullback levels (if above 200) or Short levels (if below 200)
8 EMA (Orange) - Exit indicator
⚡ Entry Signals
BULLISH Setup (Buyers Take Control)
Condition: Price breaks above PMH or YDH (seller zones)
Confirmation: Above 200 EMA for bullish trend
Entry: Use 5-minute timeframe for precise entries
Logic: Buyers have overpowered seller control zones
BEARISH Setup (Sellers Take Control)
Condition: Price breaks below PML or YDL (buyer zones)
Confirmation: Below 200 EMA for bearish trend
Entry: Use 5-minute timeframe for precise entries
Logic: Sellers have overpowered buyer control zones
🚪 Exit Strategy
Main Exit Rule
Exit Signal: Full candle close above 8 EMA on 5 or 10-minute chart
Runners: Take partial profits along the way, let runners ride until 8 EMA exit
Profit Taking
Scale out at key resistance/support levels
Use Daily 13 EMA as potential exit target
Trail stops using 8 EMA
⏰ Timeframes
Entry: 5-minute chart
Exit Monitoring: 5-minute or 10-minute chart for 8 EMA signals
PMH/PML: Calculated from 4:00 AM - 8:29 AM EST premarket session
🎯 Quick Decision Matrix
ScenarioActionBiasBreak above PMH/YDH + Above 200 EMABUYBullishBreak below PML/YDL + Below 200 EMASELLBearishFull candle close above 8 EMAEXITNeutralPrice at 13/48 EMA + Trend intactAdd/ScaleContinue
💡 Key Rules
Trend is king - Always check 200 EMA first
Zone breaks = control shifts - Trade in direction of new control
8 EMA exit - Respect the exit signal to preserve profits
Scale profits - Don't exit everything at once, use runners
Bottom Line: Trade the battle for control between buyers and sellers at key levels, with trend as your guide and 8 EMA as your exit!
Locked 5m 13 EMA & 15m 20 EMA with Mid EMA & SignalsThis indicator overlays the 5-minute 13 EMA and the 15-minute 20 EMA on any chart timeframe up to 15 minutes, along with a mid EMA (5-minute 36-period) for reference.
Features include:
EMA Cross Detection: Shows bullish and bearish cross arrows when the 5m 13 EMA crosses the 15m 20 EMA.
EMA Fill: Highlights the area between the EMAs in green (bullish) or red (bearish).
Mid EMA Buy/Sell Signals: Generates buy signals when price touches the mid EMA in a bullish stack and sell signals in a bearish stack.
Custom Alerts: Alerts for EMA crosses, EMA stack direction, and mid EMA buy/sell triggers.
Timeframe Safety Warning: Alerts if applied on timeframes higher than 15 minutes.
Ideal For:
Traders who want a locked, non-repainting EMA setup for multi-timeframe analysis and clear entry/exit signals based on mid-range EMA interaction.
Inputs:
Show/Hide arrows for EMA crosses
Show/Hide fill between EMAs
Show/Hide mid EMA line
Show/Hide buy/sell signals
Fill transparency adjustment
Malama's KAYCAP Pre-Market Box# Pre-Market Single Candle Range Box
## What Makes This Script Original
While many scripts plot entire pre-market session ranges, this indicator focuses specifically on **a single user-defined candle** within the pre-market period rather than the entire session. This targeted approach allows traders to isolate the most relevant price action from a specific time (default: 4:00 AM EST) that often establishes key levels for the trading day.
## Core Methodology & Technical Implementation
**Single Candle Isolation:**
- Captures OHLC data from one specific minute within pre-market hours (user configurable)
- Differentiates between the candle's body (open/close range) and wicks (high/low extremes)
- Creates four distinct reference levels instead of traditional session high/low boxes
**Dual Box Structure:**
- **Inner Box (Body):** Plots the range between open and close prices of the target candle
- **Outer Boundaries:** Separately plots the high and low of that same candle
- **Visual Differentiation:** Uses different colors and line weights to distinguish body vs. wick levels
**Time-Specific Logic:**
The script uses precise time matching (`hour == boxHour and minute == boxMinute`) to capture data from exactly one candle, rather than aggregating an entire session. This creates four specific price levels:
- Box Top: Higher of open/close (body boundary)
- Box Bottom: Lower of open/close (body boundary)
- Box High: Candle high (wick extreme)
- Box Low: Candle low (wick extreme)
## Why This Approach Differs from Standard Session Boxes
**vs. Full Session Ranges:** Focuses on a single critical minute rather than entire pre-market period
**vs. Traditional S/R:** Creates both body and wick levels from one specific candle
**vs. Opening Range:** Uses pre-market data rather than regular session opening minutes
## Practical Application
The 4:00 AM EST default targets a time when institutional pre-market activity often establishes initial sentiment and key levels. By isolating this specific candle's range:
- **Body levels** often act as initial support/resistance during regular hours
- **Wick extremes** provide broader range boundaries for breakout analysis
- **Precise timing** allows focus on the most statistically relevant pre-market moment
## Technical Considerations
- Requires intraday timeframes (1-minute recommended) to capture specific candle data
- Time settings should match your broker's timezone for accurate candle selection
- Works best on liquid instruments where pre-market activity is meaningful
- The selected candle must exist in your data feed for the levels to plot
## Customization Options
All timing parameters are adjustable:
- Target candle hour and minute
- Pre-market session definition (for context)
- Visual styling for all four level types
This focused approach provides more granular analysis than broad session ranges while maintaining simplicity in execution.
Pure Price Zone Flow🔎 What this indicator is
It’s a price-action-based zone indicator. Unlike moving average systems, this one relies only on:
1. Swing Highs & Swing Lows → The highest and lowest points within a recent lookback period (like "mini support & resistance").
2. ATR (Average True Range) → A volatility measure that expands the zone, making it more adaptive to different market conditions.
3. Breakouts & Retests → When price breaks above a swing high (bullish) or below a swing low (bearish), the indicator marks it and highlights the new trend.
👉 The goal is to spot clean structure shifts and define clear trend zones where traders can position themselves.
________________________________________
⚙️ How it is calculated
1. Swing High & Swing Low
o We look back len candles (default 20).
o Find the highest high (swingHigh) and the lowest low (swingLow) in that window.
o This forms the price range zone.
2. ATR Expansion
o We calculate ATR over the same len.
o Add/subtract it (multiplied by atrMult) to the zone edges to expand them.
o This ensures the zones breathe with volatility (tight in quiet markets, wide in choppy ones).
3. Mid-Zone
o Simply the average of swingHigh and swingLow.
o If price is above mid → bullish bias.
o If below mid → bearish bias.
o This gives us the trend color for candles.
4. Breakouts
o If the close crosses above swingHigh, we mark a bullish breakout with a label.
o If the close crosses below swingLow, we mark a bearish breakdown.
________________________________________
📊 How it helps traders
This indicator helps by:
1. Identifying Structure Shifts
o Many traders watch swing highs/lows for breakouts or reversals.
o This automates the process and visually confirms when structure is broken.
2. Dynamic Zone Trading
o Instead of fixed support/resistance, the ATR expansion adapts to volatility.
o This avoids false signals in high-volatility conditions.
3. Trend Bias at a Glance
o Candle coloring instantly tells you whether price is in bullish or bearish territory relative to the mid-zone.
4. Breakout Confirmation
o The labels show when a breakout has occurred, so traders can react quickly (e.g., enter with trend, wait for retest, or avoid fading moves).
________________________________________
🌍 Markets it works best in
• Crypto (Bitcoin, Ethereum, etc.): Very effective since crypto is breakout-driven and respects swing levels.
• Forex: Good for volatility-adaptive structure analysis, especially in trending pairs.
• Indices (SPX, NASDAQ, DAX, NIFTY): Useful for breakout trading during session opens or key news events.
• Commodities (Gold, Oil, Silver): Works well to define intraday ranges and breakout levels.
⚠️ Less useful in low-volatility, mean-reverting assets (like some penny stocks or sideways ranges), because breakouts may be rare or fake.
________________________________________
💡 How it adds value
• Strips away unnecessary complexity (no lagging averages).
• Focuses directly on what price is doing structurally.
• Adaptive → works across different markets & timeframes.
• Easy visualization → zones, trend coloring, breakout markers.
• Helps traders trade with the flow of the market, instead of guessing tops/bottoms.
________________________________________
👉 In short:
This indicator turns raw price action into clear, actionable zones.
It highlights when the market shifts from balance to breakout, so traders can align with momentum rather than fighting it.
Smarter Money Concepts - Wyckoff Springs & Upthrusts [PhenLabs]📊Smarter Money Concepts - Wyckoff Springs & Upthrusts
Version: PineScript™v6
📌Description
Discover institutional manipulation in real-time with this advanced Wyckoff indicator that detects Springs (accumulation phases) and Upthrusts (distribution phases). It identifies when price tests support or resistance on high volume, followed by a strong recovery, signaling potential reversals where smart money accumulates or distributes positions. This tool solves the common problem of missing these subtle phase transitions, helping traders anticipate trend changes and avoid traps in volatile markets.
By combining volume spike detection, ATR-normalized recovery strength, and a sigmoid probability model, it filters out weak signals and highlights only high-confidence setups. Whether you’re swing trading or day trading, this indicator provides clear visual cues to align with institutional flows, improving entry timing and risk management.
🚀Points of Innovation
Sigmoid-based probability threshold for signal filtering, ensuring only statistically significant Wyckoff patterns trigger alerts
ATR-normalized recovery measurement that adapts to market volatility, unlike static recovery checks in traditional indicators
Customizable volume spike multiplier to distinguish institutional volume from retail noise
Integrated dashboard legend with position and size options for personalized chart visualization
Hidden probability plots for advanced users to analyze underlying math without chart clutter
🔧Core Components
Support/Resistance Calculator: Scans a user-defined lookback period to establish dynamic levels for Spring and Upthrust detection
Volume Spike Detector: Compares current volume to a 10-period SMA, multiplied by a configurable factor to identify significant surges
Recovery Strength Analyzer: Uses ATR to measure price recovery after breaks, normalizing for different market conditions
Probability Model: Applies sigmoid function to combine volume and recovery data, generating a confidence score for each potential signal
🔥Key Features
Spring Detection: Spots accumulation when price dips below support but recovers strongly, helping traders enter longs at potential bottoms
Upthrust Detection: Identifies distribution when price spikes above resistance but falls back, alerting to possible short opportunities at tops
Customizable Inputs: Adjust lookback, volume multiplier, ATR period, and probability threshold to match your trading style and market
Visual Signals: Clear + (green) and - (red) labels on charts for instant recognition of accumulation and distribution phases
Alert System: Triggers notifications for signals and probability thresholds, keeping you informed without constant monitoring
🎨Visualization
Spring Signal: Green upward label (+) below the bar, indicating strong recovery after support break for accumulation
Upthrust Signal: Red downward label (-) above the bar, showing failed breakout above resistance for distribution
Dashboard Legend: Customizable table explaining signals, positioned anywhere on the chart for quick reference
📖Usage Guidelines
Core Settings
Support/Resistance Lookback
Default: 20
Range: 5-50
Description: Sets bars back for S/R levels; lower for recent sensitivity, higher for stable long-term zones – ideal for spotting Wyckoff phases
Volume Spike Multiplier
Default: 1.5
Range: 1.0-3.0
Description: Multiplies 10-period volume SMA; higher values filter to significant spikes, confirming institutional involvement in patterns
ATR for Recovery Measurement
Default: 5
Range: 2-20
Description: ATR period for recovery strength; shorter for volatile markets, longer for smoother analysis of post-break recoveries
Phase Transition Probability Threshold
Default: 0.9
Range: 0.5-0.99
Description: Minimum sigmoid probability for signals; higher for strict filtering, ensuring only high-confidence Wyckoff setups
Display Settings
Dashboard Position
Default: Top Right
Range: Various positions
Description: Places legend table on chart; choose based on layout to avoid overlapping price action
Dashboard Text Size
Default: Normal
Range: Auto to Huge
Description: Adjusts legend text; larger for visibility, smaller for minimal space use
✅Best Use Cases
Swing Trading: Identify Springs for long entries in downtrends turning to accumulation
Day Trading: Catch Upthrusts for short scalps during intraday distribution at resistance
Trend Reversal Confirmation: Use in conjunction with other indicators to validate phase shifts in ranging markets
Volatility Plays: Spot signals in high-volume environments like news events for quick reversals
⚠️Limitations
May produce false signals in low-volume or sideways markets where volume spikes are unreliable
Depends on historical data, so performance varies in unprecedented market conditions or gaps
Probability model is statistical, not predictive, and cannot account for external factors like news
💡What Makes This Unique
Probability-Driven Filtering: Sigmoid model combines multiple factors for superior signal quality over basic Wyckoff detectors
Adaptive Recovery: ATR normalization ensures reliability across assets and timeframes, unlike fixed-threshold tools
User-Centric Design: Tooltips, customizable dashboard, and alerts make it accessible yet powerful for all trader levels
🔬How It Works
Calculate S/R Levels:
Uses the highest high and the lowest low over the lookback period to set dynamic zones
Establishes baseline for detecting breaks in Wyckoff patterns
Detect Breaks and Recovery:
Checks for price breaking support/resistance, then recovering on volume
Measures recovery strength via ATR for volatility adjustment
Apply Probability Model:
Combines volume spike and recovery into a sigmoid function for confidence score
Triggers signal only if above threshold, plotting visuals and alerts
💡Note:
For optimal results, combine with price action analysis and test settings on historical charts. Remember, Wyckoff patterns are most effective in trending markets – use lower probability thresholds for practice, then increase for live trading to focus on high-quality setups.
Live Trading Metrics DashboardReal-Time Trading Data Table for Chart Analysis
This clean and professional dashboard displays essential trading metrics directly on your chart in an easy-to-read table format. Perfect for traders who need quick access to key volatility and momentum data without cluttering their chart with multiple indicators.
Key Metrics Displayed:
IBD Relative Strength (RS):
Professional Formula: Uses Investor's Business Daily methodology
Multi-Timeframe Analysis: Weighted calculation across 3, 6, 9, and 12-month periods
Performance Indicator: Shows how the instrument performs relative to its historical price action
Real-Time Updates: Values update with each bar for current market conditions
1.5 ATR (Average True Range):
Volatility Measurement: 14-period ATR multiplied by 1.5 for extended range analysis
Stop-Loss Placement: Ideal for setting dynamic stop-loss levels
Risk Management: Helps determine appropriate position sizing based on volatility
Breakout Targets: Useful for setting profit targets on breakout trades
1.5 ATR Percentage:
Relative Volatility: Shows 1.5 ATR as a percentage of current price
Cross-Asset Comparison: Enables volatility comparison across different instruments
Position Sizing: Helps calculate risk per trade as percentage of price
Market Context: Understand volatility relative to instrument value
How to Interpret:
Positive IBD RS: Instrument showing strength relative to historical performance
Negative IBD RS: Instrument showing weakness relative to historical performance
Higher ATR Values: Increased volatility, wider stops needed
Higher ATR %: Greater relative volatility for the instrument's price level
Perfect For:
Day traders needing quick volatility reference
Swing traders using IBD methodology
Position traders managing risk with ATR-based stops
Any trader wanting clean, organized data display
Smart Bar Coloring: Tight Closes & Volume BreakoutsAdvanced Bar Coloring Indicator for Price Action and Volume Analysis
This sophisticated indicator automatically colors price bars based on two key market conditions: tight closing ranges and significant volume activity, helping traders quickly identify consolidation periods and potential breakout setups.
Key Features:
Tight Close Detection:
ATR-Based Analysis: Uses 14-period ATR to define "tight" price movement
Dual-Bar Confirmation: Requires both current and previous bar to have closing ranges ≤ 20% of ATR
Consolidation Identification: Highlights periods of reduced volatility that often precede significant moves
Customizable Color: Default amber/orange highlighting for easy visual identification
Volume Breakout Detection:
Multi-Criteria Volume Analysis: Triggers when volume exceeds any of three thresholds:
150% of 20-period volume SMA
150% of recent 3-bar average volume
150% of 50-period volume SMA
Price Action Filter: Requires bullish price action (close > previous close OR close in upper 75% of range)
Smart Volume Handling: Automatically detects and works only with instruments that have volume data
Customizable Color: Default teal highlighting for volume-driven moves
Technical Analysis Applications:
Consolidation Patterns: Identify tight trading ranges before potential breakouts
Volume Confirmation: Spot high-volume moves with supportive price action
Entry Timing: Use tight closes to identify potential accumulation zones
Breakout Validation: Volume-colored bars confirm legitimate breakout attempts
Risk Management: Tight closes often indicate lower immediate volatility
How to Use:
Amber/Orange Bars: Indicate tight closing ranges - potential accumulation or consolidation
Teal Bars: Show significant volume with bullish price action - potential breakout confirmation
Normal Bars: Standard market conditions without special highlighting
Pattern Recognition: Look for clusters of tight closes followed by volume breakouts
Technical Requirements:
Works on any timeframe
Automatically adapts to instruments with or without volume data
Compatible with all chart types and drawing tools
Average True Ranges with IBD RSAdvanced ATR Analysis with IBD Relative Strength
This comprehensive indicator combines Average True Range (ATR) analysis with IBD (Investor's Business Daily) Relative Strength calculation, providing both volatility measurement and momentum analysis in one powerful tool.
Key Features:
ATR Analysis:
Standard ATR: Customizable period (default 14) with multiple smoothing options
1.5x ATR: Extended range for wider stop-loss and target calculations
Smoothing Options: Choose between RMA, SMA, EMA, or WMA for ATR calculation
Customizable Colors: Distinct colors for easy visual identification
IBD Relative Strength:
Professional RS Formula: Uses the same calculation method as Investor's Business Daily
Multi-Timeframe Analysis: Compares current price to 3, 6, 9, and 12-month performance
Weighted Calculation: 40% weight on 3-month, 20% each on 6, 9, and 12-month performance
Zero-Based Scale: Values above 0 indicate outperformance, below 0 indicate underperformance
Trading Applications:
Volatility-Based Stops: Use ATR and 1.5x ATR for dynamic stop-loss placement
Position Sizing: ATR helps determine appropriate position size based on volatility
Relative Strength Analysis: IBD RS identifies stocks with superior momentum
Market Timing: High RS values often precede strong price moves
Risk Management: Combine volatility (ATR) with momentum (RS) for comprehensive analysis
Technical Details:
ATR Calculation: True Range smoothed over selected period with chosen method
IBD RS Formula: (40% × 3M) + (20% × 6M) + (20% × 9M) + (20% × 12M) - 100
Display: Separate pane indicator with customizable colors for each component
How to Interpret:
High ATR: Increased volatility, wider stops needed
Low ATR: Reduced volatility, tighter stops possible
Positive IBD RS: Stock outperforming market over measured periods
Negative IBD RS: Stock underperforming market over measured periods
Customizable Parameters:
ATR calculation length
Smoothing method for ATR
Individual colors for ATR, 1.5x ATR, and IBD RS lines
Perfect for swing traders and position traders who want to combine volatility analysis with relative strength momentum in their decision-making process. Particularly useful for stock selection and risk management.
Market Structure: HH/HL/LH/LL (v6, simple)What it does
Labels swing High/Low and classifies structure as HH / HL / LH / LL after confirmation.
Uses confirmed fractals (pivothigh/pivotlow) → no repaint after confirmation (there is a right-bar confirmation delay).
Optional swing connectors (lines), optional plain H/L when structure label is not applicable.
Plots last confirmed High/Low levels as reference.
Alerts when a new HH/HL/LH/LL is formed.
How it works
Swings are detected with ta.pivothigh() / ta.pivotlow() using user-defined left and right.
A pivot is confirmed only after right bars on the right—this is the only delay. Once confirmed, the label does not repaint.
Inputs
Left bars & Right bars – fractal sensitivity.
Connect swings with lines – draw lines between consecutive swings.
Show bullish (HH/HL) / Show bearish (LH/LL) – filter what to display.
Show plain H/L – draw H/L when classification is not HH/HL/LH/LL yet.
Recommended settings
1H–4H: left=2, right=2 (responsive).
1D+: left=3, right=3 (cleaner swing map).
Alerts provided
HH formed – new Higher High confirmed.
HL formed – new Higher Low confirmed.
LH formed – new Lower High confirmed.
LL formed – new Lower Low confirmed.
Use them to automate structure tracking or feed your strategy rules.
Tips
Trend up: a sequence of HH + HL; Trend down: LH + LL.
Combine with VWAP/EMA, liquidity zones, or volume/CVD to avoid chasing late signals.
The script is intentionally simple and lightweight; BOS/CHoCH can be added in a future update.
Limitations / Notes
Because the tool relies on confirmed pivots, signals are delayed by right bars.
This is not financial advice and not a buy/sell system on its own.
Changelog
v1.0 – Initial public release (Pine v6). Structure labels, swing connectors, last levels, and alert set.
Keywords
market structure, hh hl lh ll, swing, fractal, pivothigh, pivotlow, trend, structure labels, price action
SPX → NQ Levels ConverterSPX → NQ Levels Converter is a Pine Script indicator that projects key S&P 500 (SPX) levels onto the NASDAQ 100 (NQ) chart using a configurable conversion ratio.
• Dynamic ratio: calculates the live SPX/NQ ratio in real time.
• Static ratio: allows manual input of a fixed ratio.
• Supports up to 10 custom SPX levels, automatically converted into their equivalent NQ values.
• Each level is displayed with a line and label (SPX → NQ) with independent color settings.
• Advanced visualization controls:
• line extension (right, left, both, or fixed)
• line length & placement
• label side & offset.
• Lines and labels auto-update on every bar to stay accurate over time.
Use case: particularly useful for traders who track SPX option levels or support/resistance zones but execute trades on the NQ.
FlowShift OscillatorFlowShift Oscillator
Overview
The FlowShift Oscillator is a sophisticated momentum indicator designed to capture short-term shifts in market strength, identify trend acceleration, and highlight potential reversals. Combining baseline trend analysis with normalized momentum displacement and volatility-adjusted thresholds, FlowShift provides traders with a responsive, adaptive, and visually intuitive tool suitable for multiple timeframes and asset classes. Whether used for intraday scalping or longer-term trend following, FlowShift helps traders make informed decisions with precision and confidence.
Features
Customizable Baseline Moving Average : Select from SMA, EMA, SMMA (RMA), WMA, or VWMA to define the underlying trend. Adjustable length allows for tuning to specific market conditions.
Normalized Momentum Calculation : Measures price displacement relative to the baseline MA, removing minor fluctuations while preserving meaningful momentum shifts.
Volatility-Adjusted Thresholds : Dynamic upper and lower bounds adapt to market volatility, helping identify overextended bullish or bearish conditions.
Optional Signal Markers : Buy/Sell triangles indicate potential turning points when momentum reaches critical levels, aiding trade timing and decision-making.
Visual Enhancements : Customizable area fills, line colors, and optional candle tinting allow traders to quickly interpret momentum, bias, and trend direction.
Flexible Timeframe Compatibility : Effective across all timeframes, from 1-minute intraday charts to daily and weekly analysis.
How It Works
FlowShift calculates the displacement of price from a baseline moving average to identify deviations from the prevailing trend. This displacement is normalized and smoothed using exponential moving averages, producing a clean oscillator line that highlights genuine momentum changes. The oscillator’s dynamic thresholds are determined by a percentile of recent absolute values, providing an adaptive reference for extreme conditions in both bullish and bearish markets.
Signals
Buy Signal : Triggered when the oscillator crosses above prior lows in an oversold region, suggesting potential upward momentum.
Sell Signal : Triggered when the oscillator crosses below prior highs in an overbought region, indicating potential downward momentum.
Signals are optional and can be displayed as triangles on the chart to clearly mark potential entry and exit points.
Visual Interpretation
FlowShift Line & Area : The oscillator line and area highlight momentum direction and intensity. Upward momentum is shown in green tones, downward momentum in red.
Baseline MA & Glow : Displays the selected baseline moving average with optional glow for trend reference.
Candle Tinting : Optionally tints bars based on the baseline MA bias, providing an at-a-glance view of market sentiment.
Usage Notes
FlowShift is best used in conjunction with other trend confirmation tools or support/resistance analysis.
Dynamic thresholds help identify potential reversal points, but traders should consider overall market context and not rely solely on signals.
Customize the baseline MA type and length to fit your trading style; shorter lengths increase sensitivity, while longer lengths provide smoother trend representation.
Use the optional signal markers as guidance for trade timing, combining with risk management strategies for optimal results.
Conclusion
FlowShift Oscillator delivers a powerful, adaptive, and visually intuitive approach to momentum analysis. By combining baseline trend assessment, normalized momentum, and dynamic volatility scaling, it enables traders to anticipate market shifts, spot trend accelerations, and make timely trading decisions across a wide range of markets and timeframes.
Deviation from Mid MA5 & MA10 (%)Title:
Deviation from Mid-Price MA5 & MA10 (%)
Description:
This script calculates and displays the percentage deviation of the current mid-price from its 5-day and 10-day simple moving averages.
The mid-price is defined as the average of the open and close prices: (Open + Close) / 2
Instead of relying on traditional close-based MAs, this version uses mid-price to better reflect actual price flow by incorporating both the opening and closing values.
Main features:
Displays % deviation from both 5-day and 10-day mid-price moving averages
Better alignment with intraday reality due to gap-sensitive mid-price base
Smooths out erratic closing spikes for clearer signals
Helps identify overextended moves and potential pullback zones
Included lines:
Deviation from 5-day Mid MA
Deviation from 10-day Mid MA
Zero baseline for reference
Recommended for:
Traders seeking a cleaner measure of price deviation
Short-term pullback or re-entry strategy users
Anyone analyzing steady, low-volatility uptrends
Buy Sell Volume with delta value📄 Script Description
This indicator decomposes total traded volume into buying and selling volume, and displays their relative ratios.
🔎 Key Features
Buying vs. Selling Volume Separation
Uses the candle’s high, low, and close to split total volume into buying volume and selling volume.
Formula:
Buy = volume * (close - low) / (high - low)
Sell = volume * (high - close) / (high - low)
Volume Histogram Visualization
Plots overall volume (upper/lower) and separated buy/sell volumes as color-coded columns.
UPPER V / LOWER V: total volume
BUY V: buying volume (teal)
SELL V: selling volume (red)
Buy/Sell Ratio Calculation
Computes the percentage of buy and sell volume relative to total volume.
Buy Ratio = buyVolume / totalVolume * 100
Sell Ratio = sellVolume / totalVolume * 100
Ratio Display
Shows the latest Buy Ratio in a table (top-right corner of the chart).
Adds a label above the most recent bar displaying:
"Buy XX% / Sell YY%"
Historical ratios can be inspected through the TradingView Data Window or tooltip.
🛠️ Usage
Quickly identify whether volume during each candle is dominated by buyers or sellers.
Helps to assess market pressure and confirm potential trend direction, entries, or exits.
⚠️ Notes
Labels are shown only on the most recent bar (Pine cannot track mouse cursor events).
To see historical values, use the TradingView Data Window or hover tooltips.
This method provides an approximate split of volume and does not perfectly capture all market order flows.
Auto-Fit Growth Trendline# **Theoretical Algorithmic Principles of the Auto-Fit Growth Trendline (AFGT)**
## **🎯 What Does This Algorithm Do?**
The Auto-Fit Growth Trendline is an advanced technical analysis system that **automates the identification of long-term growth trends** and **projects future price levels** based on historical cyclical patterns.
### **Primary Functionality:**
- **Automatically detects** the most significant lows in regular periods (monthly, quarterly, semi-annually, annually)
- **Constructs a dynamic trendline** that connects these historical lows
- **Projects the trend into the future** with high mathematical precision
- **Generates Fibonacci bands** that act as dynamic support and resistance levels
- **Automatically adapts** to different timeframes and market conditions
### **Strategic Purpose:**
The algorithm is designed to identify **fundamental value zones** where price has historically found support, enabling traders to:
- Identify optimal entry points for long positions
- Establish realistic price targets based on mathematical projections
- Recognize dynamic support and resistance levels
- Anticipate long-term price movements
---
## **🧮 Core Mathematical Foundations**
### **Adaptive Temporal Segmentation Theory**
The algorithm is based on **dynamic temporal partition theory**, where time is divided into mathematically coherent uniform intervals. It uses modular transformations to create bijective mappings between continuous timestamps and discrete periods, ensuring each temporal point belongs uniquely to a specific period.
**What does this achieve?** It allows the algorithm to automatically identify natural market cycles (annual, quarterly, etc.) without manual intervention, adapting to the inherent periodicity of each asset.
The temporal mapping function implements a **discrete affine transformation** that normalizes different frequencies (monthly, quarterly, semi-annual, annual) to a space of unique identifiers, enabling consistent cross-temporal comparative analysis.
---
## **📊 Local Extrema Detection Theory**
### **Multi-Point Retrospective Validation Principle**
Local minima detection is founded on **relative extrema theory with sliding window**. Instead of using a simple minimum finder, it implements a cross-validation system that examines the persistence of the extremum across multiple historical periods.
**What problem does this solve?** It eliminates false minima caused by temporal volatility, identifying only those points that represent true historical support levels with statistical significance.
This approach is based on the **statistical confirmation principle**, where a minimum is only considered valid if it maintains its extremum condition during a defined observation period, significantly reducing false positives caused by transitory volatility.
---
## **🔬 Robust Interpolation Theory with Outlier Control**
### **Contextual Adaptive Interpolation Model**
The mathematical core uses **piecewise linear interpolation with adaptive outlier correction**. The key innovation lies in implementing a **contextual anomaly detector** that identifies not only absolute extreme values, but relative deviations to the local context.
**Why is this important?** Financial markets contain extreme events (crashes, bubbles) that can distort projections. This system identifies and appropriately weights them without completely eliminating them, preserving directional information while attenuating distortions.
### **Implicit Bayesian Smoothing Algorithm**
When an outlier is detected (deviation >300% of local average), the system applies a **simplified Kalman filter** that combines the current observation with a local trend estimation, using a weight factor that preserves directional information while attenuating extreme fluctuations.
---
## **📈 Stabilized Extrapolation Theory**
### **Exponential Growth Model with Dampening**
Extrapolation is based on a **modified exponential growth model with progressive dampening**. It uses multiple historical points to calculate local growth ratios, implements statistical filtering to eliminate outliers, and applies a dampening factor that increases with extrapolation distance.
**What advantage does this offer?** Long-term projections in finance tend to be exponentially unrealistic. This system maintains short-to-medium term accuracy while converging toward realistic long-term projections, avoiding the typical "exponential explosions" of other methods.
### **Asymptotic Convergence Principle**
For long-term projections, the algorithm implements **controlled asymptotic convergence**, where growth ratios gradually converge toward pre-established limits, avoiding unrealistic exponential projections while preserving short-to-medium term accuracy.
---
## **🌟 Dynamic Fibonacci Projection Theory**
### **Continuous Proportional Scaling Model**
Fibonacci bands are constructed through **uniform proportional scaling** of the base curve, where each level represents a linear transformation of the main curve by a constant factor derived from the Fibonacci sequence.
**What is its practical utility?** It provides dynamic resistance and support levels that move with the trend, offering price targets and profit-taking points that automatically adapt to market evolution.
### **Topological Preservation Principle**
The system maintains the **topological properties** of the base curve in all Fibonacci projections, ensuring that spatial and temporal relationships are consistently preserved across all resistance/support levels.
---
## **⚡ Adaptive Computational Optimization**
### **Multi-Scale Resolution Theory**
It implements **automatic multi-resolution analysis** where data granularity is dynamically adjusted according to the analysis timeframe. It uses the **adaptive Nyquist principle** to optimize the signal-to-noise ratio according to the temporal observation scale.
**Why is this necessary?** Different timeframes require different levels of detail. A 1-minute chart needs more granularity than a monthly one. This system automatically optimizes resolution for each case.
### **Adaptive Density Algorithm**
Calculation point density is optimized through **adaptive sampling theory**, where calculation frequency is adjusted according to local trend curvature and analysis timeframe, balancing visual precision with computational efficiency.
---
## **🛡️ Robustness and Fault Tolerance**
### **Graceful Degradation Theory**
The system implements **multi-level graceful degradation**, where under error conditions or insufficient data, the algorithm progressively falls back to simpler but reliable methods, maintaining basic functionality under any condition.
**What does this guarantee?** That the indicator functions consistently even with incomplete data, new symbols with limited history, or extreme market conditions.
### **State Consistency Principle**
It uses **mathematical invariants** to guarantee that the algorithm's internal state remains consistent between executions, implementing consistency checks that validate data structure integrity in each iteration.
---
## **🔍 Key Theoretical Innovations**
### **A. Contextual vs. Absolute Outlier Detection**
It revolutionizes traditional outlier detection by considering not only the absolute magnitude of deviations, but their relative significance within the local context of the time series.
**Practical impact:** It distinguishes between legitimate market movements and technical anomalies, preserving important events like breakouts while filtering noise.
### **B. Extrapolation with Weighted Historical Memory**
It implements a memory system that weights different historical periods according to their relevance for current prediction, creating projections more adaptable to market regime changes.
**Competitive advantage:** It automatically adapts to fundamental changes in asset dynamics without requiring manual recalibration.
### **C. Automatic Multi-Timeframe Adaptation**
It develops an automatic temporal resolution selection system that optimizes signal extraction according to the intrinsic characteristics of the analysis timeframe.
**Result:** A single indicator that functions optimally from 1-minute to monthly charts without manual adjustments.
### **D. Intelligent Asymptotic Convergence**
It introduces the concept of controlled asymptotic convergence in financial extrapolations, where long-term projections converge toward realistic limits based on historical fundamentals.
**Added value:** Mathematically sound long-term projections that avoid the unrealistic extremes typical of other extrapolation methods.
---
## **📊 Complexity and Scalability Theory**
### **Optimized Linear Complexity Model**
The algorithm maintains **linear computational complexity** O(n) in the number of historical data points, guaranteeing scalability for extensive time series analysis without performance degradation.
### **Temporal Locality Principle**
It implements **temporal locality**, where the most expensive operations are concentrated in the most relevant temporal regions (recent periods and near projections), optimizing computational resource usage.
---
## **🎯 Convergence and Stability**
### **Probabilistic Convergence Theory**
The system guarantees **probabilistic convergence** toward the real underlying trend, where projection accuracy increases with the amount of available historical data, following **law of large numbers** principles.
**Practical implication:** The more history an asset has, the more accurate the algorithm's projections will be.
### **Guaranteed Numerical Stability**
It implements **intrinsic numerical stability** through the use of robust floating-point arithmetic and validations that prevent overflow, underflow, and numerical error propagation.
**Result:** Reliable operation even with extreme-priced assets (from satoshis to thousand-dollar stocks).
---
## **💼 Comprehensive Practical Application**
**The algorithm functions as a "financial GPS"** that:
1. **Identifies where we've been** (significant historical lows)
2. **Determines where we are** (current position relative to the trend)
3. **Projects where we're going** (future trend with specific price levels)
4. **Provides alternative routes** (Fibonacci bands as alternative targets)
This theoretical framework represents an innovative synthesis of time series analysis, approximation theory, and computational optimization, specifically designed for long-term financial trend analysis with robust and mathematically grounded projections.
Support Vs Reward RvCSupport Vs Reward RvC
The Support Vs Reward RvC indicator is a simple yet effective tool that analyzes candle strength relative to both price movement and trading volume. Highlights candles where both body size and volume expand or contract, helping traders spot momentum shifts and weakening moves.
📌 How it works:
- “C” expect a Continuation of Trend in the next one or two candles;
- “R” expect a Reverse of Trend in the next one or two candles.
Works well on bigger time candles like 10-15 minutes but also gives important info in day-trading or scalping.
Marks candles where both body size and volume increase or decrease, making momentum shifts easy to spot. This smart candle analyzer reveals momentum surges and fading moves through body size and volume dynamics.
It compares each candle’s body size (open-to-close range) and its volume against the previous candle.
If both the body and volume are greater than the previous candle, a green “C” from Continuation of Trend is displayed under the bar.
If both the body and volume are smaller than the previous candle, a red “R” from Reverse of Trend is displayed under the bar.
Custom filters allow users to ignore insignificant moves by setting a minimum body size (as % of price) and a minimum volume threshold.
📌 Use cases:
Spot momentum shifts when price and volume expand together.
Identify weakening moves when both price action and volume contract.
Can be combined with other strategies for confirmation of entries or exits.
⚙️ Inputs:
Minimum Body Size % (of price): Filters out small candles.
Minimum Volume: Ensures only significant moves are marked.
This indicator is best used as a confirmation tool within a larger trading strategy, rather than as a standalone buy/sell signal.
Market Outlook Score (MOS)Overview
The "Market Outlook Score (MOS)" is a custom technical indicator designed for TradingView, written in Pine Script version 6. It provides a quantitative assessment of market conditions by aggregating multiple factors, including trend strength across different timeframes, directional movement (via ADX), momentum (via RSI changes), volume dynamics, and volatility stability (via ATR). The MOS is calculated as a weighted score that ranges typically between -1 and +1 (though it can exceed these bounds in extreme conditions), where positive values suggest bullish (long) opportunities, negative values indicate bearish (short) setups, and values near zero imply neutral or indecisive markets.
This indicator is particularly useful for traders seeking a holistic "outlook" score to gauge potential entry points or market bias. It overlays on a separate pane (non-overlay mode) and visualizes the score through horizontal threshold lines and dynamic labels showing the numeric MOS value along with a simple trading decision ("Long", "Short", or "Neutral"). The script avoids using the plot function for compatibility reasons (e.g., potential TradingView bugs) and instead relies on hline for static lines and label.new for per-bar annotations.
Key features:
Multi-Timeframe Analysis: Incorporates slope data from 5-minute, 15-minute, and 30-minute charts to capture short-term trends.
Trend and Strength Integration: Uses ADX to weight trend bias, ensuring stronger signals in trending markets.
Momentum and Volume: Includes RSI momentum impulses and volume deviations for added confirmation.
Volatility Adjustment: Factors in ATR changes to assess market stability.
Customizable Inputs: Allows users to tweak periods for lookback, ADX, and ATR.
Decision Labels: Automatically classifies the MOS into actionable categories with visual labels.
This indicator is best suited for intraday or swing trading on volatile assets like stocks, forex, or cryptocurrencies. It does not generate buy/sell signals directly but can be combined with other tools (e.g., moving averages or oscillators) for comprehensive strategies.
Inputs
The script provides three user-configurable inputs via TradingView's input panel:
Lookback Period (lookback):
Type: Integer
Default: 20
Range: Minimum 10, Maximum 50
Purpose: Defines the number of bars used in slope calculations for trend analysis. A shorter lookback makes the indicator more sensitive to recent price action, while a longer one smooths out noise for longer-term trends.
ADX Period (adxPeriod):
Type: Integer
Default: 14
Range: Minimum 5, Maximum 30
Purpose: Sets the smoothing period for the Average Directional Index (ADX) and its components (DI+ and DI-). Standard value is 14, but shorter periods increase responsiveness, and longer ones reduce false signals.
ATR Period (atrPeriod):
Type: Integer
Default: 14
Range: Minimum 5, Maximum 30
Purpose: Determines the period for the Average True Range (ATR) calculation, which measures volatility. Adjust this to match your trading timeframe—shorter for scalping, longer for positional trading.
These inputs allow customization without editing the code, making the indicator adaptable to different market conditions or user preferences.
Core Calculations
The MOS is computed through a series of steps, blending trend, momentum, volume, and volatility metrics. Here's a breakdown:
Multi-Timeframe Slopes:
The script fetches data from higher timeframes (5m, 15m, 30m) using request.security.
Slope calculation: For each timeframe, it computes the linear regression slope of price over the lookback period using the formula:
textslope = correlation(close, bar_index, lookback) * stdev(close, lookback) / stdev(bar_index, lookback)
This measures the rate of price change, where positive slopes indicate uptrends and negative slopes indicate downtrends.
Variables: slope5m, slope15m, slope30m.
ATR (Average True Range):
Calculated using ta.atr(atrPeriod).
Represents average volatility over the specified period. Used later to derive volatility stability.
ADX (Average Directional Index):
A detailed, manual implementation (not using built-in ta.adx for customization):
Computes upward movement (upMove = high - high ) and downward movement (downMove = low - low).
Derives +DM (Plus Directional Movement) and -DM (Minus Directional Movement) by filtering non-relevant moves.
Smooths true range (trur = ta.rma(ta.tr(true), adxPeriod)).
Calculates +DI and -DI: plusDI = 100 * ta.rma(plusDM, adxPeriod) / trur, similarly for minusDI.
DX: dx = 100 * abs(plusDI - minusDI) / max(plusDI + minusDI, 0.0001).
ADX: adx = ta.rma(dx, adxPeriod).
ADX values above 25 typically indicate strong trends; here, it's normalized (divided by 50) to influence the trend bias.
Volume Delta (5m Timeframe):
Fetches 5m volume: volume_5m = request.security(syminfo.tickerid, "5", volume, lookahead=barmerge.lookahead_on).
Computes a 12-period SMA of volume: avgVolume = ta.sma(volume_5m, 12).
Delta: (volume_5m - avgVolume) / avgVolume (or 0 if avgVolume is zero).
This measures relative volume spikes, where positive deltas suggest increased interest (bullish) and negative suggest waning activity (bearish).
MOS Components and Final Calculation:
Trend Bias: Average of the three slopes, normalized by close price and scaled by 100, then weighted by ADX influence: (slope5m + slope15m + slope30m) / 3 / close * 100 * (adx / 50).
Emphasizes trends in strong ADX conditions.
Momentum Impulse: Change in 5m RSI(14) over 1 bar, divided by 50: ta.change(request.security(syminfo.tickerid, "5", ta.rsi(close, 14), lookahead=barmerge.lookahead_on), 1) / 50.
Captures short-term momentum shifts.
Volatility Clarity: 1 - ta.change(atr, 1) / max(atr, 0.0001).
Measures ATR stability; values near 1 indicate low volatility changes (clearer trends), while lower values suggest erratic markets.
MOS Formula: Weighted average:
textmos = (0.35 * trendBias + 0.25 * momentumImpulse + 0.2 * volumeDelta + 0.2 * volatilityClarity)
Weights prioritize trend (35%) and momentum (25%), with volume and volatility at 20% each. These can be adjusted in code for experimentation.
Trading Decision:
A variable mosDecision starts as "Neutral".
If mos > 0.15, set to "Long".
If mos < -0.15, set to "Short".
Thresholds (0.15 and -0.15) are hardcoded but can be modified.
Visualization and Outputs
Threshold Lines (using hline):
Long Threshold: Horizontal dashed green line at +0.15.
Short Threshold: Horizontal dashed red line at -0.15.
Neutral Line: Horizontal dashed gray line at 0.
These provide visual reference points for MOS interpretation.
Dynamic Labels (using label.new):
Placed at each bar's index and MOS value.
Text: Formatted MOS value (e.g., "0.2345") followed by a newline and the decision (e.g., "Long").
Style: Downward-pointing label with gray background and white text for readability.
This replaces a traditional plot line, showing exact values and decisions per bar without cluttering the chart.
The indicator appears in a separate pane below the main price chart, making it easy to monitor alongside price action.
Usage Instructions
Adding to TradingView:
Copy the script into TradingView's Pine Script editor.
Save and add to your chart via the "Indicators" menu.
Select a symbol and timeframe (e.g., 1-minute for intraday).
Interpretation:
Long Signal: MOS > 0.15 – Consider bullish positions if supported by other indicators.
Short Signal: MOS < -0.15 – Potential bearish setups.
Neutral: Between -0.15 and 0.15 – Avoid trades or wait for confirmation.
Watch for MOS crossings of thresholds for momentum shifts.
Combine with price patterns, support/resistance, or volume for better accuracy.
Limitations and Considerations:
Lookahead Bias: Uses barmerge.lookahead_on for multi-timeframe data, which may introduce minor forward-looking bias in backtesting (use with caution).
No Alerts Built-In: Add custom alerts via TradingView's alert system based on MOS conditions.
Performance: Tested for compatibility; may require adjustments for illiquid assets or extreme volatility.
Backtesting: Use TradingView's strategy tester to evaluate historical performance, but remember past results don't guarantee future outcomes.
Customization: Edit weights in the MOS formula or thresholds to fit your strategy.
This indicator distills complex market data into a single score, aiding decision-making while encouraging users to verify signals with additional analysis. If you need modifications, such as restoring plot functionality or adding features, provide details for further refinement.
MMA, Mid-Price Moving Averages (Open + Close Based MAs)📝 Script Description
This script introduces a custom set of moving averages based on the mid-price, calculated as the average of the open and close prices:
Mid Price = (Open + Close) / 2
Instead of traditional close-based MAs, this approach reflects the average sentiment throughout the trading session, offering a smoother and more realistic view of price action.
🔍 Key Features:
✅ Gap-aware smoothing
Captures opening gaps, offering a better representation of intraday shifts.
✅ Reduced noise
Less vulnerable to sharp closing moves or one-off spikes, making it easier to identify true trend breaks or supports.
✅ Closer to actual flow
Reflects a more natural midline of price movement, ideal for traders who prioritize clean, sustained trends.
✅ Better support/resistance alignment
Especially useful for identifying stable uptrends and minimizing false breakout signals.
📐 Included Moving Averages:
MA 5
MA 10
MA 20
MA 60
MA 120
MA 200
(All based on mid-price, not close)
🎯 Recommended For:
Traders seeking smoother and more reliable trendlines
Those who want a more realistic depiction of support and resistance
Ideal for filtering out noisy movements while focusing on clean, straight-moving charts
VWAP For Loop [BackQuant]VWAP For Loop
What this tool does—in one sentence
A volume-weighted trend gauge that anchors VWAP to a calendar period (day/week/month/quarter/year) and then scores the persistence of that VWAP trend with a simple for-loop “breadth” count; the result is a clean, threshold-driven oscillator plus an optional VWAP overlay and alerts.
Plain-English overview
Instead of judging raw price alone, this indicator focuses on anchored VWAP —the market’s average price paid during your chosen institutional period. It then asks a simple question across a configurable set of lookback steps: “Is the current anchored VWAP higher than it was i bars ago—or lower?” Each “yes” adds +1, each “no” adds −1. Summing those answers creates a score that reflects how consistently the volume-weighted trend has been rising or falling. Extreme positive scores imply persistent, broad strength; deeply negative scores imply persistent weakness. Crossing predefined thresholds produces objective long/short events and color-coded context.
Under the hood
• Anchoring — VWAP using hlc3 × volume resets exactly when the selected period rolls:
Day → session change, Week → new week, Month → new month, Quarter/Year → calendar quarter/year.
• For-loop scoring — For lag steps i = , compare today’s VWAP to VWAP .
– If VWAP > VWAP , add +1.
– Else, add −1.
The final score ∈ , where N = (end − start + 1). With defaults (1→45), N = 45.
• Signal logic (stateful)
– Long when score > upper (e.g., > 40 with N = 45 → VWAP higher than ~89% of checked lags).
– Short on crossunder of lower (e.g., dropping below −10).
– A compact state variable ( out ) holds the current regime: +1 (long), −1 (short), otherwise unchanged. This “stickiness” avoids constant flipping between bars without sufficient evidence.
Why VWAP + a breadth score?
• VWAP aggregates both price and volume—where participants actually traded.
• The breadth-style count rewards consistency of the anchored trend, not one-off spikes.
• Thresholds give you binary structure when you need it (alerts, automation), without complex math.
What you’ll see on the chart
• Sub-pane oscillator — The for-loop score line, colored by regime (long/short/neutral).
• Main-pane VWAP (optional) — Even though the indicator runs off-chart, the anchored VWAP can be overlaid on price (toggle visibility and whether it inherits trend colors).
• Threshold guides — Horizontal lines for the long/short bands (toggle).
• Cosmetics — Optional candle painting and background shading by regime; adjustable line width and colors.
Input map (quick reference)
• VWAP Anchor Period — Day, Week, Month, Quarter, Year.
• Calculation Start/End — The for-loop lag window . With 1→45, you evaluate 45 comparisons.
• Long/Short Thresholds — Default upper=40, lower=−10 (asymmetric by design; see below).
• UI/Style — Show thresholds, paint candles, background color, line width, VWAP visibility and coloring, custom long/short colors.
Interpreting the score
• Near +N — Current anchored VWAP is above most historical VWAP checkpoints in the window → entrenched strength.
• Near −N — Current anchored VWAP is below most checkpoints → entrenched weakness.
• Between — Mixed, choppy, or transitioning regimes; use thresholds to avoid reacting to noise.
Why the asymmetric default thresholds?
• Long = score > upper (40) — Demands unusually broad upside persistence before declaring “long regime.”
• Short = crossunder lower (−10) — Triggers only on downward momentum events (a fresh breach), not merely being below −10. This combination tends to:
– Capture sustained uptrends only when they’re very strong.
– Flag downside turns as they occur, rather than waiting for an extreme negative breadth.
Tuning guide
Choose an anchor that matches your horizon
– Intraday scalps : Day anchor on intraday charts.
– Swing/position : Month or Quarter anchor on 1h/4h/D charts to capture institutional cycles.
Pick the for-loop window
– Larger N (bigger end) = stronger evidence requirement, smoother oscillator.
– Smaller N = faster, more reactive score.
Set achievable thresholds
– Ensure upper ≤ N and lower ≥ −N ; if N=30, an upper of 40 can never trigger.
– Symmetric setups (e.g., +20/−20) are fine if you want balanced behavior.
Match visuals to intent
– Enabling VWAP coloring lets you see regime directly on price.
– Background shading is useful for discretionary reading; turn it off for cleaner automation displays.
Playbook examples
• Trend confirmation with disciplined entries — On Month anchor, N=45, upper=38–42: when the long regime engages, use pullbacks toward anchored VWAP on the main pane for entries, with stops just beyond VWAP or a recent swing.
• Downside transition detection — Keep lower around −8…−12 and watch for crossunders; combine with price losing anchored VWAP to validate risk-off.
• Intraday bias filter — Day anchor on a 5–15m chart, N=20–30, upper ~ 16–20, lower ~ −6…−10. Only take longs while score is positive and above a midline you define (e.g., 0), and shorts only after a genuine crossunder.
Behavior around resets (important)
Anchored VWAP is hard-reset each period. Immediately after a reset, the series can be young and comparisons to pre-reset values may span two periods. If you prefer within-period evaluation only, choose end small enough not to bridge typical period length on your timeframe, or accept that the breadth test intentionally spans regimes.
Alerts included
• VWAP FL Long — Fires when the long condition is true (score > upper and not in short).
• VWAP FL Short — Fires on crossunder of the lower threshold (event-driven).
Messages include {{ticker}} and {{interval}} placeholders for routing.
Strengths
• Simple, transparent math — Easy to reason about and validate.
• Volume-aware by construction — Decisions reference VWAP, not just price.
• Robust to single-bar noise — Needs many lags to agree before flipping state (by design, via thresholds and the stateful output).
Limitations & cautions
• Threshold feasibility — If N < upper or |lower| > N, signals will never trigger; always cross-check N.
• Path dependence — The state variable persists until a new event; if you want frequent re-evaluation, lower thresholds or reduce N.
• Regime changes — Calendar resets can produce early ambiguity; expect a few bars for the breadth to mature.
• VWAP sensitivity to volume spikes — Large prints can tilt VWAP abruptly; that behavior is intentional in VWAP-based logic.
Suggested starting profiles
• Intraday trend bias : Anchor=Day, N=25 (1→25), upper=18–20, lower=−8, paint candles ON.
• Swing bias : Anchor=Month, N=45 (1→45), upper=38–42, lower=−10, VWAP coloring ON, background OFF.
• Balanced reactivity : Anchor=Week, N=30 (1→30), upper=20–22, lower=−10…−12, symmetric if desired.
Implementation notes
• The indicator runs in a separate pane (oscillator), but VWAP itself is drawn on price using forced overlay so you can see interactions (touches, reclaim/loss).
• HLC3 is used for VWAP price; that’s a common choice to dampen wick noise while still reflecting intrabar range.
• For-loop cap is kept modest (≤50) for performance and clarity.
How to use this responsibly
Treat the oscillator as a bias and persistence meter . Combine it with your entry framework (structure breaks, liquidity zones, higher-timeframe context) and risk controls. The design emphasizes clarity over complexity—its edge is in how strictly it demands agreement before declaring a regime, not in predicting specific turns.
Summary
VWAP For Loop distills the question “How broadly is the anchored, volume-weighted trend advancing or retreating?” into a single, thresholded score you can read at a glance, alert on, and color through your chart. With careful anchoring and thresholds sized to your window length, it becomes a pragmatic bias filter for both systematic and discretionary workflows.
Trading Rules Panel BJTRADESFXA Simple Panel for Your Trading Rules
Trading can quickly get overwhelming if you’re juggling multiple strategies, indicators, and market conditions. A simple Trading Rules Panel on your chart helps you stay disciplined by keeping your strategy visible at all times. Instead of relying on memory or flipping through notes, the panel displays your personal trading checklist right where you need it — on your screen.
The panel can be customized to show:
✅ Entry conditions (e.g., trend direction, candle patterns, breakout levels)
✅ Exit rules (take profit, stop loss, or trailing stop logic)
✅ Risk management (lot size, max risk %, reward-to-risk ratio)
✅ Trading session reminders (only trade London/New York overlap, etc.)
✅ Personal rules (no revenge trading, stop after 2 losses, follow your plan)
This kind of panel doesn’t place trades for you; rather, it acts as a visual reminder to keep you consistent and accountable. It prevents emotional decisions and reinforces your discipline, especially during high-pressure moments.
A well-placed panel can also:
Reduce mistakes caused by forgetting steps
Keep your focus on the bigger picture
Improve backtesting and journaling since your rules are clearly visible
Help new traders stick to structure instead of chasing trades