Sharpe & Sortino Ratio PROSharpe & Sortino Ratio PRO offers an advanced and more precise way to calculate and visualize the Sharpe and Sortino Ratios for financial assets on TradingView. Its main goal is to provide a scientifically accurate method for assessing the risk-adjusted performance of assets, both in the short and long term. Unlike TradingView’s built-in metrics, this script correctly handles periodic returns, uses optional logarithmic returns, properly annualizes both returns and volatility, and adjusts for the risk-free rate — all critical factors for truly meaningful Sharpe and Sortino calculations.
Users can customize the rolling analysis window (e.g., 252 periods for one year on daily data) and the long-term smoothing period (e.g., 1260 periods for five years). There’s also an option to select between linear and logarithmic returns and to manually input a risk-free rate if real-time data from FRED (the 3-Month T-Bill Rate via FRED:DGS3MO) is unavailable. Based on the chart’s timeframe (daily, weekly, or monthly), the script automatically adjusts the risk-free rate to a per-period basis.
The Sharpe Ratio is calculated by first determining the asset’s excess returns (returns after subtracting the risk-free return per period), then computing the average and standard deviation of those excess returns over the specified window, and finally annualizing these figures separately — in line with best scientific practices (Sharpe, 1994). The Sortino Ratio follows a similar approach but only considers negative returns, focusing specifically on downside risk (Sortino & Van der Meer, 1991).
To enhance readability, the script visualizes the ratios using a color gradient: strong negative values are shown in red, neutral values in yellow, and strong positive values in green. Additionally, the long-term averages for both Sharpe and Sortino are plotted with steady colors (teal and orange, respectively), making it easier to spot enduring performance trends.
Why calculating Sharpe and Sortino Ratios manually on TradingView is necessary?
While TradingView provides basic Sharpe and Sortino Ratios, they come with significant methodological flaws that can lead to misleading conclusions about an asset’s true risk-adjusted performance.
First, TradingView often computes volatility based on the standard deviation of price levels rather than returns (TradingView, 2023). This method is problematic because it causes the volatility measure to be directly dependent on the asset’s absolute price. For instance, a stock priced at $1,000 will naturally show larger absolute daily price moves than a $10 stock, even if their percentage changes are similar. This artificially inflates the measured standard deviation and, as a result, depresses the calculated Sharpe Ratio.
Second, TradingView frequently neglects to adjust for the risk-free rate. By treating all returns as risky returns, the computed Sharpe Ratio may significantly underestimate risk-adjusted performance, especially when interest rates are high (Sharpe, 1994).
Third, and perhaps most critically, TradingView doesn’t properly annualize the mean excess return and the standard deviation separately. In correct financial math, the mean excess return should be multiplied by the number of periods per year, while the standard deviation should be multiplied by the square root of the number of periods per year (Cont, 2001; Fabozzi et al., 2007). Incorrect annualization skews the Sharpe and Sortino Ratios and can lead to under- or overestimating investment risk.
These flaws lead to three major issues:
• Overstated volatility for high-priced assets.
• Incorrect scaling between returns and risk.
• Sharpe Ratios that are systematically biased downward, especially in high-price or high-interest environments.
How to properly calculate Sharpe and Sortino Ratios in Pine Script?
To get accurate results, the Sharpe and Sortino Ratios must be calculated using the correct methodology:
1. Use returns, not price levels, to calculate volatility. Ideally, use logarithmic returns for better mathematical properties like time additivity (Cont, 2001).
2. Adjust returns by subtracting the risk-free rate on a per-period basis to obtain true excess returns.
3. Annualize separately:
• Multiply the mean excess return by the number of periods per year (e.g., 252 for daily data).
• Multiply the standard deviation by the square root of the number of periods per year.
4. Finally, divide the annualized mean excess return by the annualized standard deviation to calculate the Sharpe Ratio.
The Sortino Ratio follows the same structure but uses downside deviations instead of standard deviations.
By following this scientifically sound method, you ensure that your Sharpe and Sortino Ratios truly reflect the asset’s real-world risk and return characteristics.
References
• Cont, R. (2001). Empirical properties of asset returns: stylized facts and statistical issues. Quantitative Finance, 1(2), pp. 223–236.
• Fabozzi, F.J., Gupta, F. and Markowitz, H.M. (2007). The Legacy of Modern Portfolio Theory. Journal of Investing, 16(3), pp. 7–22.
• Sharpe, W.F. (1994). The Sharpe Ratio. Journal of Portfolio Management, 21(1), pp. 49–58.
• Sortino, F.A. and Van der Meer, R. (1991). Downside Risk: Capturing What’s at Stake in Investment Situations. Journal of Portfolio Management, 17(4), pp. 27–31.
• TradingView (2023). Help Center - Understanding Sharpe and Sortino Ratios. Available at: www.tradingview.com (Accessed: 25 April 2025).
Educational
Relative Volume CandlesVisualizes candlesticks with transparency based on volume relative to a moving average. Higher-than-average volume makes candles more opaque, while lower volume increases transparency—helping you spot significant price movements at a glance!
Features:
Customizable up/down candle colors (default: green/red)
Adjustable lookback period for volume averaging (default: 21)
Fine-tune transparency with base transparency (default: 80) and scale (default: 2.0)
Overlay directly on your chart for seamless analysis
Real True Value Adjusted - Saygın/IchizoOption
CPI = Inflation-adjusted asset price (CPI only)
M2= Money supply adjusted asset price (M2 only)
CPI + M2= Inflation + Money Printing adjusted price (very pure)
Gold Asset price compared to Gold price (XAUUSD)
None Original raw asset price
Works on ANY asset (coin, stock, forex) automatically.
Recommended timeframe: 4H, 1D, 1W (because CPI and M2 are monthly updated).
Extremely rare and powerful perspective for true valuation.
Real Value Adjusted (Gold / CPI) Saygın/IchizoThe CPI and Gold value of assets is an auxiliary indicator designed as a real value measurement tool.
Enflasyson = inflation
Altın = Gold
Advanced QQE Buy/Sell with Confirmation FiltersAdvanced QQE Buy/Sell with Confirmation Filters
This indicator provides high-probability Buy and Sell signals using an advanced Quantitative Qualitative Estimation (QQE) method, enhanced by optional powerful confirmation filters.
Core Strategy:
📈 QQE Signals: Based on smoothed RSI crossover of dynamic threshold bands.
🎯 Buy Signal: Triggered when RSI crosses above QQE Lower Band.
🎯 Sell Signal: Triggered when RSI crosses below QQE Upper Band.
Optional Confirmation Filters:
🔧 RSI Filter: Only accept buys when RSI > 55 or sells when RSI < 45.
🔧 MACD Histogram Filter: Confirms momentum direction.
🔧 VWAP Filter: Confirms if price is above (bullish) or below (bearish) VWAP.
Customization Options:
Adjust RSI Length, QQE Smoothing Length, and Threshold to match your trading style.
Independently toggle each confirmation filter ON/OFF from the settings.
VWAP line can also be plotted on chart for visual guidance.
Key Features:
Clean Buy (green up label) and Sell (red down label) signals plotted on chart.
Alerts available for Buy/Sell triggers.
Optimized for fast performance and low lag.
Recommended Timeframes:
15min, 1H, 4H, Daily.
Disclaimer:
This indicator is for educational purposes only. Trading involves risk. Always perform your own due diligence.
Developed and optimized by Keyvan 🚀
Triple Confirmation Buy/Sell Engine VWAP + MACD + RSIDescription:
This custom-built indicator generates high-confidence Buy/Sell signals using a powerful combination of MACD momentum, RSI strength, and VWAP trend confirmation — designed for cleaner entries and fewer false signals.
Unlike traditional scripts that rely on only one indicator (and produce noisy or early signals), this system requires triple confirmation, greatly increasing signal quality and reducing false trades.
✅ Buy Signal Conditions:
MACD histogram turns green (momentum shift positive)
RSI crosses above 50 (bullish strength confirmation)
Price closes above VWAP (trend confirmation)
🔻 Sell Signal Conditions:
MACD histogram turns red (momentum shift negative)
RSI crosses below 50 (weakening trend)
Price closes below VWAP (bearish confirmation)
🛠 Best For:
Trend traders seeking higher probability entries
Swing traders who want to catch bigger moves
Crypto, stocks, forex traders looking for simple, effective signals
Price in Gold True Value Saygın/IchizoShows the ounce gold value of assets.
Just open and use.
I couldn't find gold valuation in Tradingview app, so I designed the indicator.
Thanks to " Saygın K. "
Godfather of Support & Resistance Godfather of Support & Resistance
Overview
The Godfather of Support & Resistance script is a powerful tool designed to help traders identify critical support and resistance levels on their charts. These price levels are vital for understanding market behavior, as they often act as turning points where prices reverse, consolidate, or break through. By automating the detection of these levels, this script simplifies your trading decisions and enhances your technical analysis.
How It Works
Pivot Points for Level Detection:
The script uses pivot points to identify potential support (lows) and resistance (highs) levels:
A pivot high is a local peak (a high surrounded by lower highs).
A pivot low is a local trough (a low surrounded by higher lows).
You can adjust the Pivot Length (pivotLen) input to control the sensitivity of detection. Smaller values detect more levels, while larger values focus on major levels.
Dynamic Grouping with Tolerance:
The script dynamically groups nearby price levels using a tolerance percentage. This tolerance is based on the level's price, making it adaptive to all types of assets (low- and high-priced).
For example, if the tolerance is set to 1% and a level is at $100, levels within $1 are grouped together.
Touch Count for Significance:
The script tracks how many times the price interacts with each level (touch count). Only levels that meet or exceed the Minimum Touches (minTouches) input are displayed on the chart. This ensures only meaningful levels are highlighted.
Clear Visual Representation:
Resistance Levels (Red Lines): Represent areas where the price tends to reverse downward.
Support Levels (Green Lines): Represent areas where the price tends to reverse upward.
Labels are added to each level (optional) to display the price and the number of touches for better decision-making.
Inputs You Can Customize
Minimum Touches to Show Level:
Set the minimum number of price interactions required for a level to be displayed.
Maximum Lines to Keep:
Limit the number of support and resistance lines displayed to keep your chart clean and focused.
Pivot Length:
Customize the sensitivity of pivot point detection. Smaller values detect more levels, while larger values focus on key levels.
Tolerance for Touch Detection (%):
Adjust the grouping tolerance as a percentage of the price. For example, 1% groups levels that are within 1% of each other.
How to Use
Apply the Script:
Add the script to your TradingView chart, and it will automatically detect and plot support and resistance levels.
Analyze the Levels:
Use Resistance Levels (red lines) as potential sell zones or areas to place stop-loss orders above.
Use Support Levels (green lines) as potential buy zones or areas to place stop-loss orders below.
Customize for Your Trading Style:
Adjust the inputs to match your preferred strategy and the timeframe or asset you're analyzing.
Example Use Case
Imagine you're analyzing a stock:
Resistance Level: The script identifies resistance at $150 with 3 touches. This might be a potential sell zone if the price struggles to break through.
Support Level: The script identifies support at $130 with 4 touches. This might be a potential buy zone if the price shows signs of bouncing upward.
Key Features
Automatically detects and plots support and resistance levels.
Tracks the number of price touches to filter out weak levels.
Adapts dynamically to price ranges using a percentage-based tolerance.
Fully customizable to suit different trading styles and assets.
Clean and professional chart display with a limit on the number of lines.
Notes
This script is for educational purposes only and should not be considered financial advice.
Always perform your own analysis and manage risk before making trading decisions.
Why Use This Script?
The Godfather of Support & Resistance script simplifies your trading decisions by automating the detection of critical price levels. Whether you're a beginner or an experienced trader, this script is designed to save you time and help you focus on making informed trades.
Start using it today to master the art of support and resistance trading!
Let me know if you need further refinements for this description!
Micro Gaps DetectorSimple Micro Gap Indicator: A Technical Analysis Tool
The Simple Micro Gap Indicator is a specialized momentum indicator designed to identify and analyze micro gaps between consecutive candlesticks in financial charts. Unlike traditional gap analysis that focuses on larger price gaps, this indicator specifically targets smaller, less noticeable spaces between candles.
Key Features:
Detects minimal price disparities between consecutive candlesticks
Helps identify potential short-term momentum shifts
Useful for high-frequency trading and scalping strategies
Functions as a momentum indicator for short-term price movements
Wyckoff Accumulation Distribution Wyckoff Accumulation & Distribution Indicator (RSI-Based)
This Pine Script is a technical analysis indicator built around the Wyckoff Method, designed to detect accumulation and distribution phases using RSI (Relative Strength Index) and pivot points. It automatically marks key structural turning points on the chart and highlights relevant zones with colored boxes.
What Does It Do?
Draws accumulation and distribution boxes based on RSI behavior.
Automatically detects Wyckoff structural signals:
SC (Selling Climax)
AR (Automatic Rally)
ST (Secondary Test)
BC (Buying Climax)
DAR (Automatic Reaction)
DST (Secondary Test - Distribution)
Identifies trend transitions by detecting sideways RSI movement.
Attempts to detect spring and UTAD-like deviations based on RSI reversals.
Uses RSI extremes in conjunction with pivot points to generate Wyckoff signals.
How Does It Work?
RSI Zone: It identifies sideways markets when RSI stays within ±20 of the 50 level (this range is configurable).
Pivot Points: It detects pivot highs/lows that sync with RSI values (pivotLen is adjustable).
Trend Box Drawing:
When RSI exits the sideways zone, the script draws a gray box between the highest high and lowest low within that range.
If RSI breaks upward, the box becomes green (Accumulation); if downward, it becomes red (Distribution).
Wyckoff Structural Points:
SC/BC: Detected when a pivot occurs with RSI below/above a threshold.
AR/DAR: The next opposite pivot after SC or BC.
ST/DST: The next same-direction pivot after AR or DAR.
How to Use It
Works best on 4H or daily charts for more reliable signals. Shorter timeframes may generate noise.
Primarily used for interpreting RSI structures through the lens of Wyckoff methodology.
Box colors help quickly identify market phase:
Green box: Likely Accumulation
Red box: Likely Distribution
Triangular markers show key signals:
SC, AR, ST: Accumulation points
BC, DAR, DST: Distribution points
Use these signals alongside price action to manually interpret Wyckoff phases.
image.binance.vision
image.binance.vision
What Is the Wyckoff Method?
The Wyckoff Method, developed in the 1930s by Richard Wyckoff, is a market analysis approach that focuses on supply and demand dynamics behind price movements.
Wyckoff’s 5 Phases:
Accumulation: Smart money gradually buying at low prices.
Markup: Price begins trending upwards.
Distribution: Smart money selling to retail traders.
Markdown: Downtrend begins as supply outweighs demand.
Re-accumulation / Re-distribution: Trend-continuation phases with consolidations.
This indicator is specifically designed to detect phase 1 (Accumulation) and phase 3 (Distribution).
Extra Notes
Repainting is minimal, as pivots are confirmed using historical candles.
Labels use plotshape for a clean, minimalist visual style.
Other Wyckoff events (like SOS, LPS, UT, UTAD) could be added in future updates.
This script does not generate buy/sell signals; it is meant for structural interpretation.
Market Open & Pre-Open Linesversion 1.0 2025-04-23
Stated vertical line for market open and pre-market open. Market option include US, EU, UK, JP and AU. This line do auto-defined during daylight saving time. This help for those trade during market open and benefit for those doing backtest on it.
BULB 20Fractal Wave Marker Indicator
The Fractal Wave Marker is a technical analysis tool designed to visually highlight significant turning points in price action, offering clear signals of potential market reversals. By detecting fractal-like patterns, the indicator identifies high and low points within a specified period, helping traders pinpoint key market swings.
Key Features:
Fixed Period: The period is set to .., ensuring consistency in detecting turning points based on historical price data.
Swing Detection: The indicator detects both base (lower-degree) and fractal (higher-degree) swings, helping to visualize both short-term and long-term trend changes.
Color-coded Markers: High points are marked with a custom color to indicate bullish conditions, while low points are marked in another color for bearish conditions.
Wave Processing: The indicator processes swing highs and lows, dynamically updating to reflect the most relevant turning points on the chart.
Overlay on Chart: Markers are overlaid directly on the chart for quick, intuitive insights into price action, helping traders make better entry and exit decisions.
How It Works:
The indicator calculates the highest highs and lowest lows over a -bar period (fixed period).
When a new swing point is detected, the indicator marks it with a circle, color-coded based on whether it’s a high or low point.
The base swing and fractal wave directions are updated with each new turning point, allowing traders to follow price action and identify market trends.
Zen MIG Reversal V1**Zen MIG Reversal V1**
Zen MIG Reversal is a pattern-based indicator that highlights rare reversal setups.
It’s designed to support traders in visually identifying potential turning points, especially following strong momentum or gap-style moves.
**How it works:**
- **Bullish Reversal:**
Detects 3 consecutive bullish candles. The third bar must have a low above the high of the first bar and below the 20 EMA. When this occurs, a light blue box is drawn across the 3-bar range, from high to the current bar’s low. A blue arrow appears below the prior bar.
- **Bearish Reversal:**
Detects 3 consecutive bearish candles. The third bar must have a high below the low of the first bar and above the 20 EMA. A light red box is drawn from low to the current bar’s high. A red arrow appears above the prior bar.
- Optional settings allow you to:
- Show or hide the EMA line
- Toggle the arrows
- Adjust smoothing settings for context
**Purpose:**
It’s best used for discretionary analysis, journaling, or studying price behavior in momentum-driven environments.
**Disclaimer:**
This script is for educational and informational purposes only. It does not provide financial advice or trade recommendations. Always backtest and use proper risk management before applying any indicator to live trading.
Sessions OHLC - NY TimeThis Pine Script indicator, "Session OHLC Rays & Boxes - NY Time (Current Day)," visualizes trading sessions on a chart by marking the Open, High, Low, and Close (OHLC) levels for four predefined sessions—Asia, London, NY AM, and NY PM—based on New York time (EDT, UTC-4).
It draws the following for the current day:
Colored Boxes: Each session is enclosed in a semi-transparent box (e.g., green for Asia, blue for London) spanning the session’s duration, with the top and bottom at the session’s High and Low.
Horizontal Rays: Dashed lines extend rightward from the OHLC levels of each session, color-coded to match the session, if enabled via user inputs (e.g., "Show Asia Open").
OHLC Labels: Yellow labels display the OHLC prices at the start of each session box, updated dynamically: Open at session start, High and Low during the session, and Close at session end or during the session if active.
Additionally, users can display up to four previous days’ sessions (boxes and labels) by adjusting the "Show Previous Days" input. The indicator is customizable, allowing users to toggle OHLC labels and rays for each session and adjust session times and colors.
Horizontal Price TableOverview:
This script displays a dynamic price table on your chart, showing real-time prices and daily percentage changes for up to 7 user-defined tickers. You can customize both which tickers are shown and how many are visible, all through the settings panel.
How it works (Step-by-Step):
User-Defined Tickers:
The script provides input fields for up to 7 tickers using input.symbol(). You can track stocks, indexes, ETFs, crypto, or futures — anything supported by TradingView.
Choose How Many to Display:
An additional dropdown lets you choose how many of the 7 tickers to actually display (between 1 and 7). This gives you control over screen space and focus.
Market Data Fetching:
For each displayed ticker, the script fetches:
The current day’s closing price (close)
The previous day’s closing price (close )
This data is pulled using request.security() on the daily timeframe (1D).
% Change Calculation:
The script calculates the daily percentage change using:
(Current Price−Previous Close)/Previous Close×100(Current Price−Previous Close)/Previous Close×100
Cleaned Ticker Names:
Ticker symbols often include an exchange prefix like NASDAQ:AAPL. The script automatically removes anything before the colon (:), so only the clean symbol (e.g., AAPL) is shown in the table.
Table Display:
A visual table appears at the top-center of your chart, showing:
Row 1: Ticker symbol (cleaned)
Row 2: Current price (rounded to 2 decimals)
Row 3: Daily % change (green for gains, red for losses)
Customization:
You can choose the background color of the table.
Ticker names appear in white text with a gray background.
% change is color-coded: green for positive, red for negative.
Why Use This Script?
Track multiple tickers at once without leaving your chart.
Clean, customizable layout.
Useful for monitoring watchlists, portfolios, or related markets.
Tips:
Combine this with your favorite indicators for a personalized dashboard.
Works great on any chart or timeframe.
Ensure the tickers entered are valid on TradingView (e.g., SPY, BTCUSD, NQ1!, etc.).
Ultimate Gann Fan Suite with Multi-ArcsUltimate Gann Fan Suite with Multi-Arcs
This open-source indicator plots Gann Fan angles, arcs, and levels to analyze price and time relationships based on a user-selected pivot point.
What It Does:
- Draws Gann Fan angles (1x16 to 16x1) from a pivot, with optional mirrored lines.
- Plots a base Gann arc and multi-arcs scaled by Gann ratios.
- Displays a Square of 9 grid and Gann Square levels for price projections.
- Supports custom timeframes and price types for pivot selection.
How to Use:
- Pivot: Enable manual pivot picking and select a price type (e.g., Close, High).
- Timeframe: Choose a timeframe (e.g., Daily) for pivot data.
- Angles and Arcs: Show/hide specific Gann angles, arcs, or levels; adjust colors and line styles.
- Scaling: Set price scale (e.g., 9.0) and arc radius (e.g., 36) for visual clarity.
- Labels: Enable labels to identify angles and levels.
- Best for stocks, forex, or crypto on daily or weekly charts.
Notes:
- Ensure enough chart history for the selected timeframe.
- Use on assets with clear trends or cycles for best results.
- Adjust settings to balance chart readability.
JOYZONE.04JOYZONE signal for TradingView
The JOYZONE Breakout Indicator is a sophisticated tool designed for traders seeking to identify potential trend reversals and breakouts in financial markets. Built for TradingView’s Pine Script v6, this indicator leverages pivot points to detect significant price levels, offering a clear visual representation of bullish and bearish market shifts. By focusing on key price action patterns, it aims to provide traders with actionable insights for both trend-following and reversal strategies.
Core Functionality
The JOYZONE Breakout Indicator identifies critical pivot highs and lows using a fixed 5-period lookback, which simplifies the detection of potential reversal zones without requiring user adjustments. These pivot points are used to establish "JOYZONE" levels—price thresholds that, when broken with confirmation, signal a change in market trend. The indicator employs a robust confirmation mechanism within fixed bar window, reducing false signals and enhancing reliability.
Upon detecting a breakout, the indicator plots horizontal lines at the JOYZONE levels, extending until a new signal emerges or the trend shifts. Labels accompany these lines, marking bullish (+JOYZONE) and bearish (-JOYZONE) breakouts with customizable colors (default: green for bullish, red for bearish) and sizes (tiny to large). This visual clarity helps traders quickly assess market direction and key price levels.
Key Features
Simplified Inputs: The indicator minimizes user configuration by hardcoding critical parameters like the fixed-period directional detection system. Traders can toggle JOYZONE level visibility, adjust label sizes, and customize colors, ensuring flexibility without overwhelming complexity.
Efficient Signal Management: With a default cap of 86 signals, the indicator prevents chart clutter by automatically removing older lines and labels when the limit is exceeded. This feature is particularly useful for long-term chart analysis.
Dynamic Alerts: The script includes alert triggers for bullish and bearish JOYZONE breakouts, delivering real-time notifications with price details. This enables traders to act swiftly on confirmed signals, whether trading manually or integrating with automated systems.
ATR-Based Label Positioning: Labels are offset using the 50-period Average True Range (ATR), ensuring they remain visible and uncluttered regardless of market volatility.
How It Works
The indicator tracks pivot highs and lows to establish JOYZONE levels during uptrends (bearish levels) and downtrends (bullish levels). When the price crosses a JOYZONE level and satisfies the confirmation criteria, the trend updates, and a breakout signal is plotted. For example, a bullish JOYZONE breakout occurs when the price crosses above a pivot high during a downtrend, confirmed by a close above the threshold. The script then draws a green line and a “+JOYZONE” label, alerting the trader to a potential uptrend.
Use Cases
This indicator is versatile, catering to various trading styles:
Swing Traders: Use JOYZONE breakouts to enter trades at the onset of new trends, with clear entry and stop-loss levels based on plotted lines.
Day Traders: Leverage real-time alerts to capitalize on intraday reversals in volatile markets.
Position Traders: Monitor higher timeframes to identify long-term trend shifts with high-probability setups.
Customization and Performance
Traders can adjust the visibility of JOYZONE levels, label sizes, and colors to suit their chart preferences. The hardcoded 5-period lookback and 0.015% confirmation ensure consistency across assets, but users may need to test performance on specific markets (e.g., forex, stocks, crypto) to align with their strategies. The indicator’s reliance on ATR for label placement adapts to varying volatility, making it effective across different instruments.
Limitations and Considerations
While the JOYZONE Breakout Indicator excels in trending markets, it may produce delayed signals in choppy or sideways conditions due to its confirmation mechanism. Traders should combine it with other tools, such as moving averages or volume indicators, to filter signals. Additionally, the fixed period may not suit all timeframes, so testing on historical data is recommended.
Conclusion
The JOYZONE Breakout Indicator offers a streamlined, visually intuitive approach to detecting trend reversals and breakouts. Its automated signal management, dynamic alerts, and customizable display make it a valuable addition to any trader’s toolkit. By focusing on confirmed price action, it empowers traders to make informed decisions with confidence. Whether you’re a novice or seasoned trader, this indicator provides a reliable framework for navigating dynamic markets.
Disclaimer: This code does not guarantee of profit/return, please analyze with other factors, it is shared only for knowledge and educational purpose.
Nasan Market Phase ClassifierThe Nasan Market Phase Classifier indicator designed to classify market phases using volume, volatility (or momentum), and statistical analysis. Here's a summary of how it works and what it does:
🔍 Core Concept
This indicator classifies the market into four phases based on volume and ATR (or optionally momentum):
High Volume / High ATR or Momentum (HV/HATR): Strong Trend
Low Volume / High ATR or Momentum (LV/HATR): False Breakout / Exhaustion
High Volume / Low ATR or Momentum (HV/LATR): Consolidation
Low Volume / Low ATR or Momentum (LV/LATR): Stagnation
⚙️ Key Settings
Short-Term Length: Used for the active market phase.
Long-Term Length: Used as the expected/benchmark distribution.
Use Momentum: Replaces volatility (ATR) with momentum (custom ROC-based formula).
Use Fixed Alpha: Toggles adaptive vs. fixed weighting in scoring (this is based on variation of the volatility - standard deviation of true range).
📊 How It Works
Volatility or Momentum Scoring:
Uses ATR-based or Momentum-based score depending on the setting.
Applies weighing (alpha) which is based on variability of the volatility itself.
Market Phase Count:
Measures how often each of the 4 volume/volatility combinations occur in:
Short-term window (observed phase)
Long-term window (expected distribution)
Category Proportions:
Calculates percentage share of each category (e.g., % time in HV/HATR).
Plots these on chart to visually see market phase dominance (can be used for screening of pine screener).
Statistical Testing:
IQV (Index of Qualitative Variation): Measures phase diversity (0 = focused, 1 = mixed).
Chi-Squared Test: Compares current vs. historical phase distribution.
Z-Test: Tests if current phase dominance is statistically significant.
📋 Outputs
On-Chart Plots and Tabels:
Strong Trend, False Breakout/Exhaustion, Consolidation, Stagnation
Strength Quality Plot: Trend strength normalized by IQV.
Dynamic Table (Top Right):
Shows each phase’s proportion (the current phase cell is highlighted in yellow), IQV, Chi² value, and current dominant phase. The current candle classification (text) is in purple.
Highlights the dominant phase classification and color-codes significance (the cell highlighted in green highly confident about the classification, orange intermediate confidence and red low confidence). This color coding is not just based on statistical significance it is based on IQV which takes into account how spread the proportions are.
🧠 Interpretation
A dominant HV/HATR phase with low IQV and high Z-Score indicates a strong and statistically significant trend.
High IQV suggests uncertainty or mixed market behavior.
Chi² spike indicates a shift from historical behavior can be used to see is the market behavior changing by changing the long term length say to 252 and short term length to 21 this will tell if the short term behavior is different from the past 252 day behavior.
Open - CSC Bars - 33 CSC Bars – Early Session Price Action Filter
This script detects when the first three bars of the RTH (Regular Trading Hours) session all move in the same direction — either all bullish or all bearish.
It’s a tool for price action traders who want to develop structured opening strategies by observing clean directional agreement at the session start. The indicator highlights the third bar when the sequence confirms directional bias.
🔍 How It Works:
Monitors the first three bars after the RTH session begins.
If all three bars are bullish, it highlights the third bar (same for bearish sequences).
No projections, signals, or entries—purely a visual tool to observe and study opening behavior.
🎯 Use Case:
This script is designed to help traders build and test opening-based frameworks by identifying potential trend bias early in the day.
Note: This is an open-source utility script with a simple function. It does not generate signals or predictions and is intended to assist with observation and discretionary strategy building.
Bitcoin NUPL IndicatorThe Bitcoin NUPL (Net Unrealized Profit/Loss) Indicator is a powerful metric that shows the difference between Bitcoin's market cap and realized cap as a percentage of market cap. This indicator helps identify different market cycle phases, from capitulation to euphoria.
// How It Works
NUPL measures the aggregate profit or loss held by Bitcoin investors, calculated as:
```
NUPL = ((Market Cap - Realized Cap) / Market Cap) * 100
```
// Market Cycle Phases
The indicator automatically color-codes different market phases:
• **Deep Red (< 0%)**: Capitulation Phase - Most coins held at a loss, historically excellent buying opportunities
• **Orange (0-25%)**: Hope & Fear Phase - Early accumulation, price uncertainty and consolidation
• **Yellow (25-50%)**: Optimism & Anxiety Phase - Emerging bull market, increasing confidence
• **Light Green (50-75%)**: Belief & Denial Phase - Strong bull market, high conviction
• **Bright Green (> 75%)**: Euphoria & Greed Phase - Potential market top, historically good profit-taking zone
// Features
• Real-time NUPL calculation with customizable smoothing
• RSI indicator for additional momentum confirmation
• Color-coded background reflecting current market phase
• Reference lines marking key transition zones
• Detailed metrics table showing NUPL value, market sentiment, market cap, realized cap, and RSI
// Strategy Applications
• **Long-term investors**: Use extreme negative NUPL values (deep red) to identify potential bottoms for accumulation
• **Swing traders**: Look for transitions between phases for potential trend changes
• **Risk management**: Consider taking profits when entering the "Euphoria & Greed" phase (bright green)
• **Mean reversion**: Watch for overbought/oversold conditions when NUPL reaches historical extremes
// Settings
• **RSI Length**: Adjusts the period for RSI calculation
• **NUPL Smoothing Length**: Applies moving average smoothing to reduce noise
// Notes
• Premium TradingView subscription required for Glassnode and Coin Metrics data
• Best viewed on daily timeframes for macro analysis
• Historical NUPL extremes have often marked cycle bottoms and tops
• Use in conjunction with other indicators for confirmation
Zonas Horarias (UTC-3)
--------------------------------------------------------------------------------------------------
This script colors the background of the chart based on three key time ranges, using the UTC-3 time zone (for example, Buenos Aires or Montevideo). It's useful for traders who want to visually identify specific time blocks to analyze price action or plan their daily trading activities.
🕒 What does it do? Marks three user-defined time ranges on the chart.
Uses different colors for each session.
The background is colored only when the price is within each time range.
🧭 Highlighted Time Zones:
DAILY → from 00:00 to 00:15 (can be used as a reference for the start of the day).
PRE-SESSION → from 02:15 to 03:15 (useful for visualizing a pre-market or session preparation).
NEW-YORK → from 09:00 to 17:00 (the typical American session time).
⚙️ Customization: You can change the session times from the script's settings panel.
The background colors are defined with transparency so they don't interfere with other chart elements.
📌 Notes:
This script does not generate buy or sell signals.
It is designed purely as a visual tool for intraday analysis.
Optimized for the Etc/GMT+3 time zone (equivalent to UTC-3). Be sure to use this time zone for the time blocks to appear correctly.
___________________________________________________________
Este script colorea el fondo del gráfico en función de tres franjas horarias clave, usando la zona horaria UTC-3 (por ejemplo, Buenos Aires o Montevideo). Es útil para traders que desean identificar visualmente bloques de tiempo específicos para analizar la acción del precio o planificar su operativa diaria.
🧠 ¿Para qué se usa?
Este indicador forma parte de la Estrategia 2 del TraderNocturno, y se utiliza para delimitar zonas horarias relevantes dentro del análisis intradía. Permite una mejor interpretación del contexto temporal del precio.
🕒 ¿Qué hace?
Marca en el gráfico tres rangos horarios definidos por el usuario.
Usa colores distintos para cada sesión.
El fondo se colorea únicamente cuando el precio está dentro de cada franja horaria.
🧭 Zonas horarias destacadas:
DIARIA → de 00:00 a 00:15 (referencia del inicio de jornada).
PRE-SESSION → de 02:15 a 03:15 (usada como zona de preparación o acumulación).
NEW-YORK → de 09:00 a 17:00 (sesión americana, horario clave para movimientos fuertes).
⚙️ Personalización:
Puedes cambiar los horarios desde el panel de configuración.
Colores semitransparentes para una visualización clara sin interferir con otros indicadores.
📌 Notas:
Este script es una herramienta visual, no genera señales de compra o venta.
Optimizado para la zona horaria Etc/GMT+3 (UTC-3). Asegúrate de usar esta zona para que los bloques se representen correctamente.
Directional Bias | FractalystNote: This indicator is specifically designed to integrate with the Quantify suite, automating bias detection through input.source(). While other scripts may provide similar functionality, this indicator uniquely connects with Quantify by outputting precise bias values: bullish (1), bearish (-1), or neutral (0).
What is the Directional Bias indicator?
The Directional Bias indicator is a powerful tool designed to automatically identify market bias (bullish, bearish, or neutral) using a sophisticated system of moving averages and filters. It serves as the perfect companion to the Quantify suite, allowing traders to objectively determine market direction without relying on subjective analysis or emotional decision-making.
How does the Directional Bias indicator work?
The indicator utilizes up to four customizable moving averages (MA) with various types (SMA, EMA, HMA, VWMA, etc.) and timeframes to determine market direction. It analyzes price action relative to these moving averages and applies user-defined filters to calculate whether the current market condition is bullish, bearish, or neutral.
What makes this indicator different from other trend indicators?
- Unlike traditional trend indicators that rely on a single moving average or oscillator, the Directional Bias indicator offers:
- Multi-moving average analysis with up to 4 different MAs
- Customizable MA types (SMA, EMA, WMA, VWMA, RMA, HMA, DEMA, TEMA, etc.)
- Multi-timeframe functionality for each MA
- Configurable filters to eliminate false signals
- Clear visual representation of bias directly on your charts
How does this indicator integrate with the Quantify?
- The Directional Bias indicator serves as the automated "bias detection engine" for the Quantify suite. While the original Quantify model required manual bias selection, this integration allows Quantify to automatically detect market bias and adjust its calculations accordingly. This creates a more streamlined workflow where Quantify can focus on identifying high-probability setups aligned with the objectively determined market direction.
Who is this indicator designed for?
This indicator is perfect for:
- Traders who use the Quantify suite and want to automate bias detection
- Technical analysts seeking objective trend confirmation
- Systematic traders who need clear rules for market direction
- Any trader looking to remove subjectivity from their directional analysis
What are the key benefits of using the Directional Bias indicator?
- Objective Analysis: Removes emotion and subjectivity from market direction determination
- Customizable: Adapt to your preferred timeframes and moving average types
- Visual Clarity: Instantly see market bias directly on your charts
- Seamless Quantify Integration: Automates what was previously a manual step in the Quantify workflow
- Enhanced Decision-Making: Provides clear signals for when to look for long vs. short opportunities
How can I optimize the Directional Bias indicator for my trading style?
You can customize:
- MA types for different market conditions (trending vs. ranging)
- MA lengths for sensitivity adjustment (shorter for quick signals, longer for reduced noise)
- Timeframes for each MA to incorporate multi-timeframe analysis
- Filter conditions to refine signals based on your risk tolerance
How does this indicator fit into a complete trading system?
The Directional Bias indicator serves as the first essential component in a complete system:
- Step 1: Use Directional Bias to determine market direction
- Step 2: Let Quantify identify high-probability entry setups aligned with that direction
- Step 3: Implement proper risk management using Quantify's Kelly Criterion calculations
- Step 4: Manage your trades with Quantify's trailing stop mechanisms
What technical innovations does this indicator offer?
- The indicator leverages advanced Pine Script functionality to deliver:
- Real-time bias calculation across multiple timeframes
- Non-repainting signals that provide reliable analysis
- Optimized code for smooth performance
- Visual color-coding for instant bias recognition
- Seamless integration with the broader Quantify ecosystem
To implement: Add both indicators to your chart, select Directional Bias as Quantify's external input source, and the system will automatically adjust calculations based on the detected market bias.