40 SMA Scaling StrategyThis trend-following strategy focuses on capturing momentum when price breaks above the 40-period Simple Moving Average (SMA) while utilizing a systematic scale-out (Take Profit) approach to lock in gains during extended runs.
Strategy Logic
Entry: Opens a Long position with 100% of current equity when the price closes above the 40 SMA. This ensures maximum capital efficiency at the start of a new perceived trend.
Scaling Take Profits: To reduce risk as the trade progresses, the strategy automatically closes 25% of the initial position for every 1% increase in price from the entry point.
Exit: The entire remaining position is closed immediately if the price closes below the 40 SMA, acting as a trailing stop that adapts to the moving average.
Key Features
Capital-Efficient: Starts with a full account allocation to maximize exposure to the initial breakout.
Systematic De-risking: By scaling out in 25% increments, the strategy banks profits early while leaving a portion of the trade active for potential "moon shots."
Trend-Following Exit: Uses a classic SMA filter to exit, aiming to stay in the trade as long as the medium-term trend remains bullish.
المؤشرات والاستراتيجيات
Multi-Time Period Charts 1W CustomThe Multi-Time Period Charts (MTPC) indicator displays data from higher-timeframe (HTF) bars directly on the chart. It draws color-coded boxes representing HTF ranges based on standard prices or Heikin Ashi values, enabling multi-timeframe bar analysis without the need to change the chart's timeframe or type.
Ali Bin Yahya @pa_4cA simple and clean indicator that combines an Exponential Moving Average (EMA) with a Session-based VWAP that resets daily. It helps traders identify the overall trend and the fair price level during the current trading session.
Ideal for intraday trading, trend confirmation, and spotting dynamic support and resistance levels.
RSI + MACD (RSI Divergence) V3.2
RSI + MACD (RSI Divergence)
This indicator combines RSI divergence detection with a scaled MACD overlay to help traders visualize momentum structure and divergence more clearly in a single pane.
Instead of using RSI and MACD as isolated signals, this script focuses on relative movement, swing structure, and divergence logic, making it especially useful for discretionary traders who analyze momentum behavior rather than fixed indicator levels.
________________________________________
Key Features
RSI Divergence Engine
• Detects Regular Bullish / Bearish Divergence
• Optional Hidden Divergence (for trend continuation)
• Uses confirmed pivot logic (left/right lookback) to avoid repainting
• Adjustable divergence range to filter weak or overly distant signals
RSI is shifted by -50 to center it around zero, allowing better visual alignment with MACD without affecting divergence logic.
________________________________________
Scaled MACD Overlay (Visual Momentum Only)
• MACD, Signal, and Histogram are rescaled dynamically to match the RSI oscillator range
• Designed for wave structure, phase comparison, and momentum timing
• Not intended as a traditional MACD signal generator
• Helps identify momentum agreement or disagreement with RSI divergence
________________________________________
Clean & Practical Design
• Single pane display (no chart clutter)
• Color warnings for RSI overbought / oversold zones
• Adjustable scaling lookback for different markets and timeframes
• Optimized for smooth performance and non-repainting behavior
________________________________________
How to Use
• Best used on indices, crypto, and liquid forex pairs
• Combine RSI divergence signals with:
o Market structure
o Support / resistance
o Trend context
• Use the MACD overlay to:
o Confirm momentum shifts
o Spot early loss of strength
o Compare oscillator phase alignment
This indicator is best suited for analysis and confirmation, not mechanical entry signals.
________________________________________
Notes
• MACD values are scaled for visualization only and do not represent real MACD values
• Divergence signals are confirmation-based, not predictive
• No repainting once pivots are confirmed
________________________________________
Who Is This For?
• Swing traders
• Momentum & divergence traders
• Traders who prefer structure-based confirmation over raw indicator signals
• Anyone who wants RSI & MACD behavior in a single, readable oscillator
Enjoy and happy trading!
DISCLAIMER
This script is intended for informational and educational purposes only. It does not constitute financial, investment, or trading advice. All trading decisions made based on its output are solely the responsibility of the user
%-to-Tick Trailing Stop & VisualizerPercent-to-Tick Trailing Stop (strategy.exit Framework + Visualizer)
Overview
This script focuses on exit management and visualization, not entry performance. The included MA crossover entry is intentionally simple and replaceable.
Core idea (Percent → Tick conversion)
strategy.exit() trailing parameters are tick-based (trail_points, trail_offset, and loss).
This script lets you input distances in percent (%) and converts them into integer ticks using syminfo.mintick, making the same exit logic portable across most tick-based symbols/exchanges with different tick sizes.
//==What it provides==//
1. % → tick conversion for:
- Fixed stop loss (loss)
- Trailing activation distance (trail_points)
- Trailing offset distance (trail_offset)
2. On-chart visualization:
- Entry average price
- Trailing activation threshold
- Fixed stop-loss line
- Trailing stop line (with an exit-bar alignment attempt to reduce gaps)
//==How to use==//
1. Keep the included MA crossover entries, or replace them with your own entries.
2. Configure:
- Fixed Stop Loss % (loss_pct)
- Trailing Activation % (t_points_pct)
- Trailing Offset % (t_offset_pct)
3. Adjust commission/slippage defaults to match your market.
//==Important limitations (must read)==//
- calc_on_every_tick=true recalculates on realtime bars only; historical bars are evaluated differently. Backtests can differ from realtime behavior and may change after reload.
- Tick rounding: percent distances are rounded to integer ticks, so small differences can occur depending on tick size and price level.
- For more realistic intrabar backtesting, consider enabling Bar Magnifier in Strategy Properties (if available).
# Average Entry Price (Basis):
"Calculations are based on the position's average entry price (strategy.position_avg_price)."
# Pine Script v6:
"Written in the latest Pine Script v6."
요약
이 스크립트의 핵심은 “진입 전략”이 아니라 **strategy.exit()의 tick 기반 트레일링 파라미터를 % 입력으로 일반화(%→ticks 변환)**하여, 다양한 심볼/거래소의 서로 다른 tick size 환경에서도 동일한 exit 로직을 재사용할 수 있게 만든 “청산 프레임워크”입니다. 또한 calc_on_every_tick=true 환경에서 트리거/손절/트레일 라인을 실시간에 가깝게 시각화하는 데 중점을 두었습니다.
단, calc_on_every_tick은 실시간 바에서만 틱 단위 재계산이 적용되며, 히스토리 바/백테스트는 평가 방식이 달라 결과가 다를 수 있습니다.
Correlation with BTCIt can be used to observe the correlation between the returns of various assets and Bitcoin.
可用來觀測各資產與比特幣的報酬率相關性
Custom Weekly Volume Profile [Multi-Timeframe]Description: This indicator renders a high-precision Weekly Volume Profile that resets at the start of every trading week. Unlike standard fixed-range profiles, this script builds the profile bar-by-bar using lower timeframe data (e.g., 1-minute or 5-minute data) to ensure accuracy even on higher timeframe charts.
It is designed for traders who track the developing value of the current week (Auction Market Theory) and need specific alerts when price tests the edges of value.
Key Features:
Developing Weekly Profile:
The profile resets automatically at the beginning of the week (Sunday/Monday).
It tracks the Point of Control (POC), Value Area High (VAH), and Value Area Low (VAL) in real-time as the week progresses.
Previous Week Levels:
The script automatically stores the final levels (POC, VAH, VAL) of the previous week and projects them forward. This allows you to trade tests of the prior week's value.
Auto-Scaling Histogram:
Smart Width: The profile starts wider at the beginning of the week (when data is sparse) and automatically shrinks as the week progresses (Thursday/Friday) to keep your chart clean and readable.
Advanced Alerting:
Crossover Alerts: Trigger alerts when price crosses the developing VAH/VAL or the previous week's levels.
Time Window Filter: Includes a session input (default 08:30-15:00) to restrict alerts to specific trading hours, preventing notifications during low-volume overnight sessions.
Customization:
Precision: Adjustable "Row Size" and "Calculation Timeframe" to tune performance vs. accuracy.
Visuals: Full color control over the Value Area, Outer Volume, and Level Lines.
Settings:
Calculation Precision: Determines the lower timeframe used to calculate the volume (e.g., set to "5" for 5-minute precision).
Value Area %: Default is 70%, standard for AMT trading.
Timezone: Adjustable to ensure the weekly reset aligns with your local exchange time (e.g., America/Chicago for CME Futures).
Disclaimer: This script is for educational and informational purposes only. It does not constitute financial advice, trading recommendations, or a solicitation to buy or sell any financial instrument. Trading futures and other financial markets involves significant risk and is not suitable for every investor. Past performance of any trading system or methodology is not necessarily indicative of future results. The user assumes all responsibility for any trading decisions made based on the information provided by this tool. Use at your own risk.
Multi-Factor Long Bias ToolThe Multi Factor Long Bias Tool is designed to highlight periods when multiple bullish conditions align, helping traders identify higher probability long opportunities. By combining trend, momentum, and participation metrics into a unified visual signal, the indicator goes beyond single factor analysis to support more consistent decision making.
Optimized for a 1-hour chart, it integrates four complementary components—MACD momentum, RSI confirmation, volume participation, and optional short interest filtering—to reveal when market conditions collectively favor a long bias rather than isolated upswings.
Core Logic
1. Momentum confirmation with MACD (1 Hour Frame):
The tool uses a fast MACD configuration to capture short term momentum shifts. A bullish MACD state—where the MACD line is above its signal line, above zero, and supported by a positive histogram—indicates that short term momentum exceeds long term trend strength. This alignment reflects sustained upward pressure rather than temporary mean reversion.
2. Relative strength moderation via RSI:
RSI serves as a context filter to avoid extremes. The tool favors an RSI that falls between the oversold and overbought thresholds, typically between 30 and 70. This “healthy momentum zone” identifies when price maintains strength without being overheated, aligning with controlled, directional moves rather than exhaustion.
3. Volume backed participation:
A volume filter confirms whether moves are supported by meaningful market participation. The script compares current daily volume to its 20-day average; only sessions meeting or exceeding a user defined multiple (default: 1×) qualify as high volume days. This ensures momentum signals align with genuine liquidity rather than thin, unreliable activity.
4. Optional short interest condition:
An additional input allows traders to incorporate short interest data, either manually or from external sources. When enabled, the tool verifies that short interest meets a chosen minimum percentage before validating a long bias. This feature is especially useful for setups targeting potential short squeezes or for avoiding markets lacking a meaningful contrarian base.
Signal Interpretation
When MACD momentum, RSI positioning, volume participation, and optional short interest filters align, the chart background softens to green, indicating a “long bias” environment.
If the “Focus on Longs Only” option is active, a small upward triangle marker labeled LONG appears beneath price bars for clear visual confirmation.
Traders can also choose to view MACD, its signal line, histogram, and RSI in a detachable sub panel. This optional visualization makes it easy to inspect alignment between underlying momentum and the on-chart bias signal without cluttering the main price view.
Why These Factors Are Combined
Each component contributes a distinct layer of confirmation:
Momentum + liquidity: Ensures directional strength is backed by solid participation, preventing false breakouts on low volume moves.
RSI moderation: Filters out overextended rallies and unsustainable intraday spikes.
Short interest filter: Adds an optional contrarian check for potential squeeze setups or sentiment imbalance.
Together, these signals improve reliability by demanding agreement across multiple perspectives—trend, momentum, and market depth—before painting a bullish bias.
Practical Use and Tuning
The indicator serves as a bias and timing aid rather than a standalone trading system. It helps discretionary traders focus attention on periods when multiple conditions favor looking for long entries, while leaving exact entry, exit, and risk parameters to individual strategies.
All inputs—including MACD lengths, RSI range, daily volume multiplier, and short interest requirements—are fully adjustable to match various instruments, timeframes, and trading styles.
For instance:
Adjusting MACD lengths fine tunes responsiveness to trend shifts.
Modifying RSI thresholds changes the tolerance for extended momentum.
Raising the volume multiplier demands stronger conviction from market participants.
Visual Cues
Background highlight: Shaded green when all long bias conditions align.
Triangle markers: “LONG” indicators below bars when the tool detects favorable conditions.
Optional chart pane: Displays MACD and RSI for manual confirmation.
Intended Use
This tool assists traders in recognizing when technical, behavioral, and participation factors converge to support long opportunities. It is best used as part of a comprehensive trading process that includes broader context analysis, defined risk management, and confirmation from higher timeframe trends.
All parameters are user configurable for customization across markets and trading approaches. This indicator is for analytical purposes only and does not constitute financial or investment advice.
Key Price Levels + Zones"Support and resistance are rarely exact lines; hey are zones where price reacts."
This indicator upgrades standard horizontal levels by visualizing Liquidity Zones around the most critical intraday reference points: Pre-Market, Previous Day, and Previous Week Highs/Lows.
Unlike basic scripts that just draw thin lines, this tool combines the precision of exact price levels with the reality of market volatility. It offers deep customization, allowing you to separate line colors from zone colors, perfect for keeping your charts clean and professional.
Key Features
1. Dual Zone Logic (Dynamic Sizing)
• Price Tier Mode (Default): Zones are sized based on the asset price (e.g., higher-priced stocks get wider zones automatically). This mimics "psychological" levels.
• ATR Volatility Mode: Switches calculation to use the Average True Range (ATR). Zones expand during high volatility and contract during chop, adapting to the market conditions in real-time.
2. Ultimate Customization
• Separate Colors: You can finally set your Line Color (e.g., Bright Green) independently from your Zone Fill (e.g., Faint Grey).
• Individual Toggles: Turn the Line, Zone, or Label on/off individually for every single level.
• Line Styles: Differentiate daily levels (Solid) from weekly levels (Dashed) instantly.
3. The "Smart" Levels
• PM High/Low: Real-time Pre-Market tracking that freezes at the open.
• PD High/Low: Previous Day’s range.
• PW High/Low: Previous Week’s range (Critical for swing points).
---
Settings Guide
• Extension Style:
- Individual: Keeps history of levels for backtesting.
- Most Recent: Keeps the chart minimal by extending only today's levels.
• Zone Thickness Mode: Switch between "Price Tier" and "ATR Volatility".
• ATR Settings: Fully adjustable Length and Multiplier (when in ATR mode).
• Transparency: Global slider to control how subtle or bold the zones appear.
How to Trade This
• The "Trap": If price breaks a Line but fails to close outside the Zone, it is often a liquidity grab (fakeout).
• The Retest: Watch for price to break a level and use the Zone as a cushion for a bounce/retest entry.
Momentum Burst + Absolute Momentum(TI65) + EP9M)This is a momentum burst indicator popularized by StockBee (hey EGeee). Track the stock absolute momentum for continuation breakout. Last but not least, identify EP9M. It can be Episodic pivot 9M volume breakout as a classic EP (CANSLIM type) for a long term trade or a regular EP9M or EP9M delayed reaction for swing trade. KISS - don't over complicate.
Price-Time Confluence Engine
Price-Time Confluence Engine is a dual-layer market analysis indicator designed to synchronize price-based targets with time-based momentum projections, helping traders anticipate potential reaction points, reversals, and momentum shifts.
The indicator combines adaptive ATR price targets with deviation context on the chart, alongside a forward-projected Stochastic RSI structure in a dedicated pane.
🔹 Core Components
1️⃣ Adaptive Price Targets (Chart Overlay)
On every new candle, a new ATR-based price target is generated automatically.
The target updates dynamically with live price movement until the candle closes.
Targets are directionally aligned with the current candle’s momentum.
A HIT label is displayed when price reaches the active target during the candle.
Behavioral Insight
If a target fails to be hit and remains red after the next candle forms, this behavior has shown a tendency to correlate with short-term swing reversals, signaling potential exhaustion or loss of momentum.
2️⃣ Mean & Deviation Framework
A configurable mean (moving average) is plotted with up to four deviation bands.
Deviation bands provide contextual boundaries for price targets and help visually frame volatility expansion or compression.
An optional filter allows HIT labels to require alignment with the first deviation band.
3️⃣ Stochastic RSI Projection (Indicator Pane)
The lower pane displays live Stochastic RSI %K and %D values.
A historical Stoch RSI pattern is cloned and projected forward in time, creating a time-based momentum forecast.
The projection highlights anticipated crossing points between %K and %D before they occur.
A single dynamic “Projected Cross” label marks the next expected crossing location.
Vertical reference lines and directional arrows help visualize projected momentum shifts.
Important Note on Timeframes
The projection logic is optimized for the Daily timeframe.
Other timeframes may require different lookback settings for meaningful alignment.
Price-based targets and deviation logic function on any timeframe.
🔧 User Controls
ATR length and multiplier
Mean length and deviation depth
Number of deviation bands displayed
Label visibility and history limits
Projection visibility and forward shift
Optional normalization of projected momentum
Visual toggles for arrows, vertical lines, and labels
📈 How to Use
Observe the active price target forming with each new candle.
Watch whether price hits or fails to hit the target before the next candle.
Use deviation bands to contextualize where targets sit within volatility structure.
Reference the Projected Cross in the lower pane to anticipate potential momentum transitions.
Look for confluence between unhit targets and projected momentum shifts as potential inflection zones.
⚠️ Disclaimer
This indicator is a visual analysis and decision-support tool.
It does not generate trade signals and should be used in conjunction with proper risk management and additional market context.
Opening Range BoxOPENING RANGE BOX + LEVELS (RTH)
OVERVIEW
This indicator draws the Opening Range for the U.S. Regular Trading Hours session starting at 9:30 AM New York time. It plots the Opening Range High, Low, and Midpoint, and can extend those levels for the rest of the session. It also displays the Opening Range size in points and ticks.
WHAT IT DRAWS
• Opening Range box for the first N minutes of RTH (ex: 5, 10, 15)
• OR High (ORH)
• OR Low (ORL)
• OR Midline (midpoint of ORH/ORL)
• Opening Range value label (range in points + ticks)
KEY FEATURES
• Time-anchored drawings (bar_time) so levels stay accurate on any intraday timeframe
• Configurable Opening Range length in minutes
• Configurable box fill/border colors
• Independent styling for OR High / OR Low / Midline (color, width, line style)
• Line extension modes:
Line extension modes
- To RTH Close
- Right Forever
- For N Minutes
- None
Optional label placement to the LEFT of the Opening Range so it doesn’t block new candles
Option to keep previous sessions’ Opening Ranges visible for context
BEST FOR
• Futures: ES / NQ / MNQ (and other RTH-based products)
• Intraday stocks and ETFs
• OR breakout, rejection/fade, and mean reversion workflows
NOTES
• Intended for intraday charts
• Opening Range is calculated strictly inside the selected time window (no extra bars)
• Session is America/New_York, 09:30–16:00
Gold Chop MeterWhat it does
It’s a market quality filter. It does NOT tell you direction.
It tells you when Gold is too compressed/choppy to trust clean expansions.
NORMAL = tradable conditions
CHOP = compressed / messy conditions
NO TRADE (30M BOX) = hard stop (30M is CHOP)
NO TRADE (HTF CHOP) = hard stop (majority of higher TFs are CHOP)
How to read the panel (left → right)
You’ll see:
1H: NORMAL/CHOP | 30M: NORMAL/CHOP | 15M: NORMAL/CHOP | 5M: NORMAL/CHOP | TRADE/NO TRADE
The rules (exact)
If 30M = CHOP → NO TRADE (30M BOX)
This is your strongest filter. Don’t fight it.
If 30M isn’t CHOP, then it checks majority:
Default: 1H + 30M + 15M
If 2 of 3 are CHOP → NO TRADE (HTF CHOP)
If those are not true → it prints TRADE
If 15M is CHOP but 30M is NORMAL, it prints:
“TRADE (CAUTION – 15M CHOP)”
That means: trade smaller, quicker, or wait for cleaner trigger.
Settings you actually need to touch
1) Profile
Auto (by session) = best for most days (it changes the threshold by time window)
NYO / Overnight / London profiles are there if you want to force one behavior.
2) ATR Length (fixed)
Default 4 is good for Gold.
If it’s too sensitive (flips CHOP too often), raise to 5.
If it’s too slow (stays NORMAL when price is dead), drop to 3.
3) Include 5M in majority filter? (default OFF)
OFF = cleaner, less restrictive (recommended)
ON = stricter filter (needs 3 of 4 to be CHOP for “HTF CHOP” but 5M influences the count)
How to use it with your purge strategy (simple playbook)
When it says TRADE
You’re allowed to execute your normal model:
Sweep → displacement / CHoCH → first return → run
When it says TRADE (CAUTION – 15M CHOP)
Still tradable, but:
take A+ only
smaller size
quicker TP, don’t expect runners
demand a cleaner trigger (strong displacement)
When it says NO TRADE
You don’t force entries.
What you do instead:
wait for 30M to flip back to NORMAL
or wait for a clear range break + retest that turns the environment back to expansion
Quick “decision cheat”
30M CHOP? → Stop. No trade.
2/3 HTFs CHOP? → Stop. No trade.
Only 15M CHOP? → Trade, but cautious.
All NORMAL? → Green light.
SHFE Silver USD/ozPersonal utility script to view Shanghai silver prices in USD/oz along side COMEX silver.
Real Drawdown Balance (Apex Style)Beat the Psychological Game of prop firms by tracking your actual balance/drawdown.
HTF Balanced Price RangeThis script is based off of TradeForOpp's BPR indicator, but I adapted it to work on higher timeframes
SMAcross-mvrOverview
SMAcross-mvrNew is a flexible, non-repainting moving-average strategy designed for clarity, configurability, and reliable backtesting.
It supports multiple entry styles, optional layered exits, and full-capital position sizing, while remaining stable during chart zooming and dragging.
🚀 What’s New in v2
✅ Multiple Entry Modes
You can now choose how trades are entered:
Entry Mode A: Short SMA crosses Long SMA
Entry Mode B: Price crosses Long SMA
This allows both classic MA-crossover trading and trend-continuation pullback entries using the same strategy.
✅ Modular Exit System (Checkbox-Based)
Exit logic is now fully modular using independent checkboxes:
☑ Exit on opposite signal
☑ Exit when price closes beyond Short SMA
You may enable one, both, or neither.
If both are enabled, the strategy exits on whichever condition occurs first.
✅ Terminology Clarity
All labels, inputs, and alerts now use semantic naming:
Short SMA (formerly 13 SMA)
Long SMA (formerly 30 SMA)
This makes the strategy easier to understand and future-proof if SMA lengths are changed.
✅ Full-Capital Position Sizing
Each trade uses 100% of available equity, allowing performance to naturally compound over time during backtests.
✅ Optional Visual Enhancements
Optional cross price labels (can be toggled on/off)
Color-filled zone between Short and Long SMAs for quick trend recognition
Optional 200 SMA (off by default) for higher-timeframe context
✅ Alert-Ready (TV-Safe)
All alerts use static messages compatible with TradingView’s alert system, making the strategy suitable for:
Manual trade notifications
Webhook-based automation
Broker integrations
🔒 Design Principles
No repainting
No line continuations (TradingView-safe formatting)
Stable behavior when zooming or scrolling
Clear separation of entry logic, exit logic, and visuals
⚠️ Notes
This script is intended for educational and research purposes.
Always forward-test and apply proper risk management before live trading.
ZOE IFVG+his indicator combines the original ICT Inversion Fair Value Gap (iFVG) Detector by ote618 with a manual checklist panel for trade analysis.
Features:
ICT iFVG Detector
Automatically identifies bullish and bearish inversion fair value gaps (iFVGs) based on 3-candle formation logic.
Draws colored boxes on the chart to highlight confirmed iFVG zones.
Sends optional alerts when iFVGs are confirmed, respecting your selected timeframe.
Works exactly like the original ote618 iFVG script, with no modifications to the core detection logic.
Manual Checklist Panel
Displays a customizable checklist to track key market factors:
Liquidity Sweep
HTF FVG
V-Shape Recovery
Inversion FVG
Clear Opposite DOL
SMT Divergence
Assigns a score and grade (A+ to F) based on selected conditions.
Panel position and background can be customized.
Allows traders to visually track trade quality alongside iFVG zones.
Usage:
Use the iFVG boxes to identify high-probability zones for entries and liquidity hunts.
Use the manual checklist to evaluate trades based on additional criteria, creating a structured workflow for market analysis.
Fully compatible with your existing iFVG workflow — the core detection and alerts remain unchanged.
Ideal For:
Traders following ICT concepts, liquidity hunts, and structure-based strategies who want to combine automated FVG detection with a manual trade-quality checklist.
Institutional Ghost Protocol - FINAL EXECUTION"This is a private institutional-grade indicator designed for high-precision entries. It combines EMA 8/80 crossovers with directional RSI (65/35), ATR volatility confirmation, and Open Interest flow. Optimized for Binance Perpetual Markets with specific Webhook integration for automated execution."
Multi-Metric Market Regime Detector - [KK]This indicator identifies current market behavioral regimes by synthesizing six complementary analytical methodologies. Rather than generating trading signals, it provides contextual analysis to help traders understand market conditions and adapt their strategies accordingly.
Markets cycle through distinct behavioral states - trending efficiently, consolidating in ranges, compressing before breakouts, or transitioning between states. This tool quantifies these conditions using only price action data (OHLC), enabling traders to filter strategies based on current market structure.
Core Methodology
The indicator combines six independent metrics into a weighted composite classification system:
Efficiency Ratio (30% weight)
Measures the signal-to-noise ratio of price movement by comparing net price displacement to total path traveled. High efficiency indicates clean directional movement; low efficiency indicates choppy, noisy conditions.
Choppiness Index (25% weight)
Quantifies whether the market is trending or consolidating by comparing cumulative True Range to actual price range. Values below 38.2 suggest trending behavior; values above 61.8 suggest range-bound consolidation.
Volatility Analysis (20% weight)
Detects compression and expansion cycles using the relationship between Bollinger Bands and Keltner Channels. Compression phases (squeeze conditions) often precede significant directional moves.
Fractal Efficiency Proxy (10% weight)
Analyzes path complexity by comparing net displacement to cumulative range, providing insight into the smoothness versus randomness of price action.
Market Structure (15% weight)
Examines pivot point sequences to identify structural trends. Higher Highs and Higher Lows indicate bullish structure; Lower Lows and Lower Highs indicate bearish structure.
Wick-to-Body Ratio Analysis (qualitative)
Identifies rejection and indecision patterns by measuring the proportion of candle wicks to bodies, highlighting potential reversal zones or liquidity events.
Regime Classifications
The composite scoring system produces four distinct regime states:
TRENDING : High efficiency, low choppiness, clear directional structure. Favorable conditions for momentum and trend-following strategies.
CHOPPY/RANGE : Low efficiency, high choppiness, mean-reverting behavior. Favorable conditions for range trading and counter-trend setups.
COMPRESSION : Volatility squeeze detected, market coiling. Anticipate expansion; reduce position size until breakout confirmation.
TRANSITION : Mixed signals, conflicting metrics, unclear direction. Recommended to reduce exposure and wait for regime clarity.
Visual Features
Regime-Colored Candles (enabled by default)
Candles are colored according to the current regime state for immediate visual identification. Green indicates trending, gray indicates choppy, orange indicates compression, and yellow indicates transition.
Comprehensive Metrics Table (top right)
Displays real-time values for all six metrics along with individual regime assessments and the final composite classification with score.
Regime Guide Table (middle right)
Quick reference guide showing recommended strategies and actions to avoid for each regime state.
Chart Label ( optional)
Summary label displaying current regime and key metric values.
Background Coloring (optional)
Alternative visualization using background colors instead of candle coloring.
Indicator Plots (optional)
Displays Efficiency Ratio and Choppiness Index with threshold reference lines.
Customization Options
All calculation parameters are adjustable:
- Efficiency Ratio lookback period and thresholds
- Choppiness Index length and classification thresholds
- Volatility analysis parameters (BB/KC multipliers and lengths)
- Pivot detection sensitivity (left/right bars)
- Text size controls for both tables (Tiny to Huge)
- Visual element toggles (candles, background, label, tables, plots)
The indicator automatically detects chart theme (dark/light) and adjusts text colors for optimal readability.
Practical Application
This is a context tool, not a signal generator. Use it to:
- Filter trend-following strategies to trending regimes only
- Identify range-bound conditions for mean-reversion setups
- Anticipate breakout opportunities during compression phases
- Reduce exposure during transitional periods with mixed signals
- Improve risk management by matching position size to regime clarity
The indicator works on all timeframes and instruments using only OHLC data. Higher timeframes generally provide more stable regime classifications.
Alert Conditions
Four alert types are available:
- Efficiency Ratio crosses trend threshold
- Choppiness Index enters range territory
- Volatility squeeze released
- Regime state change detected
Technical Notes
Built with Pine Script v5. Uses up to 500 bars of historical data for stable calculations. All metrics are calculated in real-time with no repainting on confirmed pivots. Compatible with all chart themes through adaptive text coloring.
Disclaimer
This indicator is provided for educational and informational purposes only. It does not constitute financial advice or trading recommendations. Past performance and theoretical analysis do not guarantee future results. Always conduct independent research and implement appropriate risk management. Trading financial instruments involves substantial risk of loss.
Usage Philosophy
The goal is not to trade more frequently, but to think more clearly about market conditions. Use this tool to develop deeper intuition about market structure and to enforce discipline by avoiding low-probability setups during unfavorable regime conditions.
Photon Price Action Scanner [JOAT]
Photon Price Action Scanner - Light Speed Edition
Overview
Photon Price Action Scanner is an open-source overlay indicator that detects and displays over 15 candlestick patterns with strength filtering, trend confirmation, and velocity analysis. It combines classic pattern recognition (engulfing, hammer, doji, morning/evening star) with advanced patterns (three soldiers/crows, tweezer tops/bottoms, island reversals) and gap analysis to provide comprehensive price action insights.
What This Indicator Does
The indicator detects and displays:
Classic Patterns - Bullish/Bearish Engulfing, Hammer, Shooting Star, Doji, Morning Star, Evening Star, Piercing Line, Dark Cloud Cover, Bullish/Bearish Harami
Advanced Patterns - Three White Soldiers, Three Black Crows, Tweezer Top/Bottom, Island Reversals
Gap Analysis - Detects gap up and gap down conditions
Velocity Confirmation - Filters signals by price velocity (rate of change)
Neural Bias Filter - Adaptive EMA-based trend filter with momentum adjustment
Pattern Strength - Volume and body size weighted strength calculation
How It Works
Each pattern has specific detection logic. For example, Bullish Engulfing:
isBullishEngulfing() =>
bool pattern = close < open and close > open and
open <= close and close >= open and
close - open > open - close
pattern
Three White Soldiers detection:
isThreeWhiteSoldiers() =>
bool pattern = close > open and close > open and close > open and
close < close and close < close and
open > open and open < close and
open > open and open < close
pattern
Pattern strength is calculated using volume and body size:
calculatePatternStrength(bool pattern, series float volume, simple int period) =>
float strength = 0.0
if pattern
float avgVol = ta.sma(volume, period)
float volRatio = avgVol > 0 ? volume / avgVol : 1.0
float bodySize = math.abs(close - open) / close
strength := (volRatio + bodySize * 100) / 2
strength
Neural bias filter uses adaptive EMA with momentum adjustment:
neuralEMA(series float src, simple int period, simple float lr) =>
var float neuralValue = na
var float momentum = 0.0
float error = src - neuralValue
float adjustment = error * lr
momentum := momentum * 0.9 + adjustment * 0.1
neuralValue := neuralValue + adjustment + momentum
neuralValue
Signal Generation
Signals are filtered by multiple criteria:
Strong Pattern: Pattern detected + strength exceeds threshold + trend alignment + neural bias confirmation + velocity confirmation (if enabled)
Ultra Pattern: Strong pattern + gap in same direction + velocity confirmation
Dashboard Panel (Bottom-Right)
Current Pattern - Name of detected pattern or NONE
Bull Strength - Bullish pattern strength score
Bear Strength - Bearish pattern strength score
Trend - Current trend direction (UPTREND/DOWNTREND/SIDEWAYS)
Signal Quality - STRONG BULL/STRONG BEAR/BULL/BEAR/NONE
Velocity - FAST BULL/FAST BEAR/NORMAL
Gap Status - GAP UP/GAP DOWN/NO GAP
Light Beam - Scanning intensity percentage
Action - Recommended action (ULTRA BUY/BUY/WATCH BUY/WAIT etc.)
Visual Elements
Pattern Labels - Abbreviated labels at pattern locations (BE, H, MS, SS, ES, etc.)
Neural Bias Line - Adaptive trend line
Gap Boxes - Cyan boxes highlighting gap zones
Action Zones - Dashed boxes around strong pattern areas
Light Beam - Oscillating area plot for visual scanning effect
Velocity Markers - Small circles indicating velocity confirmation
Ultra Signals - Large labels for highest conviction signals
Input Parameters
Scan Sensitivity (default: 1.0) - Overall detection sensitivity
Pattern Strength Filter (default: 3) - Minimum strength for strong signals
Trend Period (default: 20) - Period for trend determination
Show All Patterns (default: false) - Show all patterns regardless of strength
Advanced Patterns (default: true) - Enable soldiers/crows/tweezer detection
Gap Analysis (default: true) - Enable gap detection
Velocity Confirmation (default: true) - Require velocity confirmation
Neural Bias Filter (default: true) - Enable adaptive trend filter
Neural Period (default: 50) - Period for neural bias calculation
Neural Learning Rate (default: 0.12) - Adaptation speed for neural filter
Suggested Use Cases
Identify reversal patterns at key support/resistance levels
Use pattern strength to filter high-quality setups
Combine with trend direction for higher probability trades
Watch for ultra signals as highest conviction opportunities
Use gap analysis for momentum continuation or reversal setups
Timeframe Recommendations
Effective on 1H to Daily charts. Lower timeframes produce more patterns but with potentially lower reliability.
Limitations
Pattern detection is mechanical and does not consider broader context
Strength calculation is based on volume and body size, not pattern quality
Neural bias filter may lag during rapid trend changes
Gap detection requires clean price data
Open-Source and Disclaimer
This script is published as open-source under the Mozilla Public License 2.0 for educational purposes. It does not constitute financial advice. Pattern detection does not guarantee trade outcomes. Always use proper risk management.
- Made with passion by officialjackofalltrades
Opens and RangesDisplays:
- Daily, Weekly, Monthly and Yearly opens
- High / Low / Midline(EQ) of previous day and previous week






















