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.
Luxalgo
Order Block Detector [LuxAlgo]This script makes use of high-volume activity as an indicator of the presence of market participants accumulating orders in specific areas on a lower timeframe by detecting volume peaks to form order blocks.
Mitigated order blocks are automatically hidden from the chart, also allowing users to be able to select two different mitigation methods "wick" and "close".
Additionally, users can be alerted for the creation and mitigation of bullish/bearish order blocks.
Settings
Volume Pivot Length: Lookback of the pivot function used to detect volume peaks, lower values will detect order blocks more frequently.
Bullish OB: Determines the number of most recent unmitigated bullish order blocks to display on the chart.
Bearish OB: Determines the number of most recent unmitigated bullish order blocks to display on the chart.
Bearish OB: Determines the number of most recent unmitigated bullish order blocks to display on the chart.
Average Line Style: Line style of the average order block level.
Average Line Width: Line width of the average order block level.
Mitigation Methods: Method used to determine how an order block is mitigated. "Wick" will mitigate order blocks if the candle wick goes outside of the order block and "Close" will mitigate order blocks if the closing price goes outside of the order block.
Usage
It is common for more significant market participants to execute orders incrementally in order to avoid overwhelming the market and cause significant price movements. This practice allows the orders to be executed more efficiently and effectively, reducing the impact on the market and minimizing the potential for price volatility.
Order blocks are price areas where these orders are executed incrementally and are commonly used as areas of support/resistance for traders.
Bearish order blocks occur during a downtrend, while bullish order blocks occur in an uptrend. Bullish order blocks range from the price low to the median price, while bearish order blocks range from the median price to the price high. The median price is used as an equilibrium point.
Users can highlight the bars where an order block was detected from the style settings by toggling on the 'Bull OB' or 'Bear OB' selections.
Note that in order to confirm a peak Volume Pivot Length bars are needed, as such note that order blocks are shown retrospectively.
Nadaraya-Watson non repainting [LPWN]// ENGLISH
The problem of the wonderfuls Nadaraya-Watson indicators is that they repainting, @jdehorty made an aproximation of the Nadaraya-Watson Estimator using raational Quadratic Kernel so i used this indicator as inspiration i just added the Upper and lower band using ATR with this we get an aproximation of Nadaraya-Watson Envelope without repainting
Settings:
Bandwidth. This is the number of bars that the indicator will use as a lookback window.
Relative Weighting Parameter. The alpha parameter for the Rational Quadratic Kernel function. This is a hyperparameter that controls the smoothness of the curve. A lower value of alpha will result in a smoother, more stretched-out curve, while a lower value will result in a more wiggly curve with a tighter fit to the data. As this parameter approaches 0, the longer time frames will exert more influence on the estimation, and as it approaches infinity, the curve will become identical to the one produced by the Gaussian Kernel.
Color Smoothing. Toggles the mechanism for coloring the estimation plot between rate of change and cross over modes.
ATR Period. Period to calculate the ATR (upper and lower bands)
Multiplier. Separation of the bands
// SPANISH
El problema de los maravillosos indicadores de Nadaraya-Watson es que repintan, @jdehorty hizo una aproximación delNadaraya-Watson Estimator usando un Kernel cuadrático racional, así que usé este indicador como inspiración y solo agregamos la banda superior e inferior usando ATR con esto obtenemos una aproximación de Nadaraya-Watson Envelope sin volver a pintar
Configuración:
Banda ancha. Este es el número de barras que el indicador utilizará como ventana retrospectiva.
Parámetro de ponderación relativa. El parámetro alfa para la función Rational Quadratic Kernel. Este es un hiperparámetro que controla la suavidad de la curva. Un valor más bajo de alfa dará como resultado una curva más suave y estirada, mientras que un valor más bajo dará como resultado una curva más ondulada con un ajuste más ajustado a los datos. A medida que este parámetro se acerque a 0, los marcos de tiempo más largos ejercerán más influencia en la estimación y, a medida que se acerque al infinito, la curva será idéntica a la que produce el Gaussian Kernel.
Suavizado de color. Alterna el mecanismo para colorear el gráfico de estimación entre la tasa de cambio y los modos cruzados.
Período ATR. Periodo para calcular el ATR (bandas superior e inferior)
Multiplicador. Separación de las bandas
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.
Moving Averages Proximity Oscillator [LuxAlgo]This indicator returns the percentage or count of prices greater than simple moving averages with periods in a user set range, as well as the moving average period that is the closest to price values.
Settings
Minimum Length: Minimum SMA period
Maximum Length: Maximum SMA period
Smooth: Control the degree of smoothness of the indicator outputs
Normalized: Normalize the indicator outputs in a range (0, 100)
Src: Input source of the indicator
Usage
The indicator returns two outputs.
The "Price Above MA's" output returns for a current price value the number of times this one is greater than simple moving averages with periods ranging from Minimum Length to Maximum Length . This oscillator can be expressed as a percentage if Normalized is selected.
This oscillator allows identifying the direction of an underlying trend in the price. Higher Minimum Length and Maximum Length settings will return indications regarding longer term price variations, while shorter ranges will return less detailed outputs. This can be seen in the chart above where Minimum Length = 80 to Maximum Length = 100 .
The "Proximity Index" output on the other end does not return information regarding the direction of an underlying trend but the period of the simple moving average with periods ranging from Minimum Length to Maximum Length that is the closest to the current price value.
For various simple moving averages of differing periods, we can see that SMA's with shorter periods will tend to stay closer to the price, when price start reverting it will reach higher periods moving averages.
As such, this second indicator output can help identify the start of new trends, with higher values indicating price is reverting toward longer-term moving averages, suggesting a new trend forming.
TF Segmented Polynomial Regression [LuxAlgo]This indicator displays polynomial regression channels fitted using data within a user selected time interval.
The model is fitted using the same method described in our previous script:
Settings
Degree: Degree of the fitted polynomial
Width: Multiplicative factor of the model RMSE. Controls the width of the polynomial regression's channels
Timeframe: Fits the polynomial regression using data within the selected timeframe interval
Show fit for new bars: If selected, will fit the regression model for newly generated bars, else the previous fitted value is displayed.
Src: Input source
Usage
Segmented (or piecewise) models yield multiple fits by first partitioning the data into multiple intervals from specific partitioning conditions. In this script this partitioning condition is for a user selected timeframe to change.
Segmented models can be particularly pertinent for market prices, which often describes a series of local trends.
Segmented polynomial regressions can describe the nature of underlying trends in the price from their fit, such as if an underlying trend is more linear (trending) or constant (ranging), and if a trend is monotonic.
The above chart shows a monthly partitioning on SPX 15m, using a polynomial regression of degree 3. Channel extremities allows highlighting local tops/bottoms.
For real time applications users can choose to fit a current model to incoming price data using the Show fit for new bars settings.
Details
The script does not make use of line.new to display the segmented linear regressions, which allows showing a higher number of historical fits. Each channel extremity as well as the model fit is displayed from the plot function, as such user can more easily set alerts on them.
It is important to note that achieving this requires accessing future price data, as such this script is subject to lookahead bias, historical results differ from the results one could have obtained in real-time.
Moving Average Converging [LuxAlgo]This indicator returns a moving average converging toward the price the more a trend makes new higher-highs or lower-lows depending on the detected trend.
Settings
Length: Controls the initial moving average smoothing factor ( 2 / (Length + 1) ), as well as the period of rolling maximums/minimums.
Increment: Smoothing factor increment ( 2 / (Increment+ 1) ) for new higher-high/lower-low, lower values would return a faster converging moving average.
Fast: Fast moving average smoothing factor.
Usage
The proposed moving average can be used like most slow moving averages.
Having a moving average able to converge closer to the price the longer a trend lasts allows users to obtain more timely crosses. This practice can remind us of the Parabolic SAR or our TRAMA indicator:
Notice on the chart above how the moving average converges at an increasing rate with the occurrence of new high-highs/lower-lows.
Visible Range Mean Deviation Histogram [LuxAlgo]This script displays a histogram from the mean and standard deviation of the visible price values on the chart. Bin counting is done relative to high/low prices instead of counting the price values within each bin, returning a smoother histogram as a result.
Settings
Bins Per Side: Number of bins computed above and below the price mean
Deviation Multiplier: Standard deviation multiplier
Style
Relative: Determines whether the bins length is relative to the maximum bin count, with a length controlled with the width settings to the left.
Bin Colors: Bin/POC Lines colors
Show POCs: Shows point of controls
Usage
Histograms are generally used to estimate the underlying distribution of a series of observations, their construction is generally done taking into account the overall price range.
The proposed histogram construct N intervals above*below the mean of the visible price, with each interval having a size of: σ × Mult / N , where σ is the standard deviation and N the number of Bins per side and is determined by the user. The standard deviation multipliers are highlighted at the left side of each bin.
A high bin count reflects a higher series of observations laying within that specific interval, this can be useful to highlight ranging price areas.
POCs highlight the most significant bins and can be used as potential support/resistances.
Parabolic SAR Oscillator [LuxAlgo]This indicator is a detrended price series using the Parabolic Stop and Reverse (SAR) trailing stop, resulting in a bounded oscillator in the range (-100, 100). The SAR output is also normalized to obtain a noiseless oscillator which can complement the detrended price.
Settings
Start: Initial value of the convergence factor used when a new trend is detected by the SAR
Increment: Increment value of the convergence factor
Maximum: Maximum value of the convergence factor
Usage
The price is detrended by subtracting the closing price to the SAR, this result is then normalized.
An up-trending market is indicated once the normalized SAR reaches -100, while a value of 100 indicates a down-trending market. One can anticipate trends when the normalized SAR crosses above/under 0.
The converging nature of the SAR trailing stop allows for the trader to obtain a very apparent leading oscillator.
Polynomial Regression Extrapolation [LuxAlgo]This indicator fits a polynomial with a user set degree to the price using least squares and then extrapolates the result.
Settings
Length: Number of most recent price observations used to fit the model.
Extrapolate: Extrapolation horizon
Degree: Degree of the fitted polynomial
Src: Input source
Lock Fit: By default the fit and extrapolated result will readjust to any new price observation, enabling this setting allow the model to ignore new price observations, and extend the extrapolation to the most recent bar.
Usage
Polynomial regression is commonly used when a relationship between two variables can be described by a polynomial.
In technical analysis polynomial regression is commonly used to estimate underlying trends in the price as well as obtaining support/resistances. One common example being the linear regression which can be described as polynomial regression of degree 1.
Using polynomial regression for extrapolation can be considered when we assume that the underlying trend of a certain asset follows polynomial of a certain degree and that this assumption hold true for time t+1...,t+n . This is rarely the case but it can be of interest to certain users performing longer term analysis of assets such as Bitcoin.
The selection of the polynomial degree can be done considering the underlying trend of the observations we are trying to fit. In practice, it is rare to go over a degree of 3, as higher degree would tend to highlight more noisy variations.
Using a polynomial of degree 1 will return a line, and as such can be considered when the underlying trend is linear, but one could improve the fit by using an higher degree.
The chart above fits a polynomial of degree 2, this can be used to model more parabolic observations. We can see in the chart above that this improves the fit.
In the chart above a polynomial of degree 6 is used, we can see how more variations are highlighted. The extrapolation of higher degree polynomials can eventually highlight future turning points due to the nature of the polynomial, however there are no guarantee that these will reflect exact future reversals.
Details
A polynomial regression model y(t) of degree p is described by:
y(t) = β(0) + β(1)x(t) + β(2)x(t)^2 + ... + β(p)x(t)^p
The vector coefficients β are obtained such that the sum of squared error between the observations and y(t) is minimized. This can be achieved through specific iterative algorithms or directly by solving the system of equations:
β(0) + β(1)x(0) + β(2)x(0)^2 + ... + β(p)x(0)^p = y(0)
β(0) + β(1)x(1) + β(2)x(1)^2 + ... + β(p)x(1)^p = y(1)
...
β(0) + β(1)x(t-1) + β(2)x(t-1)^2 + ... + β(p)x(t-1)^p = y(t-1)
Note that solving this system of equations for higher degrees p with high x values can drastically affect the accuracy of the results. One method to circumvent this can be to subtract x by its mean.
Bollinger Bands Breakout Oscillator [LuxAlgo]The Bollinger Bands Breakout Oscillator is an oscillator returning two series quantifying the significance of breakouts between the price and the extremities of the Bollinger Bands indicator.
Settings
Length: Period of the Bollinger Bands indicator
Mult: Controls the width of the Bollinger Bands
Src: Input source of the indicator
Usage
Each series is calculated by summing the distance between price and a respective Bollinger Bands extremity in the case price is outside this extremity and divided by the sum of the absolute distance between price and a respective extremity. This sum is done over the most recent Length bars.
Bullish breakouts are represented by the green areas of the indicator, while bearish breakouts are represented by the red areas of the indicator.
The oscillator can determine the presence of an uptrend when the bullish area is superior to the bearish area, while a downtrend is indicated by a bearish area being superior to the bullish one. The significance of the breakout is determined by the amplitude of each area, with higher amplitudes indicating more significant breakouts or strong trends.
Using higher Mult values would naturally return wider bands, which would induce less frequent breakouts, this would be highlighted by the oscillator.
In the chart above we can see the oscillator using a multiplicative factor of 2.
Horns Pattern Identifier [LuxAlgo]The following script detects regular and inverted horn patterns. Detected patterns are displayed alongside their respective confirmation and take profit levels derived from the pattern measure rule. Breakout of the confirmation levels are highlighted with labels.
This script is a continuation of the educational idea regarding horns patterns.
Settings
Threshold: Controls the maximum allowed slope of the line connecting two horns, with higher values allowing a higher slope.
Usage
Horn patterns are chart patterns introduced by Bulkowski in his book "Encyclopedia of Chart Patterns". We covered this pattern in the following post: Horn Tops & Bottoms Patterns - How To Find and Trade Them
The script allows the user to quickly determine the presence of a regular or inverted horn pattern, alongside automatically displaying the confirmation level and take profits associated with a detected pattern. These are calculated based on the rules described by Bulkowski.
Horn patterns are highlighted by a line connecting the horns, the dotted lines represent the confirmation level, once the price crosses this level a label will appear, either bullish or bearish depending on the detected pattern. The dashed line represents the take profit level.
Liquidity Heatmap LTF [LuxAlgo]This indicator displays column heatmaps highlighting candle bodies with the highest associated volume from a lower user selected timeframe.
Settings
LTF Timeframe: Lower timeframe used to retrieve the closing/opening price and volume data. Must be lower than the current chart timeframe.
Other settings control the style of the displayed graphical elements.
Usage
It can be of interest to show which candles from a lower timeframe had the highest associated volume, this allows for the highlighting of areas where a candle body was the most traded by market participants.
The area with the highest activity is highlighted in the script with a yellow color (or another user selected color) and additionally by two lines forming an interval.
When the candle body with the highest volume is overlapped by a candle body with lower volume this one will be highlighted instead, hence why certain areas of high activity might not be highlighted by the heatmap.
It is recommended to hide regular candles or use a more discrete graphical presentation of prices when using this tool. Lines are also displayed to highlight the full candle range as well as if a candle was bullish (in green) or bearish (in red). These lines can be hidden if the user is only interested in the heatmap.
Supertrend Channels [LuxAlgo]The Supertrend is one of the most used indicators by traders when it comes to determining whether the market is up-trending or down-trending.
This indicator is displayed as a trailing stop, showing a lower monotonic extremity during up-trends and an upper monotonic extremity during down-trends. Today we propose a channel indicator based on the Supertrend trailing stop using trailing maximas/minimas.
Settings
Length: Atr length used by the Supertrend indicator.
Mult: Multiplicative factor for the Atr used by the Supertrend indicator.
Usage
The ability of the indicator to show an up-trend or down-trend is the same as the Supertrend, with rising channels when an up-trend is detected by the Supertrend and declining channels when a down-trend is detected by the Supertrend.
The look of the channels can remind of the Donchian channels indicator, and as such a similar usage can be appropriate. The extremities can for example be used as supports and resistances.
Additionally, the channel's average can be used to filter out noisy variations in the price while keeping a good distance from the price.
Fibonacci Progression with Breaks [LuxAlgo]This indicator highlights points where price significantly deviates from a central level. This deviation distance is determined by a user-set value or using a multiple of a period 200 Atr and is multiplied by successive values of the Fibonacci sequence.
Settings
Method: Distance method, options include "Manual" or "Atr"
Size: Distance in points if the selected method is "Manual" or Atr multiplier if the selected method is "Atr"
Sequence Length: Determines the maximum number of significant deviations allowed.
Usage
The indicator allows highlighting potential reversal points, but it can also determine trends using the central level, with an uptrend detected if the central level is higher than its previous value and vice versa for a downtrend.
When an uptrend is detected, and the price deviates significantly upward from it a first checkmark will be highlighted alongside the Fibonacci sequence used as a multiplier, if the price deviates downward, a cross will be shown instead, then the distance threshold will be multiplied by the next value in the Fibonacci sequence.
If the price deviates from the central level such that the length of the sequence is greater than the user set Sequence Length , a break label will be shown alongside a new central level with a value determined by the current closing price, while the Fibonacci multiplier will be reset to 1.
Upper and lower extremities made from the central level and threshold distance are highlighted and can be used as support and resistances.
Bart Pattern [LuxAlgo]As a sequel to our 'meme indicator' series... The Bart Pattern Detector identifies confirmed regular and inverted Bart patterns using edge detection.
Settings
Median Lookback: Lookback period of the median filter used for the edge detection, with a shorter period allowing to detect shorter-term and less spaced patterns.
Edge Detection Sensitivity: Sensitivity of the edge detection method, with higher values making the method less sensible to edges of low magnitude.
Range To Edges Threshold: Threshold for the range to edges ratio, with lower values detecting Bart patterns with flatter ranges between the edges.
Show Inverted Barts: Show inverted Bart patterns.
Mode: Determines how detected Bart patterns are displayed.
Usage
This indicator can be used to study past Bart patterns and how the market responded to them. Their detection is not done in real-time. Additionally detected edges are used to indicate the current market sentiment.
If you don't want a meme on your chart, you can also use the simple mode - but don't worry, we won't judge you if you don't...
Details
The origins of Bart patterns can be hard to pinpoint but most likely originate from social media around 2018. This pattern has been mostly covered in the cryptocurrency market similarly to how the McDonald's Pattern became a popular meme within the community. See our McDonald's Pattern Indicator that was created by us as our first 'meme indicator' in the series
The Bart pattern as its name suggests occurs when price forms a structure resembling the head of the Simpson character "Bart Simpson". This is characterized by a rectangular structure, which is a sideways market delimited by sharp volatile edges.
The Bart pattern is sometimes traded before completion, waiting for a breakout of a support/resistance located within the sideway part of the pattern.
The cause of this pattern is still discussed by traders, with some attributing it to over-leveraged market participants and while others attributing it to exchanges themselves through spoofing.
Notes
Barts patterns are very volatile structures, characterized by sudden price jumps, be careful when trading them.
Shout to the famous alien @lilmayo and our good pal @scheplick for the suggestion to create this work of art.
And don't forget to eat your shorts.
Fibonacci Grid [LuxAlgo]The following indicator returns multiple diagonal lines forming a grid. Each line has 45-degree and is set depending on Fibonacci ratios as well as the maximum and minimum price value over a certain lookback period. These can be used as potential support and resistance.
Users also have the option to set equidistant lines instead of having them determined by Fibonacci ratios.
Settings
Length: Lookback period for determining the maximum/minimum price value used for constructing the grid.
Resolution: Grid resolution, higher values will return more lines (only available when the "Use Fibonacci Ratios" is disabled)
Use Fibonacci Ratios: Set the lines based on Fibonacci Ratios, 6 ratios are used.
Usage
Each individual diagonal line can be used as support/resistance. Two Diagonal lines form channels where the price might evolve until a breakout.
The underlying logic of this grid determined by Fibonacci ratios is that price variations farther away from the main diagonals (in orange) would tend to move inside tighter channels.
Diagonals set using Fibonacci Ratios will form tighter channels when away from the center of the Lookback area. While equidistant lines will keep the same distance between each line.
Pivot Based Trailing Maxima & Minima [LuxAlgo]This indicator returns trailing maximums/minimums and the resulting average, each resetting on the occurrence of a pivot point high/low, thus allowing to highlight past and current support and resistance levels.
Note that the user has the option to make the indicator subject to backpainting or not. Backpainting would offset the indicator output to the past and as such would be less suited for real-time applications.
🔶 USAGE
🔹 Non Backpainting
The indicator can highlight points of support and resistance given by the trailing maximum/minimum average.
An uptrend is indicated when the trailing maximum is making a new higher high, while a downtrend is indicated when the trailing minimum makes a new lower low.
🔹 Backpainting
When backpainting is enabled the historical trailing maximum/minimum and their resulting average are offset to the past. However, we extend these to the most recent bar, allowing for real-time applications of the indicator.
Users can easily analyze past trends and determine their type by observing the trailing maximum/minimum behavior. For example, trailing maximums/minimums not making new higher high/lower low would indicate a ranging market.
The frequency of new higher high/lower low can also help determine how bullish/bearish a trend was.
🔶 SETTINGS
Length: Determines the pivot high/low lookback, with higher values allowing to detect longer-term tops and bottoms.
Backpaint: Determine if the indicator is subject to backpainting. Enabling this setting would offset the returned results in the past.