Ultimate RSI [LuxAlgo]The Ultimate RSI indicator is a new oscillator based on the calculation of the Relative Strength Index that aims to put more emphasis on the trend, thus having a less noisy output. Opposite to the regular RSI, this oscillator is designed for a trend trading approach instead of a contrarian one.
🔶 USAGE
While returning the same information as a regular RSI, the Ultimate RSI puts more emphasis on trends, and as such can reach overbought/oversold levels faster as well as staying longer within these areas. This can avoid the common issue of an RSI regularly crossing an overbought or oversold level while the trend makes new higher highs/lower lows.
The Ultimate RSI crossing above the overbought level can be indicative of a strong uptrend (highlighted as a green area), while an Ultimate RSI crossing under the oversold level can be indicative of a strong downtrend (highlighted as a red area).
The Ultimate RSI crossing the 50 midline can also indicate trends, with the oscillator being above indicating an uptrend, else a downtrend. Unlike a regular RSI, the Ultimate RSI will cross the midline level less often, thus generating fewer whipsaw signals.
For even more timely indications users can observe the Ultimate RSI relative to its signal line. An Ultimate RSI above its signal line can indicate it is increasing, while the opposite would indicate it is decreasing.
🔹 Smoothing Methods
Users can return more reactive or smoother results depending on the selected smoothing method used for the calculation of the Ultimate RSI. Options include:
Exponential Moving Average (EMA)
Simple Moving Average (SMA)
Wilder's Moving Average (RMA)
Triangular Moving Average (TMA)
These are ranked by the degree of reactivity of each method, with higher ones being more reactive (but less smooth).
Users can also select the smoothing method used by the signal line.
🔶 DETAILS
The RSI returns a normalized exponential average of price changes in the range (0, 100), which can be simply calculated as follows:
ema(d) / ema(|d|) × 50 + 50
where d represent the price changes. In order to put more emphasis on trends we can put higher weight on d . We can perform this on the occurrence of new higher highs/lower lows, and by replacing d with the rolling range instead (the rolling period used to detect the higher highs/lower lows is equal to the length setting).
🔶 SETTINGS
Length: Calculation period of the indicator
Method: Smoothing method used for the calculation of the indicator.
Source: Input source of the indicator
🔹 Signal Line
Smooth: Degree of smoothness of the signal line
Method: Smoothing method used to calculation the signal line.
Luxalgo
AI Channels (Clustering) [LuxAlgo]The AI Channels indicator is constructed based on rolling K-means clustering, a common machine learning method used for clustering analysis. These channels allow users to determine the direction of the underlying trends in the price.
We also included an option to display the indicator as a trailing stop from within the settings.
🔶 USAGE
Each channel extremity allows users to determine the current trend direction. Price breaking over the upper extremity suggesting an uptrend, and price breaking below the lower extremity suggesting a downtrend. Using a higher Window Size value will return longer-term indications.
The "Clusters" setting allows users to control how easy it is for the price to break an extremity, with higher values returning extremities further away from the price.
The "Denoise Channels" is enabled by default and allows to see less noisy extremities that are more coherent with the detected trend.
Users who wish to have more focus on a detected trend can display the indicator as a trailing stop.
🔹 Centroid Dispersion Areas
Each extremity is made of one area. The width of each area indicates how spread values within a cluster are around their centroids. A wider area would suggest that prices within a cluster are more spread out around their centroid, as such one could say that it is indicative of the volatility of a cluster.
Wider areas around a specific extremity can indicate a larger and more spread-out amount of prices within the associated cluster. In practice price entering an area has a higher chance to break an associated extremity.
🔶 DETAILS
The indicator performs K-means clustering over the most recent Window Size prices, finding a number of user-specified clusters. See here to find more information on cluster detection.
The channel extremities are returned as the centroid of the lowest, average, and highest price clusters.
K-means clustering can be computationally expensive and as such we allow users to determine the maximum number of iterations used to find the centroids as well as the number of most historical bars to perform the indicator calculation. Do note that increasing the calculation window of the indicator as well as the number of clusters will return slower results.
🔶 SETTINGS
Window Size: Amount of most recent prices to use for the calculation of the indicator.
Clusters": Amount of clusters detected for the calculation of the indicator.
Denoise Channels: When enabled, return less noisy channels extremities, disabling this setting will return the exact centroids at each time but will produce less regular extremities.
As Trailing Stop: Display the indicator as a trailing stop.
🔹 Optimization
This group of settings affects the runtime performance of the script.
Maximum Iteration Steps: Maximum number of iterations allowed for finding centroids. Excessively low values can return a better script load time but poor clustering.
Historical Bars Calculation: Calculation window of the script (in bars).
Liquidity Sentiment Profile (Auto-Anchored) [LuxAlgo]
The Liquidity Sentiment Profile (Auto-Anchored) is an advanced charting tool that measures by combining PRICE and VOLUME data over specified anchored periods and highlights the distribution of the liquidity and the market sentiment at specific price levels. This version is a variation of the previously published Liquidity Sentiment Profile , wherewith this version allows users to select a variety of different anchoring periods, such as 'Auto', 'Fixed Range', 'Swing High', 'Swing Low', 'Session', 'Day', 'Week', 'Month', 'Quarter', and 'Year'
Liquidity refers to the availability of orders at specific price levels in the market, allowing transactions to occur smoothly.
🔶 USAGE
A Liquidity Sentiment Profile (Auto-Anchored) is a combination of liquidity and a sentiment profile, where the right side of the profile highlights the distribution of the traded activity at different price levels, and the left side of the profile highlights the market sentiment at those price levels
The liquidity profile is categorized by assigning different colors based on the significance of the traded activity of the specific price levels, allowing traders to reveal significant price levels, such as support and resistance levels, supply and demand zones, liquidity gaps, consolidation zones, etc
The Liquidity Sentiment Profiles aim to present Value Areas based on the significance of price levels, thus allowing users to identify value areas that can be formed more than once within the range of a single profile
Level of Significance Line - displays the changes in the price levels with the highest traded activity (developing POC)
Buyside & Sellside Liquidity Zones - displays Liquidity Levels, also known as Supply and Demand Zones
🔶 SETTINGS
The script takes into account user-defined parameters and plots the profiles, where detailed usage for each user-defined input parameter in indicator settings is provided with the related input's tooltip.
🔹 Liquidity Sentiment Profile
Anchor Period: The indicator resolution is set by the input of the Anchor Period.
Fixed Period: Applicable if the Anchor Period is set to 'Fixed Range' then the period of the profile is defined with this option
Swing Detection Length: Applicable if the Anchor Period is set to 'Swing High' or 'Swing Low' then the length required to detect the Swing Levels is defined with this option which is then used to determine the period of the profile
🔹 Liquidity Profile
Liquidity Profile: Toggles the visibility of the Liquidity Profiles
High Traded Nodes: Threshold and Color option for High Traded Nodes
Average Traded Nodes: Color option for Average Traded Nodes
Low Traded Nodes: Threshold and Color option for Low Traded Nodes
🔹 Sentiment Profile
Sentiment Profile: Toggles the visibility of the Sentiment Profiles
Bullish Nodes: Color option for Bullish Nodes
Bearish Nodes: Color option for Bearish Nodes
🔹 Buyside & Sellside Liquidity Zones
Buyside & Sellside Liquidity Zones: Toggles the visibility of the Liquidity Levels
Buyside Liquidity Nodes: Color option for Buyside Liquidity Nodes
Sellside Liquidity Nodes: Color option for Sellside Liquidity Nodes
🔹 Other Settings
Level of Significance: Toggles the visibility of the Level of Significance Line
Price Levels, Color: Toggles the visibility of the Profile Price Levels
Number of Rows: Specify how many rows each profile histogram will have. Caution, having it set to high values will quickly hit Pine Script™ drawing objects limit and fewer historical profiles will be displayed
Profile Width %: Alters the width of the rows in the histogram, relative to the profile length
Profile Range Background Fill: Toggles the visibility of the Profiles Range
🔶 RELATED SCRIPTS
Liquidity-Sentiment-Profile
Buyside-Sellside-Liquidity
ICT-Concepts
Support and Resistance Signals MTF [LuxAlgo]The Support and Resistance Signals MTF indicator aims to identify undoubtedly one of the key concepts of technical analysis Support and Resistance Levels and more importantly, the script aims to capture and highlight major price action movements, such as Breakouts , Tests of the Zones , Retests of the Zones , and Rejections .
The script supports Multi-TimeFrame (MTF) functionality allowing users to analyze and observe the Support and Resistance Levels/Zones and their associated Signals from a higher timeframe perspective.
This script is an extended version of our previously published Support-and-Resistance-Levels-with-Breaks script from 2020.
Identification of key support and resistance levels/zones is an essential ingredient to successful technical analysis.
🔶 USAGE
Support and resistance are key concepts that help traders understand, analyze and act on chart patterns in the financial markets. Support describes a price level where a downtrend pauses due to demand for an asset increasing, while resistance refers to a level where an uptrend reverses as a sell-off happens.
The creation of support and resistance levels comes as a result of an initial imbalance of supply/demand, which forms what we know as a swing high or swing low. This script starts its processing using the swing highs/lows. Swing Highs/Lows are levels that many of the market participants use as a historical reference to place their trading orders (buy, sell, stop loss), as a result, those price levels potentially become and serve as key support and resistance levels.
One of the important features of the script is the signals it provides. The script follows the major price movements and highlights them on the chart.
🔹 Breakouts (non-repaint)
A breakout is a price moving outside a defined support or resistance level, the significance of the breakout can be measured by examining the volume. This script is not filtering them based on volume but provides volume information for the bar where the breakout takes place.
🔹 Retests
Retest is a case where the price action breaches a zone and then revisits the level breached.
🔹 Tests
Test is a case where the price action touches the support or resistance zones.
🔹 Rejections
Rejections are pin bar patterns with high trading volume.
Finally, Multi TimeFrame (MTF) functionality allows users to analyze and observe the Support and Resistance Levels/Zones and their associated Signals from a higher timeframe perspective.
🔶 SETTINGS
The script takes into account user-defined parameters to detect and highlight the zones, levels, and signals.
🔹 Support & Resistance Settings
Detection Timeframe: Set the indicator resolution, the users may examine higher timeframe detection on their chart timeframe.
Detection Length: Swing levels detection length
Check Previous Historical S&R Level: enables the script to check the previous historical levels.
🔹 Signals
Breakouts: Toggles the visibility of the Breakouts, enables customization of the color and the size of the visuals
Tests: Toggles the visibility of the Tests, enables customization of the color and the size of the visuals
Retests: Toggles the visibility of the Retests, enables customization of the color and the size of the visuals
Rejections: Toggles the visibility of the Rejections, enables customization of the color and the size of the visuals
🔹 Others
Sentiment Profile: Toggles the visibility of the Sentiment Profiles
Bullish Nodes: Color option for Bullish Nodes
Bearish Nodes: Color option for Bearish Nodes
🔶 RELATED SCRIPTS
Support-and-Resistance-Levels-with-Breaks
Buyside-Sellside-Liquidity
Liquidity-Levels-Voids
Volume Profile (Maps) [LuxAlgo]The Pine Script® developers have unleashed "maps"!
Volume Profile (Maps) displays volume, associated with price, above and below the latest price, by using maps
The largest and second-largest volume is highlighted.
🔶 USAGE
The proposed script can highlight more frequent closing prices/prices with the highest volume, potentially highlighting more liquid areas. The prices with the highest associated volume (in red and orange in the indicator) can eventually be used as support/resistance levels.
Voids within the volume profile can highlight large price displacements (volatile variations).
🔶 CONCEPTS
🔹 Maps
A map object is a collection that consists of key - value pairs
Each key is unique and can only appear once. When adding a new value with a key that the map already contains, that value replaces the old value associated with the key .
You can change the value of a particular key though, for example adding volume (value) at the same price (key), the latter technique is used in this script.
Volume is added to the map, associated with a particular price (default close, can be set at high, low, open,...)
When the map already contains the same price (key), the value (volume) is added to the existing volume at the associated price.
A map can contain maximum 50K values, which is more than enough to hold 20K bars (Basic 5K - Premium plan 20K), so the whole history can be put into a map.
🔹 Visible line/box limit
We can only display maximum 500 line.new() though.
The code locates the current (last) close, and displays volume values around this price, using lines, for example 250 lines above and 250 lines below current price.
If one side contains fewer values, the other side can show more lines, taking the maximum out of the 500 visible line limitation.
Example (max. 500 lines visible)
• 100 values below close
• 2000 values above close
-> 100 values will be displayed below close
-> 400 remaining -> 400 values will be displayed above close
Pushing the limits even further, when ' Amount of bars ' is set higher than 500, boxes - box.new() - will be used as well.
These have a limit of 500 as well, bringing the total limit to 1000.
Note that there are visual differences when boxes overlap against lines.
If this is confusing, please keep ' Amount of bars ' at max. 500 (then only lines will be used).
🔹 Rounding function
This publication contains 2 round functions, which can be used to widen the Volume Profile
Round
• "Round" set at zero -> nothing changes to the source number
• "Round" set below zero -> x digit(s) after the decimal point, starting from the right side, and rounded.
• "Round" set above zero -> x digit(s) before the decimal point, starting from the right side, and rounded.
Example: 123456.789
0->123456.789
1->123456.79
2->123456.8
3->123457
-1->123460
-2->123500
Step
Another option is custom steps.
After setting "Round" to "Step", choose the desired steps in price,
Examples
• 2 -> 1234.00, 1236.00, 1238.00, 1240.00
• 5 -> 1230.00, 1235.00, 1240.00, 1245.00
• 100 -> 1200.00, 1300.00, 1400.00, 1500.00
• 0.05 -> 1234.00, 1234.05, 1234.10, 1234.15
•••
🔶 FEATURES
🔹 Adjust position & width
🔹 Table
The table shows the details:
• Size originalMap : amount of elements in original map
• # higher: amount of elements, higher than last "close" (source)
• index "close" : index of last "close" (source), or # element, lower than source
• Size newMap : amount of elements in new map (used for display lines)
• # higher : amount of elements in newMap, higher than last "close" (source)
• # lower : amount of elements in newMap, lower than last "close" (source)
🔹 Volume * currency
Let's take as example BTCUSD, relative to USD, 10 volume at a price of 100 BTCUSD will be very different than 10 volume at a price of 30000 (1K vs. 300K)
If you want volume to be associated with USD, enable Volume * currency . Volume will then be multiplied by the price:
• 10 volume, 1 BTC = 100 -> 1000
• 10 volume, 1 BTC = 30K -> 300K
Disabled
Enabled
🔶 DETAILS
🔹 Put
When the map doesn't contain a price, it will be added, using map.put(id, key, value)
In our code:
map.put(originalMap, price, volume)
or
originalMap.put(price, volume)
A key (price) is now associated with a value (volume) -> key : value
Since all keys are unique, we don't have to know its position to extract the value, we just need to know the key -> map.get(id, key)
We use map.get() when a certain key already exists in the map, and we want to add volume with that value.
if originalMap.contains(price)
originalMap.put(price, originalMap.get(price) + volume)
-> At the last bar, all prices (source) are now associated with volume.
🔹 Copy & sort
Next, every key of the map is copied and sorted (array of keys), after which the index (idx) is retrieved of last (current) price.
copyK = originalMap.keys().copy()
copyK.sort()
idx = copyK.binary_search_leftmost(src)
Then left and right side of idx is investigated to show a maximum amount of lines at both sides of last price.
🔹 New map & display
The keys (from sorted array of copied keys) that will be displayed are put in a new map, with the associated volume values from the original map.
newMap = map.new()
🔹 Re-cap
• put in original amp (price key, volume value)
• copy & sort
• find index of last price
• fetch relevant keys left/right from that index
• put keys in new map and fetch volume associated with these keys (from original map)
Simple example (only show 5 lines)
bar 0, price = 2, volume = 23
bar 1, price = 4, volume = 3
bar 2, price = 8, volume = 21
bar 3, price = 6, volume = 7
bar 4, price = 9, volume = 13
bar 5, price = 5, volume = 85
bar 6, price = 3, volume = 13
bar 7, price = 1, volume = 4
bar 8, price = 7, volume = 9
Original map:
Copied keys array:
Sorted:
-> 5 keys around last price (7) are fetched (5, 6, 7, 8, 9)
-> keys are placed into new map + volume values from original map
Lastly, these values are displayed.
🔶 SETTINGS
Source : Set source of choice; default close , can be set as high , low , open , ...
Volume & currency : Enable to multiply volume with price (see Features )
Amount of bars : Set amount of bars which you want to include in the Volume Profile
Max lines : maximum 1000 (if you want to use only lines, and no boxes -> max. 500, see Concepts )
🔹 Round -> ' Round/Step '
Round -> see Concepts
Step -> see Concepts
🔹 Display Volume Profile
Offset: shifts the Volume Profile (max. 500 bars to the right of last bar, see Features )
Max width Volume Profile: largest volume will be x bars wide, the rest is displayed as a ratio against largest volume (see Features )
Show table : Show details (see Features )
🔶 LIMITATIONS
• Lines won't go further than first bar (coded).
• The Volume Profile can be placed maximum 500 bar to the right of last price.
• Maximum 500 lines/boxes can be displayed
Machine Learning Regression Trend [LuxAlgo]The Machine Learning Regression Trend tool uses random sample consensus (RANSAC) to fit and extrapolate a linear model by discarding potential outliers, resulting in a more robust fit.
🔶 USAGE
The proposed tool can be used like a regular linear regression, providing support/resistance as well as forecasting an estimated underlying trend.
Using RANSAC allows filtering out outliers from the input data of our final fit, by outliers we are referring to values deviating from the underlying trend whose influence on a fitted model is undesired. For financial prices and under the assumptions of segmented linear trends, these outliers can be caused by volatile moves and/or periodic variations within an underlying trend.
Adjusting the "Allowed Error" numerical setting will determine how sensitive the model is to outliers, with higher values returning a more sensitive model. The blue margin displayed shows the allowed error area.
The number of outliers in the calculation window (represented by red dots) can also be indicative of the amount of noise added to an underlying linear trend in the price, with more outliers suggesting more noise.
Compared to a regular linear regression which does not discriminate against any point in the calculation window, we see that the model using RANSAC is more conservative, giving more importance to detecting a higher number of inliners.
🔶 DETAILS
RANSAC is a general approach to fitting more robust models in the presence of outliers in a dataset and as such does not limit itself to a linear regression model.
This iterative approach can be summarized as follow for the case of our script:
Step 1: Obtain a subset of our dataset by randomly selecting 2 unique samples
Step 2: Fit a linear regression to our subset
Step 3: Get the error between the value within our dataset and the fitted model at time t , if the absolute error is lower than our tolerance threshold then that value is an inlier
Step 4: If the amount of detected inliers is greater than a user-set amount save the model
Repeat steps 1 to 4 until the set number of iterations is reached and use the model that maximizes the number of inliers
🔶 SETTINGS
Length: Calculation window of the linear regression.
Width: Linear regression channel width.
Source: Input data for the linear regression calculation.
🔹 RANSAC
Minimum Inliers: Minimum number of inliers required to return an appropriate model.
Allowed Error: Determine the tolerance threshold used to detect potential inliers. "Auto" will automatically determine the tolerance threshold and will allow the user to multiply it through the numerical input setting at the side. "Fixed" will use the user-set value as the tolerance threshold.
Maximum Iterations Steps: Maximum number of allowed iterations.
Adaptive MACD [LuxAlgo]The Adaptive MACD indicator is an adaptive version of the popular Moving Average Convergence Divergence (MACD) oscillator, returning longer-term variations during trending markets and cyclic variations during ranging markets while filtering out noisy variations.
🔶 USAGE
The proposed oscillator contains all the elements within a regular MACD, such as a signal line and histogram. A MACD value above 0 would indicate up-trending variations, while a value under 0 would be indicating down-trending variations.
Just like most oscillators, our proposed Adaptive MACD is able to return divergences with the price.
As we can see in the image above ranging markets will make the Adaptive MACD more conservative toward more cyclical conservations, filtering out both noise and longer-term variations. However, when longer-term variations (such as in a trending market) are prominent the oscillator will conserve longer-term variations.
The R2 Period setting determines when trending/ranging markets are detected, with higher values returning indications for longer intervals.
The fast and slow settings will act similarly to the regular MACD, however, closer values will return more cyclical outputs.
The image above compares our proposed MACD (top) with a regular MACD (bottom), both using fast = 19 and slow = 20 .
🔶 DETAILS
It is common to be solely interested in the trend component when the market is trending, however, during a ranging market it is more common to observe a more prominent cyclical/noise component. We want to be able to preserve one of the components at the appropriate market conditions, however, the regular MACD lack the ability to preserve cyclical component with high accuracy.
The MACD is an IIR bandpass filter. In order to obtain a lower passband bandwidth and a more symmetrical magnitude response (which would allow to conserve more precise cyclical variations) we can directly change the system calculation:
y = (price - price ) × g + ((1 - a1) + (1 - a2)) × y - (1 - a1) × (1 - a2) × y
where:
a1 = 2/(fast + 1)
a2 = 2/(slow + 1)
g = a1 - a2
Using division instead of multiplication on the second feedback weight allows further weighting the 2 samples lagged output, returning a more desirable magnitude response with a higher degree of filtering on both ends of the spectrum as shown in the image below:
We are interested in conserving cycles during ranging markets, and longer-term variations during trending markets, we can do this by interpolating between our two filter coefficients:
α × + (1 - α) ×
where 1 > α > 0 . α is measuring if the market is trending or ranging, with values closer to 1 indicating a trending market. We see that for higher values of α the original coefficient of the MACD is used. The image below shows various magnitude responses given multiple values of α :
We use a rolling R-Squared as α , this measurement has the benefit of indicating if the market is trending or ranging, as well as being constrained within range (0, 1), and having a U-shaped distribution.
If you are interested to learn more about the MACD see:
🔶 SETTINGS
R2 Period: Calculation window of the R-Squared.
Fast: Fast period for the calculation of the Adaptive MACD, lower values will return more noisy results.
Slow: Slow period for the calculation of the Adaptive MACD, higher values will return result with longer-term conserved variations.
Signal: Period of the EMA applied to the Adaptive MACD.
Liquidity Levels/Voids (VP) [LuxAlgo]The Liquidity Levels/Voids (VP) is a script designed to detect liquidity voids & levels by measuring traded volume at all price levels on the market between two swing points and highlighting the distribution of the liquidity voids & levels at specific price levels.
🔶 USAGE
Liquidity is a fundamental market force that shapes the trajectory of assets.
The creation of a liquidity level comes as a result of an initial imbalance of supply/demand, which forms what we know as a swing high or swing low. As more players take positions in the market, these are levels that market participants will use as a historical reference to place their stops. When the levels are then re-tested, a decision will be made. The binary outcome here can be a breakout of the level or a reversal back to the mean.
Liquidity voids are sudden price changes that occur in the market when the price jumps from one level to another with little trading activity (low volume), creating an imbalance in price. The price tends to fill or retest the liquidity voids area, and traders understand at which price level institutional players have been active.
Liquidity voids are a valuable concept in trading, as they provide insights about where many orders were injected, creating this inefficiency in the market. The price tends to restore the balance.
🔶 SETTINGS
The script takes into account user-defined parameters and detects the liquidity voids based on them, where detailed usage for each user-defined input parameter in indicator settings is provided with the related input's tooltip.
🔹 Liquidity Levels / Voids
Liquidity Levels/Voids: Color customization option for Unfilled Liquidity Levels/Voids.
Detection Length: Lookback period used for the calculation of Swing Levels.
Threshold %: Threshold used for the calculation of the Liquidity Levels & Voids.
Sensitivity: Adjusts the number of levels between two swing points, as a result, the height of a level is determined, and then based on the above-given threshold the level is checked if it matches the liquidity level/void conditions.
Filled Liquidity Levels/Voids: Toggles the visibility of the Filled Liquidity Levels/Voids and color customization option for Filled Liquidity Levels/Voids.
🔹 Other Features
Swing Highs/Lows: Toggles the visibility of the Swing Levels, where tooltips present statistical information, such as price, price change, and cumulative volume between the two swing levels detected based on the detection length specified above, Coloring options to customize swing low and swing high label colors, and Size option to adjust the size of the labels.
🔹 Display Options
Mode: Controls the lookback length of detection and visualization.
# Bars: Lookback length customization, in case Mode is set to Present.
🔶 RELATED SCRIPTS
Liquidity-Voids-FVG
Buyside-Sellside-Liquidity
Swing-Volume-Profiles
AI SuperTrend Clustering Oscillator [LuxAlgo]The AI SuperTrend Clustering Oscillator is an oscillator returning the most bullish/average/bearish centroids given by multiple instances of the difference between SuperTrend indicators.
This script is an extension of our previously posted SuperTrend AI indicator that makes use of k-means clustering. If you want to learn more about it see:
🔶 USAGE
The AI SuperTrend Clustering Oscillator is made of 3 distinct components, a bullish output (always the highest), a bearish output (always the lowest), and a "consensus" output always within the two others.
The general trend is given by the consensus output, with a value above 0 indicating an uptrend and under 0 indicating a downtrend. Using a higher minimum factor will weigh results toward longer-term trends, while lowering the maximum factor will weigh results toward shorter-term trends.
Strong trends are indicated when the bullish/bearish outputs are indicating an opposite sentiment. A strong bullish trend would for example be indicated when the bearish output is above 0, while a strong bearish trend would be indicated when the bullish output is below 0.
When the consensus output is indicating a specific trend direction, an opposite indication from the bullish/bearish output can highlight a potential reversal or retracement.
🔶 DETAILS
The indicator construction is based on finding three clusters from the difference between the closing price and various SuperTrend using different factors. The centroid of each cluster is then returned. This operation is done over all historical bars.
The highest cluster will be composed of the differences between the price and SuperTrends that are the highest, thus creating a more bullish group. The lowest cluster will be composed of the differences between the price and SuperTrends that are the lowest, thus creating a more bearish group.
The consensus cluster is composed of the differences between the price and SuperTrends that are not significant enough to be part of the other clusters.
🔶 SETTINGS
ATR Length: ATR period used for the calculation of the SuperTrends.
Factor Range: Determine the minimum and maximum factor values for the calculation of the SuperTrends.
Step: Increments of the factor range.
Smooth: Degree of smoothness of each output from the indicator.
🔹 Optimization
This group of settings affects the runtime performances of the script.
Maximum Iteration Steps: Maximum number of iterations allowed for finding centroids. Excessively low values can return a better script load time but poor clustering.
Historical Bars Calculation: Calculation window of the script (in bars).
SuperTrend AI (Clustering) [LuxAlgo]The SuperTrend AI indicator is a novel take on bridging the gap between the K-means clustering machine learning method & technical indicators. In this case, we apply K-Means clustering to the famous SuperTrend indicator.
🔶 USAGE
Users can interpret the SuperTrend AI trailing stop similarly to the regular SuperTrend indicator. Using higher minimum/maximum factors will return longer-term signals.
The displayed performance metrics displayed on each signal allow for a deeper interpretation of the indicator. Whereas higher values could indicate a higher potential for the market to be heading in the direction of the trend when compared to signals with lower values such as 1 or 0 potentially indicating retracements.
In the image above, we can notice more clear examples of the performance metrics on signals indicating trends, however, these performance metrics cannot perform or predict every signal reliably.
We can see in the image above that the trailing stop and its adaptive moving average can also act as support & resistance. Using higher values of the performance memory setting allows users to obtain a longer-term adaptive moving average of the returned trailing stop.
🔶 DETAILS
🔹 K-Means Clustering
When observing data points within a specific space, we can sometimes observe that some are closer to each other, forming groups, or "Clusters". At first sight, identifying those clusters and finding their associated data points can seem easy but doing so mathematically can be more challenging. This is where cluster analysis comes into play, where we seek to group data points into various clusters such that data points within one cluster are closer to each other. This is a common branch of AI/machine learning.
Various methods exist to find clusters within data, with the one used in this script being K-Means Clustering , a simple iterative unsupervised clustering method that finds a user-set amount of clusters.
A naive form of the K-Means algorithm would perform the following steps in order to find K clusters:
(1) Determine the amount (K) of clusters to detect.
(2) Initiate our K centroids (cluster centers) with random values.
(3) Loop over the data points, and determine which is the closest centroid from each data point, then associate that data point with the centroid.
(4) Update centroids by taking the average of the data points associated with a specific centroid.
Repeat steps 3 to 4 until convergence, that is until the centroids no longer change.
To explain how K-Means works graphically let's take the example of a one-dimensional dataset (which is the dimension used in our script) with two apparent clusters:
This is of course a simple scenario, as K will generally be higher, as well the amount of data points. Do note that this method can be very sensitive to the initialization of the centroids, this is why it is generally run multiple times, keeping the run returning the best centroids.
🔹 Adaptive SuperTrend Factor Using K-Means
The proposed indicator rationale is based on the following hypothesis:
Given multiple instances of an indicator using different settings, the optimal setting choice at time t is given by the best-performing instance with setting s(t) .
Performing the calculation of the indicator using the best setting at time t would return an indicator whose characteristics adapt based on its performance. However, what if the setting of the best-performing instance and second best-performing instance of the indicator have a high degree of disparity without a high difference in performance?
Even though this specific case is rare its however not uncommon to see that performance can be similar for a group of specific settings (this could be observed in a parameter optimization heatmap), then filtering out desirable settings to only use the best-performing one can seem too strict. We can as such reformulate our first hypothesis:
Given multiple instances of an indicator using different settings, an optimal setting choice at time t is given by the average of the best-performing instances with settings s(t) .
Finding this group of best-performing instances could be done using the previously described K-Means clustering method, assuming three groups of interest (K = 3) defined as worst performing, average performing, and best performing.
We first obtain an analog of performance P(t, factor) described as:
P(t, factor) = P(t-1, factor) + α * (∆C(t) × S(t-1, factor) - P(t-1, factor))
where 1 > α > 0, which is the performance memory determining the degree to which older inputs affect the current output. C(t) is the closing price, and S(t, factor) is the SuperTrend signal generating function with multiplicative factor factor .
We run this performance function for multiple factor settings and perform K-Means clustering on the multiple obtained performances to obtain the best-performing cluster. We initiate our centroids using quartiles of the obtained performances for faster centroids convergence.
The average of the factors associated with the best-performing cluster is then used to obtain the final factor setting, which is used to compute the final SuperTrend output.
Do note that we give the liberty for the user to get the final factor from the best, average, or worst cluster for experimental purposes.
🔶 SETTINGS
ATR Length: ATR period used for the calculation of the SuperTrends.
Factor Range: Determine the minimum and maximum factor values for the calculation of the SuperTrends.
Step: Increments of the factor range.
Performance Memory: Determine the degree to which older inputs affect the current output, with higher values returning longer-term performance measurements.
From Cluster: Determine which cluster is used to obtain the final factor.
🔹 Optimization
This group of settings affects the runtime performances of the script.
Maximum Iteration Steps: Maximum number of iterations allowed for finding centroids. Excessively low values can return a better script load time but poor clustering.
Historical Bars Calculation: Calculation window of the script (in bars).
QQE Weighted Oscillator [LuxAlgo]The QQE (Quantitative Qualitative Estimation) Weighted Oscillator improves on its original version by weighting the RSI based on the indications given by the trailing stop, requiring more effort in order for a cross with the trailing stop to occur.
🔶 USAGE
The QQE Weighted Oscillator is comprised of a smoothed RSI oscillator and a trailing stop derived from this same RSI. The oscillator can be used to indicate whether the market is overbought/oversold as well as an early indication of trend reversals thanks to the leading nature of the RSI.
Using higher Factor values will return a longer-term trailing stop.
Like with a regular RSI divergence can be indicative of a reversal.
Further weighting will control how much "effort" is required for the trailing stop to cross the RSI. For example. For example, an RSI above the trailing stop will require a higher degree of negative price variations in order for a potential cross to occur when using higher weights.
This can cause higher weightings to return more cyclical and smoother results.
🔶 SETTINGS
Length: Length of the RSI oscillator.
Factor: Multiplicative factor used for the trailing stop calculation.
Smooth: Degree of smoothness of the RSI oscillator.
Weight: Degree of weighting used for the RSI calculation.
Support & Resistance Dynamic [LuxAlgo]The Support & Resistance Dynamic indicator aims to return real-time predictive support and resistance zones that are relevant to a detected trend. This makes this indicator similar to our previously published Predictive Ranges indicator.
Users can additionally extend the most recent historical support and resistance zones.
🔶 USAGE
Hypothetical resistance levels in an up-trend or supports in a down-trend would tend to be broken more easily, as such the indicator primary objective is to return reliable real-time support and resistance levels by taking this into account.
When the market is up-trending the indicator will only return support zones, while a down-trending market will cause the indicator to only return resistance zones.
If the price significantly breaks a support/resistance, rendering it unreliable, it can be a sign of a potential reversal.
Users can return support/resistance levels/zones for shorter-term trends by reducing the Multiplicative Factor setting.
🔹 Extension
Users can extend past estimated support/resistance levels, the amount of extended levels is determined by the users. Certain levels can stay relevant in the future, and can also aid in measuring the significance of a breakout, with further past levels being reached being indicative of more significant trends.
🔶 DETAILS
To determine if the price is up-trending or down-trending in order to show either support or resistance, the same method used in the predictive ranges script is used. A central tendency is estimated, if price significantly deviates from it upward an uptrend is detected, else a significant deviation downward would indicate a downtrend.
The central tendency estimate is used for the construction of the support and resistance levels.
🔶 SETTINGS
Multiplicative Factor: Determines the frequency at which new supports/resistances are returned, with lower values returning more frequent levels/zones.
ATR Length: ATR averaging length used as deviation threshold for the central tendency estimate.
Extend Last: Determines the amount of most recent historical supports/resistances to extend to the latest bar.
Volume Delta Methods (Chart) [LuxAlgo]The Volume Delta Methods (Chart) aims at highlighting the relationship between Buying or Selling Pressure and Price by presenting Volume Delta , and multiple derivatives of volume delta such as Cumulative Volume Delta (CVD) , Buy/Sell Volume , Total Volume , etc on top of the Main Price Chart .
The script uses two different intrabar (chart bars at a lower timeframe than the chart's) analyses to achieve the most approximate calculation of the volume delta and offers fully customizable visualization features using various types of charts such as line, area, baseline, candles, and histograms.
The script allows traders to see "within" the price bar, provides more transparency over a traditional volume histogram, and also allows users to monitor price and volume activity together.
🔶 USAGE
Volume delta is the difference between the buying volume and the selling volume, in other words, it is the net demand at a given bar allowing traders a more detailed insight when analyzing the market sentiment. A volume delta greater than 0 indicates more buying than selling pressure, whereas a volume delta less than 0 indicates more selling than buying pressure.
Volume delta plus total volume (regular volume) adds additional insight, where the total volume represents all the recorded trades for security that occurs in a given time interval. It is a measurement of the participation, enthusiasm, and interest in a given security.
Divergences occur when the polarity of the volume delta does not match the polarity of the price bar.
The users can enable the display of the numerical values of the volume delta.
Cumulative Volume Delta (CVD) is a way of using Volume Delta to measure an asset’s mid-to-long-term buy and sell pressure. It compares buying and selling volume over time and offers insights into market behavior at specific price points. Cumulative Volume Delta is effectively a continuation of the principles of Volume Delta but involves longer time periods and offers different trading signals.
Like the Volume Delta, the Cumulative Volume Delta (CVD) indicator measures the relationship between buy and sell pressure but does not focus on one specific candle in particular. Rather, the Cumulative Volume Delta takes the relative differences and combines them all over an extended time period.
Users have the ability Cumulative Volume Delta in various types of charts along with an optional smoothing line.
Placed above price bars options.
Interacting with price bar options helps to better identify CVD Divergences.
CVD Divergences
CVD reveals buying and selling trends that may or may not complement the price trend of the asset itself. Sometimes, price trends can run in contrast to trading behavior — sell volume can be dominant while the spot price is rising, and vice versa.
🔶 DETAILS
Theoretically, volume delta is calculated by taking the difference between the volume that traded at the ask price and the volume that traded at the bid price. The most precise calculation method uses tick data but requires huge amounts of data on historical bars, which usually limits the historical depth of charts. This indicator uses two different intrabar analysis methods for the volume delta calculation, where intrabars are chart bars at a lower timeframe than the chart's timeframe:
The logic used to assign intrabar volume to the "up" or "down".
- Buying/Selling pressure of the intrabar option (default)
(close - low) > (high - close) => UP
(close - low) < (high - close) => DOWN
(close - low) = (high - close) => close - previous close is used
- Polarity of the intrabar option
close > open => UP
close < open => DOWN
close = open => close - previous close is used
🔶 SETTINGS
The script takes into account user-defined parameters and performs calculations and presentations based on them, where detailed usage for each user-defined input parameter in indicator settings is provided with the related input's tooltip.
🔹 Calculation Settings
Calculation Method: Calculation method selection, available options 'Intrabar Buying/Selling Pressure' or 'Intrabar Polarity'.
Lower Timeframe Precision: Sets indicator precision, default option is 'Auto'.
🔹 Presentation Settings
Volume Delta: Toggles the visibility of the Volume Delta
Cumulative Volume Delta: Toggles the visibility of the Cumulative Volume Delta
Volume Delta/Price Bar Divergences: Toggles the visibility of the Volume Delta Divergences
Volume Delta Numerical Values: Toggles the visibility of the Volume Delta Numerical Values
🔹 Other Features
Volume MA: Toggles the visibility of the Volume Moving Average
CVD Smoothing: Toggles the visibility of the Cumulative Volume Delta's Smoothing Line
🔹 Volume Delta, Others
Volume Delta: Positive, Negative: Volume Delta color customization options
Volume Histogram: Growing, Falling: Volume Histogram color customization options
Display Length: Length of the visual objects presented with this indicator
Volume Delta Height: Volume delta height customization options
Volume Histogram Height: Volume histogram height customization options
Vertical Offset: Volume delta and histogram vertical positioning customization options
🔹 Cumulative Volume Delta, Others
CVD Line, Width, and Color: Cumulative Volume Delta - Line Width and Color customization options
CVD Area/Baseline, Gradient Coloring: Cumulative Volume Delta - Area and Baseline background gradient coloring customization options
CVD Candles Color, Positive, and Negative: Cumulative Volume Delta - Candles coloring customization options
CVD/Smoothing Background: Highlights and adjusts the transparency of the area between the Cumulative Volume Delta Line and it's Smoothing Line
🔶 RELATED SCRIPTS
Liquidity-Sentiment-Profile
EquiVolume
Volume-Footprint
Master Pattern [LuxAlgo]The Master Pattern indicator is derived from the framework proposed by Wyckoff and automatically displays major/minor patterns and their associated expansion lines on the chart.
Liquidity levels are also included and can be used as targets/stops. Note that the Liquidity levels are plotted retrospectively as they are based on pivots.
🔶 USAGE
The Master Pattern indicator detects contraction phases in the markets (characterized by a lower high and higher low). The resulting average from the latest swing high/low is used as expansion line. Price breaking the contraction range upwards highlights a bullish master pattern, while a break downward highlights a bearish master pattern.
During the expansion phase price can tend to be stationary around the expansion level. This phase is then often followed by the price significantly deviating from the expansion line, highlighting a markup phase.
Expansion lines can also be used as support/resistance levels.
🔹 Major/Minor Patterns
The script can classify patterns as major or minor patterns.
Major patterns occur when price breaks both the upper and lower extremity of a contraction range, with their contraction area highlighted with a border, while minor patterns have only a single extremity broken.
🔶 SETTINGS
Contraction Detection Lookback: Lookback used to detect the swing points used to detect the contraction range.
Liquidity Levels: Lookback for the swing points detection used as liquidity levels. Higher values return longer term liquidity levels.
Show Major Pattern: Display major patterns.
Show Minor Pattern: Display minor patterns.
HyperTrend [LuxAlgo]The HyperTrend indicator aims to provide a real-time estimate of an underlying linear trend in the price. Support and resistance extremities are constructed from this estimate which can provide trade opportunities within the overall trend.
Most tools that return lines on a chart are either subject to backpainting or repainting. We aimed to provide a reliable real-time method to estimate linear trends in the price, enhancing traders' decision making processes when it comes to trading trends in price, hence the term 'HyperTrend'.
🔶 USAGE
Users can use the HyperTrend to easily determine the trend direction in the price, with an average sloping upward indicating an uptrend, and an average sloping downward indicating a downtrend.
The channels upper extremity can act as a resistance, while the lower extremity can act as a support. Contact with candle wicks can signal timely reversals/retracements.
Using a higher "Multiplicative Factor" value will return less frequent new channels, and is suitable to analyze longer-term trends. The slope settings on the other end allow us to control the slope of the returned channels, with higher values returning flatter results (similar to our previously posted predictive ranges).
🔹 Channel Average
The channel average can return an estimate of the current (and future) trend in the price, the chart below shows an interval where a linear regression is displayed alongside the channel average:
Unlike the linear regression, the average does not have any lookahead bias, this of course comes at the price of accuracy in most cases.
Users can also use this average as a support or resistance. The breakout of a TC average that has been tested multiple times can be considered more significant in suggesting a trend reversal.
🔶 SETTINGS
Multiplicative Factor: Control the allowed degree of deviation of the price from the average line. Higher values will return less frequent new channels.
Slope: Controls the steepness of the returned lines. Higher values will return flatter results.
Width %: Width percentage of the channel. Lower results will return narrower channels.
Extrapolated Previous Trend [LuxAlgo]The Extrapolated Previous Trend indicator extrapolates the estimated linear trend of the prices within a previous interval to the current interval. Intervals can be user-defined.
🔶 USAGE
Returned lines can be used to provide a forecast of trends, assuming trends are persistent in sign and slope.
Using them as support/resistance can also be an effecting usage in case the trend in a new interval does not follow the characteristic of the trend in the previous interval.
The indicator includes a dashboard showing the degree of persistence between segmented trends for uptrends and downtrends. A higher value is indicative of more persistent trend signs.
A lower value could hint at an anti-persistent behavior, with uptrends over an interval often being followed by a down-trend and vice versa. We can invert candle colors to determine future trend direction in this case.
🔶 DETAILS
This indicator can be thought of as a segmented linear model ( a(n)t + b(n) ), where n is the specific interval index. Unlike a regular segmented linear regression model, this indicator is not subject to lookahead bias, coefficients of the model are obtained on previous intervals.
The quality of the fit of the model is dependent on the variability of its coefficients a(n) and b(n) . Coefficients being less subject to change over time are more indicative of trend persistence.
🔶 SETTINGS
Timeframe: Determine the frequency at which new trends are estimated.
Liquidity Voids (FVG) [LuxAlgo]The Liquidity Voids (FVG) indicator is designed to detect liquidity voids/imbalances derived from the fair value gaps and highlight the distribution of the liquidity voids at specific price levels.
Fair value gaps and liquidity voids are both indicators of sell-side and buy-side imbalance in trading. The only difference is how they are represented in the trading chart. Liquidity voids occur when the price moves sharply in one direction forming long-range candles that have little trading activity, whilst a fair value is a gap in price.
🔶 USAGE
Liquidity can help you to determine where the price is likely to head next. In conjunction with higher timeframe market structure, and supply and demand, liquidity can give you insights into potential price movement. It's essential to practice using liquidity alongside trend analysis and supply and demand to read market conditions effectively.
The peculiar thing about liquidity voids is that they almost always fill up. And by “filling”, we mean the price returns to the origin of the gap. The reason for this is that during the gap, an imbalance is created in the asset that has to be made up for. The erasure of this gap is what we call the filling of the void. And while some voids waste no time in filling, some others take multiple periods before they get filled.
🔶 SETTINGS
The script takes into account user-defined parameters and detects the liquidity voids based on them, where detailed usage for each user-defined input parameter in indicator settings is provided with the related input's tooltip.
🔹 Liquidity Detection
Liquidity Voids Threshold: Act as a filter while detecting the Liquidity Voids. When set to 0 basically means no filtering is applied, increasing the value causes the script to check the width of the void compared to a fixed-length ATR value
Bullish: Color customization option for Bullish Liquidity Voids
Bearish: Color customization option for Bearish Liquidity Voids
Labels: Toggles the visibility of the Liquidity Void label
Filled Liquidity Voids: Toggles the visibility of the Filled Liquidity Voids
🔹 Display Options
Mode: Controls the lookback length of detection and visualization
# Bars: Lookback length customization, in case Mode is set to Present
🔶 RELATED SCRIPTS
Buyside-Sellside-Liquidity
Fair-Value-Gaps
ICT Silver Bullet [LuxAlgo]The ICT Silver Bullet indicator is inspired from the lectures of "The Inner Circle Trader" (ICT) and highlights the Silver Bullet (SB) window which is a specific 1-hour interval where a Fair Value Gap (FVG) pattern can be formed.
When a FVG is formed during the Silver Bullet window, Support & Resistance lines will be drawn at the end of the SB session.
There are 3 different Silver Bullet windows (New York local time):
The London Open Silver Bullet (3 AM — 4 AM ~ 03:00 — 04:00)
The AM Session Silver Bullet (10 AM — 11 AM ~ 10:00 — 11:00)
The PM Session Silver Bullet (2 PM — 3 PM ~ 14:00 — 15:00)
🔶 USAGE
The ICT Silver Bullet indicator aims to provide users a comprehensive display as similar as possible to how anyone would manually draw the concept on their charts.
It's important to use anything below the 15-minute timeframe to ensure proper setups can display. In this section, we are purely using the 3-minute timeframe.
In the image below, we can see a bullish setup whereas a FVG was successfully retested during the Silver Bullet session. This was then followed by a move upwards to liquidity as our target.
Alternatively, you can also see below a bearish setup utilizing the ICT Silver Bullet indicator outlined.
At this moment, the indicator has removed all other FVGs within the Silver Bullet session & has confirmed this FVG as the retested one.
There is also a support level marked below to be used as a liquidity target as per the ICT Silver Bullet concept suggests.
In the below chart we can see 4 separate consecutive examples of bullish & bearish setups on the 3-minute chart.
🔶 CONCEPTS
This technique can visualize potential support/resistance lines, which can be used as targets.
The script contains 2 main components:
• forming of a Fair Value Gap (FVG)
• drawing support/resistance (S/R) lines
🔹 Forming of FVG
1 basic principle: when a FVG at the end of the SB session is not retraced, it will be made invisible.
Dependable on the settings, different FVG's will be shown.
• 'All FVG': all FVG's are shown, regardless the trend
• 'Only FVG's in the same direction of trend': Only FVG's are shown that are similar to the trend at that moment (trend can be visualized by enabling ' Show ' -> ' Trend ')
-> only bearish FVG when the trend is bearish vs. bullish FVG when trend is bullish
• 'strict': Besides being similar to the trend, only FVG's are shown when the closing price at the end of the SB session is:
– below the top of the FVG box (bearish FVG)
– above bottom of the FVG box (bullish FVG)
• 'super-strict': Besides being similar to the trend, only FVG's are shown when the FVG box is NOT broken
in the opposite direction AND the closing price at the end of the SB session is:
– below bottom of the FVG box (bearish FVG)
– above the top of the FVG box (bullish FVG)
' Super-Strict ' mode resembles ICT lectures the most.
🔹 Drawing support/resistance lines
When the SB session has ended, the script draws potential support/resistance lines, again, dependable on the settings.
• Previous session (any): S/R lines are fetched between current and previous session.
For example, when current session is ' AM SB Session (10 AM — 11 AM) ', then previous session is
' London Open SB (3 AM — 4 AM) ', S/R lines between these 2 sessions alone will be included.
• Previous session (similar): S/R lines are fetched between current and previous - similar - session.
For example, when current session is ' London Open SB (3 AM — 4 AM)' , only S/R lines between
current session and previous ' London Open SB (3 AM — 4 AM) ' session are included.
When a new session starts, S/R lines will be removed, except when enabling ' Keep lines (only in strict mode) '
This is not possible in ' All FVG ' or ' Only FVG's in the same direction of trend ' mode, since the chart would be cluttered.
Note that in ' All FVG ' or ' Only FVG's in the same direction of trend ' mode, both, Support/Resistance lines will be shown,
while in Strict/Super-Strict mode:
• only Support lines will be shown if a bearish FVG appears
• only Resistance lines if a bullish FVG is shown
The lines will still be drawn the the end of the SB session, when a valid FVG appears,
but the S/R lines will remain visible and keep being updated until price reaches that line.
This publication contains a "Minimum Trade Framework (mTFW)", which represents the best-case expected price delivery, this is not your actual trade entry - exit range.
• 40 ticks for index futures or indices
• 15 pips for Forex pairs.
When on ' Strict/Super-Strict ' mode, only S/R lines will be shown which are:
• higher than the lowest FVG bottom + mTFW, in a bullish scenario
• lower than the highest FVG bottom - mTFW, in a bearish scenario
When on ' All FVG/Only FVG's in the same direction of trend ' mode, or on non-Forex/Futures/Indices symbols, S/R needs to be higher/lower than SB session high/low.
🔶 SETTINGS
(Check CONCEPTS for deeper insights and explanation)
🔹 Swing settings (left): Sets the length, which will set the lookback period/sensitivity of the Zigzag patterns (which directs the trend)
🔹 Silver Bullet Session; Show SB session: show lines and labels of SB session
Labels can be disabled separately in the ' Style ' section, color is set at the ' Inputs ' section.
🔹 FVG
– Mode
• All FVG
• Only FVG's in the same direction of trend
• Strict
• Super-Strict
– Colors
– Extend: extend till last bar of SB session
🔹 Targets – support/resistance lines
– Previous session (any): S/R lines fetched between current and previous SB session
– Previous session (similar): S/R lines fetched between current and previous similar SB session
– Colors
– Keep lines (only in strict mode)
🔹 Show
– MSS ~ Session: Show Market Structure Shift , only when this happens during a SB session
– Trend: Show trend (Zigzag, colored ~ trend)
Predictive Ranges [LuxAlgo]The Predictive Ranges indicator aims to efficiently predict future trading ranges in real-time, providing multiple effective support & resistance levels as well as indications of the current trend direction.
Predictive Ranges was a premium feature originally released by LuxAlgo in 2020.
The feature was discontinued & made legacy, however, due to its popularity and reproduction attempts, we deemed it necessary to release it open source to the community.
🔶 USAGE
The primary purpose of this indicator is to provide potential support & resistance levels on the chart by estimating future trading ranges.
When the price reaches one of the upper/lower levels of the Predictive Ranges we can expect the price to reverse.
If the price exits the predicted range, new levels are given in real-time & they do not repaint. Higher "Factor" values allow returning longer term and wider ranges less susceptible to be exited.
🔹 Estimating Trend Directions
Users are able to easily estimate trend directions by looking at the central levels of the predictive ranges, which represent an estimate of the price central tendency.
If this central level increases it means the price is up-trending, if it is decreasing price is down-trending.
🔶 SETTINGS
Length: ATR Length used for the indicator calculation. Higher values will tend to return ranges of equal width.
Factor: Control the ranges width. Higher values will return less frequent ranges, each having a higher width.
Timeframe: Indicator timeframe output.
Source: Input source of the indicator. It is recommended to use input sources on the same scale as the price.
Liquidity Sentiment Profile [LuxAlgo]The Liquidity Sentiment Profile is an advanced charting tool that measures by combining PRICE and VOLUME data over specified anchored periods and highlights within a sequence of profiles the distribution of the liquidity and the market sentiment at specific price levels.
The Liquidity Sentiment Profile allows traders to reveal significant price levels, dominant market sentiment, support and resistance levels, supply and demand zones, liquidity availability levels, liquidity gaps, consolidation zones, and more based on price and volume data.
Liquidity refers to the availability of orders at specific price levels in the market, allowing transactions to occur smoothly.
🔶 USAGE
A Liquidity Sentiment Profile is a combination of a liquidity and a sentiment profile, where the right part of the profile displays the distribution of the traded activity at different price levels and the left part displays the market sentiment at those price levels.
The Liquidity Sentiment Profiles are visualized with different colors, where each color has a different meaning.
The Liquidity Sentiment Profiles aim to present Value Areas based on the significance of price levels, thus allowing users to identify value areas that can be formed more than once within the range of a single profile.
Level of Significance Line - displays the changes in the price levels with the highest traded activity (developing POC)
🔶 SETTINGS
The script takes into account user-defined parameters and plots the profiles, where detailed usage for each user-defined input parameter in indicator settings is provided with the related input's tooltip.
🔹 Liquidity Sentiment Profiles
Anchor Period: The indicator resolution is set by the input of the Anchor Period, the default option is AUTO.
🔹 Liquidity Profile Settings
Liquidity Profile: Toggles the visibility of the Liquidity Profiles
High Traded Nodes: Threshold and Color option for High Traded Nodes
Average Traded Nodes: Color option for Average Traded Nodes
Low Traded Nodes: Threshold and Color option for Low Traded Nodes
🔹 Sentiment Profile Settings
Sentiment Profile: Toggles the visibility of the Sentiment Profiles
Bullish Nodes: Color option for Bullish Nodes
Bearish Nodes: Color option for Bearish Nodes
🔹 Other Settings
Level of Significance: Toggles the visibility of the Level of Significance Line
Profile Price Levels: Toggles the visibility of the Profile Price Levels
Number of Rows: Specify how many rows each profile histogram will have. Caution, having it set to high values will quickly hit Pine Script™ drawing objects limit and fewer historical profiles will be displayed
Profile Width %: Alters the width of the rows in the histogram, relative to the profile length
Profile Range Background Fill: Toggles the visibility of the Profiles Range
🔶 LIMITATIONS
The amount of drawing objects that can be used is limited, as such using a high number of rows can display fewer historical profiles and occasionally incomplete profiles.
🔶 RELATED SCRIPTS
🔹 Buyside-Sellside-Liquidity
🔹 ICT-Concepts
🔹 Swing-Volume-Profiles
Supply and Demand Daily [LuxAlgo]The Supply and Demand Daily indicator displays daily supply and demand areas on the user's chart. These areas are constructed using the market data within a previous daily interval.
This script makes use of the same logic as our previous Supply and Demand Visible Range indicator .
🔶 USAGE
The supply/demand areas & levels displayed by the indicator aim to provide potential support/resistance levels for users. Supply areas highlight where buyers are willing to exit the market and sell the asset, thus providing resistance and potentially causing prices to reverse or bounce back downwards, while demand areas highlights where buyers were willing to purchase the asset, thus providing support and potentially causing prices to reverse or bounce back upwards.
Historical areas allow the user to study the evolution of supply/demand from one day to another. Wider areas highlight prices avoiding reverting to this area, while thinner areas highlight prices returning more frequently to them.
Trends can be determined by looking at the price position relative to the previous day's supply/demand areas. Price breaking down from the demand zone is indicative of a downtrend, while price breaking above the supply zone is indicative of an uptrend.
Pullback/throwback scenarios can also be common using this indicator.
🔶 SETTINGS
Threshold %: Percentage of the total visible range volume used as a threshold to set supply/demand areas. Higher values return wider areas.
Resolution: Determines the number of bins used to find each area. Higher values will return more precise results.
Intra-bar TF: Timeframe used to obtain intra-bar data.
🔶 RELATED SCRIPTS
Market Structure CHoCH/BOS (Fractal) [LuxAlgo]The Market Structure CHoCH/BOS (Fractal) indicator is an experimental take on classical market structure, whereas fractal patterns are used for their construction instead of swing points.
Compared to utilizing swing points for highlighting market structure like our Smart Money Concepts indicator , fractal-based market structure can appear as more adaptive, however, it can also be more restrictive when it comes to returning swing points which can cause the indicator to miss reversals in some cases.
If enabled from within the settings, users can see support and resistance levels returned from the detected market structure with breakouts highlighted on the chart. Alongside this feature, an additional dashboard showing the structure to fractal structure percentage is also provided.
🔶 SETTINGS
Length: Length of the fractal patterns to detect.
🔹 Style
Bullish Structures: Show bullish structures.
Bearish Structures: Show bullish structures.
Support: Show support levels.
Resistance: Show resistance levels.
🔹 Dashboard
Show Dashboard: Show structure to fractal percentage dashboard on the chart.
Location: Location of the dashboard on the chart.
Size: Dashboard size.
🔶 USAGE
Market structure is commonly used to determine trend direction by using price positions relative to prior swing points. Using fractal patterns to determine market structure can allow users to obtain shorter, more frequent structure labels.
Market structure is commonly classified as follows:
Change of Character (CHoCH), also referred to as Market Structure Shift (MSS)
Break of Structure (BOS), also referred to as Market Structure Break (MSB)
Change of Characters indicate a shift in the market trend, confirming trend reversals. Break of Structures on the other hand occur once a trend is already determined, confirming new higher highs/lower lows.
Using higher length values allow users to detect longer-term fractals, thus highlighting longer-term market structures. The image above detects fractal patterns made of 7 candles, even if the increment is only of 2 bars this significantly reduces the amount of detected market structure labels.
The result obtained by utilizing fractals and higher settings can be a more dynamic view of market structure, however, as seen in the image above this can introduce very significant delay compared to utilizing pure swing points.
🔹 Support/Resistance
The indicator also returns support/resistance levels constructed from the market structure, these levels are obtained similarly to order blocks, finding the minimum on the interval of a bullish market structure and the maximum of a bearish market structure.
Price reaching a support/resistance level can be expected to bounce from it. Once a level is broken, the support/resistance level will no longer extend, and a circle will be displayed highlighting the break.
While utilizing this script for fractal-based market structure, these levels can be useful to ensure all swing points are still considered by the user with the possibility of the indicator missing reversals due to its calculation not being based on swing points themselves.
🔹 Dashboard
The dashboard reports the structure to fractal percentage, that is the amount of bullish/bearish market structures relative to the total amount of detected bullish/bearish fractal patterns.
This allows us to see how often a detected fractal pattern is used to display a market structure.
🔶 DETAILS
🔹 Fractals
In the context of technical analysis, Fractals refer to specific patterns that exhibit self-similarity at different scales or timeframes.
The most commonly known fractal pattern consists of a consecutive sequence of candles (more commonly 5), with the central candle being the lowest (in case of a bullish fractal) or highest (in case of a bearish fractal).
A bullish fractal has candles on the right side of the central candle with increasing lows, while candles on the left side have decreasing lows.
A bearish fractal has candles on the right side of the central candle with decreasing highs, while candles on the left side have increasing highs.
🔶 RELATED SCRIPTS
🔹 Smart Money Concepts
🔹 Market Structure Trailing Stop
🔹 ICT Concepts
Reversal Signals [LuxAlgo]The Reversal Signals indicator is a technical analysis tool that aims to identify when a trend is fading and potentially starting to reverse.
As a counter-trend tool, the Reversal Signals indicator aims to solve the problem of several technical analysis indicators that perform well during trending markets but struggle in ranging markets. By understanding the key concepts and applications of the tool, traders can enhance their market timing and improve their trading strategies.
Note: It's important to explore the settings of the indicator to customize to your own usage & display as there are various options available as covered below.
🔶 USAGE
The Reversal Signals indicator is comprised of two main phases: Momentum Phase and Trend Exhaustion Phase . These phases help identify potential trend reversals in bullish, bearish, and ranging markets.
🔹The Momentum Phase
The momentum phase consists of a 9-candle count and in rare cases 8-candle count. In a bullish trend, a starting number ‘1’ is plotted if a candle closes higher than the close of a candle four periods ago. In a bearish trend, a starting number ‘1’ is plotted if a candle closes lower than the close of a candle four periods ago.
The following numbers are plotted when each successive candle satisfies the four-period rule. The potential reversal point comes when the Reversal Signals plot a label on top of a candle in a bullish trend or at the bottom of a candle in a bearish trend. The momentum phase is immediately canceled if, at any point, a candle fails to satisfy the four-period rule.
Based on the extremes of the momentum phase, the Reversal Signals generate support & resistance levels as well as risk/stop levels.
🔹 The Trend Exhaustion Phase
The trend exhaustion phase starts after completing the momentum phase and consists of a 13-candle count. In a bullish trend exhaustion phase, each candle’s close is compared to the close of two candles earlier, and the close must be greater than the close two periods earlier. In a bearish trend exhaustion phase, each candle’s close is compared to the close of two candles earlier, and the close must be lower than the close two periods earlier.
The trend exhaustion phase does not require a consecutive sequence of candles; if the order of candles is interrupted, the trend exhaustion phase is not canceled. The trend exhaustion phase generates stronger trading signals than the momentum phase, with the potential for longer-lasting price reversals.
🔹 Trading Signals
The Reversal Signals script presents an overall setup and some phase-specific trade setup options, where probable trades might be considered. All phase-specific trade setups, presented as options, are triggered once the selected phase is completed and followed by a price flip in the direction of the trade setup.
Please note that those setups are presented for educational purposes only and do not constitutes professional and/or financial advice
- Momentum: Enter a trade at momentum phase completion, and search for buy (sell) when the bullish (bearish) momentum phase pattern is complete. Ideally, the momentum phase completion should close near its support/resistance line but shall not be above them, which indicates continuation of the trend
- Exhaustion: Enter a trade on trend exhaustion phase completion, and search for buy (sell) when the bullish (bearish) trend exhaustion phase is complete
- Qualified: Buy (sell) when a bullish (bearish) trend exhaustion phase combined with another bullish (bearish) momentum phase sequence is complete
Long trade setups are presented with "L" label and short trade setups with "S" label, where the content of the label displays details related to the probable trade opportunity
Once a phase-specific trade setup is triggered then the Reversal Signals script keeps checking the status of the price action relative to the phase-specific trade setups and in case something goes wrong presents a caution label. Pay attention to the content of the caution labels as well as where they appear. A trade signal, followed immediately by a warning indication can be assumed as a continuation of the underlying trend and can be traded in the opposite direction of the suggested signal
It is strongly advised to confirm trading setups in conjunction with other forms of technical and fundamental analysis, including technical indicators, chart/candlestick pattern analysis, etc.
🔶 DETAILS
The Reversal Signals script performs the detection of the phases by counting the candlestick meeting the specific conditions, which includes:
- Detection of the 8th and 9th candle perfection during the momentum phase
- In some cases, the 8th count will be assumed as momentum phase completion
- Trend exhaustion phase counting stops in case any type of momentum phase completion is detected during the counting process
- Postponing the last count of the trend exhaustion phase, the 13th candle must be below/above the 8th candle and if not the candles will be indicated with '+' sign under them and the script continues to search for a 13th candle at the next ones until the conditions are met
🔶 ALERTS
When an alert is configured, the user will have the ability to be notified in case;
Momentum / Trend Exhaustion phase completion
Support & Resistance level cross detection
Stop / Risk level cross detection
Long / Short Trade Setups are triggered
Please note, alerts are available with 'any alert() function call' and the alerts will be received only for the features that are enabled during alert configuration
🔶 SETTINGS
🔹 Momentum Phase
Display Phases: displays the momentum phases, where the Completed option allows the display of only completed momentum phases. The detailed option allows the display of the entire process of the momentum phase processes
Support & Resistance Levels: Toggles the visibility of the Support & Resistance Levels and Line Styling options
Momentum Phase Risk Levels: Toggles the visibility of the momentum phase Stop/Risk Levels and Line Styling options
For color options please refer to the options available under the style tab
🔹 Trend Exhaustion Phase
Display Phases: displays the trend exhaustion phases, where the Completed option allows the display of only completed trend exhaustion phases. The detailed option allows the display of the entire process of the trend exhaustion phase processes
Trend Exhaustion Phase Risk Levels: Toggles the visibility of the trend exhaustion phase Stop/Risk Levels
Trend Exhaustion Phase Target Levels: Toggles the visibility of the trend exhaustion phase Target Levels
For color options please refer to the options available under the style tab
🔹 Trade Setups
Overall Trend Direction & Trade Setup: displays the overall trend and probable trade setup levels, the users should search for a price flip and confirm with other means of technical and fundamental analysis for the trade setups once the label is plotted
Phase-Specific Trade Setup Options
Momentum: Searches for a trade setup after momentum phase completion
Exhaustion: Searches for a trade setup after trend exhaustion phase completion, stronger trend reversal possibility compared to momentum phase setup
Qualified: Searches for a trade setup after the trend exhaustion phase followed by a momentum phase completion
None: No trade setups are presented
Price Flips against the Phase Specific Trade Setups: enables checking the price action relative to the phase-specific trade setups
🔶 RELATED SCRIPTS
Here are the scripts that may add additional insight during potential trading decisions.
Buyside-Sellside-Liquidity
Support-Resistance-Classification