True Breakout Pattern [TradingFinder] Breakout Signal Indicator🔵 Introduction
In many market conditions, what initially appears to be a decisive breakout often turns out to be nothing more than a false breakout or fake breakout. Price breaks through a key swing level or an important support and resistance zone, only to quickly return to its previous range.
These failed breakouts, which are often the result of liquidity traps or market manipulation, serve more as a warning sign of structural weakness than confirmation of a new trend.
This indicator is designed around the concept of the fake breakout.
The logic is simple but precise : when price breaks a swing level and returns to that level within a maximum of five candles, the move is considered a false breakout. At this point, a Fibonacci retracement is applied to the recent price swing to evaluate the pullback area.
If price, within ten candles after the return to the breakout level, enters the Fibonacci zone between 0.618 and 1.0, the setup becomes valid for a potential entry. This area is identified as a long entry zone, with the stop loss placed just beyond the 1.0 level and the take profit defined based on the desired risk-to-reward ratio.
By combining accurate detection of false breakouts, analysis of price reaction to swing levels, and alignment with Fibonacci retracement logic, this framework allows traders to identify opportunities often missed by others. In a market where failed breakouts are a common and recurring phenomenon, this indicator aims to transform these traps into measurable trading opportunities.
Long Setup :
Short Setup :
🔵 How to Use
This indicator operates based on the recognition of false breakouts from structural levels in the market, specifically swing levels, and combines that with Fibonacci retracement analysis.
In this strategy, trades are only considered when price returns to the broken level within a defined time window and reacts appropriately inside a predefined Fibonacci range. Depending on the direction of the initial breakout, the system outlines two scenarios for long and short setups.
🟣 Long Setup
In the long setup, price initially breaks below a support level or swing low. If the price returns to the broken level within a maximum of five candles, the move is identified as a fake breakout.
At this stage, a Fibonacci retracement is drawn from the recent high to the low. If price, within ten candles of returning to the level, moves into the 0.618 to 1.0 Fibonacci zone, the conditions for a long entry are met.
The stop loss is placed slightly below the 1.0 level, while the take profit is set based on the trader’s preferred risk-reward ratio. This setup aims to capture deeply discounted entries at low risk, aligned with smart money reversals.
🟣 Short Setup
In the short setup, the price breaks above a resistance level or swing high. If the price returns to that level within five candles, the move is again treated as a false breakout. Fibonacci is then drawn from the recent low to the high to observe the retracement area.
Should price enter the 0.618 to 1.0 Fibonacci range within ten candles of returning, a short entry is considered valid. In this case, the stop loss is placed just above the 1.0 level, and the take profit is adjusted based on the intended risk-reward target. This method allows traders to identify high-probability short setups by focusing on failed breakouts and deep pullbacks.
🔵 Settings
🟣 Logical settings
Swing period : You can set the swing detection period.
Valid After Trigger Bars : Limits how many candles after a fake breakout the entry zone remains valid.
Max Swing Back Method : It is in two modes "All" and "Custom". If it is in "All" mode, it will check all swings, and if it is in "Custom" mode, it will check the swings to the extent you determine.
Max Swing Back : You can set the number of swings that will go back for checking.
🟣 Display settings
Displaying or not displaying swings and setting the color of labels and lines.
🟣 Alert Settings
Alert False Breakout : Enables alerts for Breakout.
Message Frequency : Determines the frequency of alerts. Options include 'All' (every function call), 'Once Per Bar' (first call within the bar), and 'Once Per Bar Close' (final script execution of the real-time bar). Default is 'Once per Bar'.
Show Alert Time by Time Zone : Configures the time zone for alert messages. Default is 'UTC'.
🔵 Conclusion
A sound understanding of the false breakout phenomenon and its relationship to structural price behavior is essential for technical traders aiming to improve precision and consistency. Many poor trading decisions stem from misinterpreting failed breakouts and entering too early into weak signals.
A structured approach, grounded in the analysis of swing levels and validated through specific price action and timing rules, can turn these misleading moves into valuable trade opportunities.
This indicator, by combining fake breakout detection with time filters and Fibonacci-based retracement zones, helps traders only engage with the market when multiple confirming factors are in alignment. The result is a strategy that emphasizes probability, risk control, and clarity in decision-making, offering a solid edge in navigating today’s volatile markets.
Indicators and strategies
Non-Lagging Longevity Zones [BigBeluga]🔵 OVERVIEW
A clean, non-lagging system for identifying price zones that persist over time—ranking them visually based on how long they survive without being invalidated.
Non-Lagging Longevity Zones uses non-lagging pivots to automatically build upper and lower zones that reflect key resistance and support. These zones are kept alive as long as price respects them and are instantly removed when invalidated. The indicator assigns a unique lifespan label to each zone in Days (D), Months (M), or Years (Y), providing instant context for historical relevance.
🔵 CONCEPTS
Non-Lag Pivot Detection: Detects upper and lower pivots using non-lagging swing identification (highest/lowest over length period).
h = ta.highest(len)
l = ta.lowest(len)
high_pivot = high == h and high < h
low_pivot = low == l and low > l
Longevity Ranking: Zones are preserved as long as price doesn't breach them. Levels that remain intact grow in visual intensity.
Time-Based Weighting: Each zone is labeled with its lifespan in days , emphasizing how long it has survived.
duration = last_bar_index - start
days_ = int(duration*(timeframe.in_seconds("")/60/60/24))
days = days_ >= 365 ? int(days_ / 365) : days_ >= 30 ? int(days_ / 30) : days_
marker = days_ >= 365 ? " Y" : days_ >= 30 ? " M" : " D"
Dynamic Coloring: Older zones are drawn with stronger fill, while newer ones appear fainter—making it easy to assess significance.
Self-Cleaning Logic: If price invalidates a zone, it’s instantly removed, keeping the chart clean and focused.
🔵 FEATURES
Upper and Lower Zones: Auto-detects valid high/low pivots and plots horizontal zones with ATR-based thickness.
Real-Time Validation: Zones are extended only if price stays outside them—giving precise control zones.
Gradient Fill Intensity: The longer a level survives, the more opaque the fill becomes.
Duration-Based Labeling: Time alive is shown at the root of each zone:
• D – short-term zones
• M – medium-term structure
• Y – long-term legacy levels
Smart Zone Clearing: Zones are deleted automatically once invalidated by price, keeping the display accurate.
Efficient Memory Handling: Keeps only the 10 most recent valid levels per side for optimal performance.
🔵 HOW TO USE
Track durable S/R zones that survived price tests without being breached.
Use longer-lived zones as high-confidence confluence areas for entries or targets.
Observe fill intensity to judge structural importance at a glance .
Layer with volume or momentum tools to confirm bounce or breakout probability.
Ideal for swing traders, structure-based traders, or macro analysis.
🔵 CONCLUSION
Non-Lagging Longevity Zones lets the market speak for itself—by spotlighting levels with proven survival over time. Whether you're trading trend continuation, mean reversion, or structure-based reversals, this tool equips you with an immediate read on what price zones truly matter—and how long they've stood the test of time.
Support Resistance with Order BlocksIndicator Description
Professional Price Level Detection for Smart Trading. Master the Markets with Precision Support/Resistance and Order Block Analysis . It provides traders with clear visual cues for potential reversal and breakout areas, combining both retail and institutional trading concepts into one powerful tool.
The Support & Resistance with Order Blocks indicator is a versatile Pine Script tool designed to empower traders with clear, actionable insights into key market levels. By combining advanced pivot-based support and resistance (S/R) detection with order block (OB) filtering, this indicator delivers clean, high-probability zones for entries, exits, and reversals. With customizable display options (boxes or lines) and intuitive settings, it’s perfect for traders of all styles—whether you’re scalping, swing trading, or investing long-term. Overlay it on your TradingView chart and elevate your trading strategy today!
________________________________________
Key Features
✅ Dynamic Support/Resistance - Auto-adjusting levels based on price action
✅ Smart Order Block Detection - Identifies institutional buying/selling zones
✅ Dual Display Modes - Choose between Boxes or Clean Lines for different chart styles
✅ Customizable Sensitivity - Adjust detection parameters for different markets
✅ Broken Level Markers - Clearly shows when key levels are breached
✅ Timeframe-Adaptive - Automatically adjusts for daily/weekly charts
1. Dynamic Support & Resistance Detection
Identifies critical S/R zones using pivot high/low calculations with adjustable look back periods.
Visualizes active S/R zones with distinct colors and labels ("Support" or "Resistance" for boxes, lines for cleaner charts).
Marks broken S/R levels as "Br S" (broken support) or "Br R" (broken resistance) when historical display is enabled, aiding in breakout and reversal analysis.
2. Smart Order Block Identification
Detects bullish and bearish order blocks based on significant price movements (default: ±0.3% over 5 candles).
Highlights institutional buying/selling zones with customizable colors, displayed as boxes or lines.
Filters out overlapping OB zones to keep your chart clutter-free.
3. Dual Display Options
Boxes or Lines: Choose to display S/R and OB as boxes for detailed zones or lines for a minimalist view.
Line Width Customization: Adjust line widths for S/R and OB (1–5 pixels) for optimal visibility.
Color Customization: Tailor colors for active/broken S/R and bullish/bearish OB zones.
4. Advanced Overlap Filtering
Ensures S/R zones don’t overlap with OB zones or other S/R levels, providing only the most relevant levels.
Limits the number of active zones (default: 10) to maintain chart clarity.
5. Historical S/R Visualization
Optionally display broken S/R levels with distinct colors and labels ("Br S" or "Br R") to track historical price reactions.
Broken levels are dynamically updated and removed (or retained) based on user settings.
6. Timeframe Adaptability
Automatically adjusts pivot detection for daily/weekly timeframes (40-candle look back) versus shorter timeframes (20-candle look back).
Works seamlessly across all asset classes (stocks, forex, crypto, etc.) and timeframes.
________________________________________
How It Works
• Support & Resistance:
Uses ta.pivothigh and ta.pivotlow to detect significant price pivots, with a user-defined look back (default: 5 candles post-pivot).
Plots S/R as boxes (with labels "Support" or "Resistance") or lines, extending to the current bar for real-time relevance.
Broken S/R levels are marked with adjusted colors and labels ("S" or "R" for boxes, "Br S" or "Br R" for lines when historical display is enabled).
• Order Blocks:
Identifies OB based on strong price movements over 4 candles, plotted as boxes or lines at the candle’s midpoint.
Validates OB to prevent overlap, ensuring only significant zones are displayed.
Removes OB zones when price breaks through, keeping the chart focused on active levels.
• Customization:
Toggle S/R and OB visibility, adjust detection sensitivity, and set maximum active zones (4–50).
Fine-tune line widths and colors for a personalized chart experience.
________________________________________
Why Use This Indicator?
• Precision Trading: Pinpoint high-probability entry/exit zones with filtered S/R and OB levels.
• Clean Charts: Overlap filtering and zone limits reduce clutter, focusing on key levels.
• Versatile Display: Switch between boxes for detailed zones or lines for simplicity, with adjustable line widths.
• Institutional Edge: Leverage OB detection to align with institutional activity for smarter trades.
• User-Friendly: Intuitive settings and clear visuals make it accessible for beginners and pros alike.
________________________________________
Settings Overview________________________________________
⚙ Input Parameters
Settings Overview
Display Options:
Display Type: Choose "Boxes" or "Lines" for S/R and OB visualization.
S/R Line Width: Set line thickness for S/R lines (1–5 pixels, default: 2).
OB Line Width: Set line thickness for OB lines (1–5 pixels, default: 2).
Order Block Options:
Show Order Block: Enable/disable OB display.
Bull/Bear OB Colors: Customise border and fill colors for bullish and bearish OB zones.
Support/Resistance Options:
Show S/R: Toggle active S/R zones.
Show Historical S/R: Display broken S/R levels, marked as "Br S" or "Br R" for lines.
Detection Period: Set candle lookback for pivot detection (4–50, default: 5).
Max Active Zones: Limit active S/R and OB zones (4–50, default: 10).
Colors: Customise active and broken S/R colors for clear differentiation.
________________________________________
How to Use
1. Add to Chart: Apply the indicator to your TradingView chart.
2. Customize Settings:
o Select "Boxes" or "Lines" for your preferred display style.
o Adjust line widths, colors, and detection parameters to suit your trading style.
o Enable "Show Historical S/R" to track broken levels with "Br S" and "Br R" labels.
3. Analyze Levels:
o Use support zones (green) for buy entries and resistance zones (red) for sell entries.
o Monitor OB zones for institutional activity, signaling potential reversals or continuations.
o Watch for "Br S" or "Br R" labels to identify breakout opportunities.
4. Combine with Other Tools: Pair with trend indicators, volume analysis, or price action for a robust strategy.
5. Monitor Breakouts: Trade breakouts when price breaches S/R or OB zones, with historical labels providing context.
________________________________________
Example Use Cases
• Swing Trading: Use S/R and OB zones to identify entry/exit points, with historical broken levels for context.
• Breakout Trading: Trade price breaks through S/R or OB, using "Br S" and "Br R" labels to confirm reversals.
• Scalping: Adjust detection period for faster S/R and OB identification on lower timeframes.
________________________________________
• Performance: Optimized for all timeframes, with best results on 5M, 15M, 30M, 1H, 4H, or daily charts for swing trading.
• Compatibility: Works with any asset class and TradingView chart.
________________________________________
Get Started
Transform your trading with Support & Resistance with Order Blocks! Add it to your chart, customize it to your style, and trade with confidence. For questions or feedback, drop a comment on TradingView or message the author. Happy trading! 🚀
________________________________________
Disclaimer: This indicator is for educational and informational purposes only. Always conduct your own analysis and practice proper risk management before trading.
Buy/Sell Indicator (RSI, MACD, ATR) v6+Buy Sell indicators based on EMA, Volume and MACD Has buy and sale flag indicators
Fibonacci Optimal Entry ZoneFibonacci Optimal Entry Zone - Professional Market Structure Trading Tool
Overview
This indicator combines market structure analysis with dynamic Fibonacci retracement levels to identify optimal entry zones in trending markets. Unlike standard Fibonacci tools, this indicator automatically detects swing points, tracks market structure changes (CHoCH - Change of Character), and adapts Fibonacci levels in real-time as new market structure develops.
Key Innovation - Why This Combination Works
This tool merges two powerful concepts:
Smart Money Concepts (SMC) market structure detection
Automated Fibonacci retracement analysis
The synergy creates a systematic approach to finding high-probability reversal zones by waiting for structure breaks before drawing Fibonacci levels, ensuring you're always trading with the trend rather than against it.
How It Works
1. Market Structure Detection
Uses pivot high/low analysis to identify significant swing points
Detects "Change of Character" (CHoCH) when price breaks previous structure
Distinguishes between bullish (Higher Highs/Higher Lows) and bearish (Lower Highs/Lower Lows) market conditions
2. Dynamic Fibonacci Deployment
Automatically draws Fibonacci retracements between the most recent significant swings
Updates levels in real-time as new structure forms
Includes extended levels (-2.0 to 1.618) for both retracement and extension analysis
3. Optimal Entry Zone Identification
Highlights the "Golden Zone" (0.5-0.618 for bullish, 0.382-0.5 for bearish)
Provides visual fills between key levels to identify confluence zones
Shows exact price levels at each Fibonacci ratio
Trading Methodology
For Bullish Setups:
Wait for a bullish CHoCH (break above previous high)
Monitor price retracement to Fibonacci levels
Look for entries in the 0.5-0.618 zone (Golden Zone)
Use 0.786 as final support before trend invalidation
For Bearish Setups:
Wait for a bearish CHoCH (break below previous low)
Monitor price retracement to Fibonacci levels
Look for entries in the 0.382-0.5 zone
Use 0.236 as final resistance before trend invalidation
Unique Features
Swing Tracker Mode: Continuously updates Fibonacci levels with each new swing
Structure Period Optimization: Adjustable lookback period (default 10) to capture different market conditions
Visual Clarity: Customizable colors, line styles, and label positions
Fill Zones: Create visual zones between any two Fibonacci levels
Extended Levels: Includes negative Fibonacci levels for advanced harmonic patterns
Real-time Updates: Levels extend to current bar for immediate analysis
Best Practices
Timeframe Selection: Works best on H1 and above for swing trading, M15-H1 for intraday
Confluence: Combine with support/resistance, moving averages, or volume analysis
Risk Management: Use the 0.786 level (bullish) or 0.236 level (bearish) for stop-loss placement
Trend Confirmation: Only take trades in the direction of the CHoCH signal
Settings Guide
Structure Period: Higher values (15-20) for major swings, lower values (5-10) for minor swings
Swing Tracker: Enable for active markets, disable for cleaner historical analysis
Fibonacci Levels: Customize which levels to display based on your trading style
Golden Zone Fill: Highlights the optimal entry area for visual clarity
This indicator is designed for traders who understand market structure and want an automated, systematic approach to Fibonacci-based entries. It removes the subjectivity of manual Fibonacci placement while ensuring you're always aligned with the current market structure.
Chart Requirements:
Use a clean chart with only this indicator
Show at least one complete CHoCH signal with Fibonacci levels
Demonstrate how the levels update with new swings
Highlight the golden zone if enabled
Smart Directional Fib Zone (Selectable Session)🎯 Overview
This indicator plots a dynamic Fibonacci zone between the 0.5 and 0.618 levels , calculated from the previous day’s price action , and is designed specifically for intraday traders.
It visually highlights key retracement or reaction areas where the market often pauses or reverses.
🔍 How it works
At the start of each day, the script automatically captures:
the previous day’s open (pdo),
high (pdh),
low (pdl),
and close (pdc).
It then determines if the previous day was bullish (Close > Open) or bearish (Close < Open).
Based on that:
If the previous day was bullish, it projects the Fibonacci levels down from the high (typical for expecting retracements).
If bearish, it projects them up from the low.
The two key levels are:
0.5 (50%) retracement / projection
0.618 (61.8%) retracement / projection
A colored zone is plotted between these levels to act as a leading guide for intraday setups.
⏰ Time filtering & session customization
A unique feature is the dynamic session filtering:
By default, the zone is only plotted during active market hours, keeping your chart clean outside trading hours.
The script provides a dropdown selector so you can quickly switch between:
India session (9:15 to 15:30)
Europe session (9:00 to 17:30)
US session (9:30 to 16:00)
Or even define your own custom session times.
This makes it ideal for intraday traders in any region.
🎨 Visual features
The fill zone changes color based on the previous day’s sentiment:
Green zone if the previous day was bullish
Red zone if the previous day was bearish
🚨 Alerts
The script includes an alert condition, so you can easily set up TradingView alerts to notify you when:
Price enters the Fibonacci zone.
This is extremely helpful for catching retracements or reversals without staring at the screen all day.
⚙️ How to use
✅ Works on any intraday timeframe (1 min, 5 min, 15 min, etc.).
✅ Simply add it to your chart, pick your session in the dropdown, and watch the Fibonacci zone automatically adjust to your selected market hours.
Use it as a confluence tool alongside other indicators like VWAP, EMAs, Bollinger Bands, or price action patterns to time entries and exits.
💪 Why this is powerful
This is more than a simple Fib retracement tool:
It dynamically adapts to the previous day’s sentiment, helping you trade in alignment with recent market psychology.
The session filtering ensures your charts are focused only on the periods
暴富启点v8.3.1-AI量化指标(立省699)free and good and save ur money
free and good and save ur money
free and good and save ur money
free and good and save ur money
free and good and save ur money
Candle Color Based on 12 month SMAThis indicator is designed to be used on a 1M (monthly) chart. It:
• Calculates the 12-month Simple Moving Average (SMA).
• Colors candles green if the monthly close is above the SMA.
• Colors candles red if the monthly close is below the SMA.
• Plots the 12-month SMA as a cyan stair-step line for clear visual tracking.
Smart Range Zones [Dr. Hafiz]Smart Range Zones
Description:
This indicator highlights key market zones — High Range, Mid Range, and Low Range — to help traders visually understand dynamic support and resistance levels.
✅ High Range: Potential supply/resistance area
✅ Mid Range: Fair value or equilibrium zone
✅ Low Range: Potential demand/support area
The zones are calculated based on the highest and lowest price over a user-defined period (default: 130 bars) and dynamically projected forward.
🔸 EMA 15 Line is included as an optional trend filter — helping confirm direction or trend alignment.
🔧 Features:
Auto-calculated High/Mid/Low zones
Real-time dynamic projections
Right-aligned zone labels inside each box
Clean visual structure
Toggle for showing/hiding EMA 15
📌 Best suited for:
Intraday & swing traders
Range breakouts and rejections
Trend confirmation with EMA
Created and published by Dr. Hafiz, modified under the MPL 2.0 license.
Smart RSI Divergence PRO | Auto Lines + Alerts
**Smart RSI Divergence PRO**
This indicator automatically finds RSI divergences on price charts:
🔹 Regular & Hidden divergences
🔹 Auto trendlines connecting swing highs & lows
🔹 Clear triangle labels on the chart
🔹 Ready-to-use alerts for your strategy
Use it to spot potential trend reversals and hidden continuation signals.
---
**How it works**
- **Regular Divergence**: Price makes a higher high (or lower low) while RSI does not → possible reversal.
- **Hidden Divergence**: Price makes a lower high (or higher low) while RSI makes a higher high (or lower low) → possible trend continuation.
---
**Signal colors**
🔻 Red triangle — Regular Bearish Divergence (potential short)
🔻 Orange triangle — Hidden Bearish Divergence (possible trend continuation down)
🔺 Green triangle — Regular Bullish Divergence (potential long)
🔺 Blue triangle — Hidden Bullish Divergence (possible trend continuation up)
Works on any timeframe and market (crypto, forex, indices, stocks).
---
**💡 Want a custom version?**
I can build private Pine Script indicators & strategies **made just for you** — scalping tools, trend or reversal signals, custom filters for crypto, forex, stocks, or any pairs you trade.
I can also improve or fix your existing scripts.
If you want a unique, clean, and profitable setup — contact me anytime!
📩 Telegram 👉 t.me
Bullish/Bearish Average Wicks & Range (1 Month)This Indicator indicates the average upper and lower wick and the average body size of candles for the previous 20 periods. This indicator though separates the bullish and the bearish data from one another.
TWI Jedi Order Block TrackerJedi script helps you find perfect entry
use chart pattern and price action
Price × Volume Momentum (FSTO / RSI / Avg)decided to combine my PXVS and PXVR in to one script. user has the option to use FSTO, RSI, or the average between the two oscillators.
the oscillator components have been modified to range from -100 to +100 to express directional magnitude.
volume remains 0 to 100, so it can function as a direction-neutral amplifier.
The result is a bi-directional composite oscillator that:
>> Emphasizes congruent signals (e.g., strong price direction with strong volume).
>> Minimizes misleading or incongruent signals from high volume paired with neutral or conflicting price movement.
Ideal for identifying high-conviction breakouts and momentum divergences with volume support.
(STC) with Buy/Sell
PS! This is ment to be used as compliment and confirmation for indicator "UT Bot + LinReg Candles (Dual Sensitivity) by PDK1977
Schaff Trend Cycle (STC) Oscillator with Buy/Sell Signals
The Schaff Trend Cycle (STC) is a fast and reliable oscillator developed by Doug Schaff, designed to improve on traditional cycle indicators like MACD and Stochastic. The STC indicator helps you identify trend direction, potential reversals, and entry/exit points with greater speed and accuracy.
Key Features:
Clear, Color-Coded Line: The STC line turns green when rising and red when falling, making trend changes easy to spot.
Buy/Sell Signals:
Buy: When the STC line crosses up over the 25 level, a green triangle appears, suggesting bullish momentum.
Sell: When the STC line crosses down under the 75 level, a red triangle appears, highlighting potential bearish momentum.
Levels: 25 and 75 are highlighted to mark overbought and oversold regions.
Separate Pane: Designed to be displayed in its own subwindow below the main chart, keeping your price action clean and uncluttered.
How to Use:
Buy Signal: Watch for the STC to cross above 25 for possible long entries.
Sell Signal: Watch for the STC to cross below 75 for possible short entries.
The indicator works on all timeframes and is suitable for trending markets, swing trading, and scalping strategies.
Tip: Combine STC signals with other trend or volume indicators for added confirmation and more robust trading decisions.
MENOLAK RUGI TRADING PLAN "MENOLAK RUGI TRADING PLAN"
is a customizable trading plan table designed to help Smart Money Concept (SMC) traders visualize their execution checklist directly on the chart.
With this tool, you can select multiple timeframes for analysis, define your POI (Point of Interest) entry types, entry system preferences, stop-loss parameters, target exit strategies, break-even setup conditions, and risk per trade — all displayed in a clean, organized table.
🔧 Features:
Multi-timeframe selection (D1 to M1)
Multi-select POI Entry, Entry System, and Target Exit
Customizable SL levels (10–100 pips)
BEP setup from 1R to 5R
Risk/Trade options from 0.1% to 1%
Full control over table color, font size, and position
Perfect for discretionary and rule-based traders who want to remain consistent, accountable, and structured in their trading approach.
Lum3n Reversal IndicatorLum3n Reversal Indicator
The Lum3n Reversal Indicator is a dynamic, multi-signal tool built to identify high-probability market reversals. It combines classic candlestick pattern recognition with RSI exhaustion levels, volume spikes, trend confirmation, and support zone proximity to generate actionable buy and sell signals—each scored with a confidence value.
Key Features
Comprehensive Pattern Detection: Identifies bullish and bearish patterns including hammers, engulfing candles, stars, tweezers, and doji types.
RSI Filtering System: Uses configurable RSI levels to differentiate between weak, strong, and extreme signals.
Trend Confirmation Engine: Incorporates smoothed stochastic logic to filter signals based on broader trend conditions.
Volume Spike Detection: Confirms signal strength by detecting high-volume events above the 20-period average.
Support-Based Buy Logic: Two customizable support levels allow the script to detect price rejection at key areas.
Halo Pulse Visualization: Highlights ultra-high-confidence setups (strength ≥ 120) with transparent bubble markers.
Signal Labels with Score: All valid buy/sell signals are marked on the chart with confidence scores for easy filtering.
Optional Gradient Candle Coloring: Dynamically colors candles based on trend strength for visual clarity.
Built-in Alerts: Includes alert conditions for standard and high-conviction Lum3n Buy/Sell triggers.
How to Use It
Buy signals appear when bullish candlestick patterns align with oversold RSI levels, trend confirmation, volume surges, and proximity to key support levels.
Sell signals are generated from bearish pattern setups combined with RSI overbought conditions and bearish trend-volume alignment.
Confidence scores range based on how many conditions align. High-conviction setups will be scored above 100, with 120+ triggering the Halo Pulse visualization.
Best used with additional confirmation such as trendlines, moving averages, or higher-timeframe structure.
Customizable Inputs
Support zones and RSI thresholds
Trend sensitivity and volume filter strength
Bullish and bearish color themes
Optional candle coloring toggle for cleaner charts
IU Engulfing Candlestick PatternDISCRIPTION
📈 The IU Engulfing Candlestick Pattern indicator spotlights both bullish and bearish engulfing formations in real‑time. It shades each pattern with a transparent box and drops a concise label so you can catch potential reversals at a glance—no clutter, no noise, just the candles that matter.
USER INPUTS :
1. Pattern Recognition Based on = “Both” | “Wicks” | “Body” ( Default Both )
• Both → only highlights candles that satisfy **both** wick‑and‑body engulfing rules
• Wicks → checks full candle range (high‑to‑low)
• Body → checks only the real bodies (open‑to‑close)
2. Show Labels ( Default true )
If ticked then it will show the text as "Bullish Engulfing" or "Bearish Engulfing".
3. Show The Box ( Default true)
if ticked then it will show the green or red boxes.
INDICATOR LOGIC:
🔹 Bullish Engulfing (green box)
– Current bar closes higher than it opens and fully “wraps” the prior bar per your chosen rule.
🔹 Bearish Engulfing (red box)
– Current bar closes lower than it opens and fully “wraps” the prior bar per your chosen rule.
🔸 When a pattern confirms:
1. The script records the local high/low range.
2. Draws a semi‑transparent box spanning the engulfing pair.
3. Prints a compact up/down label exactly at the reaction point.
4. Fires a once‑per‑bar alert (“Bullish Engulfing” / “Bearish Engulfing”) you can route to webhooks or notifications.
WHY IT IS UNIQUE:
✨ Combines classic body‑only engulfing with an optional wick filter, letting traders demand stricter confirmation when markets are noisy.
✨ Box overlays visually segment the engulfed range—clearer than single‑bar markers.
✨ Lightweight: one input, zero repaint, and capped at 500 boxes to keep charts responsive.
✨ Ready‑to‑use alerts—no extra code needed for automation.
HOW USER CAN BENIFIT FROM IT :
- Spot early reversal zones or continuation thrusts without scanning candle by candle.
- Pair the alerts with trading bots, TradingView strategy testers, or mobile push notifications.
- Adapt the strictness (Body vs. Wicks vs. Both) to suit different assets, timeframes, or volatility regimes.
- Use the colored range boxes as dynamic support/resistance references for entries, targets, and stop‑loss placement.
📌 Tip: Test on multiple instruments and timeframes to find the sweet spot that matches your risk profile. This script is for educational purposes—always combine with sound risk management and confirm signals with broader market context.
Disclaimer :
This Video is not financial advice, it's for educational purposes only highlighting the power of coding( pine script) in TradingView, I am not a SEBI-registered advisor. Trading and investing involve risk, and you should consult with a qualified financial advisor before making any trading decisions. I do not guarantee profits or take responsibility for any losses you may incur.
Vùng đỉnh đáy chính + Bob Volman (Dữ liệu H1)This indicator combines two powerful components into one tool designed for traders who rely on multi-timeframe structure and price action:
🔹 1. H1 Break-Based Swing Zone Detection
Identifies key swing highs and lows based on H1 "break candle" logic — where a candle closes beyond the wick of the previous candle.
When a previous high or low is broken, a new range is drawn and trend context is updated:
🟢 Uptrend = price breaks above key high → green range
🔴 Downtrend = price breaks below key low → red range
⚪ Neutral = no new break → white range
Key swing points are marked with minimal dot labels on the chart for quick structure recognition.
🔹 2. Bob Volman-Style EMAs & Engulfing Signals (from H1)
Applies EMA 15, 21, and 35 from the H1 timeframe to reflect market bias and volatility.
Highlights the area between EMA 15 and EMA 35 with a colored fill to visualize momentum:
Green = bullish bias
Red = bearish bias
Detects classic Bullish and Bearish Engulfing Candles on H1 and marks them with arrows:
🔽 Red arrow = bearish engulfing
🔼 Green arrow = bullish engulfing
Last xHL📈 Last xHL – Visualize Key Highs and Lows
This script highlights the most recent significant highs and lows over a user-defined period, helping traders quickly identify key support and resistance zones.
🔍 Features:
Highest High (HH) and Highest Close/Open (HC) lines
Lowest Low (LL) and Lowest Close/Open (LC) lines
Dynamic updates with each new bar
Gradient-filled zones between HH–HC and LL–LC for visual clarity
⚙️ Customization:
Adjustable lookback period (_length) to suit your trading style
Color-coded lines and fills for quick interpretation
🧠 Use Case:
This tool is ideal for traders who want to:
Spot potential breakout or reversal zones
Identify price compression or expansion areas
Enhance their technical analysis with visual cues
This script is for educational and informational purposes only. It does not constitute financial advice. Always do your own research before making trading decisions.
YAS V1Use on chart
6
80
This advanced "All-in-One" indicator combines the most powerful smart money concepts (SMC), order blocks (OB), fair value gaps (FVG), support & resistance (SR), and liquidity voids, along with entry signals based on EMA and RSI filters.
💡 Key Features:
✅ Order Blocks (OB):
Highlights potential bullish and bearish order blocks to identify strong institutional zones where price might reverse.
✅ Fair Value Gaps (FVG):
Marks price gaps that indicate imbalance and possible zones for retracement or continuation.
✅ Support & Resistance (SR):
Automatically plots dynamic support and resistance levels using pivots, helping you to spot key reaction areas.
✅ Liquidity Voids:
Visualizes potential liquidity gaps or low-volume areas that can act as price magnets.
✅ Buy & Sell Signals:
Generates dynamic BUY and SELL signals based on a combination of EMA trend filters and RSI overbought/oversold levels.
✅ Fully Configurable:
Choose which features to display (OB, FVG, SR, Liquidity Voids, signals).
Adjust EMA and RSI settings to match your strategy.
Control the number of signals (reduce or increase) using a signal sensitivity filter.
⚙️ How it Works:
Trend Filter (EMA):
Price above EMA confirms a bullish environment, below EMA confirms bearish.
RSI Filter:
Signals are validated with RSI to avoid overtrading in ranging markets.
Zones & Gaps:
Institutional concepts (order blocks, gaps) help traders understand supply/demand and price inefficiencies.
🎯 Usage:
Perfect for:
Scalpers looking for intraday turning points.
Swing traders spotting high-probability levels.
Anyone interested in smart money concepts.
🚨 Alerts:
Includes built-in alerts for both BUY and SELL signals so you can react instantly without watching the screen all the time.
💬 Note:
This is a beta version designed to be improved with community feedback. Use it as a guide, and always confirm signals with your own analysis and risk management.
🔥 Ready to take your trading to the next level? Add this indicator to your chart, customize the settings, and start seeing the market like smart money!
Price Action Concepts [StratifyTrade]// This work is licensed under a Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) creativecommons.org
// © StratifyTrade - formerly know as HunterAlgos
//@version=5
indicator("Price Action Concepts ", shorttitle = "Price Action Concepts ", overlay = true, max_lines_count = 500, max_labels_count = 500, max_boxes_count = 500, max_bars_back = 500, max_polylines_count = 100)
//-----------------------------------------------------------------------------{
//Boolean set
//-----------------------------------------------------------------------------{
s_BOS = 0
s_CHoCH = 1
i_BOS = 2
i_CHoCH = 3
i_pp_CHoCH = 4
green_candle = 5
red_candle = 6
s_CHoCHP = 7
i_CHoCHP = 8
boolean =
array.from(
false
, false
, false
, false
, false
, false
, false
, false
, false
)
//-----------------------------------------------------------------------------{
// User inputs
//-----------------------------------------------------------------------------{
show_swing_ms = input.string ("All" , "Swing " , inline = "1", group = "MARKET STRUCTURE" , options = )
show_internal_ms = input.string ("All" , "Internal " , inline = "2", group = "MARKET STRUCTURE" , options = )
internal_r_lookback = input.int (5 , "" , inline = "2", group = "MARKET STRUCTURE" , minval = 2)
swing_r_lookback = input.int (50 , "" , inline = "1", group = "MARKET STRUCTURE" , minval = 2)
ms_mode = input.string ("Manual" , "Market Structure Mode" , inline = "a", group = "MARKET STRUCTURE" , tooltip = " Use selected lenght Use automatic lenght" ,options = )
show_mtf_str = input.bool (true , "MTF Scanner" , inline = "9", group = "MARKET STRUCTURE" , tooltip = "Display Multi-Timeframe Market Structure Trend Directions. Green = Bullish. Red = Bearish")
show_eql = input.bool (false , "Show EQH/EQL" , inline = "6", group = "MARKET STRUCTURE")
plotcandle_bool = input.bool (false , "Plotcandle" , inline = "3", group = "MARKET STRUCTURE" , tooltip = "Displays a cleaner colored candlestick chart in place of the default candles. (requires hiding the current ticker candles)")
barcolor_bool = input.bool (false , "Bar Color" , inline = "4", group = "MARKET STRUCTURE" , tooltip = "Color the candle bodies according to market strucutre trend")
i_ms_up_BOS = input.color (#089981 , "" , inline = "2", group = "MARKET STRUCTURE")
i_ms_dn_BOS = input.color (#f23645 , "" , inline = "2", group = "MARKET STRUCTURE")
s_ms_up_BOS = input.color (#089981 , "" , inline = "1", group = "MARKET STRUCTURE")
s_ms_dn_BOS = input.color (#f23645 , "" , inline = "1", group = "MARKET STRUCTURE")
lvl_daily = input.bool (false , "Day " , inline = "1", group = "HIGHS & LOWS MTF")
lvl_weekly = input.bool (false , "Week " , inline = "2", group = "HIGHS & LOWS MTF")
lvl_monthly = input.bool (false , "Month" , inline = "3", group = "HIGHS & LOWS MTF")
lvl_yearly = input.bool (false , "Year " , inline = "4", group = "HIGHS & LOWS MTF")
css_d = input.color (color.blue , "" , inline = "1", group = "HIGHS & LOWS MTF")
css_w = input.color (color.blue , "" , inline = "2", group = "HIGHS & LOWS MTF")
css_m = input.color (color.blue , "" , inline = "3", group = "HIGHS & LOWS MTF")
css_y = input.color (color.blue , "" , inline = "4", group = "HIGHS & LOWS MTF")
s_d = input.string ('⎯⎯⎯' , '' , inline = '1', group = 'HIGHS & LOWS MTF' , options = )
s_w = input.string ('⎯⎯⎯' , '' , inline = '2', group = 'HIGHS & LOWS MTF' , options = )
s_m = input.string ('⎯⎯⎯' , '' , inline = '3', group = 'HIGHS & LOWS MTF' , options = )
s_y = input.string ('⎯⎯⎯' , '' , inline = '4', group = 'HIGHS & LOWS MTF' , options = )
ob_show = input.bool (true , "Show Last " , inline = "1", group = "VOLUMETRIC ORDER BLOCKS" , tooltip = "Display volumetric order blocks on the chart Ammount of volumetric order blocks to show")
ob_num = input.int (5 , "" , inline = "1", group = "VOLUMETRIC ORDER BLOCKS" , tooltip = "Orderblocks number", minval = 1, maxval = 10)
ob_metrics_show = input.bool (true , "Internal Buy/Sell Activity" , inline = "2", group = "VOLUMETRIC ORDER BLOCKS" , tooltip = "Display volume metrics that have formed the orderblock")
css_metric_up = input.color (color.new(#089981, 50) , " " , inline = "2", group = "VOLUMETRIC ORDER BLOCKS")
css_metric_dn = input.color (color.new(#f23645 , 50) , "" , inline = "2", group = "VOLUMETRIC ORDER BLOCKS")
ob_swings = input.bool (false , "Swing Order Blocks" , inline = "a", group = "VOLUMETRIC ORDER BLOCKS" , tooltip = "Display swing volumetric order blocks")
css_swing_up = input.color (color.new(color.gray , 90) , " " , inline = "a", group = "VOLUMETRIC ORDER BLOCKS")
css_swing_dn = input.color (color.new(color.silver, 90) , "" , inline = "a", group = "VOLUMETRIC ORDER BLOCKS")
ob_filter = input.string ("None" , "Filtering " , inline = "d", group = "VOLUMETRIC ORDER BLOCKS" , tooltip = "Filter out volumetric order blocks by BOS/CHoCH/CHoCH+", options = )
ob_mitigation = input.string ("Absolute" , "Mitigation " , inline = "4", group = "VOLUMETRIC ORDER BLOCKS" , tooltip = "Trigger to remove volumetric order blocks", options = )
ob_pos = input.string ("Precise" , "Positioning " , inline = "k", group = "VOLUMETRIC ORDER BLOCKS" , tooltip = "Position of the Order Block Cover the whole candle Cover half candle Adjust to volatility Same as Accurate but more precise", options = )
use_grayscale = input.bool (false , "Grayscale" , inline = "6", group = "VOLUMETRIC ORDER BLOCKS" , tooltip = "Use gray as basic order blocks color")
use_show_metric = input.bool (true , "Show Metrics" , inline = "7", group = "VOLUMETRIC ORDER BLOCKS" , tooltip = "Show volume associated with the orderblock and his relevance")
use_middle_line = input.bool (true , "Show Middle-Line" , inline = "8", group = "VOLUMETRIC ORDER BLOCKS" , tooltip = "Show mid-line order blocks")
use_overlap = input.bool (true , "Hide Overlap" , inline = "9", group = "VOLUMETRIC ORDER BLOCKS" , tooltip = "Hide overlapping order blocks")
use_overlap_method = input.string ("Previous" , "Overlap Method " , inline = "Z", group = "VOLUMETRIC ORDER BLOCKS" , tooltip = " Preserve the most recent volumetric order blocks Preserve the previous volumetric order blocks", options = )
ob_bull_css = input.color (color.new(#089981 , 90) , "" , inline = "1", group = "VOLUMETRIC ORDER BLOCKS")
ob_bear_css = input.color (color.new(#f23645 , 90) , "" , inline = "1", group = "VOLUMETRIC ORDER BLOCKS")
show_acc_dist_zone = input.bool (false , "" , inline = "1", group = "Accumulation And Distribution")
zone_mode = input.string ("Fast" , "" , inline = "1", group = "Accumulation And Distribution" , tooltip = " Find small zone pattern formation Find bigger zone pattern formation" ,options = )
acc_css = input.color (color.new(#089981 , 60) , "" , inline = "1", group = "Accumulation And Distribution")
dist_css = input.color (color.new(#f23645 , 60) , "" , inline = "1", group = "Accumulation And Distribution")
show_lbl = input.bool (false , "Show swing point" , inline = "1", group = "High and Low" , tooltip = "Display swing point")
show_mtb = input.bool (false , "Show High/Low/Equilibrium" , inline = "2", group = "High and Low" , tooltip = "Display Strong/Weak High And Low and Equilibrium")
toplvl = input.color (color.red , "Premium Zone " , inline = "3", group = "High and Low")
midlvl = input.color (color.white , "Equilibrium Zone" , inline = "4", group = "High and Low")
btmlvl = input.color (#089981 , "Discount Zone " , inline = "5", group = "High and Low")
fvg_enable = input.bool (false , " " , inline = "1", group = "FAIR VALUE GAP" , tooltip = "Display fair value gap")
what_fvg = input.string ("FVG" , "" , inline = "1", group = "FAIR VALUE GAP" , tooltip = "Display fair value gap", options = )
fvg_num = input.int (5 , "Show Last " , inline = "1a", group = "FAIR VALUE GAP" , tooltip = "Number of fvg to show")
fvg_upcss = input.color (color.new(#089981, 80) , "" , inline = "1", group = "FAIR VALUE GAP")
fvg_dncss = input.color (color.new(color.red , 80) , "" , inline = "1", group = "FAIR VALUE GAP")
fvg_extend = input.int (10 , "Extend FVG" , inline = "2", group = "FAIR VALUE GAP" , tooltip = "Extend the display of the FVG.")
fvg_src = input.string ("Close" , "Mitigation " , inline = "3", group = "FAIR VALUE GAP" , tooltip = " Use the close of the body as trigger Use the extreme point of the body as trigger", options = )
fvg_tf = input.timeframe ("" , "Timeframe " , inline = "4", group = "FAIR VALUE GAP" , tooltip = "Timeframe of the fair value gap")
t = color.t (ob_bull_css)
invcol = color.new (color.white , 100)
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - UDT }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
type bar
float o = open
float c = close
float h = high
float l = low
float v = volume
int n = bar_index
int t = time
type Zphl
line top
line bottom
label top_label
label bottom_label
bool stopcross
bool sbottomcross
bool itopcross
bool ibottomcross
string txtup
string txtdn
float topy
float bottomy
float topx
float bottomx
float tup
float tdn
int tupx
int tdnx
float itopy
float itopx
float ibottomy
float ibottomx
float uV
float dV
type FVG
box box
line ln
bool bull
float top
float btm
int left
int right
type ms
float p
int n
float l
type msDraw
int n
float p
color css
string txt
bool bull
type obC
float top
float btm
int left
float avg
float dV
float cV
int wM
int blVP
int brVP
int dir
float h
float l
int n
type obD
box ob
box eOB
box blB
box brB
line mL
type zone
chart.point points
float p
int c
int t
type hqlzone
box pbx
box ebx
box lbx
label plb
label elb
label lbl
type ehl
float pt
int t
float pb
int b
type pattern
string found = "None"
bool isfound = false
int period = 0
bool bull = false
type alerts
bool chochswing = false
bool chochplusswing = false
bool swingbos = false
bool chochplus = false
bool choch = false
bool bos = false
bool equal = false
bool ob = false
bool swingob = false
bool zone = false
bool fvg = false
bool obtouch = false
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - End }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - General Setup }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
bar b = bar.new()
var pattern p = pattern.new()
alerts blalert = alerts.new()
alerts bralert = alerts.new()
if p.isfound
p.period += 1
if p.period == 50
p.period := 0
p.found := "None"
p.isfound := false
p.bull := na
switch
b.c > b.o => boolean.set(green_candle, true)
b.c < b.o => boolean.set(red_candle , true)
f_zscore(src, lookback) =>
(src - ta.sma(src, lookback)) / ta.stdev(src, lookback)
var int iLen = internal_r_lookback
var int sLen = swing_r_lookback
vv = f_zscore(((close - close ) / close ) * 100,iLen)
if ms_mode == "Dynamic"
switch
vv >= 1.5 or vv <= -1.5 => iLen := 10
vv >= 1.6 or vv <= -1.6 => iLen := 9
vv >= 1.7 or vv <= -1.7 => iLen := 8
vv >= 1.8 or vv <= -1.8 => iLen := 7
vv >= 1.9 or vv <= -1.9 => iLen := 6
vv >= 2.0 or vv <= -2.0 => iLen := 5
=> iLen
var msline = array.new(0)
iH = ta.pivothigh(high, iLen, iLen)
sH = ta.pivothigh(high, sLen, sLen)
iL = ta.pivotlow (low , iLen, iLen)
sL = ta.pivotlow (low , sLen, sLen)
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - End }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - ARRAYS }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
hl () =>
= request.security(syminfo.tickerid , 'D' , hl() , lookahead = barmerge.lookahead_on)
= request.security(syminfo.tickerid , 'W' , hl() , lookahead = barmerge.lookahead_on)
= request.security(syminfo.tickerid , 'M' , hl() , lookahead = barmerge.lookahead_on)
= request.security(syminfo.tickerid , '12M', hl() , lookahead = barmerge.lookahead_on)
lstyle(style) =>
out = switch style
'⎯⎯⎯' => line.style_solid
'----' => line.style_dashed
'····' => line.style_dotted
mtfphl(h, l ,tf ,css, pdhl_style) =>
var line hl = line.new(
na
, na
, na
, na
, xloc = xloc.bar_time
, color = css
, style = lstyle(pdhl_style)
)
var line ll = line.new(
na
, na
, na
, na
, xloc = xloc.bar_time
, color = css
, style = lstyle(pdhl_style)
)
var label lbl = label.new(
na
, na
, xloc = xloc.bar_time
, text = str.format('P{0}L', tf)
, color = invcol
, textcolor = css
, size = size.small
, style = label.style_label_left
)
var label hlb = label.new(
na
, na
, xloc = xloc.bar_time
, text = str.format('P{0}H', tf)
, color = invcol
, textcolor = css
, size = size.small
, style = label.style_label_left
)
hy = ta.valuewhen(h != h , h , 1)
hx = ta.valuewhen(h == high , time , 1)
ly = ta.valuewhen(l != l , l , 1)
lx = ta.valuewhen(l == low , time , 1)
if barstate.islast
extension = time + (time - time ) * 50
line.set_xy1(hl , hx , hy)
line.set_xy2(hl , extension , hy)
label.set_xy(hlb, extension , hy)
line.set_xy1(ll , lx , ly)
line.set_xy2(ll , extension , ly)
label.set_xy(lbl, extension , ly)
if lvl_daily
mtfphl(pdh , pdl , 'D' , css_d, s_d)
if lvl_weekly
mtfphl(pwh , pwl , 'W' , css_w, s_w)
if lvl_monthly
mtfphl(pmh , pml, 'M' , css_m, s_m)
if lvl_yearly
mtfphl(pyh , pyl , '12M', css_y, s_y)
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - End }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - Market Structure }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
method darkcss(color css, float factor, bool bull) =>
blue = color.b(css) * (1 - factor)
red = color.r(css) * (1 - factor)
green = color.g(css) * (1 - factor)
color.rgb(red, green, blue, 0)
method f_line(msDraw d, size, style) =>
var line id = na
var label lbl = na
id := line.new(
d.n
, d.p
, b.n
, d.p
, color = d.css
, width = 1
, style = style
)
if msline.size() >= 250
line.delete(msline.shift())
msline.push(id)
lbl := label.new(
int(math.avg(d.n, b.n))
, d.p
, d.txt
, color = invcol
, textcolor = d.css
, style = d.bull ? label.style_label_down : label.style_label_up
, size = size
, text_font_family = font.family_monospace
)
structure(bool mtf) =>
msDraw drw = na
bool isdrw = false
bool isdrwS = false
var color css = na
var color icss = na
var int itrend = 0
var int trend = 0
bool bull_ob = false
bool bear_ob = false
bool s_bull_ob = false
bool s_bear_ob = false
n = bar_index
var ms up = ms.new(
array.new()
, array.new< int >()
, array.new()
)
var ms dn = ms.new(
array.new()
, array.new< int >()
, array.new()
)
var ms sup = ms.new(
array.new()
, array.new< int >()
, array.new()
)
var ms sdn = ms.new(
array.new()
, array.new< int >()
, array.new()
)
switch show_swing_ms
"All" => boolean.set(s_BOS , true ), boolean.set(s_CHoCH, true ) , boolean.set(s_CHoCHP, true )
"CHoCH" => boolean.set(s_BOS , false), boolean.set(s_CHoCH, true ) , boolean.set(s_CHoCHP, false )
"CHoCH+" => boolean.set(s_BOS , false), boolean.set(s_CHoCH, false) , boolean.set(s_CHoCHP, true )
"BOS" => boolean.set(s_BOS , true ), boolean.set(s_CHoCH, false) , boolean.set(s_CHoCHP, false )
"None" => boolean.set(s_BOS , false), boolean.set(s_CHoCH, false) , boolean.set(s_CHoCHP, false )
=> na
switch show_internal_ms
"All" => boolean.set(i_BOS, true ), boolean.set(i_CHoCH, true ), boolean.set(i_CHoCHP, true )
"CHoCH" => boolean.set(i_BOS, false), boolean.set(i_CHoCH, true ), boolean.set(i_CHoCHP, false)
"CHoCH+" => boolean.set(i_BOS, false), boolean.set(i_CHoCH, false ), boolean.set(i_CHoCHP, true )
"BOS" => boolean.set(i_BOS, true ), boolean.set(i_CHoCH, false ), boolean.set(i_CHoCHP, false)
"None" => boolean.set(i_BOS, false), boolean.set(i_CHoCH, false ), boolean.set(i_CHoCHP, false)
=> na
switch
iH =>
up.p.unshift(b.h )
up.l.unshift(b.h )
up.n.unshift(n )
iL =>
dn.p.unshift(b.l )
dn.l.unshift(b.l )
dn.n.unshift(n )
sL =>
sdn.p.unshift(b.l )
sdn.l.unshift(b.l )
sdn.n.unshift(n )
sH =>
sup.p.unshift(b.h )
sup.l.unshift(b.h )
sup.n.unshift(n )
// INTERNAL BULLISH STRUCTURE
if up.p.size() > 0 and dn.l.size() > 1
if ta.crossover(b.c, up.p.first())
bool CHoCH = na
string txt = na
if itrend < 0
CHoCH := true
switch
not CHoCH =>
txt := "BOS"
css := i_ms_up_BOS
blalert.bos := true
if boolean.get(i_BOS) and mtf == false and na(drw)
isdrw := true
drw := msDraw.new(
up.n.first()
, up.p.first()
, i_ms_up_BOS
, txt
, true
)
CHoCH =>
dn.l.first() > dn.l.get(1) ? blalert.chochplus : blalert.choch
txt := dn.l.first() > dn.l.get(1) ? "CHoCH+" : "CHoCH"
css := i_ms_up_BOS.darkcss(0.25, true)
if (dn.l.first() > dn.l.get(1) ? boolean.get(i_CHoCHP) : boolean.get(i_CHoCH)) and mtf == false and na(drw)
isdrw := true
drw := msDraw.new(
up.n.first()
, up.p.first()
, i_ms_up_BOS.darkcss(0.25, true)
, txt
, true
)
if mtf == false
switch
ob_filter == "None" => bull_ob := true
ob_filter == "BOS" and txt == "BOS" => bull_ob := true
ob_filter == "CHoCH" and txt == "CHoCH" => bull_ob := true
ob_filter == "CHoCH+" and txt == "CHoCH+" => bull_ob := true
itrend := 1
up.n.clear()
up.p.clear()
// INTERNAL BEARISH STRUCTURE
if dn.p.size() > 0 and up.l.size() > 1
if ta.crossunder(b.c, dn.p.first())
bool CHoCH = na
string txt = na
if itrend > 0
CHoCH := true
switch
not CHoCH =>
bralert.bos := true
txt := "BOS"
css := i_ms_dn_BOS
if boolean.get(i_BOS) and mtf == false and na(drw)
isdrw := true
drw := msDraw.new(
dn.n.first()
, dn.p.first()
, i_ms_dn_BOS
, txt
, false
)
CHoCH =>
if up.l.first() < up.l.get(1)
bralert.chochplus := true
else
bralert.choch := true
txt := up.l.first() < up.l.get(1) ? "CHoCH+" : "CHoCH"
css := i_ms_dn_BOS.darkcss(0.25, false)
if (up.l.first() < up.l.get(1) ? boolean.get(i_CHoCHP) : boolean.get(i_CHoCH)) and mtf == false and na(drw)
isdrw := true
drw := msDraw.new(
dn.n.first()
, dn.p.first()
, i_ms_dn_BOS.darkcss(0.25, false)
, txt
, false
)
if mtf == false
switch
ob_filter == "None" => bear_ob := true
ob_filter == "BOS" and txt == "BOS" => bear_ob := true
ob_filter == "CHoCH" and txt == "CHoCH" => bear_ob := true
ob_filter == "CHoCH+" and txt == "CHoCH+" => bear_ob := true
itrend := -1
dn.n.clear()
dn.p.clear()
// SWING BULLISH STRUCTURE
if sup.p.size() > 0 and sdn.l.size() > 1
if ta.crossover(b.c, sup.p.first())
bool CHoCH = na
string txt = na
if trend < 0
CHoCH := true
switch
not CHoCH =>
blalert.swingbos := true
txt := "BOS"
icss := s_ms_up_BOS
if boolean.get(s_BOS) and mtf == false and na(drw)
isdrwS := true
drw := msDraw.new(
sup.n.first()
, sup.p.first()
, s_ms_up_BOS
, txt
, true
)
CHoCH =>
if sdn.l.first() > sdn.l.get(1)
blalert.chochplusswing := true
else
blalert.chochswing := true
txt := sdn.l.first() > sdn.l.get(1) ? "CHoCH+" : "CHoCH"
icss := s_ms_up_BOS.darkcss(0.25, true)
if (sdn.l.first() > sdn.l.get(1) ? boolean.get(s_CHoCHP) : boolean.get(s_CHoCH)) and mtf == false and na(drw)
isdrwS := true
drw := msDraw.new(
sup.n.first()
, sup.p.first()
, s_ms_up_BOS.darkcss(0.25, true)
, txt
, true
)
if mtf == false
switch
ob_filter == "None" => s_bull_ob := true
ob_filter == "BOS" and txt == "BOS" => s_bull_ob := true
ob_filter == "CHoCH" and txt == "CHoCH" => s_bull_ob := true
ob_filter == "CHoCH+" and txt == "CHoCH+" => s_bull_ob := true
trend := 1
sup.n.clear()
sup.p.clear()
// SWING BEARISH STRUCTURE
if sdn.p.size() > 0 and sup.l.size() > 1
if ta.crossunder(b.c, sdn.p.first())
bool CHoCH = na
string txt = na
if trend > 0
CHoCH := true
switch
not CHoCH =>
bralert.swingbos := true
txt := "BOS"
icss := s_ms_dn_BOS
if boolean.get(s_BOS) and mtf == false and na(drw)
isdrwS := true
drw := msDraw.new(
sdn.n.first()
, sdn.p.first()
, s_ms_dn_BOS
, txt
, false
)
CHoCH =>
if sup.l.first() < sup.l.get(1)
bralert.chochplusswing := true
else
bralert.chochswing := true
txt := sup.l.first() < sup.l.get(1) ? "CHoCH+" : "CHoCH"
icss := s_ms_dn_BOS.darkcss(0.25, false)
if (sup.l.first() < sup.l.get(1) ? boolean.get(s_CHoCHP) : boolean.get(s_CHoCH)) and mtf == false and na(drw)
isdrwS := true
drw := msDraw.new(
sdn.n.first()
, sdn.p.first()
, s_ms_dn_BOS.darkcss(0.25, false)
, txt
, false
)
if mtf == false
switch
ob_filter == "None" => s_bear_ob := true
ob_filter == "BOS" and txt == "BOS" => s_bear_ob := true
ob_filter == "CHoCH" and txt == "CHoCH" => s_bear_ob := true
ob_filter == "CHoCH+" and txt == "CHoCH+" => s_bear_ob := true
trend := -1
sdn.n.clear()
sdn.p.clear()
= structure(false)
if isdrw
f_line(drw, size.small, line.style_dashed)
if isdrwS
f_line(drw, size.small, line.style_solid)
= request.security("", "15" , structure(true))
= request.security("", "60" , structure(true))
= request.security("", "240" , structure(true))
= request.security("", "1440" , structure(true))
if show_mtf_str
var tab = table.new(position = position.top_right, columns = 10, rows = 10, bgcolor = na, frame_color = color.rgb(54, 58, 69, 0), frame_width = 1, border_color = color.rgb(54, 58, 69, 100), border_width = 1)
table.cell(tab, 0, 1, text = "15" , text_color = color.silver, text_halign = text.align_center, text_size = size.normal, bgcolor = chart.bg_color, text_font_family = font.family_monospace, width = 2)
table.cell(tab, 0, 2, text = "1H" , text_color = color.silver, text_halign = text.align_center, text_size = size.normal, bgcolor = chart.bg_color, text_font_family = font.family_monospace, width = 2)
table.cell(tab, 0, 3, text = "4H" , text_color = color.silver, text_halign = text.align_center, text_size = size.normal, bgcolor = chart.bg_color, text_font_family = font.family_monospace, width = 2)
table.cell(tab, 0, 4, text = "1D" , text_color = color.silver, text_halign = text.align_center, text_size = size.normal, bgcolor = chart.bg_color, text_font_family = font.family_monospace, width = 2)
table.cell(tab, 1, 1, text = itrend15 == 1 ? "BULLISH" : itrend15 == -1 ? "BEARISH" : na , text_halign = text.align_center, text_size = size.normal, text_color = itrend15 == 1 ? i_ms_up_BOS.darkcss(-0.25, true) : itrend15 == -1 ? i_ms_dn_BOS.darkcss(0.25, false) : color.gray, bgcolor = chart.bg_color, text_font_family = font.family_monospace)
table.cell(tab, 1, 2, text = itrend1H == 1 ? "BULLISH" : itrend1H == -1 ? "BEARISH" : na , text_halign = text.align_center, text_size = size.normal, text_color = itrend1H == 1 ? i_ms_up_BOS.darkcss(-0.25, true) : itrend1H == -1 ? i_ms_dn_BOS.darkcss(0.25, false) : color.gray, bgcolor = chart.bg_color, text_font_family = font.family_monospace)
table.cell(tab, 1, 3, text = itrend4H == 1 ? "BULLISH" : itrend4H == -1 ? "BEARISH" : na , text_halign = text.align_center, text_size = size.normal, text_color = itrend4H == 1 ? i_ms_up_BOS.darkcss(-0.25, true) : itrend4H == -1 ? i_ms_dn_BOS.darkcss(0.25, false) : color.gray, bgcolor = chart.bg_color, text_font_family = font.family_monospace)
table.cell(tab, 1, 4, text = itrend1D == 1 ? "BULLISH" : itrend1D == -1 ? "BEARISH" : na , text_halign = text.align_center, text_size = size.normal, text_color = itrend1D == 1 ? i_ms_up_BOS.darkcss(-0.25, true) : itrend1D == -1 ? i_ms_dn_BOS.darkcss(0.25, false) : color.gray, bgcolor = chart.bg_color, text_font_family = font.family_monospace)
table.cell(tab, 0, 5, text = "Detected Pattern", text_halign = text.align_center, text_size = size.normal, text_color = color.silver, bgcolor = chart.bg_color, text_font_family = font.family_monospace)
table.cell(tab, 0, 6, text = p.found, text_halign = text.align_center, text_size = size.normal, text_color = na(p.bull) ? color.white : p.bull ? i_ms_up_BOS.darkcss(-0.25, true) : p.bull == false ? i_ms_dn_BOS.darkcss(0.25, false) : na, bgcolor = chart.bg_color, text_font_family = font.family_monospace)
table.merge_cells(tab, 0, 5, 1, 5)
table.merge_cells(tab, 0, 6, 1, 6)
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - End }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - Strong/Weak High/Low And Equilibrium }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
var phl = Zphl.new(
na
, na
, label.new(na , na , color = invcol , textcolor = i_ms_dn_BOS , style = label.style_label_down , size = size.tiny , text = "")
, label.new(na , na , color = invcol , textcolor = i_ms_up_BOS , style = label.style_label_up , size = size.tiny , text = "")
, true
, true
, true
, true
, ""
, ""
, 0
, 0
, 0
, 0
, high
, low
, 0
, 0
, 0
, 0
, 0
, 0
, na
, na
)
zhl(len)=>
upper = ta.highest(len)
lower = ta.lowest(len)
var float out = 0
out := b.h > upper ? 0 : b.l < lower ? 1 : out
top = out == 0 and out != 0 ? b.h : 0
btm = out == 1 and out != 1 ? b.l : 0
= zhl(sLen)
= zhl(iLen)
upphl(trend) =>
var label lbl = label.new(
na
, na
, color = invcol
, textcolor = toplvl
, style = label.style_label_down
, size = size.small
)
if top
phl.stopcross := true
phl.txtup := top > phl.topy ? "HH" : "HL"
if show_lbl
topl = label.new(
b.n - swing_r_lookback
, top
, phl.txtup
, color = invcol
, textcolor = toplvl
, style = label.style_label_down
, size = size.small
)
line.delete(phl.top )
phl.top := line.new(
b.n - sLen
, top
, b.n
, top
, color = toplvl)
phl.topy := top
phl.topx := b.n - sLen
phl.tup := top
phl.tupx := b.n - sLen
if itop
phl.itopcross := true
phl.itopy := itop
phl.itopx := b.n - iLen
phl.tup := math.max(high, phl.tup)
phl.tupx := phl.tup == high ? b.n : phl.tupx
phl.uV := phl.tup != phl.tup ? b.v : phl.uV
if barstate.islast
line.set_xy1(
phl.top
, phl.tupx
, phl.tup
)
line.set_xy2(
phl.top
, b.n + 50
, phl.tup
)
label.set_x(
lbl
, b.n + 50
)
label.set_y(
lbl
, phl.tup
)
dist = math.abs(phl.uV / (phl.uV + phl.dV)) * 100
label.set_text (lbl, trend < 0
? "Strong High | " + str.tostring(phl.uV, format.volume) + " (" + str.tostring(math.round(dist,0)) + "%)"
: "Weak High | " + str.tostring(phl.uV, format.volume) + " (" + str.tostring(math.round(dist,0)) + "%)")
dnphl(trend) =>
var label lbl = label.new(
na
, na
, color = invcol
, textcolor = btmlvl
, style = label.style_label_up
, size = size.small
)
if btm
phl.sbottomcross := true
phl.txtdn := btm > phl.bottomy ? "LH" : "LL"
if show_lbl
btml = label.new(
b.n - swing_r_lookback
, btm, phl.txtdn
, color = invcol
, textcolor = btmlvl
, style = label.style_label_up
, size = size.small
)
line.delete(phl.bottom )
phl.bottom := line.new(
b.n - sLen
, btm
, b.n
, btm
, color = btmlvl
)
phl.bottomy := btm
phl.bottomx := b.n - sLen
phl.tdn := btm
phl.tdnx := b.n - sLen
if ibtm
phl.ibottomcross := true
phl.ibottomy := ibtm
phl.ibottomx := b.n - iLen
phl.tdn := math.min(low, phl.tdn)
phl.tdnx := phl.tdn == low ? b.n : phl.tdnx
phl.dV := phl.tdn != phl.tdn ? b.v : phl.dV
if barstate.islast
line.set_xy1(
phl.bottom
, phl.tdnx
, phl.tdn
)
line.set_xy2(
phl.bottom
, b.n + 50
, phl.tdn
)
label.set_x(
lbl
, b.n + 50
)
label.set_y(
lbl
, phl.tdn
)
dist = math.abs(phl.dV / (phl.uV + phl.dV)) * 100
label.set_text (lbl, trend > 0
? "Strong Low | " + str.tostring(phl.dV, format.volume) + " (" + str.tostring(math.round(dist,0)) + "%)"
: "Weak Low | " + str.tostring(phl.uV, format.volume) + " (" + str.tostring(math.round(dist,0)) + "%)")
midphl() =>
avg = math.avg(phl.bottom.get_y2(), phl.top.get_y2())
var line l = line.new(
y1 = avg
, y2 = avg
, x1 = b.n - sLen
, x2 = b.n + 50
, color = midlvl
, style = line.style_solid
)
var label lbl = label.new(
x = b.n + 50
, y = avg
, text = "Equilibrium"
, style = label.style_label_left
, color = invcol
, textcolor = midlvl
, size = size.small
)
if barstate.islast
more = (phl.bottom.get_x1() + phl.bottom.get_x2()) > (phl.top.get_x1() + phl.top.get_x2()) ? phl.top.get_x1() : phl.bottom.get_x1()
line.set_xy1(l , more , avg)
line.set_xy2(l , b.n + 50, avg)
label.set_x (lbl , b.n + 50 )
label.set_y (lbl , avg )
dist = math.abs((l.get_y2() - close) / close) * 100
label.set_text (lbl, "Equilibrium (" + str.tostring(math.round(dist,0)) + "%)")
hqlzone() =>
if barstate.islast
var hqlzone dZone = hqlzone.new(
box.new(
na
, na
, na
, na
, bgcolor = color.new(toplvl, 70)
, border_color = na
)
, box.new(
na
, na
, na
, na
, bgcolor = color.new(midlvl, 70)
, border_color = na
)
, box.new(
na
, na
, na
, na
, bgcolor = color.new(btmlvl, 70)
, border_color = na
)
, label.new(na, na, text = "Premium" , color = invcol, textcolor = toplvl, style = label.style_label_down, size = size.small)
, label.new(na, na, text = "Equilibrium", color = invcol, textcolor = midlvl, style = label.style_label_left, size = size.small)
, label.new(na, na, text = "Discount" , color = invcol, textcolor = btmlvl, style = label.style_label_up , size = size.small)
)
dZone.pbx.set_lefttop(int(math.max(phl.topx, phl.bottomx)) , phl.tup)
dZone.pbx.set_rightbottom(b.n + 50 , 0.95 * phl.tup + 0.05 * phl.tdn)
dZone.ebx.set_lefttop(int(math.max(phl.topx, phl.bottomx)), 0.525 * phl.tup + 0.475 * phl.tdn)
dZone.ebx.set_rightbottom(b.n + 50 , 0.525 * phl.tdn + 0.475 * phl.tup)
dZone.lbx.set_lefttop(int(math.max(phl.topx, phl.bottomx)), 0.95 * phl.tdn + 0.05 * phl.tup)
dZone.lbx.set_rightbottom(b.n + 50 , phl.tdn)
dZone.plb.set_xy( int(math.avg(math.max(phl.topx, phl.bottomx), int(b.n + 50))) , phl.tup)
dZone.elb.set_xy( int(b.n + 50) , math.avg(phl.tup, phl.tdn))
dZone.lbl.set_xy( int(math.avg(math.max(phl.topx, phl.bottomx), int(b.n + 50))) , phl.tdn)
if show_mtb
upphl (trend)
dnphl (trend)
hqlzone()
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - End }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - Volumetric Order Block }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
method eB(box b, bool ext, color css, bool swing) =>
b.unshift(
box.new(
na
, na
, na
, na
, xloc = xloc.bar_time
, text_font_family = font.family_monospace
, extend = ext ? extend.right : extend.none
, border_color = swing ? color.new(css, 0) : color.new(color.white,100)
, bgcolor = css
, border_width = 1
)
)
method eL(line l, bool ext, bool solid, color css) =>
l.unshift(
line.new(
na
, na
, na
, na
, width = 1
, color = css
, xloc = xloc.bar_time
, extend = ext ? extend.right : extend.none
, style = solid ? line.style_solid : line.style_dashed
)
)
method drawVOB(bool cdn, bool bull, color css, int loc, bool swing) =>
= request.security(
syminfo.tickerid
, ""
,
, lookahead = barmerge.lookahead_off
)
var obC obj = obC.new(
array.new()
, array.new()
, array.new< int >()
, array.new()
, array.new()
, array.new()
, array.new< int >()
, array.new< int >()
, array.new< int >()
, array.new< int >()
, array.new()
, array.new()
, array.new< int >()
)
var obD draw = obD.new(
array.new()
, array.new()
, array.new()
, array.new()
, array.new()
)
if barstate.isfirst
for i = 0 to ob_num - 1
draw.mL .eL(false, false, use_grayscale ? color.new(color.gray, 0) : color.new(css,0))
draw.ob .eB(false, use_grayscale ? color.new(color.gray, 90) : css, swing)
draw.blB.eB(false, css_metric_up , swing)
draw.brB.eB(false, css_metric_dn , swing)
draw.eOB.eB(true , use_grayscale ? color.new(color.gray, 90) : css, swing)
float pos = ob_pos == "Full"
? (bull ? high : low)
: ob_pos == "Middle"
? ohlc4
: ob_pos == "Accurate"
? hl2
: hl2
if cdn
obj.h.clear()
obj.l.clear()
obj.n.clear()
for i = 1 to math.abs((loc - b.n)) - 1
obj.h.push(hH )
obj.l.push(lL )
obj.n.push(b.t )
// obj.h.reverse()
// obj.l.reverse()
int iU = obj.l.indexof(obj.l.min()) + 1
int iD = obj.h.indexof(obj.h.max()) + 1
obj.dir.unshift(
bull
? (b.c > b.o ? 1 : -1)
: (b.c > b.o ? 1 : -1)
)
obj.top.unshift(
bull
? pos
: obj.h.max()
)
obj.btm.unshift(
bull
? obj.l.min()
: pos
)
obj.left.unshift(
bull
? obj.n.get(obj.l.indexof(obj.l.min()))
: obj.n.get(obj.h.indexof(obj.h.max()))
)
obj.avg.unshift(
math.avg(obj.top.first(), obj.btm.first())
)
obj.cV.unshift(
bull
? b.v
: b.v
)
if ob_pos == "Precise"
switch bull
true =>
if obj.avg.get(0) < (b.c < b.o ? b.c : b.o ) and obj.top.get(0) > hlcc4
obj.top.set(0, obj.avg.get(0))
obj.avg.set(0, math.avg(obj.top.first(), obj.btm.first()))
false =>
if obj.avg.get(0) > (b.c < b.o ? b.o : b.c ) and obj.btm.get(0) < hlcc4
obj.btm.set(0, obj.avg.get(0))
obj.avg.set(0, math.avg(obj.top.first(), obj.btm.first()))
obj.blVP.unshift ( 0 )
obj.brVP.unshift ( 0 )
obj.wM .unshift ( 1 )
if use_overlap
int rmP = use_overlap_method == "Recent" ? 1 : 0
if obj.avg.size() > 1
if bull
? obj.btm.first() < obj.top.get(1)
: obj.top.first() > obj.btm.get(1)
obj.wM .remove(rmP)
obj.cV .remove(rmP)
obj.dir .remove(rmP)
obj.top .remove(rmP)
obj.avg .remove(rmP)
obj.btm .remove(rmP)
obj.left .remove(rmP)
obj.blVP .remove(rmP)
obj.brVP .remove(rmP)
if barstate.isconfirmed
for x = 0 to ob_num - 1
tg = switch ob_mitigation
"Middle" => obj.avg
"Absolute" => bull ? obj.btm : obj.top
for in tg
if (bull ? cC < pt : cC > pt)
obj.wM .remove(idx)
obj.cV .remove(idx)
obj.dir .remove(idx)
obj.top .remove(idx)
obj.avg .remove(idx)
obj.btm .remove(idx)
obj.left .remove(idx)
obj.blVP .remove(idx)
obj.brVP .remove(idx)
if barstate.islast
if obj.avg.size() > 0
// Alert
if bull
? ta.crossunder(low , obj.top.get(0))
: ta.crossover (high, obj.btm.get(0))
switch bull
true => blalert.obtouch := true
false => bralert.obtouch := true
float tV = 0
obj.dV.clear()
seq = math.min(ob_num - 1, obj.avg.size() - 1)
for j = 0 to seq
tV += obj.cV.get(j)
if j == seq
for y = 0 to seq
obj.dV.unshift(
math.floor(
(obj.cV.get(y) / tV) * 100)
)
obj.dV.reverse()
for i = 0 to math.min(ob_num - 1, obj.avg.size() - 1)
dmL = draw.mL .get(i)
dOB = draw.ob .get(i)
dblB = draw.blB.get(i)
dbrB = draw.brB.get(i)
deOB = draw.eOB.get(i)
dOB.set_lefttop (obj.left .get(i) , obj.top.get(i))
deOB.set_lefttop (b.t , obj.top.get(i))
dOB.set_rightbottom (b.t , obj.btm.get(i))
deOB.set_rightbottom(b.t + (b.t - b.t ) * 100 , obj.btm.get(i))
if use_middle_line
dmL.set_xy1(obj.left.get(i), obj.avg.get(i))
dmL.set_xy2(b.t , obj.avg.get(i))
if ob_metrics_show
dblB.set_lefttop (obj.left.get(i), obj.top.get(i))
dbrB.set_lefttop (obj.left.get(i), obj.avg.get(i))
dblB.set_rightbottom(obj.left.get(i), obj.avg.get(i))
dbrB.set_rightbottom(obj.left.get(i), obj.btm.get(i))
rpBL = dblB.get_right()
rpBR = dbrB.get_right()
dbrB.set_right(rpBR + (b.t - b.t ) * obj.brVP.get(i))
dblB.set_right(rpBL + (b.t - b.t ) * obj.blVP.get(i))
if use_show_metric
txt = switch
obj.cV.get(i) >= 1000000000 => str.tostring(math.round(obj.cV.get(i) / 1000000000,3)) + "B"
obj.cV.get(i) >= 1000000 => str.tostring(math.round(obj.cV.get(i) / 1000000,3)) + "M"
obj.cV.get(i) >= 1000 => str.tostring(math.round(obj.cV.get(i) / 1000,3)) + "K"
obj.cV.get(i) < 1000 => str.tostring(math.round(obj.cV.get(i)))
deOB.set_text(
str.tostring(
txt + " (" + str.tostring(obj.dV.get(i)) + "%)")
)
deOB.set_text_size (size.auto)
deOB.set_text_halign(text.align_left)
deOB.set_text_color (use_grayscale ? color.silver : color.new(css, 0))
if ob_metrics_show and barstate.isconfirmed
if obj.wM.size() > 0
for i = 0 to obj.avg.size() - 1
switch obj.dir.get(i)
1 =>
switch obj.wM.get(i)
1 => obj.blVP.set(i, obj.blVP.get(i) + 1), obj.wM.set(i, 2)
2 => obj.blVP.set(i, obj.blVP.get(i) + 1), obj.wM.set(i, 3)
3 => obj.brVP.set(i, obj.brVP.get(i) + 1), obj.wM.set(i, 1)
-1 =>
switch obj.wM.get(i)
1 => obj.brVP.set(i, obj.brVP.get(i) + 1), obj.wM.set(i, 2)
2 => obj.brVP.set(i, obj.brVP.get(i) + 1), obj.wM.set(i, 3)
3 => obj.blVP.set(i, obj.blVP.get(i) + 1), obj.wM.set(i, 1)
var hN = array.new(1, b.n)
var lN = array.new(1, b.n)
var hS = array.new(1, b.n)
var lS = array.new(1, b.n)
if iH
hN.pop()
hN.unshift(int(b.n ))
if iL
lN.pop()
lN.unshift(int(b.n ))
if sH
hS.pop()
hS.unshift(int(b.n ))
if sL
lS.pop()
lS.unshift(int(b.n ))
if ob_show
bull_ob.drawVOB(true , ob_bull_css, hN.first(), false)
bear_ob.drawVOB(false, ob_bear_css, lN.first(), false)
if ob_swings
s_bull_ob.drawVOB(true , css_swing_up, hS.first(), true)
s_bear_ob.drawVOB(false, css_swing_dn, lS.first(), true)
if bull_ob
blalert.ob := true
if bear_ob
bralert.ob := true
if s_bull_ob
blalert.swingob := true
if s_bear_ob
blalert.swingob := true
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - End }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{ - FVG | VI | OG }
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
//{----------------------------------------------------------------------------------------------------------------------------------------------}
ghl() => request.security(syminfo.tickerid, fvg_tf, [high , low , close , open ])
tfG() => request.security(syminfo.tickerid, fvg_tf, )
cG(bool bull) =>
= ghl()
= tfG()
var FVG draw = FVG.new(
array.new()
, array.new()
)
var FVG cords = array.new()
float pup = na
float pdn = na
bool cdn = na
int pos = 2
cc = timeframe.change(fvg_tf)
if barstate.isfirst
for i = 0 to fvg_num - 1
draw.box.unshift(box.new (na, na, na, na, border_color = color.new(color.white, 100), xloc = xloc.bar_time))
draw.ln.unshift (line.new(na, na, na, na, xloc = xloc.bar_time, width = 1, style = line.style_solid))
switch what_fvg
"FVG" =>
pup := bull ? gl : l
pdn := bull ? h : gh
cdn := bull ? gl > h and cc : gh < l and cc
pos := 2
"VI" =>
pup := bull
? (gc > go
? go
: gc)
: (gc > go
? go
: gc )
pdn := bull
? (gc > go
? gc
: go )
: (gc > go
? gc
: go)
cdn := bull
? go > gc and gh > gl and gc > gc and go > go and gh < math.min(gc, go) and cc
: go < gc and gl < gh and gc < gc and go < go and gl > math.max(gc, go) and cc
pos := 1
"OG" =>
pup := bull ? b.l : gl
pdn := bull ? gh : gh
cdn := bull ? gl > gh and cc : gh < gl and cc
pos := 1
if not na(cdn) and cdn
cords.unshift(
FVG.new(
na
, na
, bull
? true
: false
, pup
, pdn
, b.t - (b.t - b.t ) * pos
, b.t + (b.t - b.t ) * fvg_extend)
)
if bull
blalert.fvg := tru
Fibonacci Retracement Engine (DFRE) [PhenLabs]📊 Fibonacci Retracement Engine (DFRE)
Version: PineScript™ v6
📌 Description
Dynamic Fibonacci Retracement Engine (DFRE) is a sophisticated technical analysis tool that automatically detects important swing points and draws precise Fibonacci retracement levels on various timeframes. The intelligent indicator eliminates the subjectivity of manual Fibonacci drawing using intelligent swing detection algorithms combined with multi timeframe confluence analysis.
Built for professional traders who demand accuracy and consistency, DFRE provides real time Fibonacci levels that adapt to modifications in market structure without sacrificing accuracy in changing market conditions. The indicator excels at identifying key support and resistance levels where price action is more likely to react, giving traders a potent edge in entry and exit timing.
🚀 Points of Innovation
Intelligent Swing Detection Algorithm : Advanced pivot detection with customizable confirmation bars and minimum swing percentage thresholds
Multi-Timeframe Confluence Engine : Simultaneous analysis across three timeframes to identify high-probability zones
Dynamic Level Management : Automatically updates and manages multiple Fibonacci sets while maintaining chart clarity
Adaptive Visualization System : Smart labeling that shows only the most relevant levels based on user preferences
Real-Time Confluence Detection : Identifies zones where multiple Fibonacci levels from different timeframes converge
Automated Alert System : Comprehensive notifications for level breakouts and confluence zone formations
🔧 Core Components
Swing Point Detection Engine : Uses pivot high/low calculations with strength confirmation to identify significant market turns
Fibonacci Calculator : Automatically computes standard retracement levels (0.236, 0.382, 0.5, 0.618, 0.786, 0.886) plus extensions (1.272, 1.618)
Multi-Timeframe Security Function : Safely retrieves Fibonacci data from higher timeframes without repainting
Confluence Analysis Module : Mathematically identifies zones where multiple levels cluster within specified thresholds
Dynamic Drawing Management : Efficiently handles line and label creation, updates, and deletion to maintain performance
🔥 Key Features
Customizable Swing Detection : Adjust swing length (3-50 bars) and strength confirmation (1-10 bars) to match your trading style
Selective Level Display : Choose which Fibonacci levels to show, from core levels to full extensions
Multi-Timeframe Analysis : Analyze up to 3 different timeframes simultaneously for confluence identification
Intelligent Labeling System : Options to show main levels only or all levels, with latest-set-only functionality
Visual Customization : Adjustable line width, colors, and extension options for optimal chart clarity
Performance Optimization : Limit maximum Fibonacci sets (1-5) to maintain smooth chart performance
Comprehensive Alerting : Get notified on level breakouts and confluence zone formations
🎨 Visualization
Dynamic Fibonacci Lines : Color-coded lines (green for uptrends, red for downtrends) with customizable width and extension
Smart Level Labels : Precise level identification with both ratio and price values displayed
Confluence Zone Highlighting : Visual emphasis on areas where multiple timeframe levels converge
Clean Chart Management : Automatic cleanup of old drawing objects to prevent chart clutter
Responsive Design : All visual elements adapt to different chart sizes and timeframes
📖 Usage Guidelines
Swing Detection Settings
Swing Detection Length - Default: 25 | Range: 3-50 | Controls the lookback period for identifying pivot points. Lower values detect more frequent swings but may include noise, while higher values focus on major market turns.
Swing Strength (Confirmation Bars) - Default: 2 | Range: 1-10 | Number of bars required to confirm a swing point. Higher values reduce false signals but increase lag.
Minimum Swing % Change - Default: 1.0% | Range: 0.1-10.0% | Minimum percentage change required to register a valid swing. Filters out insignificant price movements.
Fibonacci Level Settings
Individual Level Toggles : Enable/disable specific Fibonacci levels (0.236, 0.382, 0.5, 0.618, 0.786, 0.886)
Extensions : Show projection levels (1.272, 1.618) for target identification
Multi-Timeframe Settings
Timeframe Selection : Choose three higher timeframes for confluence analysis
Confluence Threshold : Percentage tolerance for level clustering (0.5-5.0%)
✅ Best Use Cases
Swing Trading : Identify optimal entry and exit points at key retracement levels
Confluence Trading : Focus on high-probability zones where multiple timeframe levels align
Support/Resistance Trading : Use dynamic levels that adapt to changing market structure
Breakout Trading : Monitor level breaks for momentum continuation signals
Target Setting : Utilize extension levels for profit target placement
⚠️ Limitations
Lagging Nature : Requires confirmed swing points, which means levels appear after significant moves
Market Condition Dependency : Works best in trending markets; less effective in extremely choppy conditions
Multiple Signal Complexity : Multiple timeframe analysis may produce conflicting signals requiring experience to interpret
Performance Considerations : Multiple Fibonacci sets and MTF analysis may impact indicator loading time on slower devices
💡 What Makes This Unique
Automated Precision : Eliminates manual drawing errors and subjective level placement
Multi-Timeframe Intelligence : Combines analysis from multiple timeframes for superior confluence detection
Adaptive Management : Automatically updates and manages multiple Fibonacci sets as market structure evolves
Professional-Grade Alerts : Comprehensive notification system for all significant level interactions
🔬 How It Works
Step 1 - Swing Point Identification : Scans price action using pivot high/low calculations with specified lookback periods, applies confirmation logic to eliminate false signals, and calculates swing strength based on surrounding price action for quality assessment.
Step 2 - Fibonacci Level Calculation : Automatically computes retracement and extension levels between confirmed swing points, creates dynamic level sets that update as new swing points are identified, and maintains multiple active Fibonacci sets for comprehensive market analysis.
Step 3 - Multi-Timeframe Confluence : Retrieves Fibonacci data from higher timeframes using secure request functions, analyzes level clustering across different timeframes within specified thresholds, and identifies high-probability zones where multiple levels converge.
💡 Note: This indicator works best when combined with other technical analysis tools and proper risk management. The multi-timeframe confluence feature provides the highest probability setups, but always confirm signals with additional analysis before entering trades.
Divergences HeatmapWhen the price is around a support or resistance zone, look for any divergences. Ignore any signals if the price is ranging.
ICT Killzone Level TableCreates a table of ICT Killzone levels with mitigation state for quick reference