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).
LUX
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.
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
Volume Profile Regression Channel [LuxAlgo]The Volume Profile Regression Channel calculates a volume profile from an anchored linear regression channel. Users can choose the starting and ending points for the indicator calculation interval.
Like a regular volume profile, a "line" of control (LOC), value area, and a developing LOC are displayed.
🔶 SETTINGS
Sections: The number of sections the linear regression channel is divided into for the calculation of the volume profile.
Width %: Determines the length of the profile within the channel relative to the channel length.
Value Area %: Highlights the sections starting from the POC whose accumulated volume is equal to the user-defined percentage of the total profile sections volume.
🔶 USAGES
Regular volume profiles are often constructed from a horizontal price area, this can allow highlighting price areas where most trading activity takes place.
However, when price is strongly trending a classical volume profile can sometimes be more uniform. This is where using an angled volume profile can be useful.
The line of control allows highlighting the section of the channel with the most accumulated volume, this line can be used as a potential future support/resistance. This is where an angled volume profile might be the most useful.
The developing LOC highlights the LOC location at a specific time within the profile (from left to right) and can sometimes provide an estimate of the underlying trend in the price.
🔶 DETAILS
To be computed the script requires a left and right chart time coordinates. When adding the script to their charts users can determine the left and right time coordinates by clicking on the chart.
The linear regression channel width is determined so that the channel precisely encompasses the whole price.
🔶 LIMITATIONS
Using a very large calculation interval can return timeouts. Users can reduce the calculation interval to fix that issue from occurring.
The amount of drawing objects that can be used is limited, as such using a high calculation interval can display an incomplete profile.
🔶 ACKNOWLEDGEMENTS
If you are interested in these types of scripts, @HeWhoMustNotBeNamed published a similar script where users can use a custom line angle. See his 'Angled Volume Profile' script from March 2023.
ICT NWOG/NDOG & EHPDA [LuxAlgo]This indicator displays New Week/Day Opening Gaps alongside Event Horizon PD Arrays which were conceptualized by a trader, ICT.
🔶 SETTINGS
Show: Determines if new week opening gaps (NWOG) or new day opening gaps (NDOG) are shown.
Amount: Controls the amount of most recent NWOGs/NDOGs to display on the chart.
Show EHPDA: Displays Event Horizons PD arrays.
🔶 USAGE
New Week/Day Opening Gaps are generally used as potential support or resistance areas.
Trader ICT describes that under consolidating market conditions, price tends to revert towards the opening gap area. This is consistent with other analysis suggesting that price has a tendency to come back toward gaps, ultimately looking to fill them.
ICT also introduces a novel concept, the "Event Horizon PD Array" (EHPDA) which are intermediary levels constructed from the average between the neighboring NWOGs or NDOGs.
EHPDA's are described by ICT as levels that "will not allow price to escape to the NWOG that will create a surge towards the NWOG it got too "close" to but has not yet reached."
The Strat [LuxAlgo]The Strat indicator is a full toolkit regarding most of the concepts within "The Strat" methodology with features such as candle numbering, pivot machine gun (PMG) highlighting, custom combo highlighting, and various statistics included.
Alerts are also included for the detection of specific candle numbers, custom combos, and PMGs.
🔶 SETTINGS
Show Numbers on Chart: Shows candle numbering on the chart.
Style Candles: Style candles based on the detected number. Only effective on non-line charts and if the script is brought to the front.
🔹 Custom Combo Search
Combo: User defined combo to be searched by the script. Combos can be composed of any series of numbers including (1, 2, -2, 3), e.g : 2-21. No spaces or other characters should be used.
🔹 Pivot Machine Gun
Show Labels: Highlight detected PMGs with a label.
Min Sequence Length: Minimum sequence length of consecutive higher lows/lower highs required to detect a PMG.
Min Breaks: Minimum amount of broken previous highs/lows required to detect a PMG.
Show Levels: Show levels of the broken highs/lows.
🔹 Pivot Combos
Pivot Lookback: Lookback period used for detecting pivot points.
Right Bars Scan: Number of bars scanned to the right side of a detected pivot.
Left Bars Scan: Number of bars scanned to the left side of a detected pivot.
🔹 Dashboard
Show Dashboard: Displays statistics dashboard on chart.
Numbers Counter: Displays the numbers counter section on the dashboard.
Pivot Combos: Displays pivots combo section on the dashboard.
%: Display the percentage of detected pivot combos on the dashboard instead of absolute numbers.
Pivot Combos Rows: Number of rows displayed by the "Pivots Combo" dashboard section.
Show MTF: Showa MTF candle numbering on the dashboard.
Location: Location of the dashboard on the chart.
Size: Size of the displayed dashboard.
🔶 USAGE
This script allows users with an understanding of The Strat to quickly highlight elements such as candle numbers, pivot machine guns, and custom combos. The usage for these concepts is given in the sub-sections below.
🔹 Candle Numbers
The Strat assigns a number to individual candles, this number is determined by the current candle position relative to the precedent candle, these include:
Number 1 - Inside bar, occurs when the previous candle range engulfs the current one.
Number 2 Up - Upside Directional Bar, occurs when the current price high breaks the previous high while the current low is lower than the previous high.
Number 2 Down - Downside Directional Bar, occurs when the current price low breaks the previous low while the current high is higher than the previous low.
Number 3 - Outside bar, occurs when the current candle range engulfs the previous one.
The script can highlight the number of a candle by using labels but can also style candles by depending on the candle number. Inside bars (1) only have their candle wick highlighted, directional bars (2) (-2) only have their candle body highlighted. Outside bars have their candle range highlighted.
Note that downside directional bars are highlighted with the number -2.
Users can see the total amount of times a specific candle number is detected on the historical data on the dashboard available within the settings, as well as the number of times a candle number is detected relative to the total amount of detected candle numbers expressed as a percentage.
It is also possible to see the current candle numbers returned by multiple timeframes on the dashboard.
🔹 Searching For Custom Combos
Combos are made of a sequence of two or more candle numbers. These combos can highlight multiple reversals/continuation scenarios. Various common combos are documented by The Strat community.
This script allows users to search for custom combos by entering them on the Combo user setting field.
When a user combo is found, it is highlighted on the chart as a box highlighting the combo range.
🔹 Pivot Combos
It can be of interest to a user to display the combo associated with a pivot high/low. This script will highlight the location of pivot points on the chart and display its associated combo by default. These are based on the Pivot Combo lookback and not displayed in real-time.
Users can see on the dashboard the combos associated with a pivot high/low, these are ranked by frequency.
🔹 Pivot Machine Gun (PMG)
Pivot Machine Guns (PMG)s describe the scenario where a single price variation breaks the value of multiple past successive higher lows/lower highs. This can highlight a self-exciting behavior, where even more past successive higher lows/lower highs get broken.
Users can select the minimum sequence length of successive higher lows/lower highs required for a PMG to be detected, as well the amount of these successive higher lows/lower highs that must be broken.
Currency Strength [LuxAlgo]The Currency Strength indicator displays the historical relative strength of 5 user selected currencies over a user selected period of time. Users can also display relative strength of currencies as a scatter plot, further informing on the evolution of currency strength.
🔶 SETTINGS
Display: Determines the type of data displayed by the indicator. By default, the trailing relative strength of currencies is displayed, with the other option displaying the scatter plot.
Timeframe: Timeframe period used to calculate currency relative strength.
🔹 Meter
Show Strength Meter: Displays the currency strength meter on the indicator panel.
Strength Meter Resolution: Resolution of the currency strength meter, higher resolutions allow to observe smaller difference in strength.
Location: Location of the currency strength meter on the indicator pane.
Size: Size of the currency strength meter.
🔹 Relative Strength Scatter Graph
Scatter Graph Resolution: Horizontal and vertical width of the scatter plot (in bars). Higher values allow a more precise position on the X axis.
🔶 USAGE
Measuring the relative strength of a currency allows users to assess the relative performance of a currency against a basket of other currencies.
The term "strength" can convey various interpretations depending on the indicator. Here "strength" is interpreted as an indicator of performance, with stronger currencies having greater performances over the selected period (positive changes of higher magnitude).
The Currency Strength indicator allows users to analyze the relative strength of currencies over a user selected period - the returned results will reset periodically and will accumulate afterward.
The above chart shows the hourly relative strength of various currencies on the 1min TF.
🔹 Scatter Graph
The scatter graph displays the relative strength of a currency over its value during the previous period. This not only allows users to see if a currency is strong... but also if it's getting stronger compared to the previous period.
In order to quickly interpret results, the graph is divided into four areas. A currency (displayed as a point) being in a specific area returns the following information:
Strong(Green): Currency has a positive relative strength (bullish) and is greater than its value over the previous period.
Improving (Yellow): Currency has a negative relative strength (bearish) and is greater than its value over the previous period.
Weakening (Aqua): Currency has a positive relative strength (bullish) and is lower than its value over the previous period.
Weak (Red): Currency has a negative relative strength (bearish) and is lower than its value over the previous period.
🔶 DETAILS
There is a wide variety of methods for the calculation of a currency's relative strength. The primary focus of the indicator is on the meter as well as the relative strength scatter graph. The currency strength calculation can be considered more basic.
Given two currencies, B (base) and Q (quote), the proposed indicator calculation process is as follows:
Exchange rate BQ(t) over time t is obtained, a rising value of BQ(t) means that a unit of B is now worth a higher amount of Q , highlighting strength of B over Q on that precise variation.
The individual relative strength over time IRS(t) is obtained as the percentage relatively close to the open difference of BQ(t) , that is:
IRS(t) = / open(t) * 100
Normalizing the close to open difference allows for the various currencies' relative strengths to approximately share the same scale.
The above operation is performed n times over a space of n currencies O( n ) . The obtained individual relative strengths for one specific currency are then added together, forming the final composite relative strength ( CRS ) of that currency:
CRS (t) = IRS (t) + IRS (t) + ... + IRS (t)
The cumulative sum of CRS(t) over the user selected period is then obtained.
Liquidity Swings [LuxAlgo]The liquidity swings indicator highlights swing areas with existent trading activity. The number of times price revisited a swing area is highlighted by a zone delimiting the swing areas. Additionally, the accumulated volume within swing areas is highlighted by labels on the chart. An option to filter out swing areas with volume/counts not reaching a user-set threshold is also included.
This indicator by its very nature is not real-time and is meant for descriptive analysis alongside other components of the script. This is normal behavior for scripts detecting pivots as a part of a system and it is important you are aware the pivot labels are not designed to be traded in real-time themselves.
🔶 USAGE
The indicator can be used to highlight significant swing areas, these can be accumulation/distribution zones on lower timeframes and might play a role as future support or resistance.
Swing levels are also highlighted, when a swing level is broken it is displayed as a dashed line. A broken swing high is a bullish indication, while a broken swing low is a bearish indication.
Filtering swing areas by volume allows to only show significant swing areas with an higher degree of liquidity. These swing areas can be wider, highlighting higher volatility, or might have been visited by the price more frequently.
🔶 SETTINGS
Pivot Lookback : Lookback period used for the calculation of pivot points.
Swing Area : Determine how the swing area is calculated, "Wick Extremity" will use the range from price high to the maximum between price close/open in case of a swing high, and the range from price low to the minimum between price close/open in case of a swing low. "Full Range" will use the full candle range as swing area.
Intrabar Precision : Use intrabar data to calculate the accumulated volume within a swing area, this allows obtaining more precise results.
Filter Areas By : Determine how swing areas are filtered out, "Count" will filter out swing areas where price visited the area a number of time inferior to the user set threshold. "Volume" will filter out swing areas where the accumulated volume within the area is inferior to the user set threshold.
🔹 Style
Swing High : Show swing highs.
Swing Low : Show swing lows.
Label Size : Size of the labels on the chart.
Note that swing points are confirmed after Pivot Lookback bars, as such all elements are displayed retrospectively.
DR/IDR Candles [LuxAlgo]This indicator displays defining ranges (DR) and implied defining ranges (IDR) constructed from two user set sessions (RDR/ODR) as graphical candles on the chart. The script introduces additional graphical elements to the original DR/IDR concept and as such can be thought as a graphical method in addition to a technical indicator.
Additionally, this script can display various Fibonacci retracements from the constructed DR/IDR if enabled within the settings.
Settings
Regular Session: Enable/disable regular session's DR/IDR alongside setting the session time. By default, 09:30 - 10:30 am.
Overnight Session: Enable/disable overnight session's DR/IDR alongside setting the session time. By default, 03:00 - 04:00 am.
UTC Offset: UTC offset for the time zone, by default -5 (EST)
Retracements
Reverse: Inverts source range upper/lower value for constructing the retracements.
From: Source range used to construct the retracements, by default DR is used.
By default, the 0.5 retracement (average line) is displayed.
Usage
The used sessions are highlighted by a gray background. DRs are highlighted by dashed lines while IDRs are highlighted by solid ones. The maximum/minimum price between each user set session is highlighted by solid wicks.
The color of the DRs/IDRs/wicks are determined by the price position relative to the DR; if price is above the DR maximum, then a blue color is used. If price is below, then an orange color is used, and if price is within the DR range, then a gray color is used.
Additionally, the area of the DR range is used to highlight the number of time price is located within the DR, with a longer background highlighting a higher number of occurrences. This can help highlight if the DR levels were potentially useful as support/resistance.
When price is outside the IDR range, the area between the price and IDR is highlighted, in blue if price is above the IDR, and orange if it is under.
The original author of the DR/IDR concept describes 3 rules using the price position relative to the DR/IDR levels:
1.) If price on the 5-minute timeframe closes above the DR high after 10:30 AM or 04:00 AM then the DR low will likely be the low of the trading session.
2.) If price on the 5-minute timeframe closes below the DR low after 10:30 AM or 04:00 AM then the DR high will likely be the high of the trading session.
3.) If price closes above the IDR high after 10:30 AM or 04:00 AM it is an early indication that the low of the DR will be the low of the day and vice versa.
We can see that the above rules are cases of conditional probabilities.
There is no significant data supporting or regarding any statistical probability of the above rules to be true, which are more than uncertain given the stochastic nature of prices. The lack of precision of these rules is also a concern (time zone dependance, applicable markets, etc...).
Credits
Credits to trader TheMas7er who originally created the DR/IDR concept in November of 2022. This script was derived from his proposed session times & rules for trading.
ICT Killzones [LuxAlgo]This script highlights ICT Killzones on the chart along with Fibonacci retracements constructed from each Killzone's price range, allowing traders to find more optimal entries.
Settings
Killzone Retracements
Show Retracements: Determines whether Fibonacci retracements are displayed on the chart.
Extend: Determines if the retracements are extended outside the Killzone.
Reverse: Switches the maximum and minimum levels for the calculation of the retracements.
Other settings allow disabling as well as changing the retracement value and color.
Usage
Killzones are introduced by forex trader ICT and represent different time intervals that aims at offering optimal trade entries. Killzones include:
New York Killzone (7:9 ET)
London Open Killzone (2:5 ET)
London Close Killzone (10:12 ET)
Asian Killzone (20:00 ET)
Note that using timeframes superior to 1h can highlight incorrect intervals
Fibonacci retracements on an active Killzone are subject to changes, if no Killzones are active then the associated Fibonacci retracements will stay at their current level.
Disabling specific Killzones while having extended retracements will allow them to extend further. In the image above the New York and Asian Killzones are disabled.
Imbalance Detector [LuxAlgo]This indicator detects and highlights market imbalances alongside a dashboard returning information about their frequency of occurrence and their fill percentage. Imbalances included in this script are Fair Value Gaps (FVG), Opening Gaps (OG) and Volume Imbalances (VI).
Alerts are available for the occurrences of all market imbalances.
Settings
Imbalances
Each imbalance has the same settings layout:
Imbalance: Enable/disable the detection of the specific imbalance.
Min Width: If enabled, requires the imbalance area width to be greater than the specified value. This minimum width can be expressed in points, percentages or ATR multiples.
Extend: Extend imbalances by a specified number of bars.
Dashboard
Show Dashboard: Enable/disable the dashboard on the chart.
Dashboard Location: Location of the dashboard on the chart.
Dashboard Size: Size of the dashboard.
Usage
Market imbalances are part of the many concepts available to price action traders and highlight areas where there is a disparity between supply and demand.
It is common to see price come back to these areas and traders often use them as supports and resistances but also as targets.
Details
The script can detect three distinct types of imbalances described below.
Fair Value Gaps
Fair Value Gaps (FVG) are three candle formations characterized by a gap between the wicks of the non-adjacent candles in the formation.
A bullish FVG is characterized by a gap between the current price low and the 2 bars anterior price high, and a bearish FVG is characterized by a gap between the current price high and the 2 bars anterior price low.
Opening Gaps
Opening Gaps (OG) are imbalances characterized by non-existent activity within a specific price range.
A bullish OG occurs when the current price low is greater than the previous high, a bearish OG occurs when price high is lower than the previous price low.
Opening Gaps primarily occur in closing markets, as such they are less common in the cryptocurrency market.
Most of the time an Opening Gap will also be accompanied by a Fair Value Gap, in order to avoid clutter the indicator will not detect Fair Value Gaps if Opening Gaps are enabled and if an Opening Gap has been detected
Volume Imbalances
Volume Imbalances (VI) are characterized by a price discontinuity between the opening price and previous close, but unlike Opening Gaps we do not see nonexistent activity within a certain price range.
A bullish VI occur when both the opening and closing prices are superior to the previous closing price, with the current price low overlapping the previous price high. A bearish VI occur when both the opening and closing prices are inferior to the previous closing price, with the current price high overlapping the previous price low.
Because Volume Imbalances can occur excessively on markets with frequent gaps, we make use of an additional condition for filtering out less significant imbalances. Bullish VI's will require the previous price high to be lower than the opening price, while bullish VI's will require the previous price low to be higher than the opening price.
Sessions [LuxAlgo]This indicator shows when user set sessions are active and returns various tools + metrics using the closing price within active sessions as an input. Users have the option to change up to 4 session times.
The indicator will increasingly lack accuracy when the chart timeframe is higher than 1 hour.
Settings
Sessions
Enable Session: Allows to enable or disable all associated elements with a specific user set session.
Session Time: Opening and closing times of the user set session in the hh:mm format.
Range: Highlights the associated session range on the chart.
Trendline: Returns the associated session trendline on the chart.
Mean: Returns the associated session mean average on the chart.
VWAP: Returns the associated session volume weighted average price on the chart.
Ranges Settings
Range Area Transparency: Transparency of the area highlighting sessions ranges.
Range Outline: Highlights the borders of the session range area.
Range Label: Shows the session label at the mid-point of the session interval.
Dashboard
Show Dashboard: Enables sessions dashboard on the chart.
Advanced Dashboard: Returns more information regarding user set sessions on the dashboard.
Dividers
Show Session Divider: Highlights active sessions using intervals on the bottom of the chart (this can lead to less responsive charts)
Show Daily Divider: Highlights days on the chart.
Usage
This tool is versatile and allows the user to perform a wide variety of tasks all focusing on highlighting and analyzing price movements within a specific user set session in a periodic fashion.
Significant forex trading sessions are used by default, but the users are free to choose the opening and closing time of their choices.
Using ranges can indicate which sessions returned the most volatile price movements.
Trendlines can be useful to estimate the underlying trend of a specific session, but they can also offer a quick way to see which session started a trend reversal.
The session Mean highlights the equilibrium level within a session, extrapolating these levels can provide potential support and resistances levels of interest.
Finally, users can use the sessions VWAP's for real time applications, using them as trailing supports and resistances.
Using The Advanced Dashboard
The advanced dashboard returns useful information regarding the user set sessions. Each dashboard elements are described below:
Status: Highlights whether the user set session is active (open) of inactive (closed).
Trend: Shows correlation coefficient between the session prices and a linear sequence of values. Values above 0 indicates an up-trending session, while values under 0 indicates a down-trending session. Values closer to (1, -1) indicates a more trending session.
Volume: Shows accumulated volume within the session
σ (Standard Deviation): Shows standard deviation of the session, while this value is not bounded it can be useful to compare it with the other ones to see which session was the most volatile.
Note that when a session becomes inactive the value on the dashboard will hold until the specific session becomes active again.
Smart Money Concepts (SMC) [LuxAlgo]This all-in-one indicator displays real-time market structure (internal & swing BOS / CHoCH), order blocks, premium & discount zones, equal highs & lows, and much more...allowing traders to automatically mark up their charts with widely used price action methodologies. Following the release of our Fair Value Gap script, we received numerous requests from our community to release more features in the same category.
"Smart Money Concepts" (SMC) is a fairly new yet widely used term amongst price action traders looking to more accurately navigate liquidity & find more optimal points of interest in the market. Trying to determine where institutional market participants have orders placed (buy or sell side liquidity) can be a very reasonable approach to finding more practical entries & exits based on price action.
The indicator includes alerts for the presence of swing structures and many other relevant conditions.
Features
This indicator includes many features relevant to SMC, these are highlighted below:
Full internal & swing market structure labeling in real-time
Break of Structure (BOS)
Change of Character (CHoCH)
Order Blocks (bullish & bearish)
Equal Highs & Lows
Fair Value Gap Detection
Previous Highs & Lows
Premium & Discount Zones as a range
Options to style the indicator to more easily display these concepts
Settings
Mode: Allows the user to select Historical (default) or Present, which displays only recent data on the chart.
Style: Allows the user to select different styling for the entire indicator between Colored (default) and Monochrome.
Color Candles: Plots candles based on the internal & swing structures from within the indicator on the chart.
Internal Structure: Displays the internal structure labels & dashed lines to represent them. (BOS & CHoCH).
Confluence Filter: Filter non-significant internal structure breakouts.
Swing Structure: Displays the swing structure labels & solid lines on the chart (larger BOS & CHoCH labels).
Swing Points: Displays swing points labels on chart such as HH, HL, LH, LL.
Internal Order Blocks: Enables Internal Order Blocks & allows the user to select how many most recent Internal Order Blocks appear on the chart.
Swing Order Blocks: Enables Swing Order Blocks & allows the user to select how many most recent Swing Order Blocks appear on the chart.
Equal Highs & Lows: Displays EQH/EQL labels on chart for detecting equal highs & lows.
Bars Confirmation: Allows the user to select how many bars are needed to confirm an EQH/EQL symbol on chart.
Fair Value Gaps: Displays boxes to highlight imbalance areas on the chart.
Auto Threshold: Filter out non-significant fair value gaps.
Timeframe: Allows the user to select the timeframe for the Fair Value Gap detection.
Extend FVG: Allows the user to choose how many bars to extend the Fair Value Gap boxes on the chart.
Highs & Lows MTF: Allows the user to display previous highs & lows from daily, weekly, & monthly timeframes as significant levels.
Premium/Discount Zones: Allows the user to display Premium, Discount, and Equilibrium zones on the chart
Usage
Users can see automatic CHoCH and BOS labels to highlight breakouts of market structure, which allows to determine the market trend. In the chart below we can see the internal structure which displays more frequent labels within larger structures. We can also see equal highs & lows (EQH/EQL) labels plotted alongside the internal structure to frequently give indications of potential reversals.
In the chart below we can see the swing market structure labels. These are also labeled as BOS and CHoCH but with a solid line & larger text to show larger market structure breakouts & trend reversals. Users can be mindful of these larger structure labels while trading internal structures as displayed in the previous chart.
Order blocks highlight areas where institutional market participants open positions, one can use order blocks to determine confirmation entries or potential targets as we can expect there is a large amount of liquidity at these order blocks. In the chart below we can see 2 potential trade setups with confirmation entries. The path outlined in red would be a potential short entry targeting the blue order block below, and the path outlined in green would be a potential long entry, targeting the red order blocks above.
As we can see in the chart below, the bullish confirmation entry played out in this scenario with the green path outlined in hindsight. As price breaks though the order blocks above, the indicator will consider them mitigated causing them to disappear, and as per the logic of these order blocks they will always display 5 (by default) on the chart so we can now see more actionable levels.
The Smart Money Concepts indicator has many other features and here we can see how they can also help a user find potential levels for price action trading. In the screenshot below we can see a trade setup using the Previous Monthly High, Strong High, and a Swing Order Block as a stop loss. Accompanied by the Premium from the Discount/Premium zones feature being used as a potential entry. A potential take profit level for this trade setup that a user could easily identify would be the 50% mark labeled with the Fair Value Gap & the Equilibrium all displayed automatically by the indicator.
Conclusion
This indicator highlights all relevant components of Smart Money Concepts which can be a very useful interpretation of market structure, liquidity, & more simply put, price action. The term was coined & popularized primarily within the forex community & by ICT while making its way to become a part of many traders' analysis. These concepts, with or without this indicator do not guarantee a trader to be trading within the presence of institutional or "bank-level" liquidity, there is no supporting data regarding the validity of these teachings.
Hull Butterfly Oscillator [LuxAlgo]The Hull Butterfly Oscillator (HBO) is an oscillator constructed from the difference between a regular Hull Moving Average (HMA) and another with coefficients flipped horizontally.
Levels are obtained from cumulative means of the absolute value of the oscillator. These are used to return dots indicating potential reversal points.
Settings
Length: Number of past price inputs processed by the oscillator.
Levels Multiplier: Determine how far the levels are from 0.
Src: Input source of the indicator.
Usage
The oscillator can be used like most available oscillators. The sign of the HBO allows determining the current trend direction, while divergences with price might indicate potential reversals.
The displayed levels can additionally indicate whether the market is overbought or oversold. When the direction of the oscillator changes while being above the upper or lower level a red dot (if above upper level) or green dot (if under lower level) will be displayed, indicating a potential reversal.
Details
The name of the indicator is directly derived behind the coefficients used for its calculation. Displaying regular Hull coefficients alongside those flipped horizontally slightly resemble a butterfly, the difference between these sets of coefficients allows obtaining the HBO.
This operation allows to obtain a more structured impulse response, potentially giving less undesired performances on the frequency domain compared to simpler operation involving subtracting the HMA to a SMA, EMA or WMA.
Squeeze Index [LuxAlgo]The Squeeze Index aims to measure the action of price being squeezed, and is expressed as a percentage, with higher values suggesting prices are subject to a higher degree of compression.
Settings
Convergence Factor: Convergence factor of exponential envelopes.
Length: Period of the indicator.
Src: Source input of the indicator.
Usage
Prices being squeezed refer to the action of price being compressed within a tightening area. Prices in a tight area logically indicate a period of stationarity, price breaking out of this area will generally indicate the trader whether to buy or sell depending on the breakout direction.
The convergence factor and length settings both play an important role in the returned indicator values. A convergence factor greater than the period value will detect more squeezed prices area, while a period greater than the convergence will return fewer detected squeezed areas.
We recommend using a convergence factor equal to the period setting or a convergence factor twice as high.
The above chart makes use of a convergence factor of 100 and a period of 10.
Due to the calculation method, it is possible to see retracements being interpreted as price squeezing. This effect can be emphasized with higher convergence factor values.
Details
In order to measure the effect of price being squeezed in a tighter area we refer to damping, where the oscillations amplitude of a system decrease over time. If the envelopes of a damped system can be estimated, then getting the difference between the upper and lower extremity of these envelopes would return a decreasing series of values.
This approach is used here. First the difference between the exponential envelopes extremities is obtained, the logarithm of this difference if obtained due to the extremities converging exponentially toward their input.
We then use the correlation oscillator to get a scaled measurement.
Signal Moving Average [LuxAlgo]The following script returns a moving average designed to be used as a signal line in a moving average crossover system. The moving average will diverge from the price during ranging markets and reach the value of a regular moving average during trending markets.
Settings
Length: Moving average period
Src: Source input of the indicator
Usage
Moving average crossover strategies often rely on a "signal" line, a slower moving average used to determine a general trend. This signal line is paired with a faster moving average to filter out potential whipsaw trades that would have been given from crosses between the regular price and the signal line.
The proposed indicator will avoid crossing the price by diverging from it during more ranging periods, thus effectively reducing the number of crosses produced between the price and the signal line.
The color of the area between the price and the signal line is determined by the position of the price relative to the signal line, with a green color indicator a price superior to the signal line.
The color of the signal line, however, is taking into account whether market is trending or ranging, only changing once the market is trending.
The chart above shows the cumulated number of crosses between the price and the signal line (green) and a regular simple moving average of the same period (red) on AMD 15m, a lowered number of crosses can effectively reduce the impact of frictional costs introduced by whipsaw trades.
Candlestick Channels [LuxAlgo]Candlestick Channels return channels whose extremities converge towards the price when a corresponding candlestick pattern is detected. This allows for us to obtain more reactive extremities in the presence of a cluster of candlestick patterns.
The detected candlestick patterns are also highlighted with labels on your chart automatically.
Settings
Trend Length: Period of the stochastic oscillator used to determine trend sentiment; this sentiment is used to detect certain candlestick patterns.
Convergence: Convergence percentage of the channel extremities used during the occurrence of a candlestick pattern. A lower value will return extremities converging more slowly toward the price.
Smooth: Determines the degree of smoothness of the channel extremities.
Patterns
This category determines which patterns are detected by the indicator. Patterns toggled off will not be detected and won't affect the channels.
Usage
Candlesticks patterns are commonly used by traders to detect potential reversals or continuation periods in the price. It can be of interest to use them as core elements in the calculation of more classical indicators, this can allow us to filter out potential false signals returned by candlestick patterns by shifting the source of interpretation towards the channel extremities instead.
In this indicator extremities converge towards the price when a corresponding pattern is detected. As such bullish patterns will make the upper extremity converge towards the price, facilitating a cross with price. Using a lower convergence percentage will require a greater number of patterns to make the extremity converge closer towards the price.
Users can use the channel like most indicators returning extremities, with an uptrend being detected when price cross over the upper extremity and a downtrend being detected when price cross under the lower extremity.
An approach solely making use of crosses between the price and the average line can be used but the user should expect further whipsaws signals.
Users can eventually use the candlestick patterns as entries and use the extremities for confirmation. For example, users can follow a candlestick pattern return an indication in accordance with the detected trend by the channels.
This approach would lead to the following of bullish patterns when they occur in an uptrend, that is when the price is above the average line (in orange). The same logic applies to bearish patterns.
The chart above highlights the candlesticks patterns in accordance with a detected trend.
Notes
- Bullish/Bearish engulfing patterns are turned off by default due their more frequent appearance.
- Candlestick patterns relying on gaps were not included, since they would be more uncommon in cryptocurrencies, thus leading to a disparity between the indicator performance on the cryptocurrency and stock market.
Fair Value Gap [LuxAlgo]Fair value gaps (FVG) highlight imbalances areas between market participants and have become popular amongst technical analysts. The following script aims to display fair value gaps alongside the percentage of filled gaps and the average duration (in bars) before gaps are filled.
Users can be alerted when an FVG is filled using the alerts built into this script.
🔶 USAGE
In practice, FVG's highlight areas of support (bullish FVG) and resistances (bearish FVG). Once a gap is filled, suggesting the end of the imbalance, we can expect the price to reverse.
This approach is more contrarian in nature, users wishing to use a more trend-following approach can use the identification of FVG as direct signals, going long with the identification of a bullish FVG, and short with a bearish FVG.
🔹 Mitigation
By default, the script highlights the areas of only unmitigated FVG's. Users can however highlight the mitigation level of mitigated FVG's, that is the lower extremity of bullish FVG's and the upper extremity of bearish FVG's.
The user can track the evolution of a mitigated FVG's using the "Dynamic" setting.
🔹 Threshold
The gap height can be used to determine the degree of imbalance between buying and selling market participants. Users can filter fair value gaps based on the gap height using the "Threshold %" setting. Using the "Auto" will make use of an automatic threshold, only keeping more volatile FVG's.
🔶 DETAILS
We use the following rules for detecting FVG's in this script:
Bullish FVG
low > high(t-2)
close(t-1) > high(t-2)
(low - high(t-2)) / high(t-2) > threshold
Upper Bullish FVG = low
Lower Bullish FVG = high(t-2)
Bearish FVG
high < low(t-2)
close(t-1) < low(t-2)
(low(t-2) - high) / high < -threshold
Upper Bearish FVG = low(t-2)
Lower Bearish FVG = high
🔶 SETTINGS
Threshold %: Threshold percentage used to filter our FVG's based on their height.
Auto Threshold: Use the cumulative mean of relative FVG heights as threshold.
Unmitigatted Levels: Extent the mitigation level of the number of unmitigated FVG's set by the user.
Mitigation Levels: Show the mitigation levels of mitigated FVG's.
Timeframe : Timeframe of the price data used to detect FVG's.