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.
Trend Analysis
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.
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
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
Fibonacci 61.8 BUY or SELL (EMA-Filtered)This indicator helps identify Fibonacci-based Buy or Sell zones based on recent pivot highs/lows, but only when filtered by the EMA trend.
✅ Buy Zones: Only when price is above EMA
✅ Sell Zones: Only when price is below EMA
🟩 Draws a 61.8% Fibonacci retracement line
🟥 Adds a label with price value: BUY @ or SELL @
📏 All drawing is based on pivot structure (LL → LH for buy; HH → HL for sell)
📊 EMA Trend Filter
Only draws buy setups when price > EMA
Only draws sell setups when price < EMA
You can change the EMA length:
📈 How It Works – Step by Step
✅ BUY SETUP (LL → LH, only if price > EMA):
Detects pivot low → stores as prevLow
Detects pivot high after that → stores as prevHigh
Calculates Fib Level:
fibLevel = prevLow + (prevHigh - prevLow) * 0.618
Draws a green dashed line at that fib level
Adds a label to the right:
"BUY @ price"
🚫 SELL SETUP (HH → HL, only if price < EMA):
Detects pivot high → stores as prevHigh
Detects pivot low after that → stores as prevLow
Calculates Fib Level:
fibLevel = prevHigh - (prevHigh - prevLow) * 0.618
Draws a red dashed line at that fib level
Adds a label to the right:
"SELL @ price"
✅ Strengths
Simple yet powerful EMA + Fibonacci strategy
Visually clean: only one signal shown at a time
Customizable: style, color, width, offset, precision
Works well for trend continuation trades
⚠️ Limitations
Only shows latest setup, not historical signals
Does not show price breaking fib level or reacting to it
Assumes fixed 61.8% retracement—no multi-level analysis
Doesn't differentiate between minor and major pivots
📌 How to Trade It
🟢 BUY Example:
Price above EMA
Pivot Low → Pivot High → 61.8% level plotted
Wait for price to react at that level to go long
🔴 SELL Example:
Price below EMA
Pivot High → Pivot Low → 61.8% level plotted
Wait for price to react at that level to go short
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.
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.
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.
AV BTC Pi Cycle Top (with ATH) OverlayPi Cycle Top Indicator
Created by Phillip Swift . It works by comparing the 111-day SMA (blue) and the 350-day SMA. The value of the 350-day SMA is multiplied by 2 and referred to as 2*350 SMA (purple). Note: The number of days is not multiplied; the 350-day SMA is not doubled to calculate a 700-day SMA.
These two moving averages were selected because 350 / 111 ≈ 3.153, an approximation of the number Pi.
When the 111-day SMA (blue) crosses over the 2*350 SMA (purple), it signals a market cycle peak. Historically, this has worked extremely well. However, with the growth of BTC Futures and ETFs, this indicator might lose its edge.
A label and a red circle signal crossover. The indicator also marks all ATH (All-Time High) bars with yellow diamonds. The ATH line is hidden by default but can be enabled in the style tab. Additionally, halving days are marked with grey vertical lines and labels. Feel free to hide certain elements in the style tab.
For marking overbought and oversold areas, I believe looking at the Pi Cycle Oscillator is a better choice. For this reason, this indicator does not highlight overbought or oversold areas; it only marks market tops.
CQ_MTF Target Price Lines [BITCOIN HOY]Introducing the “BITCOIN HOY” Price Action Indicator
A Practical Tool Inspired by Esteban Perez for Efficient Market Tracking
Welcome to everyone subscribed to the YouTube channel “BITCOIN HOY”! Today, we are excited to present a specialized indicator designed for traders and enthusiasts following the guidance and strategies of Esteban Perez. This indicator was created in direct response to Esteban’s suggestion—providing the community with a more organized, digital alternative to the traditional trading notebook.
Purpose and Inspiration
The foundation of this indicator rests on a simple yet powerful concept: making it easier to track weekly and daily price action updates, along with calculated support, resistance, and target levels across different time frames. By digitizing the process, you no longer need to write each level by hand—the indicator does the plotting for you, presenting a clear, organized view directly on your chart.
Key Features
• Manual Entry for Multi-Time Frame Targets: Enter your own calculated price targets for intraday (1H), short-term (4H), daily (1D), and weekly (1W) charts.
• Visual Price Labels: Each inputted target draws a corresponding line and price label, making it easy to visualize and reference directly on your trading platform.
• Central Operations Axis: For each time frame, you can specify the central axis of operations, reflecting strategic zones or pivotal price points as described in Esteban Perez’s methodology.
• Related Event Tracking: Document and associate key market events with their respective price zones, helping contextualize market movements and decisions.
• Intuitive Organization: Adheres to the structure and terminology familiar to followers of “BITCOIN HOY,” ensuring everyone can use it with confidence.
How to Use the Indicator
• Step 1: Calculate your desired price targets for each time frame (1H, 4H, 1D, 1W) using your preferred methods or following Esteban’s recommendations.
• Step 2: Enter the targets into the indicator input fields, separated by commas for multiple entries on the same time frame.
• Step 3: Input individual prices for weekly targets and for the central operations axis in the dedicated fields.
• Step 4: Optionally, annotate related events or notes corresponding to particular levels, giving further clarity to your analysis.
• Step 5: Observe your chart—the indicator will draw lines and labels, offering a visual roadmap for your trading decisions.
Benefits
• Saves Time: No more repetitive manual note-taking—everything is streamlined and visible in one place.
• Reduces Errors: Visual price labels help minimize mistakes that can occur with hand-written notes or misreads.
• Enhances Consistency: Maintains the disciplined, methodical approach advocated on the “BITCOIN HOY” channel.
• Supports Strategic Planning: Easily reference central axes and event annotations to make informed decisions.
Acknowledgments
This tool is made possible through the dedication and insight of Esteban Perez. His commitment to educating and empowering the “BITCOIN HOY” community has inspired many, and his willingness to share both his knowledge and his strategies continues to elevate everyone following his channel. Thank you, Esteban, for your hard work and generosity.
ATR Trend Color📌 ATR Trend Color — Visually clean trend-following tool based on adaptive ATR trailing stop
► Description
ATR Trend Color is a simple yet powerful indicator designed to visually identify and follow the market trend using an adaptive ATR-based trailing stop. Its main advantage lies in clarity — it uses just a single line that dynamically changes color based on trend direction:
✅ Blue line indicates price is above the trailing stop (bullish trend).
🔻 Black line indicates price is below the trailing stop (bearish trend).
This clean display allows for instant trend recognition and potential exit or reversal zones.
► How it works
The indicator uses the Average True Range (ATR) to calculate a dynamic trailing stop level. ATR measures volatility and adjusts the trailing line to match current market conditions:
When the price rises, the line moves up and acts as dynamic support.
When the price drops, the line moves down and acts as resistance.
This behavior makes it ideal for trend following and volatility-adjusted stop-loss placement.
► Key Features:
✅ Clean chart with just one ATR trailing line
✅ Dynamic color changes in real-time
✅ Great for trend confirmation and management
✅ Customizable ATR period and multiplier
✅ Step line with diamonds for high visual clarity
► How to use
Add the indicator to your chart.
Adjust ATR period and multiplier to your strategy (default: ATR 7 / multiplier 3.1).
Follow the line color:
Blue: Bullish trend — may signal to stay in long positions.
Black: Bearish trend — may suggest exit or short entries.
► Originality
Unlike typical ATR trailing stop indicators that display two lines or static colors, ATR Trend Color simplifies visualization by using a single smart line with real-time visual feedback on trend direction.
Additionally, it uses the “Step line with diamonds” display mode to enhance readability in fast or noisy markets.
Volumetric Compressed MAVCMA uses the compressor and weighted stdev functions originally translated to pine by @gorx1. Compressor is usually used in audio to avoid clipping of certain frequencies. The original idea is actually pretty simple:
ma(simple string smt, float src, simple int len) =>
switch smt
'RMA' => ta.rma(src, len)
'SMA' => ta.sma(src, len)
'EMA' => ta.ema(src, len)
'WMA' => ta.wma(src, len)
'HMA' => ta.hma(src, len)
'LSMA' => ta.linreg(src, len, 0)
=> na
compressor(float in_1, simple int len, simple int thresh_dn_m, simple int thresh_up_m) =>
data = math.log(math.abs(in_1))
loc = ta.wma(data, len)
dev = wstdev(data, len)
thresh_dn = loc + dev * thresh_dn_m
thresh_up = loc + dev * thresh_up_m
math.exp(math.min(math.max(data, thresh_up), thresh_dn)) - math.exp(thresh_up)
compressed_out = compressor(volume, len_window, up_thresh, down_thresh)
comp_ma = ma(ma_type, close * compressed_out, len_ml) / ma(ma_type, compressed_out, len_ml)
vwma = ma(ma_type, close, len_window)
We get the ratio of the compressed volume calculation and plot it with the base MA. Base MA's length is determined by window size input compared to ML length that is used for compressed version.
This provides us another possible confirmation indicator that can be used to take advantage of volume ranges. Autmated crossover alerts are also added. A reminder is that this kind of indicators should not be used on it's own for trading but rather should be used as a confirmation along with your trend detection and main entry indicators to provide additional confluence.
Adaptive Causal Wavelet Trend FilterThe Adaptive Causal Wavelet Trend Filter is a technical indicator implementing causal approximations of wavelet transform properties for better trend detection with adaptive volatility response.
The Adaptive Causal Wavelet Trend Filter (ACWTF) applies mathematical principles derived from wavelet analysis to financial time series, providing robust trend identification with minimal lag. Unlike conventional moving averages, it preserves significant price movements while filtering market noise through signal processing that i describe below.
I was inspired to build this indicator after reading " Wavelet-Based Trend Identification in Financial Time Series " by In, F., & Kim, S. 2013 and reading about Mexican Hat wavelet filters.
The ACWTF maintains optimal performance across varying market regimes without requiring parameter adjustments by adapting filter characteristics to current volatility conditions.
Mathematical Foundation
Inspired by the Mexican Hat wavelet (Ricker wavelet), this indicator implements causal approximations of wavelet filters optimized for real-time financial analysis. The multi-resolution approach identifies features at different scales and the adaptive component dynamically adjusts filtering characteristics based on local volatility measurements.
Key mathematical properties include:
Non-linear frequency response adaptation
Edge-preserving signal extraction
Scale-space analysis through dual filter implementation
Volatility-dependent coefficient adjustment, which I love
Filter Methods
Adaptive: Implements a volatility-weighted combination of multiple filter types to optimize the time-frequency resolution trade-off
Hull: Provides a causal approximation of wavelet edge detection properties with forward-projection characteristics
VWMA: Incorporates volume information into the filtering process for enhanced signal detection
EMA Cascade: Creates a multi-pole filter structure that approximates certain wavelet scaling properties
Suggestion: try all as they will provide slightly different signals. Try also different time-frames.
Practical Applications
Trend Direction Identification: Clear visual trend direction with reduced noise and lag
Regime Change Detection: Early identification of significant trend reversals
Market Condition Analysis: Integrated volatility metrics provide context for current market behavior
Multi-timeframe Confirmation: Alignment between primary and secondary filters offers additional confirmation
Entry/Exit Timing: Filter crossovers and trend changes provide potential trading signals
The comprehensive information panel provides:
Current filter method and trend state
Trend alignment between timeframes
Real-time volatility assessment
Price position relative to filter
Overall trading bias based on multiple factors
Implementation Notes
Log returns option provides improved statistical properties for financial time series
Primary and secondary filter lengths can be adjusted to optimize for specific instruments and timeframes
The indicator performs particularly well during trend transitions and regime changes
The indicator reduces the need for using additional indicators to check trend reversion
YAS GROUPThis script is a powerful combination of Order Blocks (OB), market structure, and liquidity levels. It helps traders easily identify high-probability areas for entries and exits, detect trend shifts (BOS & CHoCH), and highlight strong support/resistance zones. The script is designed for both scalping and swing trading, offering flexibility and precision. Users can adjust OB sensitivity, show or hide structure labels, and customize visual settings to match their style. Alerts are also included for key signals. Perfect for traders looking to read the market like smart money.
DAX Setup ScreenerPine Script – Setup Screener
This code detects:
Range trading zone
Breakout long & breakdown short signals
With visual overlay
Use it like this:
Adjust rangeHigh, rangeLow, and breakoutBuffer
Enabled: Draws signals on the live chart
Rob Hoffman IRB Strategy by SniffDog30 Min Bonk Strategy. Not sure if this is beneficial for other tokens/coins. Use at you own risk.
Good strategy for starter in Rob Hoffman style of indicators.
NOTE:
1) Switch to 30 mins
2) adjust to your exchange and quantity of trade
Silver Bullet🎯 Silver Bullet Macro Time & Bias Framework
The Silver Bullet script is a complete framework for identifying high-probability trading windows and directional bias, inspired by ICT concepts.
✅ Key Features:
• Macro Sessions Detection – Automatically identifies key time windows (ICT Killzones or custom hours) on any timeframe.
• Dynamic Session Boxes – Visual boxes marking each session’s high/low range.
• Bias Calculation – Determines Long or Short bias using price action within the session.
• Fibonacci Levels – Automatically draws Fibonacci retracements and extensions relative to session ranges.
• Adaptive Labels & Tables – Clear labels showing session range, bias, entry, target, and stop levels.
• Customizable Timezones & Styles – Supports all chart timezones, different text sizes, and flexible display positions.
⸻
📈 Optimized for the 5-Minute Chart, but can be applied to other intraday timeframes.
🌐 Learn more & contact support: www.macrobullet.trade
Price Action Breakout – CALL/PUT AlertsThis strategy generates CALL or PUT alerts based on price breakouts confirmed by EMA and volume filters.
🔍 Breakout Logic
📈 CALL Alert (Bullish Breakout):
Price closes above EMA
Price breaks above previous high
Volume is above average × multiplier
📉 PUT Alert (Bearish Breakout):
Price closes below EMA
Price breaks below previous low
Volume is above average × multiplier
🎯 Alert Structure
CALL 📈 / PUT 📉
Entry Price
Take Profit (TP) – Based on risk/reward ratio
Stop Loss (SL) – Based on percentage distance from entry
📊 Chart Elements
Labels on breakout candle with full alert info
Horizontal lines for TP and SL levels
Works on any timeframe (e.g., 15min for intraday)
✅ Use Case
Ideal for options traders, scalpers, and automated alerts
Relative StrengthDescription:
This indicator provides a simplified yet powerful method for measuring a stock's momentum based on its proximity to its recent high. It is a direct implementation of a trading concept discussed in a lecture from the New York Institute of Finance.
Core Concept
The underlying theory, supported by academic research, is that a stock making a new high is one of the most bullish signals possible. Such stocks have a statistical tendency to continue making new highs in the near term.
Instead of requiring complex relative strength calculations against a universe of stocks, this indicator uses a simple and elegant ratio to act as a proxy for momentum:
Indicator Value = Current Close / Highest High of Lookback Period
A value approaching 1.0 indicates the stock is strong and nearing a new high. A value at 1.0 means a new high has just been made.
How to Use This Indicator
The indicator consists of two primary components:
RS Line (Teal): The core momentum calculation (Close / High).
Signal MA (Orange): A moving average of the NHRS Line, which acts as the trigger for signals.
The signals are generated based on the crossover between these two lines:
BUY Signal: When the RS Line crosses ABOVE its moving average. This suggests that short-term momentum is accelerating and a new uptrend may be starting. The background will turn green.
SELL Signal: When the RS Line crosses BELOW its moving average. This indicates that momentum is fading and it may be prudent to exit the position to avoid a decline. The background will turn red.
Indicator Settings
You can customize the indicator to fit your trading style and the timeframe you are analyzing:
High Lookback Period: Choose the period for the "Highest High" calculation. Options range from 1 Month to 12 Months (52 weeks), allowing you to measure short-term or long-term strength.
Moving Average Length: Adjust the length of the signal line's moving average. The lecturer defaults to 26 weeks for a six-month view.
Moving Average Type: Select the type of moving average for the signal line (SMA, EMA, WMA, HMA).
Credits and Inspiration
Proper credit is essential. This script is a practical application of a concept that builds upon foundational academic work.
The core idea that a stock's proximity to its 52-week high is an investable anomaly was detailed in the 2004 Journal of Finance paper:
"The 52 Week High and Momentum Investing" by Thomas J. George and Chuan-Yang Hwang.
The lecturer's contribution, which this script implements, was to simplify this concept into an actionable trading tool by applying a moving average crossover to generate clear and objective buy and sell signals.
Disclaimer: This tool is for educational and informational purposes only. It is not financial advice. All trading involves risk, and you should always perform your own research and backtesting before making any trading decisions.