Correlation Heatmap█ OVERVIEW 
This indicator creates a correlation matrix for a user-specified list of symbols based on their time-aligned weekly or monthly price returns. It calculates the  Pearson correlation coefficient  for each possible symbol pair, and it displays the results in a symmetric table with heatmap-colored cells. This format provides an intuitive view of the linear relationships between various symbols' price movements over a specific time range.
 █ CONCEPTS 
 Correlation 
 Correlation  typically refers to an observable statistical relationship between two datasets. In a financial time series context, it usually represents the extent to which sampled values from a pair of datasets, such as two series of price returns, vary jointly over time. More specifically, in this context, correlation describes the  strength  and  direction  of the relationship between the samples from both series. 
If two separate time series tend to rise and fall together proportionally, they might be highly correlated. Likewise, if the series often vary in opposite directions, they might have a strong  anticorrelation . If the two series do not exhibit a clear relationship, they might be  uncorrelated . 
Traders frequently analyze asset correlations to help optimize portfolios, assess market behaviors, identify potential risks, and support trading decisions. For instance, correlation often plays a key role in  diversification . When two instruments exhibit a strong correlation in their returns, it might indicate that buying or selling both carries elevated  unsystematic risk . Therefore, traders often aim to create balanced portfolios of relatively uncorrelated or anticorrelated assets to help promote investment diversity and potentially offset some of the risks.
When using correlation analysis to support investment decisions, it is crucial to understand the following caveats:
 •  Correlation does not imply causation . Two assets might vary jointly over an analyzed range, resulting in high correlation or anticorrelation in their returns, but that  does not  indicate that either instrument directly influences the other. Joint variability between assets might occur because of shared sensitivities to external factors, such as interest rates or global sentiment, or it might be entirely coincidental. In other words, correlation does not provide sufficient information to identify  cause-and-effect  relationships. 
 • Correlation  does not  predict the future relationship between two assets. It only reflects the estimated strength and direction of the relationship between the current analyzed samples. Financial time series are ever-changing. A strong trend between two assets can weaken or reverse in the future. 
 Correlation coefficient 
A  correlation coefficient  is a numeric measure of correlation. Several coefficients exist, each quantifying  different types  of relationships between two datasets. The most common and widely known measure is the  Pearson product-moment correlation coefficient , also known as the  Pearson correlation coefficient  or  Pearson's r . Usually, when the term "correlation coefficient" is used without context, it refers to this correlation measure. 
The Pearson correlation coefficient quantifies the strength and direction of the  linear relationship  between two variables. In other words, it indicates how consistently variables' values move together or in opposite directions in a proportional, linear manner. Its formula is as follows:
𝑟(𝑥, 𝑦) = cov(𝑥, 𝑦) / (𝜎𝑥 * 𝜎𝑦)
Where:
 • 𝑥 is the first variable, and 𝑦 is the second variable.
 • cov(𝑥, 𝑦) is the  covariance  between 𝑥 and 𝑦.
 • 𝜎𝑥 is the  standard deviation  of 𝑥.
 • 𝜎𝑦 is the standard deviation of 𝑦.
In essence, the correlation coefficient measures the covariance between two variables,  normalized  by the product of their standard deviations. The coefficient's value ranges from -1 to 1, allowing a more straightforward interpretation of the relationship between two datasets than what covariance alone provides:
 • A value of 1 indicates a perfect positive correlation over the analyzed sample. As one variable's value changes, the other variable's value changes proportionally in the  same direction .
 • A value of -1 indicates a perfect negative correlation (anticorrelation). As one variable's value increases, the other variable's value  decreases  proportionally. 
 • A value of 0 indicates  no linear relationship  between the variables over the analyzed sample. 
 Aligning returns across instruments 
In a financial time series, each data point (i.e., bar) in a sample represents information collected in periodic intervals. For instance, on a "1D" chart, bars form at specific times as successive days elapse. 
However, the times of the data points for a symbol's standard dataset depend on its active  sessions , and sessions vary across instrument types. For example, the daily session for NYSE stocks is 09:30 - 16:00 UTC-4/-5 on weekdays, Forex instruments have 24-hour sessions that span from 17:00 UTC-4/-5 on one weekday to 17:00 on the next, and new daily sessions for cryptocurrencies start at 00:00 UTC every day because crypto markets are consistently open. 
Therefore, comparing the standard datasets for different asset types to identify correlations presents a challenge. If two symbols' datasets have bars that form at unaligned times, their correlation coefficient  does not  accurately describe their relationship. When calculating correlations between the returns for two assets, both datasets must maintain consistent time alignment in their values and cover identical ranges for meaningful results.
To address the issue of time alignment across instruments, this indicator requests confirmed  weekly  or  monthly  data from  spread tickers  constructed from the chart's ticker and another specified ticker. The datasets for spreads are derived from lower-timeframe data to ensure the values from all symbols come from aligned points in time, allowing a fair comparison between different instrument types. Additionally, each spread ticker ID includes necessary modifiers, such as extended hours and adjustments. 
In this indicator, we use the following process to retrieve time-aligned returns for correlation calculations:
 1. Request the current and previous prices from a spread representing the  sum  of the chart symbol and another symbol ( "chartSymbol + anotherSymbol" ).
 2. Request the prices from another spread representing the  difference  between the two symbols ( "chartSymbol - anotherSymbol" ).
 3. Calculate half of the difference between the values from both spreads ( 0.5 * (requestedSum - requestedDifference) ). The results represent the symbol's prices at times aligned with the sample points on the current chart.
 4. Calculate the arithmetic return of the retrieved prices:  (currentPrice - previousPrice) / previousPrice 
 5. Repeat steps 1-4 for each symbol requiring analysis. 
It's crucial to note that because this process retrieves prices for a symbol at times consistent with periodic points on the current chart, the values can represent prices from  before or after  the closing time of the symbol's usual session.
Additionally, note that the maximum number of weeks or months in the correlation calculations depends on the chart's range and the largest time range common to all the requested symbols. To maximize the amount of data available for the calculations, we recommend setting the chart to use a daily or higher timeframe and specifying a chart symbol that covers a sufficient time range for your needs.
 █ FEATURES 
This indicator analyzes the correlations between several pairs of user-specified symbols to provide a structured, intuitive view of the relationships in their returns. Below are the indicator's key features:
 Requesting a list of securities 
The "Symbol list" text box in the indicator's "Settings/Inputs" tab accepts a  comma-separated  list of symbols or ticker identifiers with optional spaces (e.g., "XOM, MSFT, BITSTAMP:BTCUSD"). The indicator dynamically requests returns for each symbol in the list, then calculates the correlation between each pair of return series for its heatmap display. 
Each item in the list must represent a valid symbol or ticker ID. If the list includes an invalid symbol, the script raises a runtime error. 
To specify a broker/exchange for a symbol, include its name as a prefix with a colon in the "EXCHANGE:SYMBOL" format. If a symbol in the list does not specify an exchange prefix, the indicator selects the most commonly used exchange when requesting the data.
Note that the number of symbols allowed in the list depends on the user's plan. Users with non-professional plans can compare up to 20 symbols with this indicator, and users with professional plans can compare up to 32 symbols. 
 Timeframe and data length selection 
The "Returns timeframe" input specifies whether the indicator uses weekly or monthly returns in its calculations. By default, its value is "1M", meaning the indicator analyzes monthly returns. Note that this script requires a chart timeframe lower than or equal to "1M". If the chart uses a higher timeframe, it causes a runtime error.  
To customize the length of the data used in the correlation calculations, use the "Max periods" input. When enabled, the indicator limits the calculation window to the number of periods specified in the input field. Otherwise, it uses the chart's time range as the limit. The top-left corner of the table shows the number of confirmed weeks or months used in the calculations. 
It's important to note that the number of confirmed periods in the correlation calculations is limited to the largest time range common to  all  the requested datasets, because a meaningful correlation matrix requires analyzing each symbol's returns under the  same  market conditions. Therefore, the correlation matrix can show different results for the same symbol pair if another listed symbol restricts the aligned data to a shorter time range. 
 Heatmap display 
This indicator displays the correlations for each symbol pair in a heatmap-styled table representing a symmetric correlation matrix. Each row and column corresponds to a specific symbol, and the cells at their intersections correspond to  symbol pairs . For example, the cell at the "AAPL" row and "MSFT" column shows the weekly or monthly correlation between those two symbols' returns. Likewise, the cell at the "MSFT" row and "AAPL" column shows the same value. 
Note that the  main diagonal  cells in the display, where the row and column refer to the same symbol, all show a value of 1 because any series of non-na data is always perfectly correlated with itself. 
The background of each correlation cell uses a gradient color based on the correlation value. By default, the gradient uses blue hues for positive correlation, orange hues for negative correlation, and white for no correlation. The intensity of each blue or orange hue corresponds to the strength of the measured correlation or anticorrelation. Users can customize the gradient's base colors using the inputs in the "Color gradient" section of the "Settings/Inputs" tab. 
 █ FOR Pine Script® CODERS 
  • This script uses the `getArrayFromString()` function from our  ValueAtTime  library to process the input list of symbols. The function splits the "string" value by its commas, then constructs an  array  of non-empty strings without leading or trailing whitespaces. Additionally, it uses the  str.upper()  function to convert each symbol's characters to uppercase. 
  • The script's `getAlignedReturns()` function requests time-aligned prices with two  request.security()  calls that use spread tickers based on the chart's symbol and another symbol. Then, it calculates the arithmetic return using the `changePercent()` function from the  ta  library. The `collectReturns()` function uses `getAlignedReturns()` within a loop and stores the data from each call within a  matrix . The script calls the `arrayCorrelation()` function on pairs of rows from the returned matrix to calculate the correlation values. 
  • For consistency, the `getAlignedReturns()` function includes extended hours and dividend adjustment modifiers in its data requests. Additionally, it includes other settings inherited from the chart's context, such as "settlement-as-close" preferences.
  • A Pine script can execute up to 40 or 64 unique `request.*()` function calls, depending on the user's plan. The maximum number of symbols this script compares is  half  the plan's limit, because `getAlignedReturns()` uses two  request.security()  calls. 
  • This script can use the  request.security()  function within a loop because all scripts in Pine v6 enable  dynamic requests  by default. Refer to the  Dynamic requests  section of the  Other timeframes and data  page to learn more about this feature, and see our  v6 migration guide  to learn what's new in Pine v6.
  • The script's  table  uses two distinct  color.from_gradient()  calls in a  switch  structure to determine the cell colors for positive and negative correlation values. One call calculates the color for values from -1 to 0 based on the first and second input colors, and the other calculates the colors for values from 0 to 1 based on the second and third input colors. 
 Look first. Then leap. 
Cari dalam skrip untuk "one一季度财报"
ADR Nivele Horizontale dhe EMAThe user provided a Pine Script code for an indicator called "ADR Nivele Horizontale dhe EMA". The task is to explain how this code works. Hmm, first, I need to understand what this indicator does. The title mentions ADR levels and EMA, so it's probably combining horizontal lines based on Average Daily Range and some Exponential Moving Averages.
Looking at the code, the first part is the indicator declaration with version 6. The settings include an ADR period, levels above and below the mid, and line style. Then there's a section for calculations. They request daily high and low to compute the daily range. The ADR is the SMA of the daily range over the specified period. The mid is the average of daily high and low. The adr_val is half of ADR, maybe to create symmetrical levels around the mid.
Next, they create arrays for lines and labels above and below the mid. The loops go from 1 to levels_above/below, calculate each level, draw lines and labels. The mid line is also drawn with a different color. Then, there are several EMAs plotted: 13, 50, 200, 400, 600, 800, each with different colorsWait, but in Pine Script, when you use arrays to store lines and labels, you have to manage them properly to avoid repainting or memory issues. The code uses array.concat to add new lines and labels each bar. However, since this code is running on each bar, the for loops might be creating multiple lines each time, leading to too many objects. Oh right, but they use var to initialize the arrays, so they are only initialized once. Wait, no. The var keyword initializes the variable once, but in each iteration, they are concatenating new lines. Wait, no: the for loops are inside the main script, which runs on each bar. So every time a new bar is processed, the loops will run again, adding new lines and labels. That's a problem because each bar would create new lines, leading to an ever-increasing number of lines, which could hit the maximum limit (max_lines_count is set to 20, but maybe they have more bars). Oh, the indicator has max_lines_count=20, but the code might be creating multiple lines per bar. So maybe the code isn't handling the line management correctly. For example, if levels_above is 2, then each bar would create 2 new lines above and 2 below, plus the mid line. Over 20 bars, that's way over 20 lines. So this could cause the indicator to stop drawing after 20 lines. The user might not have realized that the lines are being recreated every bar, leading to a buildup. But perhaps the original code intended to have the lines update each bar, extending to the current bar. Let's see: in line.new, they use bar_index  as the starting x1 and bar_index as x2. So each line is drawn from the previous bar's index to the current one. But since this is done on every bar, each line is only one bar long. Wait, no. Because on each new bar, the code creates a new line from the previous bar's index (bar_index , which is now the bar before the current one) to the current bar_index. So each line is just a segment from the previous bar to the current bar. But when the next bar comes, a new line is created again. So the result is that each level line is a series of one-bar-length segments, which might not be intended. The user probably wants continuous lines that extend from the left to the right, not just per bar. So this approach is incorrect. The correct way would be to have a line that starts at the first bar of the calculation and extends to the right, updating each bar. But the current code creates a new line each bar, leading to multiple short lines instead of one continuous line. That's a mistake.
So the main issue here is that the code is generating a new line segment for each bar, which is not efficient and would quickly hit the line limit. To fix this, instead of creating a new line every bar, they should create the line once and then update its position each bar. But in Pine Script, you can't directly update a line after it's created; instead, you need to track the line ID and use line.set_xy() to extend it. However, the current code uses array.concat to add new lines each bar, which isn't the right approach.
Therefore, the code as written will create multiple short lines instead of continuous horizontal lines. The correct approach for horizontal levels that extend to the right is to create the line once, starting at a certain bar and extending indefinitely, or to update the line's end point each new bar. But in Pine Script, you can't extend lines infinitely; you have to manage them each bar. Alternatively, using the 'line.extend' style might help, but I think the original code's logic is flawed here.
Additionally, the EMA part is straightforward: plotting multiple EMAs with different periods. That part should work as expected.
So the explanation should mention that the ADR levels are calculated based on the daily high and low, then the code attempts to draw horizontal lines above and below the mid-point. However, the way the lines are drawn may lead to multiple short segments instead of continuous lines, potentially causing performance issues or hitting the maximum line count. The EMAs are plotted correctly with various periods..
MA SniperThis indicator automatically finds the most effective moving average to use in a price crossover strategy—so you can focus on trading, not testing. It continuously evaluates a wide range of moving average periods, ranks them based on real-time market performance, and selects the one delivering the highest quality signals. The result? A smarter, adaptive tool that shows you exactly when price crosses its optimal moving average—bullish signals in green, bearish in red.
What makes it unique is the way it thinks.
Under the hood, the script doesn’t just pick a random MA or let you choose one manually. Instead, it backtests a large panel of moving average lengths for the current asset and timeframe. It evaluates each one by calculating its **Profit Factor**—a key performance metric used by pros to measure the quality of a strategy. Then, it assigns each MA a score and ranks them in a clean, built-in table so you can see, at a glance, which ones are currently most effective.
From that list, it picks the top-performing MA and uses it to generate live crossover signals on your chart. That MA is plotted automatically, and the signals adapt in real-time. This isn’t a static setup—it’s a dynamic system that evolves as the market evolves.
Even better: the indicator detects the type of instrument you’re trading (forex, stocks, etc.) and adjusts its internal calculations accordingly, including how many bars per day to consider. That means it remains highly accurate whether you’re trading EURUSD, SPX500, or TSLA.
You also get a real-time dashboard (via the table) that acts as a transparent scorecard. Want to see how other MAs are doing? You can. Want to understand why a certain MA was selected? The data is right there.
This tool is for traders who love crossover strategies but want something smarter, faster, and more precise—without spending hours manually testing. Whether you're scalping or swing trading, it offers a data-driven edge that’s hard to ignore.
Give it a try—you’ll quickly see how powerful it can be when your MA does the thinking for you.
 This tool is for informational and educational purposes only. Trading involves risk, and past performance does not guarantee future results. Use responsibly. 
Adaptive Trend FinderAdaptive Trend Finder - The Ultimate Trend Detection Tool
Introducing Adaptive Trend Finder, the next evolution of trend analysis on TradingView. This powerful indicator is an enhanced and refined version of Adaptive Trend Finder (Log), designed to offer even greater flexibility, accuracy, and ease of use. 
What’s New?
Unlike the previous version, Adaptive Trend Finder allows users to fully configure and adjust settings directly within the indicator menu, eliminating the need to modify chart settings manually. A major improvement is that users no longer need to adjust the chart's logarithmic scale manually in the chart settings; this can now be done directly within the indicator options, ensuring a smoother and more efficient experience. This makes it easier to switch between linear and logarithmic scaling without disrupting the analysis. This provides a seamless user experience where traders can instantly adapt the indicator to their needs without extra steps.
One of the most significant improvements is the complete code overhaul, which now enables simultaneous visualization of both long-term and short-term trend channels without needing to add the indicator twice. This not only improves workflow efficiency but also enhances chart readability by allowing traders to monitor multiple trend perspectives at once.
The interface has been entirely redesigned for a more intuitive user experience. Menus are now clearer, better structured, and offer more customization options, making it easier than ever to fine-tune the indicator to fit any trading strategy.
Key Features & Benefits
 
 Automatic Trend Period Selection: The indicator dynamically identifies and applies the strongest trend period, ensuring optimal trend detection with no manual adjustments required. By analyzing historical price correlations, it selects the most statistically relevant trend duration automatically.
 Dual Channel Display: Traders can view both long-term and short-term trend channels simultaneously, offering a broader perspective of market movements. This feature eliminates the need to apply the indicator twice, reducing screen clutter and improving efficiency.
 Fully Adjustable Settings: Users can customize trend detection parameters directly within the indicator settings. No more switching chart settings – everything is accessible in one place.
 Trend Strength & Confidence Metrics: The indicator calculates and displays a confidence score for each detected trend using Pearson correlation values. This helps traders gauge the reliability of a given trend before making decisions.
 Midline & Channel Transparency Options: Users can fine-tune the visibility of trend channels, adjusting transparency levels to fit their personal charting style without overwhelming the price chart.
 Annualized Return Calculation: For daily and weekly timeframes, the indicator provides an estimate of the trend’s performance over a year, helping traders evaluate potential long-term profitability.
 Logarithmic Adjustment Support: Adaptive Trend Finder is compatible with both logarithmic and linear charts. Traders who analyze assets like cryptocurrencies, where log scaling is common, can enable this feature to refine trend calculations.
 Intuitive & User-Friendly Interface: The updated menu structure is designed for ease of use, allowing quick and efficient modifications to settings, reducing the learning curve for new users.
 
Why is this the Best Trend Indicator?
Adaptive Trend Finder stands out as one of the most advanced trend analysis tools available on TradingView. Unlike conventional trend indicators, which rely on fixed parameters or lagging signals, Adaptive Trend Finder dynamically adjusts its settings based on real-time market conditions. By combining automatic trend detection, dual-channel visualization, real-time performance metrics, and an intuitive user interface, this indicator offers an unparalleled edge in trend identification and trading decision-making.
Traders no longer have to rely on guesswork or manually tweak settings to identify trends. Adaptive Trend Finder does the heavy lifting, ensuring that users are always working with the strongest and most reliable trends. The ability to simultaneously display both short-term and long-term trends allows for a more comprehensive market overview, making it ideal for scalpers, swing traders, and long-term investors alike.
With its state-of-the-art algorithms, fully customizable interface, and professional-grade accuracy, Adaptive Trend Finder is undoubtedly one of the most powerful trend indicators available.
Try it today and experience the future of trend analysis.
 This indicator is a technical analysis tool designed to assist traders in identifying trends. It does not guarantee future performance or profitability. Users should conduct their own research and apply proper risk management before making trading decisions. 
// Created by Julien Eche - @Julien_Eche
[GYTS-CE] Market Regime Detector🧊 Market Regime Detector (Community Edition) 
 🌸 Part of GoemonYae Trading System (GYTS) 🌸 
 🌸 --------- INTRODUCTION --------- 🌸 
 💮 What is the Market Regime Detector? 
The Market Regime Detector is an advanced, consensus-based indicator that identifies the current market state to increase the probability of profitable trades. By distinguishing between trending (bullish or bearish) and cyclic (range-bound) market conditions, this detector helps you select appropriate tactics for different environments. Instead of forcing a single strategy across all market conditions, our detector allows you to adapt your approach based on real-time market behaviour.
 💮 The Importance of Market Regimes 
Markets constantly shift between different behavioural states or "regimes":
•  Bullish trending markets  - characterised by sustained upward price movement
•  Bearish trending markets  - characterised by sustained downward price movement
•  Cyclic markets  - characterised by range-bound, oscillating behaviour
Each regime requires fundamentally different trading approaches. Trend-following strategies excel in trending markets but fail in cyclic ones, while mean-reversion strategies shine in cyclic markets but underperform in trending conditions. Detecting these regimes is essential for successful trading, which is why we've developed the Market Regime Detector to accurately identify market states using complementary detection methods.
 🌸 --------- KEY FEATURES --------- 🌸 
 💮 Consensus-Based Detection 
Rather than relying on a single method, our detector employs two  complementary  detection methodologies that analyse different aspects of market behaviour:
• Dominant Cycle Average (DCA) - analyzes price movement relative to its lookback period, a proxy for the dominant cycle
• Volatility Channel - examines price behaviour within adaptive volatility bands
These diverse perspectives are synthesised into a robust consensus that minimises false signals while maintaining responsiveness to genuine regime changes.
 💮 Dominant Cycle Framework 
The Market Regime Detector uses the concept of dominant cycles to establish a reference framework. You can input the dominant cycle period that best represents the natural rhythm of your market, providing a stable foundation for regime detection across different timeframes.
 💮 Intuitive Parameter System 
We've distilled complex technical parameters into intuitive controls that traders can easily understand:
• Adaptability - how quickly the detector responds to changing market conditions
• Sensitivity - how readily the detector identifies transitions between regimes
• Consensus requirement - how much agreement is needed among detection methods
This approach makes the detector accessible to traders of all experience levels while preserving the power of the underlying algorithms.
 💮 Visual Market Feedback 
The detector provides clear visual feedback about the current market regime through:
• Colour-coded chart backgrounds (purple shades for bullish, pink for bearish, yellow for cyclic)
• Colour-coded price bars
• Strength indicators showing the degree of consensus
• Customizable colour schemes to match your preferences or trading system
 💮 Integration in the GYTS suite 
The Market Regime Detector is  compatible with the GYTS Suite , i.e. it passes the regime into the 🎼  Order Orchestrator  where you can set how to trade the trending and cyclic regime.
 🌸 --------- CONFIGURATION SETTINGS --------- 🌸 
 💮 Adaptability 
Controls how quickly the Market Regime detector adapts to changing market conditions. You can see it as a low-frequency, long-term change parameter:
 
  Very Low: Very slow adaptation, most stable but may miss regime changes
  Low: Slower adaptation, more stability but less responsiveness
  Normal: Balanced between stability and responsiveness
  High: Faster adaptation, more responsive but less stable
  Very High: Very fast adaptation, highly responsive but may generate false signals
 
This setting affects lookback periods and filter parameters across all detection methods.
  
  
 💮 Sensitivity 
Controls how sensitive the detector is to market regime transitions. This acts as a high-frequency, short-term change parameter:
 
  Very Low: Requires substantial evidence to identify a regime change
  Low: Less sensitive, reduces false signals but may miss some transitions
  Normal: Balanced sensitivity suitable for most markets
  High: More sensitive, detects subtle regime changes but may have more noise
  Very High: Very sensitive, detects minor fluctuations but may produce frequent changes
 
This setting affects thresholds for regime detection across all methods.
  
  
 💮 Dominant Cycle Period 
This parameter allows you to specify the market's natural rhythm in bars. This represents a complete market cycle (up and down movement). Finding the right value for your specific market and timeframe might require some experimentation, but it's a crucial parameter that helps the detector accurately identify regime changes. Most of the times the cycle is between 20 and 40 bars.
 💮 Consensus Mode 
Determines how the signals from both detection methods are combined to produce the final market regime:
•  Any Method (OR) : Signals bullish/bearish if either method detects that regime. If methods conflict (one bullish, one bearish), the stronger signal wins. More sensitive, catches more regime changes but may produce more false signals.
•  All Methods (AND) : Signals only when both methods agree on the regime. More conservative, reduces false signals but might miss some legitimate regime changes.
•  Weighted Decision : Balances both methods with equal weighting. Provides a middle ground between sensitivity and stability.
Each mode also calculates a continuous regime strength value that's used for colour intensity in the 'unconstrained' display mode.
  
  
  
 💮 Display Mode 
Choose how to display the market regime colours:
• Unconstrained regime: Shows the regime strength as a continuous gradient. This provides more nuanced visualisation where the intensity of the colour indicates the strength of the trend.
• Consensus only: Shows only the final consensus regime with fixed colours based on the detected regime type.
  
The background and bar colours will change to indicate the current market regime:
• Purple shades: Bullish trending market (darker purple indicates stronger bullish trend)
• Pink shades: Bearish trending market (darker pink indicates stronger bearish trend)
• Yellow: Cyclic (range-bound) market
 💮 Custom Colour Options 
The Market Regime Detector allows you to customize the colour scheme to match your personal preferences or to coordinate with other indicators:
• Use custom colours: Toggle to enable your own colour choices instead of the default scheme
• Transparency: Adjust the transparency level of all regime colours
• Bullish colours: Define custom colours for strong, medium, weak, and very weak bullish trends
• Bearish colours: Define custom colours for strong, medium, weak, and very weak bearish trends
• Cyclic colour: Define a custom colour for cyclic (range-bound) market conditions
 🌸 --------- DETECTION METHODS --------- 🌸 
 💮 Dominant Cycle Average (DCA) 
The Dominant Cycle Average method forms a key part of our detection system:
1.  Theoretical Foundation :
   The DCA method builds on cycle analysis and the observation that in trending markets, price consistently remains on one side of a moving average calculated using the dominant cycle period. In contrast, during cyclic markets, price oscillates around this average.
2.  Calculation Process :
   • We calculate a Simple Moving Average (SMA) using the specified lookback period - a proxy for the dominant cycle period
   • We then analyse the proportion of time that price spends above or below this SMA over a lookback window. The theory is that the price should cross the SMA each half cycle, assuming that the dominant cycle period is correct and price follows a sinusoid.
   • This lookback window is adaptive, scaling with the dominant cycle period (controlled by the Adaptability setting)
   • The different values are standardised and normalised to possess more resolving power and to be more robust to noise.
3.  Regime Classification :
   • When the normalised proportion exceeds a positive threshold (determined by Sensitivity setting), the market is classified as bullish trending
   • When it falls below a negative threshold, the market is classified as bearish trending
   • When the proportion remains between these thresholds, the market is classified as cyclic
 💮 Volatility Channel 
The Volatility Channel method complements the DCA method by focusing on price movement relative to adaptive volatility bands:
1.  Theoretical Foundation :
   This method is based on the observation that trending markets tend to sustain movement outside of normal volatility ranges, while cyclic markets tend to remain contained within these ranges. By creating adaptive bands that adjust to current market volatility, we can detect when price behaviour indicates a trending or cyclic regime.
2.  Calculation Process :
   • We first calculate a smooth base channel center using a low pass filter, creating a noise-reduced centreline for price
   • True Range (TR) is used to measure market volatility, which is then smoothed and scaled by the deviation factor (controlled by Sensitivity)
   • Upper and lower bands are created by adding and subtracting this scaled volatility from the centreline
   • Price is smoothed using an adaptive A2RMA filter, which has a very flat and stable behaviour, to reduce noise while preserving trend characteristics
   • The position of this smoothed price relative to the bands is continuously monitored
3.  Regime Classification :
   • When smoothed price moves above the upper band, the market is classified as bullish trending
   • When smoothed price moves below the lower band, the market is classified as bearish trending
   • When price remains between the bands, the market is classified as cyclic
   • The magnitude of price's excursion beyond the bands is used to determine trend strength
4.  Adaptive Behaviour :
   • The smoothing periods and deviation calculations automatically adjust based on the Adaptability setting
   • The measured volatility is calculated over a period proportional to the dominant cycle, ensuring the detector works across different timeframes
   • Both the center line and the bands adapt dynamically to changing market conditions, making the detector responsive yet stable
This method provides a unique perspective that complements the DCA approach, with the consensus mechanism synthesising insights from both methods.
 🌸 --------- USAGE GUIDE --------- 🌸 
 💮 Starting with Default Settings 
The default settings (Normal for Adaptability and Sensitivity, Weighted Decision for Consensus Mode) provide a balanced starting point suitable for most markets and timeframes. Begin by observing how these settings identify regimes in your preferred instruments.
 💮 Finding the Optimal Dominant Cycle 
The dominant cycle period is a critical parameter. Here are some approaches to finding an appropriate value:
• Start with typical values, usually something around 25 works well
• Visually identify the average distance between significant peaks and troughs
• Experiment with different values and observe which provides the most stable regime identification
• Consider using cycle-finding indicators to help identify the natural rhythm of your market
 💮 Adjusting Parameters 
• If you notice too many regime changes → Decrease Sensitivity or increase Consensus requirement
• If regime changes seem delayed → Increase Adaptability
• If a trending regime is not detected, the market is automatically assigned to be in a cyclic state
• If you want to see more nuanced regime transitions → Try the "unconstrained" display mode (note that this will not affect the output to other indicators)
 💮 Trading Applications 
 Regime-Specific Strategies: 
•  Bullish Trending Regime  - Use trend-following strategies, trail stops wider, focus on breakouts, consider holding positions longer, and emphasize buying dips
•  Bearish Trending Regime  - Consider shorts, tighter stops, focus on breakdown points, sell rallies, implement downside protection, and reduce position sizes
•  Cyclic Regime  - Apply mean-reversion strategies, trade range boundaries, apply oscillators, target definable support/resistance levels, and use profit-taking at extremes
 Strategy Switching: 
Create a set of rules for each market regime and switch between them based on the detector's signal. This approach can significantly improve performance compared to applying a single strategy across all market conditions.
 GYTS Suite Integration: 
• In the GYTS 🎼 Order Orchestrator, select the '🔗 STREAM-int 🧊 Market Regime' as the market regime source
• Note that the consensus output (i.e. not the "unconstrained" display) will be used in this stream
• Create different strategies for trending (bullish/bearish) and cyclic regimes. The GYTS 🎼 Order Orchestrator is specifically made for this.
• The output stream is actually very simple, and can possibly be used in indicators and strategies as well. It outputs 1 for bullish, -1 for bearish and 0 for cyclic regime.
 🌸 --------- FINAL NOTES --------- 🌸 
 💮 Development Philosophy 
The Market Regime Detector has been developed with several key principles in mind:
1.  Robustness  - The detection methods have been rigorously tested across diverse markets and timeframes to ensure reliable performance.
2.  Adaptability  - The detector automatically adjusts to changing market conditions, requiring minimal manual intervention.
3.  Complementarity  - Each detection method provides a unique perspective, with the collective consensus being more reliable than any individual method.
4.  Intuitiveness  - Complex technical parameters have been abstracted into easily understood controls.
 💮 Ongoing Refinement 
The Market Regime Detector is under continuous development. We regularly:
• Fine-tune parameters based on expanded market data
• Research and integrate new detection methodologies
• Optimise computational efficiency for real-time analysis
Your feedback and suggestions are very important in this ongoing refinement process!
TimezoneLibrary with pre-defined timezone enums that can be used to request a timezone input from the user.  The library provides a `tostring()` function to convert enum values to a valid string that can be used as a `timezone` parameter in pine script built-in functions.  The library also includes a bonus function to get a formatted UTC offset from a UNIX timestamp.
The timezone enums in this library were compiled by referencing the available timezone options from TradingView chart settings as well as multiple Wikipedia articles relating to lists of time zones.
Some enums from this library are used to retrieve an IANA time zone identifier, while other enums only use UTC/GMT offset notation.  It is important to note that the Pine Script User Manual recommends using IANA notation in most cases.
 HOW TO USE 
This library is intended to be used by Pine Coders who wish to provide their users with a simple way to input a timezone.  Using this library is as easy as 1, 2, 3:
 Step 1 
Import the library into your script.  Replace  with the latest available version number for this library.
 
//@version=6
indicator("Example")
 
import n00btraders/Timezone/ as tz
 
 Step 2 
Select one of the available enums from the library and use it as an input.  Tip: view the library source code and scroll through the enums at the top to find the best choice for your script.
 
timezoneInput = input.enum(tz.TimezoneID.EXCHANGE, "Timezone")
 
 Step 3 
Convert the user-selected input into a valid string that can be used in one of the pine script built-in functions that have a `timezone` parameter.
 
string timezone = tz.tostring(timezoneInput)
 
 EXPORTED FUNCTIONS 
There are multiple 𝚝𝚘𝚜𝚝𝚛𝚒𝚗𝚐() functions in this library: one for each timezone enum.  The function takes a single parameter: any enum field from one of the available timezone enums that are exported by this library.  Depending on the selected enum, the function will return a time zone string in either UTC/GMT notation or IANA notation.
Note: to avoid confusion with the built-in `str.tostring()` function, it is recommended to use this library's `tostring()` as a method rather than a function:
 
string timezone = timezoneInput.tostring()
 
 offset(timestamp, format, timezone, prefix, colon) 
  Formats the time offset from a UNIX timestamp represented in a specified timezone.
  Namespace types: series OffsetFormat
  Parameters:
     timestamp (int) : (series int) A UNIX time.
     format (series OffsetFormat) : (series OffsetFormat) A time offset format.
     timezone (string) : (series string) A UTC/GMT offset or IANA time zone identifier.
     prefix (string) : (series string) Optional 'UTC' or 'GMT' prefix for the result.
     colon (bool) : (series bool) Optional usage of colon separator.
  Returns: Time zone offset using the selected format.
The 𝚘𝚏𝚏𝚜𝚎𝚝() function is provided as a convenient alternative to manually using `str.format_time()` and then manipulating the result.
The OffsetFormat enum is used to decide the format of the result from the `offset()` function.  The library source code contains comments above this enum declaration that describe how each enum field will modify a time offset.
Tip: hover over the `offset()` function call in the Pine Editor to display a pop-up containing:
 
  Function description
  Detailed parameter list, including default values
  Example function calls
  Example outputs for different OffsetFormat.* enum values
 
 NOTES 
 
  At the time of this publication, Pine cannot be used to access a chart's selected time zone.  Therefore, the main benefit of this library is to provide a quick and easy way to create a pine script input for a time zone (most commonly, the same time zone selected in the user's chart settings).
  At the time of the creation of this library, there are 95 Time Zones made available in the TradingView chart settings.  If any changes are made to the time zone settings, this library will be updated to match the new changes.
  All time zone enums (and their individual fields) in this library were manually verified and tested to ensure correctness.
  An example usage of this library is included at the bottom of the source code.
  Credits to  HoanGhetti  for providing a nice  Markdown  resource which I referenced to be able to create a formatted informational pop-up for this library's `offset()` function.
Uptrick: Time Based ReversionIntroduction 
The Uptrick: Time Based Reversion indicator is designed to provide a comprehensive view of market momentum and potential trend shifts by combining multiple moving averages, a streak-based trend analysis system, and adaptive color visualization. It helps traders identify strong trends, spot potential reversals, and make more informed trading decisions.
 Purpose 
The primary goal of this indicator is to assist traders in distinguishing between sustained market movements and short-lived fluctuations. By evaluating how price behaves relative to its moving averages, and by measuring consecutive streaks above or below these averages, the indicator highlights areas where trends are likely to continue or lose momentum.
 Overview 
Uptrick: Time Based Reversion calculates one or more moving averages of price data and then tracks the number of consecutive bars (streaks) above or below these averages. This streak-based detection provides insight into whether a trend is gaining strength or nearing a potential reversal point. The indicator offers:
• Multiple moving average types (SMA, EMA, WMA)  
• Optional second and third moving average layers for additional smoothing of first moving average
• A streak detection system to quantify trend intensity  
• A dynamic color scheme that changes with streak strength  
• Optional buy and sell signals for potential trade entries and exits  
• A ribbon mode that applies moving averages to Open, High, Low, and Close prices for a more detailed visualization of overall trend alignment  
 Originality and Uniqueness 
Unlike traditional moving average indicators, Uptrick: Time Based Reversion incorporates a streak measurement system to detect trend strength. This approach helps clarify whether a price movement is merely a quick fluctuation or part of a longer-lasting trend. Additionally, the optional ribbon mode extends this logic to Open, High, Low, and Close prices, creating a layered and intuitive visualization that shows complete trend alignment.
 Inputs and Features 
1. Enable Ribbon Mode  
   This input lets you activate or deactivate the ribbon display of multiple moving averages. When enabled, the script plots moving averages for the Open, High, Low, and Close prices and uses color fills to show whether these four data points are collectively above or below their respective moving averages.
  
2. Color Scheme Selection  
   Users can choose from several predefined color schemes, such as Default, Emerald, Crimson, Sapphire, Gold, Purple, Teal, Orange, Gray, Lime, or Aqua. Each scheme assigns distinct bullish, bearish and neutral colors..
  
3. Show Buy/Sell Signals  
   The indicator can display buy or sell signals based on its streak analysis logic. These signals appear as markers on the chart, indicating a “Safe Uptrend” (buy) or “Safe Downtrend” (sell).
  
4. Moving Average Types and Lengths  
   • First MA Type and Length: Choose SMA, EMA, or WMA along with a customizable period.  
   • Second and Third MA Types and Lengths: You can optionally stack additional moving averages for further smoothing, each with its own customizable type and period.
  
5. Streak Threshold Multiplier  
   This numeric input determines how strong a streak must be before the script considers it a “safe” trend. A higher multiplier requires a longer or more intense streak for a buy or sell signal.
6. Dynamic Transparency Calculation  
   The color intensity adapts to the streak’s strength. Longer streaks increase the transparency of the opposing color, making the current dominant color stand out. This feature ensures that a vigorous uptrend or downtrend is visually distinct from short-lived or weaker moves.
7. Ribbon Moving Averages  
   In ribbon mode, the script calculates moving averages for the Open, High, Low, and Close prices. Each of these is optionally smoothed again if the second and/or third moving average layers are active. The final result is a ribbon of moving averages that helps confirm whether the market is uniformly aligned above or below these key reference points.
 Calculation Methodology 
1. Initial Moving Average  
   The script calculates the first moving average (SMA, EMA, or WMA) of the closing price over a user-defined period.
2. Optional Secondary and Tertiary Averages  
   If selected, the script then applies a second and/or third smoothing step. Each of these steps can be a different type of moving average (SMA, EMA, or WMA) with its own period length.
3. Streak Detection  
   The indicator counts consecutive bars above or below the smoothed moving average. A running total (streakUp or streakDown) increments with every bar that remains above or below that average.
4. Reversion Intensity  
   The script compares the current streak value to its own average (calculated over the final chosen period). This ratio determines whether the streak is nearing a likely reversion or is strong enough to continue.
5. Color Assignment and Signals  
   The indicator calculates color transparency based on streak intensity. Buy and sell signals appear when the streak meets or exceeds the threshold multiplier, indicating a safe uptrend or downtrend.
 Color Schemes and Visualization 
This indicator offers multiple predefined color sets. Each scheme specifies a unique bullish color, bearish color and neutral color. The script automatically varies transparency to highlight strong trends and fade weaker ones, making it visually clear when a trend is intensifying or losing momentum.
 Smoothing Techniques 
By allowing up to three layers of moving average smoothing, the indicator accommodates different trading styles. A single layer provides faster reactions to market changes, while more layers reduce noise at the cost of slower responsiveness. Traders can choose the right balance between responsiveness and stability for their strategy, whether it is short-term scalping or long-term trend following.
 Why It Combines Specific Smoothing Techniques 
The Uptrick: Time Based Reversion indicator strategically combines specific smoothing techniques—SMA, EMA, and WMA—to leverage their complementary strengths. The SMA provides stable and consistent trend identification by equally weighting all data points, while the EMA emphasizes recent price movements, allowing quicker responses to market changes. WMA enhances sensitivity to recent price shifts, which helps in detecting subtle momentum changes early. By integrating these methods in layers, the indicator effectively balances responsiveness with stability, helping traders clearly identify genuine trend changes while filtering out short-term noise and false signals.
 Ribbon Mode 
If Open, High, Low, and Close prices remain above or below their respective moving averages consistently, the script colors the bars fully bullish or bearish. When the data points are mixed, a neutral color is applied. This mode provides a thorough perspective on whether the entire price range is aligned in one direction or showing conflicting signals.
 Summary 
Uptrick: Time Based Reversion combines multiple moving averages, streak detection, and dynamic color adjustments to help traders identify significant trends and potential reversal areas. Its flexibility allows it to be used either in a simpler form, with one moving average and streak analysis, or in a more advanced configuration with ribbon mode that charts multiple smoothed averages for a deeper understanding of price alignment. By adapting color intensities based on streak strength and providing optional buy/sell signals, this indicator delivers a clear and flexible tool suited to various trading strategies.
 Disclaimer
This indicator is designed as an analysis aid and does not guarantee profitable trades. Past performance does not indicate future success, and market conditions can change unexpectedly. Users are advised to employ proper risk management and thoroughly evaluate trades before taking positions. Use this indicator as part of a broader strategy, not as a sole decision-making tool. 
Normalised Price Crossover - MACD but TickersEver noticed two different tickers are correlated yet have different lags? Ever find one ticker moves first and when the other finally goes to catch up, the first one has already reversed?
So I thought to myself, would be wicked if I took the faster one and made it into a 'Signal Line' and the slow one and made it into a 'Slow Line' almost like a MACD if you will.
So that's what I did, I took the price charts of the tickers and I normalised the price data so they could actually cross, plotted it and sat back to see it generate signals, lo and behold!
Pretty neat, though I'd advise to use spreads and such for the different tickers to really feel the power of the indicator, works well when you use formulas that model actual mechanisms instead of arbitrary price data of different assets as correlation =/= causation.
Enjoy.
[TehThomas] - ICT Volume ImbalanceThis script is a Volume Imbalance (VI) detector and visualizer for use on the TradingView platform. The goal of the script is to automatically identify areas where there are significant imbalances in the volume of trades between consecutive candlesticks and visually highlight these areas. These imbalances can provide traders with valuable insights about the market’s current condition, often signaling potential reversal or continuation points based on price and volume action.
 ICT (Inner Circle Trader) Concept of Volume Imbalances 
Volume imbalances are a critical concept in the ICT trading methodology. They refer to situations where there is an unusual or significant difference in volume between two consecutive candlesticks, which might indicate institutional or large player activity. According to ICT principles, these imbalances can show us areas of market inefficiency or potential price manipulation. By identifying these imbalances, traders can gain an edge in understanding where the market is likely to move next.
 Bullish and Bearish Volume Imbalances: 
Bullish Volume Imbalance: This occurs when there is a strong increase in buying pressure, typically indicated by a higher volume on a candle that closes significantly above the previous one, often leaving a gap or larger price movement. The market could be preparing to push higher, and the volume shows a clear shift in buying demand.
 Bearish Volume Imbalance: 
Conversely, a bearish imbalance occurs when there is a strong increase in selling pressure, typically signaled by a candle that closes significantly lower than the previous one, again with higher volume. This could indicate that large players are offloading positions, and the price is likely to drop further.
 Key Features and Functions of the Script 
 The script automates the process of detecting these volume imbalances and visually marking them on a price chart. Let’s explore its functionality in detail. 
 1. Inputs Section 
The script allows for significant customization through its input options, which help traders adjust the detection and visualization of volume imbalances based on their individual preferences and trading style. Below are the details:
 
 lookback (250 bars): This input specifies the number of bars (or candles) the script should look back when analyzing the volume imbalance. By setting this to 250, the user is looking at the last 250 bars on the chart to detect any significant volume imbalances. This period is adjustable between 50 to 500 bars.
 volumeThreshold (1.0 multiplier): This input helps set the sensitivity for identifying volume imbalances. The script compares the volume of the current candle with the previous one, and if the current volume exceeds the previous volume by this threshold multiplier (in this case, 1.0 means at least equal to the previous volume), then it triggers an imbalance. Users can adjust the multiplier to suit different market conditions.
 showBoxes (true/false): This toggle determines whether the boxes representing volume imbalances are drawn on the chart. When enabled, the script visually highlights the imbalances with colored boxes.
 fillBaseColor (orange with 80% opacity): This is the color setting for the background of the imbalance boxes. A softer color (like orange with opacity) ensures the imbalance is highlighted without obscuring the price action.
 borderColor (gray): The color of the border around the imbalance boxes. This adds a visual distinction to make the imbalance areas more visible.
 borderWidth (1 pixel): This controls the width of the box's border to adjust how prominent it appears.
 rightOffset (30 bars): This input controls how far the imbalance box extends to the right on the chart. It helps users anticipate the potential continuation of the imbalance beyond the current candle.
 allowWickOverlap (true/false): This setting allows imbalances to be identified even if the wicks of the two consecutive candlesticks overlap. If set to false, only imbalances where the bodies of the candlesticks don’t overlap are considered.
 showBrokenBoxes (true/false): If enabled, once a volume imbalance no longer holds true (i.e., the price breaks through the box), the box is marked as "broken." If disabled, the box is deleted when the imbalance condition no longer applies.
 brokenBoxColor (red): This controls the color of the box when it is broken, which can be used as a visual cue that the imbalance was invalidated or no longer valid for analysis.
 
 2. Volume Imbalance Function 
This is the core function of the script, where the logic to detect bullish and bearish volume imbalances is implemented.
 Bullish Imbalance Condition: 
 
 The first condition checks if the low of the current candle is greater than the high of the previous candle. This suggests that the market is moving upward with buying pressure.
 The second condition checks whether the volume of the current candle is higher than the previous candle by the volumeThreshold multiplier. If both conditions are satisfied, a bullish imbalance is detected.
 
 Bearish Imbalance Condition: 
 
 The first condition checks if the high of the current candle is lower than the low of the previous candle. This suggests downward price action with selling pressure.
 The second condition checks whether the current volume exceeds the previous volume by the threshold
 
Allow Wick Overlap: If allowWickOverlap is set to true, the script will still detect imbalances if the wicks of the two candles overlap (common in volatile markets). If false, imbalances are only considered if the wicks do not overlap.
 3. Box Creation and Management 
When a volume imbalance is detected, the script creates a box on the chart:
 
 The bullish imbalance box is drawn using the minimum of the open and close of the current bar as the top boundary and the maximum of the open and close of the previous bar as the bottom boundary.
 Conversely, the bearish imbalance box is drawn in reverse, using the maximum of the current bar’s open and close as the top boundary and the minimum of the previous bar’s open and close as the bottom boundary.
 
Once the box is created, it is displayed on the chart with the specified background color, border color, and width.
 4. Processing Existing Boxes 
After detecting a new imbalance and drawing a box, the script checks whether the box should still remain on the chart:
 
 If the price moves beyond the boundaries of the imbalance box, the box is marked as broken (if showBrokenBoxes is enabled), and its color is changed to red, signifying that the imbalance is no longer valid.
 If the box remains intact (i.e., the price has not broken the defined boundaries), the script keeps the box extended to the right as the market continues to evolve.
 
 5. Removing Outdated Boxes 
 
 Lastly, the script removes boxes that are older than the specified lookback period. For example, if a box was created 250 bars ago, it will be deleted after that period. This ensures the chart stays clean and only focuses on relevant imbalances.
 
 Why This Script is Useful for Traders 
This script is extremely valuable for traders, especially those following the ICT methodology, because it automates the process of detecting market inefficiencies or imbalances that might signal future price action. Here’s why it’s particularly useful:
 
 Identifying Key Areas of Interest: Volume imbalances often point to areas where institutional or large-scale traders have entered the market. These areas could provide clues about the next significant move in the market.
 Visualizing Market Structure: By automatically drawing boxes around volume imbalances, the script helps traders visually identify potential areas of support, resistance, or turning points, enabling them to make informed trading decisions.
 Time Efficiency: Instead of manually analyzing each candlestick and volume spike, this script does the heavy lifting, saving traders valuable time and allowing them to focus on other aspects of their strategy.
 Enhanced Trade Entries and Exits: By understanding where volume imbalances are occurring, traders can time their entries (buying during bullish imbalances and selling during bearish ones) and exits (as imbalances break) more effectively, thus improving their chances of success.
 
 Conclusion 
In summary, this script is a powerful tool for traders looking to implement volume imbalance strategies based on the ICT methodology. It automates the identification and visualization of significant imbalances in price and volume, offering traders a clear visual representation of potential market turning points. By customizing the settings, traders can tailor the script to their preferred timeframes and sensitivity, making it a flexible and effective tool for any trading strategy.
 __________________________________________ 
 Thanks for your support! 
If you found this idea helpful or learned something new, drop a like 👍 and leave a comment, I’d love to hear your thoughts! 🚀
Make sure to follow me for more price action insights, free indicators, and trading guides. Let’s grow and trade smarter together! 📈 
[COG]TMS Crossfire 🔍 TMS Crossfire: Guide to Parameters 
  📊 Core Parameters 
 🔸 Stochastic Settings (K, D, Period) 
- **What it does**: These control how the first stochastic oscillator works. Think of it as measuring momentum speed.
- **K**: Determines how smooth the main stochastic line is. Lower values (1-3) react quickly, higher values (3-9) are smoother.
- **D**: Controls the smoothness of the signal line. Usually kept equal to or slightly higher than K.
- **Period**: How many candles are used to calculate the stochastic. Standard is 14 days, lower for faster signals.
- **For beginners**: Start with the defaults (K:3, D:3, Period:14) until you understand how they work.
  🔸 Second Stochastic (K2, D2, Period2) 
- **What it does**: Creates a second, independent stochastic for stronger confirmation.
- **How to use**: Can be set identical to the first one, or with slightly different values for dual confirmation.
- **For beginners**: Start with the same values as the first stochastic, then experiment.
  🔸 RSI Length 
- **What it does**: Controls the period for the RSI calculation, which measures buying/selling pressure.
- **Lower values** (7-9): More sensitive, good for short-term trading
- **Higher values** (14-21): More stable, better for swing trading
- **For beginners**: The default of 11 is a good balance between speed and reliability.
  🔸 Cross Level 
- **What it does**: The centerline where crosses generate signals (default is 50).
- **Traditional levels**: Stochastics typically use 20/80, but 50 works well for this combined indicator.
- **For beginners**: Keep at 50 to focus on trend following strategies.
 🔸 Source 
- **What it does**: Determines which price data is used for calculations.
- **Common options**: 
  - Close: Most common and reliable
  - Open: Less common
  - High/Low: Used for specialized indicators
- **For beginners**: Stick with "close" as it's most commonly used and reliable.
  🎨 Visual Theme Settings 
 🔸 Bullish/Bearish Main 
- **What it does**: Sets the overall color scheme for bullish (up) and bearish (down) movements.
- **For beginners**: Green for bullish and red for bearish is intuitive, but choose any colors that are easy for you to distinguish.
  🔸 Bullish/Bearish Entry 
- **What it does**: Colors for the entry signals shown directly on the chart.
- **For beginners**: Use bright, attention-grabbing colors that stand out from your chart background.
 🌈 Line Colors 
  🔸 K1, K2, RSI (Bullish/Bearish) 
- **What it does**: Controls the colors of each indicator line based on market direction.
- **For beginners**: Use different colors for each line so you can quickly identify which line is which.
 ⏱️ HTF (Higher Timeframe) Settings 
 🔸 HTF Timeframe 
- **What it does**: Sets which higher timeframe to use for filtering (e.g., 240 = 4 hour chart).
- **How to choose**: Should be at least 4x your current chart timeframe (e.g., if trading on 15min, use 60min or higher).
- **For beginners**: Start with a timeframe 4x higher than your trading chart.
 🔸 Use HTF Filter 
- **What it does**: Toggles whether the higher timeframe filter is applied or not.
- **For beginners**: Keep enabled to reduce false signals, especially when learning.
  🔸 HTF Confirmation Bars 
- **What it does**: How many bars must confirm a trend change on higher timeframe.
- **Higher values**: More reliable but slower to react
- **Lower values**: Faster signals but more false positives
- **For beginners**: Start with 2-3 bars for a good balance.
  📈 EMA Settings 
  🔸 Use EMA Filter 
- **What it does**: Toggles price filtering with an Exponential Moving Average.
- **For beginners**: Keep enabled for better trend confirmation.
  🔸 EMA Period 
- **What it does**: Length of the EMA for filtering (shorter = faster reactions).
- **Common values**: 
  - 5-13: Short-term trends
  - 21-50: Medium-term trends
  - 100-200: Long-term trends
- **For beginners**: 5-10 is good for short-term trading, 21 for swing trading.
  🔸 EMA Offset 
- **What it does**: Shifts the EMA forward or backward on the chart.
- **For beginners**: Start with 0 and adjust only if needed for visual clarity.
  🔸 Show EMA on Chart 
- **What it does**: Toggles whether the EMA appears on your main price chart.
- **For beginners**: Keep enabled to see how price relates to the EMA.
 🔸 EMA Color, Style, Width, Transparency 
- **What it does**: Customizes how the EMA line looks on your chart.
- **For beginners**: Choose settings that make the EMA visible but not distracting.
  🌊 Trend Filter Settings 
  🔸 Use EMA Trend Filter 
- **What it does**: Enables a multi-EMA system that defines the overall market trend.
- **For beginners**: Keep enabled for stronger trend confirmation.
  🔸 Show Trend EMAs 
- **What it does**: Toggles visibility of the trend EMAs on your chart.
- **For beginners**: Enable to see how price moves relative to multiple EMAs.
 
🔸 EMA Line Thickness 
- **What it does**: Controls how the thickness of EMA lines is determined.
- **Options**:
  - Uniform: All EMAs have the same thickness
  - Variable: Each EMA has its own custom thickness
  - Hierarchical: Automatically sized based on period (longer periods = thicker)
- **For beginners**: "Hierarchical" is most intuitive as longer-term EMAs appear more dominant.
  🔸 EMA Line Style 
- **What it does**: Sets the line style (solid, dotted, dashed) for all EMAs.
- **For beginners**: "Solid" is usually clearest unless you have many lines overlapping.
 🎭 Trend Filter Colors/Width 
  🔸 EMA Colors (8, 21, 34, 55) 
- **What it does**: Sets the color for each individual trend EMA.
- **For beginners**: Use a logical progression (e.g., shorter EMAs brighter, longer EMAs darker).
  🔸 EMA Width Settings 
- **What it does**: Controls the thickness of each EMA line.
- **For beginners**: Thicker lines for longer EMAs make them easier to distinguish.
 🔔 How These Parameters Work Together 
The power of this indicator comes from how these components interact:
1. **Base Oscillator**: The stochastic and RSI components create the main oscillator
2. **HTF Filter**: The higher timeframe filter prevents trading against larger trends
3. **EMA Filter**: The EMA filter confirms signals with price action
4. **Trend System**: The multi-EMA system identifies the overall market environment
Think of it as multiple layers of confirmation, each adding more reliability to your trading signals.
  💡 Tips for Beginners 
1. **Start with defaults**: Use the default settings first and understand what each element does
2. **One change at a time**: When customizing, change only one parameter at a time
3. **Keep notes**: Write down how each change affects your results
4. **Backtest thoroughly**: Test any changes on historical data before trading real money
5. **Less is more**: Sometimes simpler settings work better than complicated ones
Remember, no indicator is perfect - always combine this with proper risk management and other forms of analysis!
Uptrick: Alpha TrendIntroduction 
Uptrick: Alpha Trend is a comprehensive technical analysis indicator designed to provide traders with detailed insights into market trends, momentum, and risk metrics. It adapts to various trading styles—from quick scalps to longer-term positions—by dynamically adjusting its calculations and visual elements. By combining multiple smoothing techniques, advanced color schemes, and customizable data tables, the indicator offers a holistic view of market behavior.
 Originality 
The Alpha Trend indicator distinguishes itself by blending established technical concepts with innovative adaptations. It employs three different smoothing techniques tailored to specific trading modes (Scalp, Swing, and Position), and it dynamically adjusts its parameters to match the chosen mode. The indicator also offers a wide range of color palettes and multiple on-screen tables that display key metrics. This unique combination of features, along with its ability to adapt in real time, sets it apart as a versatile tool for both novice and experienced traders.
 Features 
1. Multi-Mode Trend Line  
   The indicator automatically selects a smoothing method based on the trading mode:
   - Scalp Mode uses the Hull Moving Average (HMA) for rapid responsiveness.
  
   - Swing Mode employs the Exponential Moving Average (EMA) for balanced reactivity.
  
   - Position Mode applies the Weighted Moving Average (WMA) for smoother, long-term trends.
  
   Each method is chosen to best capture the price action dynamics appropriate to the trader’s timeframe.
2. Adaptive Momentum Thresholds  
   It tracks bullish and bearish momentum with counters that increment as the trend confirms directional movement. When these counters exceed a user-defined threshold, the indicator generates optional buy or sell signals. This approach helps filter out minor fluctuations and highlights significant market moves.
  
3. Gradient Fills  
   Two types of fills enhance visual clarity:
   - Standard Gradient Fill displays ATR-based zones above and below the trend line, indicating potential bullish and bearish areas.
  
   - Fading Gradient Fill creates a smooth transition between the trend line and the price, visually emphasizing the distance between them.
  
4. Bar Coloring and Signal Markers  
   The indicator can color-code bars based on market conditions—bullish, bearish, or neutral—allowing for immediate visual assessment. Additionally, signal markers such as buy and sell arrows are plotted when momentum thresholds are breached.
  
5. Comprehensive Data Tables  
   Uptrick: Alpha Trend offers several optional tables for detailed analysis:
   - Insider Info: Displays key metrics like the current trend value, bullish/bearish momentum counts, and ATR.
  
   - Indicator Metrics: Lists input settings such as trend length, damping, signal threshold, and net momentum.
  
   - Market Analysis: Summarizes overall trend direction, trend strength, Sortino ratio, return, and volatility.
  
   - Price & Trend Dynamics: Details price deviation from the trend, trend slope, and ATR ratio.
  
   - Momentum & Volatility Insights: Presents RSI, standard deviation (volatility), and net momentum.
  
   - Performance & Acceleration Metrics: Focuses on the Sortino ratio, trend acceleration, return, and trend strength.
  
   Each table can be positioned flexibly on the chart, allowing traders to customize the layout according to their needs.
 Why It Combines Specific Smoothing Techniques 
Smoothing techniques are essential for filtering out market noise and revealing underlying trends. The indicator combines three smoothing methods for the following reasons:
- The Hull Moving Average (HMA) in Scalp Mode minimizes lag and responds quickly to price changes, which is critical for short-term trading.
- The Exponential Moving Average (EMA) in Swing Mode gives more weight to recent data, striking a balance between speed and smoothness. This makes it suitable for mid-term trend analysis.
- The Weighted Moving Average (WMA) in Position Mode smooths out short-term fluctuations, offering a clear view of longer-term trends and reducing the impact of transient market volatility.
By using these specific methods in their respective trading modes, the indicator ensures that the trend line is appropriately responsive for the intended time frame, enhancing decision-making while maintaining clarity.
 Inputs 
1. Trend Length (Default: 30)  
   Defines the lookback period for the smoothing calculation. A shorter trend length results in a more responsive line, while a longer length produces a smoother, less volatile trend.
2. Trend Damping (Default: 0.75)  
   Controls the degree of smoothing applied to the trend line. Lower values lead to a smoother curve, whereas higher values increase sensitivity to price fluctuations.
3. Signal Strength Threshold (Default: 5)  
   Specifies the number of consecutive bullish or bearish bars required to trigger a signal. Higher thresholds reduce the frequency of signals, focusing on stronger moves.
4. Enable Bar Coloring (Default: True)  
   Toggles whether each price bar is colored to indicate bullish, bearish, or neutral conditions.
5. Enable Signals (Default: True)  
   When enabled, this option plots buy or sell arrows on the chart once the momentum thresholds are met.
6. Enable Standard Gradient Fill (Default: False)  
   Activates ATR-based gradient fills around the trend line to visualize potential support and resistance zones.
7. Enable Fading Gradient Fill (Default: True)  
   Draws a gradual color transition between the trend line and the current price, emphasizing their divergence.
8. Trading Mode (Options: Scalp, Swing, Position)  
   Determines which smoothing method and ATR period to use, adapting the indicator’s behavior to short-term, medium-term, or long-term trading.
9. Table Position Inputs  
   Allows users to select from nine possible chart positions (top, middle, bottom; left, center, right) for each data table.
10. Show Table Booleans  
    Separate toggles control the display of each table (Insider Info, Indicator Metrics, Market Analysis, and the three Deep Tables), enabling a customized view of the data.
 Color Schemes 
(Default)  - The colors in the preview image of the indicator.
(Emerald)  
  
(Sapphire)  
  
(Golden Blaze)  
  
(Mystic)  
  
(Monochrome)  
  
(Pastel)  
  
(Vibrant)  
  
(Earth)  
  
(Neon)
  
 Calculations 
1. Trend Line Methods  
   - Scalp Mode: Utilizes the Hull Moving Average (HMA), which computes two weighted moving averages (one at half the length and one at full length), subtracts them, and then applies a final weighted average based on the square root of the length. This method minimizes lag and increases responsiveness.  
   - Swing Mode: Uses the Exponential Moving Average (EMA), which assigns greater weight to recent prices, thus balancing quick reaction with smoothness.  
   - Position Mode: Applies the Weighted Moving Average (WMA) to focus on longer-term trends by emphasizing the entire lookback period and reducing the impact of short-term volatility.
2. Momentum Tracking  
   The indicator maintains separate counters for bullish and bearish momentum. These counters increase as the trend confirms directional movement and reset when the trend reverses. When a counter exceeds the defined signal strength threshold, a corresponding signal (buy or sell) is triggered.
3. Volatility and ATR Zones  
   The Average True Range (ATR) is calculated using a period that adapts to the selected trading mode (shorter for Scalp, longer for Position). The ATR value is then used to define upper and lower zones around the trend line, highlighting the current level of market volatility.
4. Return and Trend Acceleration  
   - Return is calculated as the difference between the current and previous closing prices, providing a simple measure of price change.  
   - Trend Acceleration is derived from the change in the trend line’s movement (its first derivative) compared to the previous bar. This metric indicates whether the trend is gaining or losing momentum.
5. Sortino Ratio and Standard Deviation  
   - The Sortino Ratio measures risk-adjusted performance by comparing returns to downside volatility (only considering negative price changes).  
   - Standard Deviation is computed over the lookback period to assess the extent of price fluctuations, offering insights into market stability.
 Usage 
This indicator is suitable for various time frames and market instruments. Traders can enable or disable specific visual elements such as gradient fills, bar coloring, and signal markers based on their preference. For a minimalist approach, one might choose to display only the primary trend line. For a deeper analysis, enabling multiple tables can provide extensive data on momentum, volatility, trend dynamics, and risk metrics.
 Important Note on Risk 
Trading involves inherent risk, and no indicator can eliminate the uncertainty of the markets. Past performance is not indicative of future results. It is essential to use proper risk management, test any new tool thoroughly, and consult multiple sources or professional advice before making trading decisions.
 Conclusion 
Uptrick: Alpha Trend unifies a diverse set of calculations, adaptive smoothing techniques, and customizable visual elements into one powerful tool. By combining the Hull, Exponential, and Weighted Moving Averages, the indicator is able to provide a trend line that is both responsive and smooth, depending on the trading mode. Its advanced color schemes, gradient fills, and detailed data tables deliver a comprehensive analysis of market trends, momentum, and risk. Whether you are a short-term trader or a long-term investor, this indicator aims to clarify price action and assist you in making more informed trading decisions.
Momentum Theory Quick BiasMomentum Theory Quick Bias is a watchlist screener tool for rapid multi-timeframe analysis. It displays a variety of information from higher timeframes in order to set a directional bias including: breakout levels, peak levels, previous bar closes, and swing points.
✅ 8 Symbol Watchlist Scanner
✅ Quickly Set Directional Bias 
✅ For Scalpers, Day Traders, and Swing Traders
--- 📷  INDICATOR GALLERY  ---
  
  
  
--- 🚀  QUICK LOOK  ---
✔ Multi-Timeframe Analysis
Displays various higher timeframe information in order to read how an asset is moving with one quick glance. Utilizes icons and colors that serve as visual cues.
  
--- ⚡  FEATURES  ---
✔ Breakout Bias
Shows if the current price is above or below the breakout level on the timeframe.
  
✔ Peak Bias
Shows if the current previous peak has been triggered and where price is relative to it.
  
✔ Previous Bar Close
Shows how the previous bar closed and whether it's bullish or bearish.
  
  Breakout
  Fakeout
  Inside
  Outside
 
✔ Swing Point
Shows if the timeframe has currently flipped its breakout level.
  
✔ Bias Alignment
Shows visual icons if there is bias alignment between the timeframes.
  
 ↗️↘️ Breakout Bias Alignment
🔼🔽 Peak Bias Alignment
🔀 Breakout and Peak Bias Alignment, but opposite
✅ Breakout and Peak Bias Alignment
 
✔ Quick Analysis
Hover over the symbol name to view which timeframe levels are bullish or bearish and if peak levels have been triggered.
  
--- 🔥  OTHER FEATURES  ---
✔ Built-In Presets
Create your own custom watchlist or use one of the built-in ones (using Oanda charts)
  
 It's recommended to use the same source for all assets in your watchlist whenever possible 
✔ Customized Layouts
Display the watchlist in a variety of different column arrangements.
  
✔ Dark and Light Modes
Adjustable theme colors to trade your chart the way you want.
  
✔ Plug-and-Play
Automatically changes the relevant levels depending on the viewed timeframe. Just fill in your watchlist, add it to your chart, and start trading!
  
 Set the indicator to the following timeframes to view those arrangements:
 
 Month Timeframe - Y / 6M / 3M / M
 Week Timeframe - 6M / 3M / M / W
 Day Timeframe - 3M / M / W / D
 H4 Timeframe - Y / M / W / D
 M15 Timeframe - M / W / D / H8
 M10 Timeframe - M / W / D / H4
 M5 Timeframe - W / D / H8 / H2
 M3 Timeframe - W / D / H4 / H1
 M2 Timeframe - D / H8 / H2 / M30
 M1 Timeframe - D / H4 / H1 / M15
 
 
--- 📝  HOW TO USE  ---
1) Create your watchlist or use one of the built-in presets and place it on the timeframe you want to see. If no watchlist is created, it automatically sets to the current asset.
  
2) Alignments will trigger in real-time and push to the top of the column.
  
 It is recommended to place the indicator in a different chart window, so it won't have to refresh every time the asset or timeframe changes.
Pearson Correlation CoefficientDescription:  The Pearson Correlation Coefficient measures the strength and direction of the linear relationship between two data series. Its value ranges from -1 to +1, where:
 
 +1 indicates a perfect positive linear correlation: as one asset increases, the other asset increases proportionally.
 0 indicates no linear correlation: variations in one asset have no relation to variations in the other asset.
 -1 indicates a perfect negative linear correlation: as one asset increases, the other asset decreases proportionally.
 
This measure is widely used in technical analysis to assess the degree of correlation between two financial assets. The "Pearson Correlation (Manual Compare)" indicator allows users to manually select two assets and visually display their correlation relationship on a chart.
 Features: 
 
 Correlation Period:  The time period used for calculating the correlation can be adjusted (default: 50).
 Comparison Asset:  Users can select a secondary asset for comparison.
 Visual Plots:  The chart includes reference lines for perfect correlations (+1 and -1) and strong correlations (+0.7 and -0.7).
 Alerts:  Set alerts for when the correlation exceeds certain threshold values (e.g., +0.7 for strong positive correlation).
 
 How to Select the Second Asset: 
 
 Primary Asset Selection:  The primary asset is the one you select for viewing on the chart. This can be done by simply opening the chart for the desired asset.
 Secondary Asset Selection:  To select the secondary asset for comparison, use the input field labeled "Comparison Asset" in the script settings. You can manually enter the ticker symbol of the secondary asset you want to compare with the primary asset.
 
This indicator is ideal for traders looking to identify relationships and correlations between different financial assets to make informed trading decisions.
ELHAI Futures Trend Checker (ES, NQ, YM)The ELHAI Futures Trend Checker is a powerful TradingView indicator designed for futures traders who want to monitor the trend synchronization of the three major U.S. futures indices:
✅ E-mini S&P 500 (ES1!)
✅ E-mini Nasdaq 100 (NQ1!)
✅ E-mini Dow Jones (YM1!)
This indicator checks whether all three futures indices are bullish or bearish during each candle formation. If one of them is out of sync (e.g., two indices are bullish while one is bearish), the indicator triggers an alert and highlights the background in red, helping traders identify potential market indecision or divergence.
Key Features
📌 Designed for Futures Traders – Focuses on ES, NQ, and YM futures contracts.
📌 Live Market Monitoring – Works in real-time and updates dynamically with each tick.
📌 Bullish/Bearish Trend Confirmation – Detects when all three indices are in sync.
📌 Mismatch Detection – Alerts you when at least one index is out of trend.
📌 Custom Alerts – Set up TradingView alerts to be notified instantly when a trend mismatch occurs.
📌 Visual Background Highlight – A red background warns of a market divergence.
How It Works
The script retrieves open and close prices for ES, NQ, and YM.
Determines whether each futures index is bullish (close > open) or bearish (close < open).
If all three indices are bullish or all are bearish, it remains neutral.
If one index is different, an alert is triggered and the background turns red.
How to Use
Apply the indicator to your TradingView chart.
Choose any timeframe – Works well on intraday, daily, or higher timeframes.
Enable alerts: Go to Alerts → Create Alert, select "Futures Trend Mismatch", and set your preferred alert frequency.
Use alongside other indicators like moving averages, RSI, or MACD for better trade confirmation.
Best Use Cases
✔ Day traders & scalpers – Quickly spot market divergence in live trading.
✔ Swing traders – Identify when futures markets lose synchronization.
✔ Trend followers – Confirm if all major futures markets are aligned before making a move.
Final Notes
This indicator was built for Elhai to provide real-time trend analysis across major U.S. futures indices. Use it as a confirmation tool to improve market timing and decision-making.
Custom Support LineIt is made with the following conditions in mind.
1. At the center of the candle at the moment,
Out of the last 10 candles, the low price (L) is within 3% of each other, drawing one line at the low prices of the candles.
2. Out of the last 10 candles, the market price (O) is within 3% of each other, drawing one line at the low end of each candle.
3.Out of the last 10 candles, the closing price (C) is within 3% of each other, and one line is drawn at the lower prices of the candles.
4. Draw one line when the three lines match the above three conditions.
We wanted to create a clear support line according to the above conditions.
Dragon Harmonic Pattern [TradingFinder] Dragon Detector🔵 Introduction 
The Dragon Harmonic Pattern is one of the technical analysis tools that assists traders in identifying Potential Reversal Zones (PRZ). Resembling an "M" or "W" shape, this pattern is recognized in financial markets as a method for predicting bullish and bearish trends. By leveraging precise Fibonacci ratios and measuring price movements, traders can use this pattern to forecast market trends with high accuracy.
The Dragon Harmonic Pattern is built on the XABCD structure, where each point plays a significant role in shaping and forecasting price movements. Point X marks the beginning of the trend, representing the initial price movement. Point A indicates the first retracement, usually falling within the 0.380 to 0.620 range of the XA wave. 
Next, point B signals the second retracement, which lies within 0.200 to 0.400 of the AB wave. Point C, acting as the hump of the pattern, is generally located within 0.800 to 1.100 of the XA wave. Finally, point D represents the endpoint of the pattern and the Potential Reversal Zone (PRZ), where the primary price reversal occurs.
In bullish scenarios, the Dragon Pattern indicates a reversal from a downtrend to an uptrend, where prices move upward from point D. Conversely, in bearish scenarios, prices decline after reaching point D. Accurate identification of this pattern through Fibonacci ratio analysis and PRZ examination can significantly increase the success rate of trades, enabling traders to adjust their strategies based on key market levels such as 0.618 or 1.100.
Due to its high accuracy in identifying Potential Reversal Zones (PRZ) and its alignment with Fibonacci ratios, the Dragon Harmonic Pattern is considered one of the most popular tools in technical analysis. Traders can use this pattern to pinpoint entry and exit points with greater confidence while minimizing trading risks.
 Bullish :
  
 Bearish :
  
🔵 How to Use 
The Dragon Harmonic Pattern indicator helps traders identify bullish and bearish patterns in the market, allowing them to capitalize on available trading opportunities. By analyzing Fibonacci ratios and the XABCD structure, the indicator highlights Potential Reversal Zones (PRZ).
🟣 Bullish Dragon Pattern 
In the Bullish Dragon Pattern, the price transitions from a downtrend to an uptrend after reaching point D. At this stage, points X, A, B, C, and D must be carefully identified.
Fibonacci ratios for these points are as follows: Point A should fall within 0.380 to 0.620 of the XA wave, point B within 0.200 to 0.400 of the AB wave, and point C within 0.800 to 1.100 of the XA wave. 
When the price reaches point D, traders should look for bullish signals such as reversal candlesticks or increased trading volume to enter a buy position. The take-profit level can be set near the previous price high or based on the 1.272 Fibonacci ratio of the XA wave, while the stop-loss should be placed slightly below point D.
  
🟣 Bearish Dragon Pattern 
In the Bearish Dragon Pattern, the price shifts from an uptrend to a downtrend after reaching point D. In this pattern, points X, A, B, C, and D must also be identified. Fibonacci ratios for these points are as follows: Point A should fall within 0.380 to 0.620 of the XA wave, point B within 0.200 to 0.400 of the AB wave, and point C within 0.800 to 1.100 of the XA wave. 
Upon reaching point D, bearish signals such as reversal candlesticks or decreasing trading volume indicate the opportunity to enter a sell position. The take-profit level can be set near the previous price low or based on the 1.272 Fibonacci ratio of the XA wave, while the stop-loss should be placed slightly above point D.
By combining the Dragon Harmonic Pattern indicator with precise Fibonacci ratio analysis, traders can identify key opportunities while minimizing risks and improving their decision-making in both bullish and bearish market conditions.
  
🔵 Setting  
🟣 Logical Setting  
 ZigZag Pivot Period : You can adjust the period so that the harmonic patterns are adjusted according to the pivot period you want. This factor is the most important parameter in pattern recognition. 
 Show Valid Forma t: If this parameter is on "On" mode, only patterns will be displayed that they have exact format and no noise can be seen in them. If "Off" is, the patterns displayed that maybe are noisy and do not exactly correspond to the original pattern.
   
 Show Formation Last Pivot Confirm : if Turned on, you can see this ability of patterns when their last pivot is formed. If this feature is off, it will see the patterns as soon as they are formed. The advantage of this option being clear is less formation of fielded patterns, and it is accompanied by the latest pattern seeing and a sharp reduction in reward to risk. 
 Period of Formation Last Pivot : Using this parameter you can determine that the last pivot is based on Pivot period.
  
🟣 Genaral Setting  
 Show : Enter "On" to display the template and "Off" to not display the template. 
 Color : Enter the desired color to draw the pattern in this parameter. 
 LineWidth : You can enter the number 1 or numbers higher than one to adjust the thickness of the drawing lines. This number must be an integer and increases with increasing thickness. 
 LabelSize : You can adjust the size of the labels by using the "size.auto", "size.tiny", "size.smal", "size.normal", "size.large" or "size.huge" entries. 
🟣 Alert Setting  
 Alert : On / Off 
 Message Frequency : This string parameter defines the announcement frequency. Choices include: "All" (activates the alert every time the function is called), "Once Per Bar" (activates the alert only on the first call within the bar), and "Once Per Bar Close" (the alert is activated only by a call at the last script execution of the real-time bar upon closing). The default setting is "Once per Bar". 
 Show Alert Time by Time Zone : The date, hour, and minute you receive in alert messages can be based on any time zone you choose. For example, if you want New York time, you should enter "UTC-4". This input is set to the time zone "UTC" by default.
🔵 Conclusion 
The Dragon Harmonic Pattern is an advanced and practical technical analysis tool that aids traders in accurately predicting bullish and bearish trends by identifying Potential Reversal Zones (PRZ) and utilizing Fibonacci ratios. Built on the XABCD structure, this pattern stands out for its flexibility and precision in identifying price movements, making it a valuable resource among technical analysts. One of its key advantages is its compatibility with other technical tools such as trendlines, support and resistance levels, and Fibonacci retracements.
By using the Dragon Harmonic Pattern indicator, traders can accurately determine entry and exit points for their trades. The indicator analyzes key Fibonacci ratios—0.380 to 0.620, 0.200 to 0.400, and 0.800 to 1.100—to identify critical levels such as price highs and lows, offering precise trading strategies. In bullish scenarios, traders can profit from rising prices, while in bearish scenarios, they can capitalize on price declines.
In conclusion, the Dragon Harmonic Pattern is a highly reliable tool for identifying trading opportunities with exceptional accuracy. However, for optimal results, it is recommended to combine this pattern with other analytical tools and thoroughly assess market conditions. By utilizing this indicator, traders can reduce their trading risks while achieving higher profitability and confidence in their trading strategies.
Professional GBP/JPY Analysis ToolThe foundation of professional trading begins with analyzing individual currencies first, not just currency pairs. By understanding the relative strength of each currency in the pair, traders can anticipate potential market moves with greater accuracy.
This indicator simplifies that process by:
Analyzing Individual Currency Strength:
The strength of GBP is calculated by averaging its performance across seven major GBP currency pairs:
GBP/EUR
GBP/USD
GBP/CAD
GBP/CHF
GBP/AUD
GBP/NZD
GBP/JPY
The strength of JPY is calculated by averaging its performance across seven major JPY currency pairs:
JPY/USD
JPY/CAD
JPY/EUR
JPY/GBP
JPY/AUD
JPY/NZD
JPY/CHF
The values are normalized to allow direct comparison on the same scale.
Identifying Correlation Between GBP and JPY:
The histogram displays the correlation between GBP and JPY strength:
Positive Correlation (Green): Both GBP and JPY are trending up or down together, indicating a less strong trend. This is a market condition to avoid, as both currencies are strengthening or weakening simultaneously.
Negative Correlation (Red): One currency is strong while the other is weak, indicating a stronger trend in GBP/JPY. This scenario presents a better trading opportunity, as you are trading one strong currency against one weak currency, amplifying the potential for a clearer price movement in GBP/JPY.
Visualizing Long/Short Bias:
GBP Strength > JPY Strength: Bullish bias for GBP/JPY (green background).
JPY Strength > GBP Strength: Bearish bias for GBP/JPY (red background).
This indicator equips traders with a deeper understanding of GBP/JPY dynamics by first breaking down the individual currencies. With insights into currency strength, their correlation, and the optimal conditions for trading, it provides a solid foundation for making informed trading decisions.
 How to Use: 
Check the Histogram for Correlation:
Wait for the histogram to be red. This indicates that GBP and JPY are moving in opposite directions, signaling a stronger trend where you're trading a strong currency against a weak one—a more favorable setup.
Align with Background Color for Confirmation:
Wait for the background color to match your trade plan:
Green Background: Confirms a bullish bias, supporting long positions on the GBP/JPY pair.
Red Background: Confirms a bearish bias, supporting short positions on the GBP/JPY pair.
By following these steps, you can identify stronger trade opportunities and align them with your strategy.
Multi-Band Comparison (Uptrend)Multi-Band Comparison
Overview:
The Multi-Band Comparison indicator is engineered to reveal critical levels of support and resistance in strong uptrends. In a healthy upward market, the price action will adhere closely to the 95th percentile line (the Upper Quantile Band), effectively “riding” it. This indicator combines a modified Bollinger Band (set at one standard deviation), quantile analysis (95% and 5% levels), and power‑law math to display a dynamic picture of market structure—highlighting a “golden channel” and robust support areas.
Key Components & Calculations:
    The Golden Channel: Upper Bollinger Band & Upper Std Dev Band of the Upper Quantile
        Upper Bollinger Band:
            Calculation:
            boll_upper=SMA(close,length)+(boll_mult×stdev)
            boll_upper=SMA(close,length)+(boll_mult×stdev) Here, the 20-period SMA is used along with one standard deviation of the close, where the multiplier (boll_mult) is 1.0.
            Role in an Uptrend:
            In a healthy uptrend, price rides near the 95th percentile line. When price crosses above this Upper Bollinger Band, it confirms strong bullish momentum.
        Upper Std Dev Band of the Upper Quantile (95th Percentile) Band:
            Calculation:
            quant_upper_std_up=quant_upper+stdev
            quant_upper_std_up=quant_upper+stdev The Upper Quantile Band, quant_upperquant_upper, is calculated as the 95th percentile of recent price data. Adding one standard deviation creates an extension that accounts for normal volatility around this extreme level.
            The Golden Channel:
            When the price crosses above the Upper Bollinger Band, the Upper Std Dev Band of the Upper Quantile immediately shifts to gold (yellow) and remains gold until price falls below the Bollinger level. Together, these two lines form the “golden channel”—a visual hallmark of a healthy uptrend where the price reliably hugs the 95th percentile level.
    Upper Power‑Law Band
        Calculation:
        The Upper Power‑Law Band is derived in two steps:
            Determine the Extreme Return Factor:
            power_upper=Percentile(returns,95%)
            power_upper=Percentile(returns,95%) where returns are computed as:
            returns=closeclose −1.
            returns=close close−1.
            Scale the Current Price:
            power_upper_band=close×(1+power_upper)
            power_upper_band=close×(1+power_upper)
            Rationale and Correlation:
            By focusing on the upper 5% of returns (reflecting “fat tails”), the Upper Power‑Law Band captures extreme but statistically expected movements. In an uptrend, its value often converges with the Upper Std Dev Band of the Upper Quantile because both measures reflect heightened volatility and extreme price levels. When the Upper Power‑Law Band exceeds the Upper Std Dev Band, it can signal a temporary overextension.
    Upper Quantile Band (95% Percentile)
        Calculation:
        quant_upper=Percentile(price,95%)
        quant_upper=Percentile(price,95%) This level represents where 95% of past price data falls below, and in a robust uptrend the price action practically rides this line.
        Color Logic:
        Its color shifts from a neutral (blackish) tone to a vibrant, bullish hue when the Upper Power‑Law Band crosses above it—signaling extra strength in the trend.
    Lower Quantile and Its Support
        Lower Quantile Band (5% Percentile):
            Calculation:
            quant_lower=Percentile(price,5%)
            quant_lower=Percentile(price,5%)
            Behavior:
            In a healthy uptrend, price remains well above the Lower Quantile Band. It turns red only when price touches or crosses it, serving as a warning signal. Under normal conditions it remains bright green, indicating the market is not nearing these extreme lows.
        Lower Std Dev Band of the Lower Quantile:
            This line is calculated by subtracting one standard deviation from quant_lowerquant_lower and typically serves as absolute support in nearly all conditions (except during gap or near-gap moves). Its consistent role as support provides traders with a robust level to monitor.
How to Use the Indicator:
    Golden Channel and Trend Confirmation:
    As price rides the Upper Quantile (95th percentile) perfectly in a healthy uptrend, the Upper Bollinger Band (1 stdev above SMA) and the Upper Std Dev Band of the Upper Quantile form a “golden channel” once price crosses above the Bollinger level. When this occurs, the Upper Std Dev Band remains gold until price dips back below the Bollinger Band. This visual cue reinforces trend strength.
    Power‑Law Insights:
    The Upper Power‑Law Band, which is based on extreme (95th percentile) returns, tends to align with the Upper Std Dev Band. This convergence reinforces that extreme, yet statistically expected, price moves are occurring—indicating that even though the price rides the 95th percentile, it can only stretch so far before a correction or consolidation.
    Support Indicators:
        Primary and Secondary Support in Uptrends:
        The Upper Bollinger Band and the Lower Std Dev Band of the Upper Quantile act as support zones for minor retracements in the uptrend.
        Absolute Support:
        The Lower Std Dev Band of the Lower Quantile serves as an almost invariable support area under most market conditions.
Conclusion:
The Multi-Band Comparison indicator unifies advanced statistical techniques to offer a clear view of uptrend structure. In a healthy bull market, price action rides the 95th percentile line with precision, and when the Upper Bollinger Band is breached, the corresponding Upper Std Dev Band turns gold to form a “golden channel.” This, combined with the Power‑Law analysis that captures extreme moves, and the robust lower support levels, provides traders with powerful, multi-dimensional insights for managing entries, exits, and risk.
Disclaimer:
Trading involves risk. This indicator is for educational purposes only and does not constitute financial advice. Always perform your own analysis before making trading decisions.
Volume EquilibriumThe intent behind this indicator is to provide comprehensive information relating to volume compared to multiple timeframes. This indicator allows one to see what the market 'theoretically' sees as 'fair-value' whilst also allowing one to gauge where the price of a stock is headed. 
 Volume Equilibrium 
The main indicator finds the difference between buying volume and selling volume, under the basic presumption that more buying volume indicates greater bullish sentiment and vice versa. 
Buying Volume = volume when close price is higher than open price.
Selling Volume = volume when close price is lower than open price.
Volume Balance = Cumulative Buying Volume − Cumulative Selling Volume
Volume Balance is then expressed as a percentage by dividing by total volume
This indicator is composed of three different lengths of the same indicator. Short, Mid, and Long term representations of Volume Equilibrium. The difference between the mid and long term are highlighted so to make it easy to see where volume is going relative to a longer time frame.
HOW TO USE:
At 0 ---> Equilibrium ---> Equal Buying/Selling Volume
Above 0 ---> More buying Volume
Below 0 ---> More selling Volume
Using theory, it is assumed that the price is at a 'fair-value' when the buying/selling volume is at 0. This is of course relative to the respective timeframe of your choosing. More weight given to larger timeframes. 
 Volume Histogram 
It is a basic volume chart that represents the total volume though has highlighted bars so to indicate buying(green) and selling(red) volume. This allows one to see what the indicator is based off of. 
 Open-Close Oscillator(not needed)  
Calculates the average open-close for a selected timeframe and then provides the current closing price relative to that average open-close. Very simply put, values below 0 indicate bearish and values above 0 generally indicate bullishness. This indicator is for a quick reference of price action relative to volume.
           Another way to use this indicator, though unique, is to analyze the separate open-close lines themselves. Using the open-close bands, bullishness is defined as increasing closing prices and bearish as decreasing closing prices. So, in regard to this indicator, bear sessions can be indicated by the opening line being below the closing line and bull sessions as the opening line being above. Use the 'flip' of these lines to your advantage, they are very helpful at capturing long continuous sentiment. 
This indicator is composed of great information though I still think it best to use many different indicators to help you with your trades.
NOTE: Be aware of what we are trying to analyze, Volume. This means that one should also look out for divergences to capture early indications of reversals. This indicator can be leveraged greatly.
SMT Divergence ICT 01 [TradingFinder] Smart Money Technique🔵 Introduction 
SMT Divergence (short for Smart Money Technique Divergence) is a trading technique in the ICT Concepts methodology that focuses on identifying divergences between two positively correlated assets in financial markets. 
These divergences occur when two assets that should move in the same direction move in opposite directions. Identifying these divergences can help traders spot potential reversal points and trend changes. 
Bullish and Bearish divergences are clearly visible when an asset forms a new high or low, and the correlated asset fails to do so. This technique is applicable in markets like Forex, stocks, and cryptocurrencies, and can be used as a valid signal for deciding when to enter or exit trades.
  
 Bullish SMT Divergence : This type of divergence occurs when one asset forms a higher low while the correlated asset forms a lower low. This divergence is typically a sign of weakness in the downtrend and can act as a signal for a trend reversal to the upside.
  
  
 Bearish SMT Divergence : This type of divergence occurs when one asset forms a higher high while the correlated asset forms a lower high. This divergence usually indicates weakness in the uptrend and can act as a signal for a trend reversal to the downside.
  
  
🔵 How to Use  
SMT Divergence is an analytical technique that identifies divergences between two correlated assets in financial markets. 
This technique is used when two assets that should move in the same direction move in opposite directions. 
Identifying these divergences can help you pinpoint reversal points and trend changes in the market.
🟣 Bullish SMT Divergence 
This divergence occurs when one asset forms a higher low while the correlated asset forms a lower low. This divergence indicates weakness in the downtrend and can signal a potential price reversal to the upside. 
In this case, when the correlated asset is forming a lower low, and the main asset is moving lower but the correlated asset fails to continue the downward trend, there is a high probability of a trend reversal to the upside.
  
🟣 Bearish SMT Divergence 
Bearish divergence occurs when one asset forms a higher high while the correlated asset forms a lower high. This type of divergence indicates weakness in the uptrend and can signal a potential trend reversal to the downside. 
When the correlated asset fails to make a new high, this divergence may be a sign of a trend reversal to the downside.
  
🟣 Confirming Signals with Correlation 
To improve the accuracy of the signals, use assets with strong correlation. Forex pairs like  OANDA:EURUSD  and  OANDA:GBPUSD  , or cryptocurrencies like  COINBASE:BTCUSD   and  COINBASE:ETHUSD  , or commodities such as gold ( FX:XAUUSD ) and silver ( FX:XAGUSD ) typically have significant correlation. Identifying divergences between these assets can provide a strong signal for a trend change.
🔵 Settings 
 Second Symbol : This setting allows you to select another asset for comparison with the primary asset. By default, "XAUUSD" (Gold) is set as the second symbol, but you can change it to any currency pair, stock, or cryptocurrency. For example, you can choose currency pairs like EUR/USD or GBP/USD to identify divergences between these two assets.
 Divergence Fractal Periods : This parameter defines the number of past candles to consider when identifying divergences. The default value is 2, but you can change it to suit your preferences. This setting allows you to detect divergences more accurately by selecting a greater number of candles.
 Bullish Divergence Line : Displays a line showing bullish divergence from the lows.
 Bearish Divergence Line : Displays a line showing bearish divergence from the highs.
 Bullish Divergence Label : Displays the "+SMT" label for bullish divergences.
 Bearish Divergence Label : Displays the "-SMT" label for bearish divergences.
🔵 Conclusion 
SMT Divergence is an effective tool for identifying trend changes and reversal points in financial markets based on identifying divergences between two correlated assets. This technique helps traders receive more accurate signals for market entry and exit by analyzing bullish and bearish divergences.
Identifying these divergences can provide opportunities to capitalize on trend changes in Forex, stocks, and cryptocurrency markets. Using SMT Divergence along with risk management and confirming signals with other technical analysis tools can improve the accuracy of trading decisions and reduce risks from sudden market changes.
Moment-Based Adaptive DetectionMBAD (Moment-Based Adaptive Detection) : a method applicable to a wide range of purposes, like outlier or novelty detection, that requires building a sensible interval/set of thresholds. Unlike other methods that are static and rely on optimizations that inevitably lead to underfitting/overfitting, it dynamically adapts to your data distribution without any optimizations, MLE, or stuff, and provides a set of data-driven adaptive thresholds, based on closed-form solution with O(n) algo complexity.
 1.5 years ago, when I was still living in Versailles at my friend's house not knowing what was gonna happen in my life tomorrow, I made a damn right decision not to give up on one idea and to actually R&D it and see what’s up. It allowed me to create this one. 
 The Method Explained 
I’ve been wandering about z-values, why exactly 6 sigmas, why 95%? Who decided that? Why would you supersede your opinion on data? Based on what? Your ego?
Then I consciously noticed a couple of things:
1) In control theory & anomaly detection, the popular threshold is 3 sigmas (yet nobody can firmly say why xD). If your data is Laplace, 3 sigmas is not enough; you’re gonna catch too many values, so it needs a higher sigma.
2) Yet strangely, the normal distribution has kurtosis of 3, and 6 for Laplace.
3) Kurtosis is a standardized moment, a moment scaled by stdev, so it means "X amount of something measured in stdevs."
4) You generate synthetic data, you check on real data (market data in my case, I am a quant after all), and you see on both that:
lower extension = mean - standard deviation * kurtosis ≈ data minimum  
upper extension = mean + standard deviation * kurtosis ≈ data maximum  
 Why not simply use max/min?
    - Lower info gain: We're not using all info available in all data points to estimate max/min; we just pick the current higher and lower values. Lol, it’s the same as dropping exponential smoothing with alpha = 0 on stationary data & calling it a day.
You can’t update the estimates of min and max when new data arrives containing info about the matter. All you can do is just extend min and max horizontally, so you're not using new info arriving inside new data.
    - Mixing order and non-order statistics is a bad idea; we're losing integrity and coherence. That's why I don't like the Hurst exponent btw (and yes, I came up with better metrics of my own).
    - Max & min are not even true order statistics, unlike a percentile (finding which requires sorting, which requires multiple passes over your data). To find min or max, you just need to do one traversal over your data. Then with or without any weighting, 100th percentile will equal max. So unlike a weighted percentile, you can’t do weighted max. Then while you can always check max and min of a geometric shape, now try to calculate the 56th percentile of a pentagram hehe.
TL;DR max & min are rather topological characteristics of data, just as the difference between starting and ending points. Not much to do with statistics. 
Now the second part of the ballet is to work with data asymmetry:
1) Skewness is also scaled by stdev -> so it must represent a shift from the data midrange measured in stdevs -> given asymmetric data, we can include this info in our models. Unlike kurtosis, skewness has a sign, so we add it to both thresholds:
lower extension = mean - standard deviation * kurtosis + standard deviation * skewness  
upper extension = mean + standard deviation * kurtosis + standard deviation * skewness  
2) Now our method will work with skewed data as well, omg, ain’t it cool?
3) Hold up, but what about 5th and 6th moments (hyperskewness & hyperkurtosis)? They should represent something meaningful as well.
4) Perhaps if extensions represent current estimated extremums, what goes beyond? Limits, beyond which we expect data not to be able to pass given the current underlying process generating the data?
When you extend this logic to higher-order moments, i.e., hyperskewness & hyperkurtosis (5th and 6th moments), they measure asymmetry and shape of distribution tails, not its core as previous moments -> makes no sense to mix 4th and 3rd moments (skewness and kurtosis) with 5th & 6th, so we get:
lower limit = mean - standard deviation * hyperkurtosis + standard deviation * hyperskewness  
upper limit = mean + standard deviation * hyperkurtosis + standard deviation * hyperskewness  
While extensions model your data’s natural extremums based on current info residing in the data without relying on order statistics, limits model your data's maximum possible and minimum possible values based on current info residing in your data. If a new data point trespasses limits, it means that a significant change in the data-generating process has happened, for sure, not probably—a confirmed structural break.
And finally we use time and volume weighting to include order & process intensity information in our model.
 I can't stress it enough: despite the popularity of these non-weighted methods applied in mainstream open-access time series modeling,  it doesn’t make ANY sense to use non-weighted calculations on time series data . Time = sequence, it matters. If you reverse your time series horizontally, your means, percentiles, whatever, will stay the same. Basically, your calculations will give the same results on different data. When you do it, you disregard the order of data that does have order naturally. Does it make any sense to you? It also concerns regressions applied on time series as well, because even despite the slope being opposite on your reversed data, the centroid (through which your regression line always comes through) will be the same. It also might concern Fourier (yes, you can do weighted Fourier) and even MA and AR models—might, because I ain’t researched it extensively yet. 
I still can’t believe it’s nowhere online in open access. No chance I’m the first one who got it. It’s literally in front of everyone’s eyes for centuries—why no one tells about it?
 How to use 
That’s easy: can be applied to any, even non-stationary and/or heteroscedastic time series to automatically detect novelties, outliers, anomalies, structural breaks, etc. In terms of quant trading, you can try using extensions for mean reversion trades and limits for emergency exits, for example. The market-making application is kinda obvious as well.
The only parameter the model has is length, and it should NOT be optimized but picked consciously based on the process/system you’re applying it to and based on the task. However, this part is not about sharing info & an open-access instrument with the world. This is about using dem instruments to do actual business, and we can’t talk about it.
∞
Mean Price 
^^ Plotting switched to Line.
This method of financial time series (aka bars) downsampling is literally, naturally, and thankfully the best you can do in terms of maximizing info gain. You can finally chill and feed it to your studies & eyes, and probably use nothing else anymore.
(HL2 and  occ3  also have use cases, but other aggregation methods? Not really, even if they do, the use cases are ‘very’ specific). Tho in order to understand why, you gotta read the following wall, or just believe me telling you, ‘I put it on my momma’.
 The true story about trading volumes and why this is all a big misdirection 
 Actually, you don’t need to be a quant to get there. All you gotta do is stop blindly following other people’s contextual (at best) solutions, eg OC2 aggregation xD, and start using your own brain to figure things out. 
Every individual trade (basically an imprint on 1D price space that emerges when market orders hit the order book) has several features like: price, time, volume, AND direction (Up if a market buy order hits the asks, Down if a market sell order hits the bids). Now, the last two features—volume and direction—can be effectively combined into one (by multiplying volume by 1 or -1), and this is probably how every order matching engine should output data. If we’re not considering size/direction, we’re leaving data behind. Moreover, trades aren’t just one-price dots all the time. One trade can consume liquidity on several levels of the order book, so a single trade can be several ticks big on the price axis.
 You may think now that there are no zero-volume ticks. Well, yes and no. It depends on how you design an exchange and whether you allow intra-spread trades/mid-spread trades (now try to Google it). Intra-spread trades could happen if implemented when a matching engine receives both buy and sell orders at the same microsecond period. This way, you can match the orders with each other at a better price for both parties without even hitting the book and consuming liquidity. Also, if orders have different sizes, the remaining part of the bigger order can be sent to the order book. Basically, this type of trade can be treated as an OTC trade, having zero volume because we never actually hit the book—there’s no imprint. Another reason why it makes sense is when we think about volume as an impact or imbalance act, and how the medium (order book in our case) responds to it, providing information. OTC and mid-spread trades are not aggressive sells or buys; they’re neutral ticks, so to say. However huge they are, sometimes many blocks on NYSE, they don’t move the price because there’s no impact on the medium (again, which is the order book)—they’re not providing information. 
... Now, we need to aggregate these trades into, let’s say, 1-hour bars (remember that a trade can have either positive or negative volume). We either don’t want to do it, or we don’t have this kind of information. What we can do is take already aggregated OHLC bars and extract all the info from them. Given the market is fractal, bars & trades gotta have the same set of features:
-  Highest & lowest ticks (high & low) <- by price;
-  First & last ticks (open & close) <- by time;
- Biggest and smallest ticks <- by volume.*
*e.g., in the array  ,
2323: biggest trade,
-1212: smallest trade.
Now, in our world, somehow nobody started to care about the biggest and smallest trades and their inclusion in OHLC data, while this is actually natural. It’s the same way as it’s done with high & low and open & close: we choose the minimum and maximum value of a given feature/axis within the aggregation period.
So, we don’t have these 2 values: biggest and smallest ticks. The best we can do is infer them, and given the fact the biggest and smallest ticks can be located with the same probability everywhere, all we can do is predict them in the middle of the bar, both in time and price axes. That’s why you can see two HL2’s in each of the 3 formulas in the code.
 So, summed up absolute volumes that you see in almost every trading platform are actually just a derivative metric, something that I call Type 2 time series in my own (proprietary ‘for now’) methods. It doesn’t have much to do with market orders hitting the non-uniform medium (aka order book); it’s more like a statistic. Still wanna use VWAP? Ok, but you gotta understand you’re weighting Type 1 (natural) time series by Type 2 (synthetic) ones. 
 How to combine all the data in the right way (khmm khhm ‘order’) 
Now, since we have 6 values for each bar, let’s see what information we have about them, what we don’t have, and what we can do about it:
- Open and close: we got both when and where (time (order) and price);
- High and low: we got where, but we don’t know when;
- Biggest & smallest trades: we know shit, we infer it the way it was described before.'
By using the location of the close & open prices relative to the high & low prices, we can make educated guesses about whether high or low was made first in a given bar. It’s not perfect, but it’s ultimately all we can do—this is the very last bit of info we can extract from the data we have.
There are 2 methods for inferring volume delta (which I call simply volume) that are presented everywhere, even here on TradingView. Funny thing is, this is actually 2 parts of the 1 method. I wonder how many folks see through it xD. The same method can be used for both inferring volume delta AND making educated guesses whether high or low was made first.
Imagine and/or find the cases on your charts to understand faster:
* Close > open means we have an up bar and probably the volume is positive, and probably high was made later than low.
* Close < open means we have a down bar and probably the volume is negative, and probably low was made later than high.
 Now that’s the point when you see that these 2 mentioned methods are actually parts of the 1 method: 
If close = open, we still have another clue: distance from open/close pair to high (HC), and distance from open/close pair to low (LC):
* HC < LC, probably high was made later.
* HC > LC, probably low was made later.
And only if close = open and HC = LC, only in this case we have no clue whether high or low was made earlier within a bar. We simply don’t have any more information to even guess. This bar is called a neutral bar.
At this point, we have both time (order) and price info for each of our 6 values. Now, we have to solve another weighted average problem, and that’s it. We’ll weight prices according to the order we’ve guessed. In the neutral bar case, open has a weight of 1, close has a weight of 3, and both high and low have weights of 2 since we can’t infer which one was made first. In all cases, biggest and smallest ticks are modeled with HL2 and weighted like they’re located in the middle of the bar in a time sense.
P.S.: I’ve also included a "robust" method where all the bars are treated like neutral ones. I’ve used it before; obviously, it has lesser info gain -> works a bit worse.
High/Low Location Frequency [LuxAlgo]The  High/Low Location Frequency  tool provides users with probabilities of tops and bottoms at user-defined periods, along with advanced filters that offer deep and objective market information about the likelihood of a top or bottom in the market.
🔶  USAGE 
  
There are four different time periods that traders can select for analysis of probabilities:
 
 HOUR OF DAY:  Probability of occurrence of top and bottom prices for each hour of the day
 DAY OF WEEK:  Probability of occurrence of top and bottom prices for each day of the week
 DAY OF MONTH:  Probability of occurrence of top and bottom prices for each day of the month
 MONTH OF YEAR:  Probability of occurrence of top and bottom prices for each month
 
The data is displayed as a dashboard, which users can position according to their preferences. The dashboard includes useful information in the header, such as the number of periods and the date from which the data is gathered. Additionally, users can enable active filters to customize their view. The probabilities are displayed in one, two, or three columns, depending on the number of elements.
🔹  Advanced Filters 
  
  
Advanced Filters allow traders to exclude specific data from the results. They can choose to use none or all filters simultaneously, inputting a list of numbers separated by spaces or commas. However, it is not possible to use both separators on the same filter.
The tool is equipped with five advanced filters:
 
 HOURS OF DAY:  The permitted range is from 0 to 23.
 DAYS OF WEEK:  The permitted range is from 1 to 7.
 DAYS OF MONTH:  The permitted range is from 1 to 31.
 MONTHS:  The permitted range is from 1 to 12.
 YEARS:  The permitted range is from 1000 to 2999.
 
It should be noted that the  DAYS OF WEEK  advanced filter has been designed for use with tickers that trade every day, such as those trading in the crypto market. In such cases, the numbers displayed will range from 1 (Sunday) to 7 (Saturday). Conversely, for tickers that do not trade over the weekend, the numbers will range from 1 (Monday) to 5 (Friday).
To illustrate the application of this filter, we will exclude results for Mondays and Tuesdays, the first five days of each month, January and February, and the years 2020, 2021, and 2022. Let us review the results:
 
 DAYS OF WEEK:  `2,3` or `2 3` (for crypto) or `1,2` or `1 2` (for the rest)
 DAYS OF MONTH:  `1,2,3,4,5` or `1 2 3 4 5`
 MONTHS:  `1,2` or `1 2`
 YEARS:  `2020,2021,2022` or `2020 2021 2022`
 
🔹  High Probability Lines 
  
The tool enables traders to identify the next period with the highest probability of a top (red) and/or bottom (green) on the chart, marked with two horizontal lines indicating the location of these periods.
🔹  Top/Bottom Labels and Periods Highlight 
  
The tool is capable of indicating on the chart the upper and lower limits of each selected period, as well as the commencement of each new period, thus providing traders with a convenient reference point.
🔶  SETTINGS 
 
 Period:  Select how many bars (hours, days, or months) will be used to gather data from, max value as default.
 Execution Window:  Select how many bars (hours, days, or months) will be used to gather data from
 
🔹  Advanced Filters 
 
 Hours of day:  Filter which hours of the day are excluded from the data, it accepts a list of hours from 0 to 23 separated by commas or spaces, users can not mix commas or spaces as a separator, must choose one
 Days of week:  Filter which days of the week are excluded from the data, it accepts a list of days from 1 to 5 for tickers not trading weekends, or from 1 to 7 for tickers trading all week, users can choose between commas or spaces as a separator, but can not mix them on the same filter.
 Days of month:  Filter which days of the month are excluded from the data, it accepts a list of days from 1 to 31, users can choose between commas or spaces as separator, but can not mix them on the same filter.
 Months:  Filter months to exclude from data. Accepts months from 1 to 12. Choose one separator: comma or space.
 Years:  Filter years to exclude from data. Accepts years from 1000 to 2999. Choose one separator: comma or space.
 
🔹  Dashboard 
 
 Dashboard Location:  Select both the vertical and horizontal parameters for the desired location of the dashboard.
 Dashboard Size:  Select size for dashboard.
 
🔹  Style 
 
 High Probability Top Line:  Enable/disable `High Probability Top` vertical line and choose color
 High Probability Bottom Line:  Enable/disable `High Probability Bottom` vertical line and choose color
 Top Label:  Enable/disable period top labels, choose color and size.
 Bottom Label:  Enable/disable period bottom labels, choose color and size.
 Highlight Period Changes:  Enable/disable vertical highlight at start of period






















