Normalized Fibonacci Retracement (MTF/LOG)A question: Instead of creating indicators that constantly plot Fibonacci Retracement levels in a visually overwhelming way, why don't we redefine them on a different scale? 🤨
Overview
The Normalized Fibonacci Retracement indicator converts price data to a 0-100 scale based on the selected timeframe's high-low range, displaying normalized candlesticks alongside standard Fibonacci levels (23.6%, 38.2%, 50%, 61.8%, 78.6%). This normalization reveals patterns that may be hidden in absolute price charts and allows consistent analysis across different instruments.
Originality
By normalizing prices to percentages, this indicator enables pattern recognition independent of absolute price levels. The same formation at $10-$20 and $1000-$2000 appears identical on the normalized scale, helping traders identify recurring structures across various assets and timeframes.
Concepts
The indicator uses a simple formula to transform price data into percentages. This creates a bounded scale where patterns become comparable regardless of the underlying asset's price range. The normalized view often reveals symmetries and relationships not visible in traditional price charts.
Mechanics
The system tracks highs and lows within the selected timeframe as anchor points. When a new period begins, fresh boundaries are established and prices recalculated. Trend direction is determined by timing of extremes. Linear scaling uses direct percentage calculation, while logarithmic scaling applies exponential interpolation for assets with large percentage moves.
Functions
Timeframe Selection: Higher timeframe analysis on any chart resolution
Normalized Display: OHLC data converted to 0-100 percentage scale
Fibonacci Levels: Standard retracement levels plotted automatically
Scaling Options: Linear or logarithmic calculation methods
Pattern Recognition: Reveals formations hidden in absolute price charts
Moving Average: Optional 20-period SMA overlay
Notes
Ensure chart data covers the full selected timeframe for accurate calculations. Use logarithmic scaling for volatile assets with large percentage moves. The normalized scale is effective at revealing patterns and structures that remain consistent across different price ranges, making it particularly useful for comparative analysis and pattern-based trading strategies.
I hope it helps everyone. Do not forget to manage your risk. And trade as safely as possible. Best of luck!
Penunjuk dan strategi
Fair Value Gap Profiles [AlgoAlpha]🟠 OVERVIEW
This script draws and manages Fair Value Gap (FVG) zones by detecting unfilled gaps in price action and then augmenting them with intra-gap volume profiles from a lower timeframe. It is designed to help traders find potential areas where price may return to fill liquidity voids, and to provide extra detail about volume distribution inside each gap to assess strength and likely mitigation. The script automatically tracks each gap, updates its state over time, and can show which gaps are still unfilled or have been mitigated.
🟠 CONCEPTS
A Fair Value Gap is a zone between candles where no trades occurred, often seen as an inefficiency that price later revisits. The script checks each bar to see if a bullish (low above 2-bars-ago high) or bearish (high below 2-bars-ago low) gap has formed, and measures whether the gap’s size exceeds a threshold defined by a volatility-adjusted multiplier of past gap widths (to only detect significantly large gaps). Once a qualified gap is found, it gets recorded and visualized with a box that can stretch forward in time until filled. To add more context, a mini volume profile is built from a lower timeframe’s price and volume data, showing how volume is distributed inside the gap. The lowest-volume subzone is also highlighted using a sliding window scan method to visualise the true gap (area with least trading activity)
🟠 FEATURES
Visual gap boxes that appear automatically when bullish or bearish fair value gaps are detected on the chart.
Color-coded zones showing bullish gaps in one color and bearish gaps in another so you can easily see which side the gap favors.
Volume profile histograms plotted inside each gap using data from a lower timeframe, helping you see where volume concentrated inside the gap area.
Highlight of the lowest-volume subzone within each gap so you can spot areas price may target when filling the gap.
Dynamic extension of the gap boxes across the chart until price comes back and fills them, marking them as mitigated.
Customizable colors and transparency settings for gap boxes, profiles, and low-volume highlights to match your chart style.
Alerts that notify you when a new gap is created or when price fills an existing gap.
🟠 USAGE
This indicator helps you find and track unfilled price gaps that often act as magnets for price to revisit. You can use it to spot areas where liquidity may rest and plan entries or exits around these zones.
The colored gap boxes show you exactly where a fair value gap starts and ends, so you can anticipate potential pullbacks or continuations when price approaches them.
The intra-gap volume profile lets you gauge whether the gap was created on strong or thin participation, which can help judge how likely it is to be filled. The highlighted lowest-volume subzone shows where price might accelerate once inside the gap.
Traders often look for entries when price returns to a gap, aiming for a reaction or reversal in that area. You can also combine the mitigation alerts with your trade management to track when gaps have been closed and adjust your bias accordingly. Overall, the tool gives a clear visual reference for imbalance zones that can help structure trades around supply and demand dynamics.
{FREE} Candlestick Patterns [NASAlgoTrading]{FREE} Candlestick Patterns identifies and plots various candlestick patterns on price charts. It helps traders visualize potential reversal and continuation patterns in the market.
Key Features
Bullish Reversal Patterns Detected:
Hammer - Signals potential bullish reversal after a downtrend
Inverted Hammer - Indicates possible bullish reversal
Three White Soldiers - Strong bullish reversal pattern showing consecutive bullish candles
Bullish Harami - Shows potential trend reversal from bearish to bullish
Bearish Reversal Patterns Detected:
Hanging Man - Warns of potential bearish reversal after an uptrend
Shooting Star - Suggests possible bearish reversal
Three Black Crows - Strong bearish reversal pattern showing consecutive bearish candles
Bearish Harami - Indicates potential trend reversal from bullish to bearish
Dark Cloud Cover - Shows bearish reversal potential
Continuation Patterns Detected:
Rising Three Methods - Bullish continuation pattern
Falling Three Methods - Bearish continuation pattern
Gravestone Doji - Can indicate potential reversals (shown in orange)
Long-legged Doji - Shows market indecision (shown in orange)
Dragonfly Doji - Can signal potential reversals (shown in orange)
Benefits for Traders
Visual Pattern Recognition: Automatically identifies and labels patterns on the chart, saving traders time in manual analysis.
Comprehensive Coverage: Detects multiple important candlestick patterns in a single indicator.
Clear Visual Cues:
Bullish patterns marked in green below price bars
Bearish patterns marked in red above price bars
Doji patterns marked in orange
Trend Analysis: Helps identify both reversal and continuation patterns, providing insights into potential market direction.
Confirmation Tool: Can be used alongside other technical indicators to confirm trading signals.
Educational Value: Helps new traders learn to recognize important candlestick patterns.
Customization: The indicator allows for up to 50 lines to be displayed (max_lines_count = 50).
Implementation Notes
The indicator uses precise mathematical conditions to identify each pattern, including:
Relative candle body and wick sizes
Previous candle patterns and trends
Price relationships between current and historical candles
This systematic approach ensures consistent pattern recognition that might be subjective when done manually.
Monday Range +Monday Range+
A precision tool for early-week price action traders.
🔧 Features:
- Auto-draws Monday High, Low & Midrange
- Clear LONG/SHORT signal labels
- Midrange Reset (reloads trade logic)
- Ex-Line Protection (sweep filter)
- ½ Risk to Reward extension option
- Multi-Timeframe (MTF) support
📈 Trade Setup Logic:
LONG Setup:
- Valid only after Monday
- Price breaks below Monday Low
- Closes back above the Low and under the Midrange
- Candle must close higher than previous candle
- If Ex-Line Protection is on, trade is blocked if price swept below extension
- Enter at the Low of the range, target the High
SHORT Setup:
- Valid only after Monday
- Price breaks above Monday High
- Closes back below the High and above the Midrange
- Candle must close lower than previous candle
- If Ex-Line Protection is on, trade is blocked if price swept above extension
- Enter at the High of the range, target the Low
🎯 Ideal for liquidity fades and range reversal setups.
EdgeXplorer - Profit Bottoms EdgeXplorer – Profit Bottoms
⸻
🔍 What This Indicator Does
Profit Bottoms is a custom momentum oscillator designed to reveal price strength inflections through correlation logic. It identifies potential market exhaustion zones, highlights overbought/oversold conditions, and visually marks swing tops and bottoms — helping traders pinpoint profit-taking opportunities or early reversals across any asset or timeframe.
It features a flexible histogram view, color-coded background trends, and precision labels for clearer insight into market sentiment momentum shifts.
⸻
⚙️ How It Works
At the core of this indicator is a correlation function:
• It measures how strongly the price (close) correlates with bar index progression over a lookback window — essentially evaluating how directional recent price action has been.
• This results in a “strength index” ranging between +1 (strong uptrend) and -1 (strong downtrend).
• It tracks the slope of this index to infer trend direction and visually represent shifts.
From there, the indicator layers on:
• Dynamic overbought/oversold zones (±0.9)
• Swing high/low detection based on local peaks and troughs
• Trend background shading based on momentum slope
• Optional histogram and fill display styles
⸻
📈 Visual Components Explained
Element Meaning
🔮 Pulse Strength Line (purple line) Primary oscillator showing strength of directional movement
🌈 Colored Fill Fills above/below baseline to represent bullish/bearish intensity
🟢 Green Background Slope of strength index is rising (trend gaining)
🔴 Red Background Slope of strength index is falling (trend weakening)
🔼 ↑ Label Price is entering extreme overbought territory
🔽 ↓ Label Price is entering extreme oversold territory
🟠 Circle Markers Swing Top (Teal) or Swing Bottom (Orange)
📊 Histogram / Line Style Alternate visualizations of the oscillator based on user preference
⸻
📊 Input Settings Explained
Setting Description
Window Size Lookback period for correlation calculation
Bull Fill / Bear Fill Gradient colors for up/down momentum
Mark Tops/Bottoms Enables visual detection of swing highs/lows
Highlight Overbought/Oversold Displays zone entry markers (↑/↓) near extremes
Show Pulse Histogram Adds either histogram or line view
Histogram Style Choose between histogram bars, a thin line, or hide the visual entirely
⸻
🧠 How to Interpret in Different Market Conditions
Condition Interpretation
Strength Index near +1 Strong upward correlation — trend likely maturing or overbought
Strength Index near -1 Strong downward correlation — trend possibly exhausted or oversold
Cross below 0 Momentum shift from bullish to bearish
Cross above 0 Momentum shift from bearish to bullish
Swing Top Detected Potential short-term exhaustion — profit zone for longs
Swing Bottom Detected Early reversal zone or buying opportunity
The colored background makes it easy to visually segment the chart by trend environment, while the swing markers and zone labels add precision entry/exit timing cues.
⸻
🧪 Use Cases & Strategy Tips
• Scalpers & intraday traders: Use swing tops/bottoms with zone labels for tight entries.
• Swing traders: Watch for strength fading as a warning sign to exit positions.
• Divergence Spotting: Compare price action to the oscillator for hidden signals.
• Momentum Riders: Use histogram mode with background coloring to stay in trend longer.
For example:
If you see a swing bottom occur just below the -0.9 zone, paired with a background color flip from red to green — that’s a high-probability setup for reversion or breakout.
⸻
🧷 Alerts Included
This indicator provides built-in alerts for key conditions:
• EPS+ Top Detected → Swing Top
• EPS+ Bottom Detected → Swing Bottom
• EPS+ Overbought Zone → Strength Index > 1
• EPS+ Oversold Zone → Strength Index < -1
These can be used in alert-based automation or simply for manual signal confirmation.
TrendZonesTrendZones
This is an indicator which I use, have tested, tweaked and added features to for use in my trend following investing system. I got the idea for it when for some reason I was looking for a dynamic reference to measure the height of a channel or something. In search of this I made MA’s of the high and low borders of a Donchian channel which turned out to be two near parallel and stunningly smooth curves. This visual was so appealing that I immediately tried to turn it into a replacement for the KeltCOG which I previously used in my system. First I created a curve in the middle of the upper and lower curves, which I called COG (Center Of Gravity). Then I decided to enter only one lookback and let the script create a Donchian channel with half the lookback and use this to create the curves with an MA of whole lookback. For this reason the minimum lookback is set to 14, enough room for the Donchian Channel of 7 periods. This Donchian ChanneI has a special way of calculating the borders, involving a 5 period Median value. Thanks to this these borders are really a resistance and support level, which won’t change at a whim, e.g. when a ‘dead cat bounce’ occurs. I prevented the Donchian channel to show itself between the curves and only pop out from behind these. These pop outs now function as “strong trend zones”. I gave it colors (blue:-strong up, green: moderate up, orange: moderate down, red: strong down, near COG: gray, curves horizontal: gray) and it looked very appealing. I tested it in different time frames. In some weekend, when I was bored, I observed for a few hours the minute chart of bitcoin. It turned out that you can reliably tell that an uptrend ends when the candles go under the COG beginning a downtrend. Uptrend starts again once the candles go above COG. As Trends on minute charts only last around half an hour, this entertainment made the potential of this indicator very clear to me in just one afternoon.
Risk Management, Safe Level and Logical Stops.
In the inputs are settings for “Risk Tolerance”, and to activate “Show Logical Stop Level” (activated in example chart) and “Show Safe Level”. As a rule of thump a trade should not expose the invested capital to a risk of losing more than 2 percent. I divided my investment capital in ten equal parts which are allocated to ten different stocks or other instruments or kept liquid. This means that when a position is closed by triggering a Stop with a loss of 20 percent, the invested capital suffers only 2 percent (20% x 10% = 2%). This is why the value for “Risk Tolerance” has a default of 20. Because I put my Stops on the lower curve, a “Safe Level” can be calculated such that when you buy for a price below or at this level, the stop will protect the position sufficiently. Because I only buy when the instrument is in uptrend, the buying price should be between COG and Safe Level. Although I never do that, putting the stop at other curves is feasible and when you want to widen the stop (I never lower my stops btw) in a downtrend situation, even 1 ATR below the “Low Border”. I call these “Logical Stop Levels”, marked with dark green circles on the lower curve when safe buying by placing the Stoploss on this curve is possible, gray circles on the other curves, on the Upper Curve navy when price enters very profitable level. In a downtrend situation maroon circles appear.
Target lines
When I open a position I always set a Stoploss and a Target, for this purpose two types of Target values can be set and corresponding Target lines activated. These lines are drawn above the “High Border” at the set distance. If one expects some price to be used, differences will occur.
Other Features
Support Zone, this is 1 ATR below the “Low Border”, the maroon circles of the “Logal Stops” are placed on this “Support level”.
Stop distance and Channel Width. (activated in example chart) These are reported in a two cell table in the right lower corner of the main panel. I created this because I want to be able to check the volatility, whether the channel shows a situation in which safe buying in most levels of the channel is possible or what risk you take when you buy now and set the Stop at the nearest logical level (which is not always the “Lower curve”). This feature comes in handy for creating a setup I propose in the “Day Trading Fantasy” below.
Some General and User Settings. I never activate this, perhaps you will.
Use Of TrendZones In My System.
Create a list of stocks in uptrend. I define ‘stock in uptrend’ as in uptrend zone in all three monthly, weekly and daily charts, all three should at the same time be in uptrend. The advantage of TrendZones is that you can immediately see in which zone the candle moves.
Opening a position in a stock from the above list. I do this only when in both the daily and weekly the green dot on the lower curve indicates a buying opportunity. This is usually not the case in most of the items of the list, this feature thus provides a good timing for opening a position. Sometimes you need to wait a few weeks for this to happen.
Setting a target over a position. For this I use the Target percent line of the weekly chart with the default value of 10.
Updating the Stoploss and Target values. Every week or two weeks I set these to the new values of the “Lower Curve” and the Target line of the weekly. Attention: never shift down Stops, only up or let them stay the same when the curve moves down. I never use Stop levels on other curves.
I Check the charts whenever I like to do this. Close the position when the uptrend obviously shifts down. Otherwise I let the profits run until the Target triggers which closes the position with some profit.
For selecting stocks an checking charts for volume events, I also use a subpanel indicator called “TZanalyser”, which borrows the visual of my “Fibonacci Zone Oscillator”, is based on TrendZones and includes code from my REVE indicators. I intend to publish that as well.
Day Trading Fantasy.
Day trading is an attempt to earn a dime by opening a position in the morning and close it during the day again with a profit (or a loss). Before the market closes, you close all day trading positions.
In my fantasy the “Logical Stop Level” is repurposed for use as entry point and the ATR-based Target line is used to provide a target setting in an intraday chart, like e.g. 15 minute. To do this the “Safe Level” should be limited to between Channel width and COG. This can be done by showing “Safe Level” and “Channel Width” and then set “Risk Tolerance” to around the shown Channel Width. In this setting you can then wait for the green circle to show up for entering your trade and protect it with the stop.
I don’t know if this works fine or if it’s better than other day trade systems, because I don’t do day trading.
Take care and have fun.
Crypto Breadth | AlphaNatt\ Crypto Breadth | AlphaNatt\
A dynamic, visually modern market breadth indicator designed to track the strength of the top 40 cryptocurrencies by measuring how many are trading above their respective 50-day moving averages. Built with precision, branding consistency, and UI enhancements for fast interpretation.
\ 📊 What This Script Does\
* Aggregates the performance of \ 40 major cryptocurrencies\ on Binance
* Calculates a \ breadth score (0.00–1.00)\ based on how many tokens are above their moving averages
* Smooths the breadth with optional averaging
* Displays the result as a \ dynamic, color-coded line\ with aesthetic glow and gradient fill
* Provides automatic \ background zones\ for extreme bullish/bearish conditions
* Includes \ alerts\ for key threshold crossovers
* Highlights current values in an \ information panel\
\ 🧠 How It Works\
* Pulls real-time `close` prices for 40 coins (e.g., XRP, BNB, SOL, DOGE, PEPE, RENDER, etc.)
* Compares each coin's price to its 50-day SMA (adjustable)
* Assigns a binary score:
• 1 if the coin is above its MA
• 0 if it’s below
* Aggregates all results and divides by 40 to produce a normalized \ breadth percentage\
\ 🎨 Visual Design Features\
* Smooth blue-to-pink \ color gradient\ matching the AlphaNatt brand
* Soft \ glow effects\ on the main line for enhanced legibility
* Beautiful \ multi-stop fill gradient\ with 16 transition zones
* Optional \ background shading\ when extreme sentiment is detected:
• Bullish zone if breadth > 80%
• Bearish zone if breadth < 20%
\ ⚙️ User Inputs\
* \ Moving Average Length\ – Number of periods to calculate each coin’s SMA
* \ Smoothing Length\ – Smooths the final breadth value
* \ Show Background Zones\ – Toggle extreme sentiment overlays
* \ Show Gradient Fill\ – Toggle the modern multicolor area fill
\ 🛠️ Utility Table (Top Right)\
* Displays live breadth percentage
* Shows how many coins (e.g., 27/40) are currently above their MA
\ 🔔 Alerts Included\
* \ Breadth crosses above 50%\ → Bullish signal
* \ Breadth crosses below 50%\ → Bearish signal
* \ Breadth > 80%\ → Strong bullish trend
* \ Breadth < 20%\ → Strong bearish trend
\ 📈 Best Used For\
* Gauging overall market strength or weakness
* Timing trend transitions in the crypto market
* Confirming trend-based strategies with broad market support
* Visual dashboard in macro dashboards or strategy overlays
\ ✅ Designed For\
* Swing traders
* Quantitative investors
* Market structure analysts
* Anyone seeking a macro view of crypto performance
Note: Not financial advise
Profit Sniper RSI Based Buy/Sell📌 Profit Sniper RSI – Intelligent Buy/Sell Signals Based on Adaptive RSI Zones
Profit Sniper RSI is a precision-engineered indicator that generates high-confidence Buy and Sell signals by dynamically interpreting the Relative Strength Index (RSI) across five market zones. It is designed to reduce signal noise and avoid false breakouts using a combination of crossover logic, zone validation, and trend sentiment detection.
🔍 Underlying Concept:
This script divides the RSI into five structured zones:
- **0–24**: Power Sell (Extreme bearish momentum)
- **24–40**: Sell (Weak price action with downward pressure)
- **40–60**: Neutral/Consolidation (No clear trend)
- **60–76**: Buy (Bullish initiation zone)
- **76–100**: Power Buy (Strong bullish momentum)
Signals are generated **only after the RSI crosses a zone boundary** (e.g., from below 60 to above 60), and only **after the candle closes**, which helps filter out noise from intra-bar RSI fluctuations.
📈 Signal Logic:
- **Buy signals** are triggered when RSI crosses key thresholds (24, 40, or 60) upward, indicating rising strength.
- **Sell signals** are triggered when RSI crosses downward below 76, 60, or 40, suggesting trend weakness or reversal.
- **Power Buy and Power Sell signals** are reserved for extreme crossovers beyond 76 and below 24, respectively.
- The script avoids repeated signals (e.g., Buy after Buy) by tracking the last confirmed signal state.
🔧 Customization:
- Users can toggle visibility of Buy, Sell, Power Buy, and Power Sell signals independently.
- Adjustable RSI length input to fit different market conditions or timeframes.
- Displays a real-time info panel showing the current RSI, last signal type, the RSI level at the time of the last signal, and the price when the signal was triggered.
🧠 How It Helps Traders:
- Reduces false entries by only generating signals **after candle closure**.
- Designed to work across **any timeframe** and **any market** (Crypto, Forex, Stocks).
- Ideal for traders who rely on **RSI-based confirmation** before entry and prefer minimal visual clutter.
- Acts as a sniper tool — waiting for clear RSI structure and crossover before acting.
⚠️ Note:
This script does **not repaint**. All signals are based on closed-bar RSI logic. While no indicator guarantees profitability, this tool is built for serious traders who value disciplined entries backed by momentum structure.
💡 Tip: Combine Profit Sniper RSI with key support/resistance or trendline zones for added confluence and trade precision.
Buy sell Trend VolumeThis indicator analyzes the flow of volume and price changes to identify potential trends.
Understanding Volume Indicator: A Comprehensive Guide
Introduction. The volume indicator is a vital tool investors and traders use to understand the liquidity and market activity in trading.
Zero-Lag RSI DivergenceZero-Lag RSI Divergence
Overview
This indicator identifies RSI divergences in real-time without delay, providing immediate signals as price-momentum discrepancies develop. The indicator analyzes price action against RSI momentum across dual configurable periods, enabling traders to detect potential reversal opportunities with zero lag.
Key Features
Instant Divergence Detection : Identifies bullish and bearish divergences immediately upon formation without waiting for candle confirmation or historical validation. This eliminates signal delay but may increase false signals due to higher sensitivity.
Dual Period Analysis : Configure detection across two independent cycles - Short Period (default 15) and Long Period (default 50) - allowing for multi-timeframe divergence analysis and enhanced signal validation across different market conditions.
Visual Divergence Lines : Automatically draws dashed lines connecting divergence points between price highs/lows and corresponding RSI peaks/troughs, clearly illustrating the momentum-price relationship.
Customizable RSI Parameters : Adjustable RSI length (default 14) allows optimization for different market volatility and trading timeframes.
How It Works
The indicator continuously monitors price action patterns and RSI momentum:
- Bullish Divergence : Detected when price makes lower lows while RSI makes higher lows, suggesting potential upward momentum
- Bearish Divergence : Identified when price makes higher highs while RSI makes lower highs, indicating potential downward momentum
The algorithm uses candle color transitions and immediate RSI comparisons to trigger signals without historical repainting , ensuring backtesting accuracy and real-time reliability.
How To Read
Important Notes
Higher Signal Frequency : The zero-lag approach increases signal sensitivity, generating more frequent alerts that may include false signals. Consider using additional confirmation methods for trade entries.
Non-Repainting : All signals are generated and maintained without historical modification, ensuring consistent backtesting and forward-testing results.
Input Parameters
RSI Length: Period for RSI calculation (default: 14)
Short/Long Periods: Lookback periods for divergence detection (default: 15/50)
Line Colors: Customizable colors for short and long period divergence lines
Label Settings: Optional divergence labels with custom text
This indicator is designed for traders seeking immediate divergence identification across multiple timeframes while maintaining signal integrity and backtesting reliability.
Crowding model ║ BullVision🔬 Overview
The Crypto Crowding Model Pro is a sophisticated analytical tool designed to visualize and quantify market conditions across multiple cryptocurrencies. By leveraging Relative Strength Index (RSI) and Z-score calculations, this indicator provides traders with an intuitive and detailed snapshot of current crypto market dynamics, highlighting areas of extreme momentum, crowded trades, and potential reversal points.
⚙️ Key Concepts
📊 RSI and Z-Score Analysis
RSI (Relative Strength Index) evaluates the momentum and strength of each cryptocurrency, identifying overbought or oversold conditions.
Z-Score Normalization measures each asset's current price deviation relative to its historical average, identifying statistically significant extremes.
🎯 Crowding Analytics
An integrated analytics panel provides real-time crowding metrics, quantifying market sentiment into four distinct categories:
🔥 FOMO (Fear of Missing Out): High momentum, potential exhaustion.
❄️ Fear: Low momentum, potential reversal or consolidation.
📈 Recovery: Moderate upward momentum after a downward trend.
💪 Strength: Stable bullish conditions with sustained momentum.
🖥️ Visual Scatter Plot
Assets are plotted on a dynamic scatter plot, positioning each cryptocurrency according to its RSI and Z-score.
Color coding, symbol shapes, and sizes help quickly identify main market segments (BTC, ETH, TOTAL, OTHERS) and individual asset conditions.
🧩 Quadrant Classification
Assets are categorized into four quadrants based on their momentum and deviation:
Overbought Extended: High RSI and positive Z-score.
Recovery Phase: Low RSI but positive Z-score.
Oversold Compressed: Low RSI and negative Z-score.
Strong Consolidation: High RSI but negative Z-score.
🔧 User Customization
🎨 Visual Settings
Bar Scale: Adjust the scatter plot visual scale.
Asset Visibility: Optionally display key market benchmarks (TOTAL, BTC, ETH, OTHERS).
Gradient Background: Enhances visual interpretation of asset clusters.
Crowding Analytics Panel: Toggle the analytics panel on/off.
📊 Indicator Parameters
RSI Length: Defines the calculation period for RSI.
Z-score Lookback: Historical lookback period for normalization.
Crowding Alert Threshold: Sets alert sensitivity for crowded market conditions.
🎯 Zone Settings
Quadrant Labels: Displays descriptive labels for each quadrant.
Danger Zones: Highlights extreme RSI levels indicative of heightened market risk.
📈 Visual Output
Dynamic Scatter Plot: Visualizes asset positioning clearly and intuitively.
Gradient and Grid: Professional gridlines and subtle gradient backgrounds assist visual assessment.
Danger Zone Highlights: Visually indicates RSI extremes to warn of potential market turning points.
Crowding Analytics Panel: Real-time summary of market sentiment and asset distribution.
🔍 Use Cases
This indicator is particularly beneficial for traders and analysts looking to:
Identify crowded trades and potential reversal points.
Quickly assess overall market sentiment and individual asset strength.
Integrate a robust momentum analysis into broader technical or fundamental strategies.
Enhance market timing and improve risk management decisions.
⚠️ Important Notes
This indicator does not provide explicit buy or sell signals.
It is intended solely for informational, analytical, and educational purposes.
Past performance and signals are not indicative of future market results.
Always combine with additional tools and analysis as part of comprehensive decision-making.
AshishBediSPLThis tool, called "AshishBediSPL," is a special indicator for traders using TradingView. Its main purpose is to help you track and trade the combined price of a Call and a Put option at the same strike price, a strategy known as a Short Straddle.
What It Does:
Tracks Straddle Prices: You can select a specific Indian index or a stock like Reliance, choose a strike price and expiry date, and the indicator will show you the combined price of that Call and Put option as a single line on your chart.
Calculates Everything for You: You don't need to manually add the prices. The indicator automatically does the math to show you the total premium of the straddle.
Adds Trading Signals: You can turn on various popular trading tools (like VWAP, EMA, Supertrend, etc.). The indicator will then use these tools to automatically show "Buy" and "Sell" signals directly on the chart, helping you decide when to enter or exit a trade.
Customizable: You can choose which trading tools you want to use and adjust their settings to fit your personal trading style.
What is it Used For?
This indicator is specifically for traders who:
Trade a Short Straddle: This is a neutral options strategy where you expect the market to stay in a small range. The indicator helps you monitor the total premium you've collected.
Want to Simplify Analysis: Instead of looking at a Call chart and a Put chart separately, this tool combines them into one easy-to-read chart.
Use Technical Analysis: It helps you apply standard technical indicators directly to the combined premium price, giving you clear signals for your straddle trades.
Volumatic + Adaptive Trend Flow [Fusion] by Ignotus📌 Description
```
This script combines two public open source indicators available on TradingView:
1. Volumatic Variable Index Dynamic Average
© BigBeluga
License: Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International https:creativecommons.org/licenses/by-nc-sa/4.0/
Original link:
2. Adaptive Trend Flow
© QuantAlgo
License: Mozilla Public License 2.0 (MPL-2.0)
https:mozilla.org/MPL/2.0/
Original link:
This indicator merges both scripts without modifying their internal logic, maintaining all their functionality, settings, and alerts.
This work is a custom compilation for educational and analytical purposes, complying with the attribution and redistribution terms of both licenses.
I do not claim to be the author of the original code for either indicator.
⚠️ Note on the CC BY-NC-SA license:
The license for the first indicator prohibits commercial use without explicit permission.
Therefore, this script should not be used for commercial purposes without the authorization of the original creator (BigBeluga).
```
---
✅ What does this indicator include?
This indicator combines two powerful tools in a single script:
🔹 Volumatic Variable Index Dynamic Average
- Volume and trend-based indicator.
- Detects liquidity zones and dynamic support/resistance.
- Uses VIDYA (Variable Index Dynamic Average) along with ATR to identify trend changes.
- Includes visual volume signals, dynamic support/resistance lines, and smart labels.
🔹 Adaptive Trend Flow
- Adaptive indicator for market volatility.
- Identifies bullish and bearish trends using calculations based on EMAs and standard deviation.
- Includes candle color, dynamic background, entry/exit signals, and built-in alerts.
---
🛡️ Responsible Use
- This indicator is NOT designed for automatic trading and does not guarantee profits.
- It is recommended to use it as a technical analysis tool, always under your own supervision and discretion.
- Do not use this script for commercial purposes or on external platforms without the explicit consent of the original authors.
---
📣 Credits
- Creator of the combined indicator: Ignotus
- Original source of the indicators: TradingView
- Final result license: MPL-2.0 (except where otherwise indicated by copyright of the original author)
Auto LevelsSimple auto level tracker that automatically detects and plots the high/low for the current week, day, and month, as well as the previous week/day/month.
Includes a built-in dashboard that shows how close or far price is from each level, along with directional guidance (above/below). The closest level to current price is automatically highlighted for quick awareness.
Everything is fully toggleable to only show the levels and info that is needed.
VisionThis indicator helps visually distinguish and analyze the Asian, London, and New York trading sessions. It's a great tool for intraday traders focusing on time-based liquidity zones.
🔧 Features:
Asian range box, London / New York high-low lines with distinct colors.
Customizable time windows, Asian range deviations and colors.
Trend Impulse Channels (Zeiierman)Jun 8
Support & Resistance Aries
This indicator automatically identifies support and resistance levels based on the highest and lowest closing prices within a configurable period.
How it works:
The user sets a calculation period (default is 20 candles).
The indicator plots:
Green line = Support: lowest closing price within the period.
Red line = Resistance: highest closing price within the period.
Adjustable parameter:
Calculation Period (1 to 200): defines how many candles are used to find the price extremes.
Purpose:
Helps users quickly visualize dynamic support and resistance zones that adjust as price evolves, making it easier to identify areas for potential entries, exits, and stop placements.
Important:
This indicator should not be used as a standalone buy or sell signal, nor as a trend confirmation tool on its own.
It is recommended to use it in combination with other technical analysis tools such as MACD, RSI, Volume, Moving Averages, among others, for a more complete market view.
Disclaimer:
Investing involves financial risk. Be cautious with both profits and losses. Always define a stop loss to avoid larger losses if the trend reverses.
One of the golden rules in trading is: a trader should not lose more than 3% to 5% of their capital per trade. Protecting your capital should always be the priority.
Key Levels Cheat Sheet🎯 Overview
The Key Levels Cheat Sheet is a comprehensive TradingView indicator that displays 25+ critical price levels in a clean, organized table format. Inspired by professional trading platforms, this indicator eliminates chart clutter by
consolidating all essential support and resistance levels into a single, real-time updating reference table.
Perfect for day traders, swing traders, and scalpers who need instant visibility of key levels without drawing multiple lines on their charts.
📊 Features
Volume-Based Levels
- Session VWAP - Current day's volume weighted average price
- Weekly VWAP - Longer-term institutional trading level
- VWAP Bands (1σ, 2σ, 3σ) - Standard deviation bands showing price extension levels
Session-Based Levels (ICT Concepts)
- True Day Open - Midnight EST opening (ICT methodology)
- Futures Session Open - 6 PM EST futures market open
- Asia Session (9 PM - 1 AM EST) - Asian market high/low
- London Session (3 AM - 6 AM EST) - European market high/low
- NY AM Session (9:30 AM - 11 AM EST) - New York morning high/low
- NY PM Session (1:30 PM - 4 PM EST) - New York afternoon high/low
- Opening Range - Customizable 5/15/30-minute opening range
Historical Levels
- Prior Day/Week/Month - Previous period high/low levels
- 52-Week High/Low - Yearly extremes
- All-Time High/Low - Historical extremes
- Current Day High/Low - Today's range
Smart Money Structure
- Advanced Swing Detection - Market structure-based swing highs/lows
- Swept Range Detection - Automatically hides mitigated levels
- Real-Time Updates - Dynamic level detection
Technical Indicators
- EMAs (9, 21, 50) - Exponential moving averages
- SMAs (20, 50, 200) - Simple moving averages
Expected Move Calculation
- VIX-Based Range - Live VIX data integration
- Multiple Anchors - Calculate from True Day Open, NY Open, or Session Start
- Options Trading - Perfect for probability-based strategies
🎨 Display Features
Smart Table Design
- Auto-Sorting - Levels sorted from highest to lowest
- Color Coding - Green above price, red below price
- Distance Display - Shows percentage or points from current price
- 9 Position Options - Place table anywhere on chart
- Customizable Size - Adjustable text and opacity
Intelligent Filtering
- Hide Swept Ranges - Automatically removes broken levels
- Toggle Individual Levels - Show only what you need
- Clean Interface - No chart clutter
💡 Use Cases
Day Trading
- Track key intraday levels without cluttering charts
- Monitor session highs/lows for breakout trades
- Use VWAP and bands for mean reversion
- Opening range breakout strategies
Swing Trading
- Monitor weekly/monthly levels for position entries
- Track 52-week highs/lows for momentum plays
- Use prior period levels for support/resistance
Options Trading
- VIX-based expected move for strike selection
- Probability zones for credit spreads
- Key levels for pin risk assessment
Scalping
- Quick reference for immediate support/resistance
- VWAP bands for quick reversals
- Session levels for range trading
📚 Educational Value
Every setting includes detailed tooltips explaining:
- ICT (Inner Circle Trader) concepts
- Session trading strategies
- VWAP and standard deviation usage
- Expected move calculations
- Smart money structure
Perfect for traders learning advanced concepts while getting practical trading levels.
⚙️ Customization
Smart Defaults
- Essential levels enabled by default
- Less common levels disabled to reduce clutter
- Swept range hiding enabled for clean display
Full Control
- Toggle any level on/off
- Choose percentage or points display
- Adjust table position and appearance
- Customize for your trading style
🚀 Getting Started
1. Add to Chart - Works on any timeframe and instrument
2. Position Table - Choose from 9 positions
3. Enable Levels - Turn on levels relevant to your strategy
4. Start Trading - All levels update in real-time
📈 Why Use This Indicator?
- Save Time - No more drawing levels manually
- Stay Organized - All levels in one place
- Trade Better - Never miss a key level
- Learn Concepts - Educational tooltips included
- Professional Tool - Institutional-grade level tracking
🎓 Tips for Best Results
- Use on 1-15 minute charts for day trading
- Enable session levels for futures/forex trading
- Use expected move for options strategies
- Combine with your existing strategy for confluence
- Hide swept ranges to focus on active levels
---
The Key Levels Cheat Sheet transforms how you view and use support/resistance levels. Stop cluttering your charts with lines and start trading with clarity.
Tags: #levels #support #resistance #vwap #sessions #daytrading #scalping #options #expectedmove #smartmoney #ict #tradingview
Elite Trend FusionThis indicator combines multiple technical analysis tools to assist traders in identifying trends, support/resistance levels, and potential trading opportunities. Developed by @IQ-TRADER with contributions to the Alpha Section by @KivancOzbilgic, this script overlays the following components on your chart:
EMA1: A customizable Exponential Moving Average for short-term trend analysis.
SMA Cluster (50, 100, 200): Simple Moving Averages on daily timeframes to identify long-term trends and key support/resistance zones.
Anchored VWAP x2 (VWAPCVD & VWAPARZ): Two Volume Weighted Average Price lines anchored to user-defined dates, providing insights into price levels relative to volume from specific points in time.
AlphaTrend: A custom trend-following indicator based on ATR and MFI, helping to gauge market direction and volatility.
Usage InstructionsInstallation:
Copy and paste the script into the Pine Script editor on TradingView, then add it to your chart.
Customization:Adjust the periods for EMA, SMA50, SMA100, and SMA200 under the "Inputs" tab.
Set the anchor dates for VWAPCVD and VWAPARZ to analyze specific historical periods.
Enable or disable individual components (EMA1, SMA50, SMA100, SMA200, VWAPCVD, VWAPARZ, AlphaTrend) and toggle labels via the settings.
Customize colors and line thickness to suit your preferences.
Modify the AlphaTrend multiplier and period for tailored sensitivity.
Interpretation:
Use the EMA1 for short-term momentum and crossovers with SMAs.
Monitor SMA crossovers (e.g., SMA50 crossing SMA200) for trend changes.
The Anchored VWAPs act as dynamic support/resistance levels based on the selected anchor dates.
AlphaTrend provides a visual guide for trend direction; use it alongside other indicators for confirmation.
Labels on the last bar show the current value and percentage distance from the price for each enabled indicator.
Pine Screener Module Usage:
Add this indicator to the Pine Screener to filter stocks, forex pairs, or other instruments based on the calculated distances (in percentage) between the close price and SMA50, SMA100, SMA200, VWAPCVD, and VWAPARZ.
In the Screener, use the "SMA50 Distance (%)", "SMA100 Distance (%)", "SMA200 Distance (%)", "VWAPCVD Distance (%)", and "VWAPARZ Distance (%)" columns to identify overbought/oversold conditions or potential reversal points.
Example filters: Set conditions like "SMA50 Distance (%) > 5" to find stocks trading significantly above the 50-day SMA, or "VWAPCVD Distance (%) < -2" to spot assets below the anchored VWAP, indicating potential support levels.
Combine multiple conditions (e.g., SMA50 Distance (%) > 5 AND AlphaTrend > previous AlphaTrend) to refine your scan for bullish trends.
Note: Ensure the indicator is applied to the chart or screener with the desired timeframe for accurate results.
Notes
This is an overlay indicator, meaning it plots directly on the price chart.
The script uses daily SMA calculations for consistency across timeframes.
Labels appear only on the last bar and are customizable.
This tool is for educational and informational purposes only. Trading involves risks, and it is recommended to consult a financial advisor before making decisions.
The script is credited to @IQ-TRADER with acknowledgment to @KivancOzbilgic for the Alpha Section contribution, adhering to intellectual property guidelines.
No Financial Advice: The description explicitly states that the indicator is for educational use and not financial advice, complying with TradingView's policy against promoting trading signals as guarantees.
Clear Usage: Step-by-step instructions are provided to ensure users can apply the indicator effectively, including screener usage.
No External Links or Promotions: No external links or promotional content is included, aligning with platform rules.
Intraday vs Overnight OBV🔍 Purpose
This indicator provides a volume-weighted cumulative flow model that mimics On-Balance Volume (OBV) logic but splits the volume impact into intraday vs. overnight sessions. It allows traders to track how volume contributes to price movement in each session and identify whether buying/selling pressure is stronger during or outside of regular trading hours.
This indicator attempts to alleviate some of the downfalls of the standard OBV indicator, which only looks at total volume and total direction. The price of stocks generally behaves extremely differently during market hours and outside market hours, and many of the large moves happen outside of regular market hours on low volume.
⚙️ Core Features
1) OBV-style calculation:
If price increases → volume is added to the OBV stream.
If price decreases → volume is subtracted.
If price is flat → OBV remains unchanged.
2) Session splitting:
Intraday session: movement from today's open to close.
Overnight session: movement from yesterday’s close to today’s open.
Volume is split proportionally between these two periods based on user input.
3) Four visualization modes:
"Intraday" — plots only OBV from intraday price movement.
"Overnight" — plots only OBV from overnight price movement.
"Aggregate" — plots the sum of intraday and overnight OBV for a holistic view.
"Both Intraday and Overnight" — plots intraday and overnight OBV separately on the same chart.
📐 Inputs
1) Synthetic OBV Type:
"Intraday" — Show OBV from open to close only.
"Overnight" — Show OBV from prior close to today's open only.
"Aggregate" — Show a single line combining both.
"Both Intraday and Overnight" — Show both lines on the same chart.
2) Estimated Overnight Volume %:
Percentage of total daily volume assumed to occur during extended hours.
The rest is allocated to regular session (intraday).
Default: 20% overnight, 80% intraday.
🧮 How It Works
Volume Splitting:
Total bar volume is split into overnight Volume and intraday Volume:
Intraday change is the difference between today’s close and open.
Overnight change is the difference between today’s open and yesterday’s close.
Session OBV Calculations:
OBV is incremented/decremented by the session's allocated volume, depending on whether the session’s price change was positive or negative.
Aggregate OBV:
Combines both session deltas for a holistic volume flow view.
📊 Interpretation
Rising OBV (any stream) suggests accumulation; falling OBV suggests distribution.
Divergences between price and OBV lines (especially overnight vs. intraday) can reveal where hidden buying/selling is occurring.
Comparing intraday vs overnight OBV can help:
Spot whether institutional demand is building off-hours.
Detect retail vs. institutional behavior (retail trades often dominate intraday; institutional may prefer after-hours).
💡 Use Cases
Identify whether overnight gaps are supported by overnight volume momentum.
Detect accumulation in low-volume overnight sessions.
Compare intraday and overnight strength during earnings season or news events.
Complement traditional OBV by seeing session-based breakdowns.
EdgeXplorer - Support vs ResistanceEdgeXplorer – Support vs Resistance
Spot the battle zones. Catch the breakouts. Ride the volume.
EdgeXplorer – Support vs Resistance is your visual compass for identifying institutional support and resistance levels in real time. By dynamically detecting pivot zones, tracking volume shifts, and highlighting high-conviction breakouts, this tool gives traders a clean, no-fluff map of where price is likely to react, reject, or rip through.
No guesswork — just clear structure and smarter signal flow.
⸻
🧱 What It Does
This tool automatically maps support and resistance zones based on swing pivots, overlays visual boxes on your chart, and triggers breakout signals when those zones are tested with volume confirmation. It’s built for traders who want more than just lines — they want intent.
⸻
⚙️ Core Components
Component Description
🟩 Support Boxes Detected from pivot lows, with label and visual zone
🟥 Resistance Boxes Detected from pivot highs, styled for clean contrast
📉 Breakout Signals Volume-validated support/resistance breaks
🕳️ Wick Detectors Wick rejections after breakout attempts (false breaks)
🎨 Visual Styling Auto-colored candles at pivots + zone label toggles
⸻
🔍 How It Works
1. Pivot Logic:
The script uses a flexible left/right pivot length (default 15) to detect local highs/lows that form reliable turning points. These are your anchors for support/resistance zones.
2. Zone Construction:
Each pivot creates a dynamic price zone with adjustable thickness. These zones are plotted as shaded rectangles, giving you real-time visual structure.
3. Breakout Detection:
When price crosses a zone and the volume oscillator confirms strength, the script triggers a B (Breakout) label above/below the bar.
4. Wick Filters:
It also highlights W (Wick) setups — signs of false breaks or stop hunts — based on wick-to-body comparisons. These can be excellent reversal signals when confirmed.
⸻
🛠️ Custom Settings
Setting What It Controls
🔁 Pivot Left/Right Controls how far left/right the script looks for highs/lows
🔻 Volume Threshold Sets how strong the volume shift must be to trigger breakouts
🎨 Zone Height Adjusts how thick each S/R box appears
🟢 Show Zones Toggle visual boxes on/off
🔔 Show Breaks Turn on/off the breakout + wick signals
🏷️ Show Labels Toggle support/resistance text labels
⸻
📈 Use Cases
• Breakout Traders:
Watch for high-volume breaks of resistance/support with clean confirmation. Enter on candle closes or wick rejections.
• Range Traders:
Use zones as reversal points during sideways markets. The wick markers help filter traps.
• Swing & Intraday Scalping:
Zoom out for higher timeframes to establish zones, then drill down to 1m–15m for breakout execution using the live signals.
• Liquidity Hunters:
Combine this with internal order blocks or EQH/EQL markers. S/R zones = liquidity pools.
⸻
🔔 Built-In Alerts
✅ Resistance Breakout
✅ Support Breakdown
Get notified in real-time when key zones get broken with strong volume follow-through.
智能货币概念 [LuxAlgo]Designed to seamlessly integrate the complex "Smart Money Concepts" (SMC) directly onto your TradingView charts. It's more than just a single indicator; it's a complete analytical framework that automates the identification and visualization of key price action patterns used by institutional traders, helping you to decode the market like a professional.
Whether you are a newcomer to the world of SMC or a seasoned trader seeking to enhance your efficiency, this tool offers unparalleled insight.
Core Feature Highlights:
Dual Market Structure Analysis:
Automatically plots Breaks of Structure (BOS) and Changes of Character (CHoCH).
Uniquely differentiates between Internal Structure and Swing Structure, allowing you to grasp both short-term dynamics and the overarching trend for a more holistic market view.
Order Blocks (OB):
Precisely identifies both bullish and bearish Internal and Swing Order Blocks, highlighting key potential reversal zones.
Includes a built-in volatility filter (ATR or Cumulative Average Range) to effectively screen out insignificant blocks and automatically tracks if they have been "mitigated."
Liquidity Identification:
Automatically marks Equal Highs (EQH) and Equal Lows (EQL), clearly revealing the liquidity pools targeted by smart money.
Market Imbalances (FVG):
Intelligently detects and draws Fair Value Gaps (FVG), representing areas of imbalance where price is likely to return. It supports custom timeframes and an automatic threshold filter.
Premium & Discount Zones:
Based on the major swing structure, it automatically delineates Premium, Discount, and Equilibrium zones, helping you identify optimal locations for entries.
Multi-Timeframe (MTF) Confluence:
With a single click, you can overlay key high/low levels from the Previous Day, Week, and Month onto your current chart, providing powerful, higher-timeframe context for your trading decisions.
Unique Advantages:
Highly Customizable: From colors and styles to display modes (Historical vs. Present), nearly every element can be tailored to your personal preference, creating a bespoke analysis interface.
Real-time Alert System: Comprehensive alerts are built-in for all key events (BOS/CHoCH formation, Order Block mitigation, FVG appearance, etc.), ensuring you never miss a trading opportunity.
Clear Visual Presentation: It transforms abstract theories into intuitive on-chart markers and zones, significantly simplifying the learning curve and the daily analysis workflow.
Smart Harmonic Pattern Detector//@version=6
indicator("Smart Harmonic Pattern Detector", overlay=true, max_lines_count=500, max_labels_count=500)
// === User Input ===
zigzagDepth = input.int(12, title="ZigZag Depth")
bullColor = input.color(color.green, title="Bullish Signal Color")
bearColor = input.color(color.red, title="Bearish Signal Color")
textSize = input.string(size.small, title="Label Size")
// === Signal Detection Variables ===
var bool showBuySignal = false
var bool showSellSignal = false
var string signalDir = na
var int signalBar = na
// === ZigZag Pivot Logic ===
var float zz_prices = array.new_float()
var int zz_indexes = array.new_int()
var bool zz_types = array.new_bool() // true for high, false for low
ph = ta.pivothigh(high, zigzagDepth, zigzagDepth)
pl = ta.pivotlow(low, zigzagDepth, zigzagDepth)
if not na(ph)
array.push(zz_prices, ph)
array.push(zz_indexes, bar_index - zigzagDepth)
array.push(zz_types, true)
if not na(pl)
array.push(zz_prices, pl)
array.push(zz_indexes, bar_index - zigzagDepth)
array.push(zz_types, false)
// Reset signals
showBuySignal := false
showSellSignal := false
// === Pattern Detection ===
if array.size(zz_prices) >= 5
// Get last 5 points
float x = array.get(zz_prices, array.size(zz_prices)-5)
float a = array.get(zz_prices, array.size(zz_prices)-4)
float b = array.get(zz_prices, array.size(zz_prices)-3)
float c = array.get(zz_prices, array.size(zz_prices)-2)
float d = array.get(zz_prices, array.size(zz_prices)-1)
int x_i = array.get(zz_indexes, array.size(zz_indexes)-5)
int a_i = array.get(zz_indexes, array.size(zz_indexes)-4)
int b_i = array.get(zz_indexes, array.size(zz_indexes)-3)
int c_i = array.get(zz_indexes, array.size(zz_indexes)-2)
int d_i = array.get(zz_indexes, array.size(zz_indexes)-1)
bool x_type = array.get(zz_types, array.size(zz_types)-5)
bool a_type = array.get(zz_types, array.size(zz_types)-4)
bool b_type = array.get(zz_types, array.size(zz_types)-3)
bool c_type = array.get(zz_types, array.size(zz_types)-2)
bool d_type = array.get(zz_types, array.size(zz_types)-1)
// Validate swing structure
validStructure = (x_type != a_type) and (a_type != b_type) and (b_type != c_type) and (c_type != d_type)
if validStructure
// Calculate Fibonacci ratios
ab = math.abs(b - a)
bc = math.abs(c - b)
xa = math.abs(a - x)
cd = math.abs(d - c)
ab_pct = ab / xa
bc_pct = bc / ab
cd_pct = cd / bc
// Pattern detection
isBullish = false
isBearish = false
// Gartley Pattern
if (ab_pct >= 0.55 and ab_pct <= 0.65) and
(bc_pct >= 0.35 and bc_pct <= 0.45) and
(cd_pct >= 1.2 and cd_pct <= 1.35)
isBullish := not d_type
isBearish := d_type
// Bat Pattern
if (ab_pct >= 0.35 and ab_pct <= 0.45) and
(bc_pct >= 0.85 and bc_pct <= 0.9) and
(cd_pct >= 1.5 and cd_pct <= 1.7)
isBullish := not d_type
isBearish := d_type
// Current bar check
isCurrentBar = bar_index == d_i
// Set signal flags
if isCurrentBar and isBullish
showBuySignal := true
signalDir := "buy"
signalBar := bar_index
alert("Harmonic Buy signal detected", alert.freq_once_per_bar_close)
if isCurrentBar and isBearish
showSellSignal := true
signalDir := "sell"
signalBar := bar_index
alert("Harmonic Sell signal detected", alert.freq_once_per_bar_close)
// Draw labels
if isCurrentBar and (isBullish or isBearish)
label.new(
x = d_i,
y = d,
text = "→ " + (isBullish ? "buy" : "sell"),
style = d_type ? label.style_label_down : label.style_label_up,
color = (isBullish ? bullColor : bearColor),
textcolor = color.white
)
// === Plot Signals at Global Scope ===
plotshape(showBuySignal, title="Buy Signal", location=location.belowbar,
color=bullColor, style=shape.triangleup, size=size.normal)
plotshape(showSellSignal, title="Sell Signal", location=location.abovebar,
color=bearColor, style=shape.triangledown, size=size.normal)