Humble Linear Regression Candles & UT Bot Alerts compilationLinear Regression Candles by ugurvu & UT Bot Alerts by QuantNomad are the codes created by respective owners. I have compiled both codes into one indicator. For any further information / clarification check with respective individual indicator's scripts.
Regressions
Half Trend Regression [AlgoAlpha]Introducing the Half Trend Regression indicator by AlgoAlpha, a cutting-edge tool designed to provide traders with precise trend detection and reversal signals. This indicator uniquely combines linear regression analysis with ATR-based channel offsets to deliver a dynamic view of market trends. Ideal for traders looking to integrate statistical methods into their analysis to improve trade timing and decision-making.
Key Features
🎨 Customizable Appearance : Adjust colors for bullish (green) and bearish (red) trends to match your charting preferences.
🔧 Flexible Parameters : Configure amplitude, channel deviation, and linear regression length to tailor the indicator to different time frames and trading styles.
📈 Dynamic Trend Line : Utilizes linear regression of high, low, and close prices to calculate a trend line that adapts to market movements.
🚀 Trend Direction Signals : Provides clear visual signals for potential trend reversals with plotted arrows on the chart.
📊 Adaptive Channels : Incorporates ATR-based channel offsets to account for market volatility and highlight potential support and resistance zones.
🔔 Alerts : Set up alerts for bullish or bearish trend changes to stay informed of market shifts in real-time.
How to Use
🛠 Add the Indicator : Add the Half Trend Regression indicator to your chart from the TradingView library. Access the settings to customize parameters such as amplitude, channel deviation, and linear regression length to suit your trading strategy.
📊 Analyze the Trend : Observe the plotted trend line and the filled areas under it. A green fill indicates a bullish trend, while a red fill indicates a bearish trend.
🔔 Set Alerts : Use the built-in alert conditions to receive notifications when a trend reversal is detected, allowing you to react promptly to market changes.
How It Works
The Half Trend Regression indicator calculates linear regression lines for the high, low, and close prices over a specified period to determine the general direction of the market. It then computes moving averages and identifies the highest and lowest points within these regression lines to establish a dynamic trend line. The trend direction is determined by comparing the moving averages and previous price levels, updating as new data becomes available. To account for market volatility, the indicator calculates channels above and below the trend line, offset by a multiple of half the Average True Range (ATR). These channels help visualize potential support and resistance zones. The area under the trend line is filled with color corresponding to the current trend direction—green for bullish and red for bearish. When the trend direction changes, the indicator plots arrows on the chart to signal a potential reversal, and alerts can be set up to notify you. By integrating linear regression and ATR-based channels, the indicator provides a comprehensive view of market trends and potential reversal points, aiding traders in making informed decisions.
Enhance your trading strategy with the Half Trend Regression indicator by AlgoAlpha and gain a statistical edge in the markets! 🌟📊
Linear Regression Channel UltimateKey Features and Benefits
Logarithmic scale option for improved analysis of long-term trends and volatile markets
Activity-based profiling using either touch count or volume data
Customizable channel width and number of profile fills
Adjustable number of most active levels displayed
Highly configurable visual settings for optimal chart readability
Why Logarithmic Scale Matters
The logarithmic scale option is a game-changer for analyzing assets with exponential growth or high volatility. Unlike linear scales, log scales represent percentage changes consistently across the price range. This allows for:
Better visualization of long-term trends
More accurate comparison of price movements across different price levels
Improved analysis of volatile assets or markets experiencing rapid growth
How It Works
The indicator calculates a linear regression line based on the specified period
Upper and lower channel lines are drawn at a customizable distance from the regression line
The space between the channel lines is divided into a user-defined number of levels
For each level, the indicator tracks either:
- The number of times price touches the level (touch count method)
- The total volume traded when price is at the level (volume method)
The most active levels are highlighted based on this activity data
Understanding Touch Count vs Volume
Touch count method: Useful for identifying key support/resistance levels based on price action alone
Volume method: Provides insight into levels where the most trading activity occurs, potentially indicating stronger support/resistance
Practical Applications
Trend identification and strength assessment
Support and resistance level discovery
Entry and exit point optimization
Volume profile analysis for improved market structure understanding
This Linear Regression Channel indicator combines powerful statistical analysis with flexible visualization options, making it an invaluable tool for traders and analysts across various timeframes and markets. Its unique features, especially the logarithmic scale and activity profiling, provide deeper insights into market behavior and potential turning points.
Alpine Predictive BandsAlpine Predictive Bands - ADX & Trend Projection is an advanced indicator crafted to estimate potential price zones and trend strength by integrating dynamic support/resistance bands, ADX-based confidence scoring, and linear regression-based price projections. Designed for adaptive trend analysis, this tool combines multi-timeframe ADX insights, volume metrics, and trend alignment for improved confidence in trend direction and reliability.
Key Calculations and Components:
Linear Regression for Price Projection:
Purpose: Provides a trend-based projection line to illustrate potential price direction.
Calculation: The Linear Regression Centerline (LRC) is calculated over a user-defined lookbackPeriod. The slope, representing the rate of price movement, is extended forward using predictionLength. This projected path only appears when the confidence score is 70% or higher, revealing a white dotted line to highlight high-confidence trends.
Adaptive Prediction Bands:
Purpose: ATR-based bands offer dynamic support/resistance zones by adjusting to volatility.
Calculation: Bands are calculated using the Average True Range (ATR) over the lookbackPeriod, multiplied by a volatilityMultiplier to adjust the width. These shaded bands expand during higher volatility, guiding traders in identifying flexible support/resistance zones.
Confidence Score (ADX, Volume, and Trend Alignment):
Purpose: Reflects the reliability of trend projections by combining ADX, volume status, and EMA alignment across multiple timeframes.
ADX Component: ADX values from the current timeframe and two higher timeframes assess trend strength on a broader scale. Strong ADX readings across timeframes boost the confidence score.
Volume Component: Volume strength is marked as “High” or “Low” based on a moving average, signaling trend participation.
Trend Alignment: EMA alignment across timeframes indicates “Bullish” or “Bearish” trends, confirming overall trend direction.
Calculation: ADX, volume, and trend alignment integrate to produce a confidence score from 0% to 100%. When the score exceeds 70%, the white projection line is activated, underscoring high-confidence trend continuations.
User Guide
Projection Line: The white dotted line, which appears only when the confidence score is 70% or higher, highlights a high-confidence trend.
Prediction Bands: Adaptive bands provide potential support/resistance zones, expanding with market volatility to help traders visualize price ranges.
Confidence Score: A high score indicates a stronger, more reliable trend and can support trend-following strategies.
Settings
Prediction Length: Determines the forward length of the projection.
Lookback Period: Sets the data range for calculating regression and ATR.
Volatility Multiplier: Adjusts the width of bands to match volatility levels.
Disclaimer: This indicator is for educational purposes and does not guarantee future price outcomes. Additional analysis is recommended, as trading carries inherent risks.
Linear regression Zscore | Rocheur Linear Regression Z-Score Indicator by Rocheur
The Linear Regression Z-Score Indicator developed by Rocheur is a robust technical analysis tool that combines valuation through Z-score analysis with trend detection . This indicator is designed to provide traders with a comprehensive understanding of both price extremities and trend strength. It is highly customizable, allowing users to adjust visual and calculation settings to suit their specific trading styles and asset classes.
1. Visual Settings
The indicator offers flexibility in how it displays its outputs through customizable visual settings. Users can choose from a variety of color modes that modify the appearance of the bullish and bearish signals. Additionally, there are two key visual modes :
Valuation Mode : Highlights price movements based on the Z-score, using a color gradient to show the magnitude of price deviation from its mean.
Trend Mode : Displays the overall market trend, coloring bullish trends in one color (typically green) and bearish trends in another (usually red).
These visual options allow traders to tailor the indicator to match their charting preferences, making it easier to interpret key signals quickly.
2. Indicator Settings
Users can modify key calculation parameters to fit their trading needs:
Length : This setting defines the lookback period used for calculating the linear regression line, which reflects the overall market trend. A longer length provides a smoother trendline, whereas a shorter length makes the indicator more responsive to price changes.
Offset : The offset shifts the calculation by a specified number of bars, which can help traders in certain backtesting scenarios.
These settings ensure that the indicator is adaptable to different trading strategies, whether you prefer short-term or long-term market analysis.
3. Threshold Settings
The indicator allows users to set upper and lower thresholds that help define overbought and oversold conditions:
Upper Threshold : When the Z-score exceeds this level, it indicates that the price may be overbought, signaling a potential reversal or selling opportunity.
Lower Threshold : If the Z-score falls below this value, it indicates that the price may be oversold, signaling a possible buying opportunity.
These thresholds can be customized depending on the asset’s volatility, providing flexibility to traders based on their risk tolerance and market conditions.
4. Z-Score Calculation
The heart of the indicator is its calculation of the Z-score , a measure of price deviation from its mean, adjusted for volatility. This Z-score is derived from three key components:
Linear Regression : The indicator uses a linear regression line to assess the overall trend in the market over a specific period.
Mean : The use of a moving average smooths the linear regression line, calculating the average price over a longer period. This ensures that the Z-score is calculated relative to the asset's historical average.
Standard Deviation : The standard deviation measures price volatility, allowing the indicator to adjust for the magnitude of price swings relative to the trend.
The resulting Z-score shows how far the price has moved from its mean in terms of standard deviations. A positive Z-score indicates that the price is above the mean, while a negative Z-score shows that the price is below the mean. This provides traders with insights into whether an asset is overbought or oversold.
5. Scoring System
The indicator employs a simple scoring mechanism to determine whether the market is in a bullish or bearish state:
Bullish Trend : When the Z-score is above the upper threshold, the indicator assigns a score of 1, signaling a potential buying opportunity.
Bearish Trend : When the Z-score falls below the lower threshold, the score is set to -1, indicating a potential selling opportunity.
This scoring system helps simplify trend detection by categorizing market conditions into clear bullish or bearish states, making it easier for traders to follow trends.
6. Plotting and Visualization
The indicator uses dynamic color gradients to visualize the Z-score and its corresponding trend on the chart:
Gradient Visualization : When the Z-score is positive (above zero), the color gradient moves from neutral to bright, indicating the strength of the trend. Similarly, when the Z-score is negative, the color gradient shifts from neutral to darker tones, highlighting bearish trends.
Trend Color Coding : In Trend Mode , the bars are colored based on the score. If the score is positive (bullish), the bars are colored in one shade (usually green). If the score is negative (bearish), the bars take on a different shade (typically red).
This color-based visualization simplifies interpreting market movements, allowing traders to quickly identify whether the market is trending up or down.
7. Range Highlights and Visual Aids
To aid in analysis, the indicator includes range highlights at key Z-score levels:
Highlighted Zones : The indicator highlights specific Z-score ranges (such as +1.5 and -1.5), which indicate strong overbought or oversold conditions. These zones help traders visually grasp when the price is reaching an extreme, signaling potential reversal points.
These visual aids ensure that traders can quickly detect critical price levels and make more informed trading decisions.
8. Strategic Value and Advantages
The Linear Regression Z-Score Indicator offers several strategic advantages for traders:
Combines Valuation and Trend Detection : The dual functionality of this indicator makes it a powerful tool for identifying both overbought/oversold conditions and trend direction. This combination allows traders to assess the market holistically and make better-timed trades.
Precision in Detecting Market Extremes : The Z-score calculation provides a clear measure of how far the price has moved from its historical average, giving traders a precise tool for detecting price extremes and potential turning points.
Adaptability Across Markets : This indicator works across multiple asset classes and timeframes, making it suitable for stocks, forex, commodities, and cryptocurrencies. Whether you are a day trader, swing trader, or long-term investor, this tool can be tailored to your strategy.
Customizable for Risk Profiles : The ability to adjust thresholds, length, and visual settings means that traders can fine-tune the indicator to align with their risk tolerance and market conditions.
Enhanced Trend-Following : In strong trending markets, this indicator helps traders stay aligned with the broader market movement. The scoring system ensures that traders don’t exit trades too early by filtering out minor price fluctuations and focusing on sustained trends.
Note:
Backtests are based on past results and are not indicative of future performance.
Conclusion
The Linear Regression Z-Score Indicator by Rocheur is a versatile, powerful tool that provides both valuation insights and trend detection in one package. Its customization options make it suitable for a wide range of trading strategies and market conditions. The indicator’s dynamic color visualization and scoring system simplify market analysis, helping traders make informed decisions in real-time. By integrating valuation extremes with trend direction, this indicator enhances a trader’s ability to identify optimal entry and exit points, making it a valuable addition to any trading toolkit.
CoffeeShopCrytpo Dynamic PPIIn the financial world, the Producer Price Index (PPI) is often used to measure how domestic products are performing over time, indicating the health of the market. Domestic products refer to goods and services that are produced within a specific country’s borders. However, in this indicator, we’ve taken that idea and applied it directly to financial assets, allowing traders to see how an asset is performing relative to its own base value over a given period of time.
Here, the asset’s base value is represented as 100%. When the asset performs above 100%, it's considered to be in a buyer's market—indicating strength and demand. Conversely, if the value dips below 100%, it's operating below its base value, signaling a potential seller's market.
Why This Matters:
This indicator not only converts an asset’s performance into a PPI-style calculation, but it also visualizes price movements as price candles. This dual perspective is crucial, because even if the asset’s performance is over 100%, the closing price might still fall below that threshold—adding nuance to your understanding of market conditions.
Key Features of the Indicator:
Bullish and Bearish Convergence Levels: These levels show whether the market leans bullish or bearish. If the Bullish Convergence level is higher than the Bearish one, the market is bullish, and vice versa. Importantly, these levels can signal shifts in market strength, regardless of where the PPI candles are positioned.
If Bullish Convergence is rising below Bearish, the bearish market is weakening and bullish pressure is growing. Conversely, if Bearish Convergence is falling above Bullish, the bearish side is losing ground.
Market Strength Visualizations:
Strong Bullish Market: Bullish Convergence is higher than Bearish, and it’s still rising.
Strong Bearish Market: Bearish Convergence is above Bullish, and it's climbing.
Weak Bullish Market: Bullish Convergence is above Bearish, but the PPI closes below Bullish Convergence.
Weak Bearish Market: Bearish Convergence is above Bullish, but the PPI closes above Bullish Convergence
Pullbacks:
Bullish Pullback: In a strong bullish market, the PPI shows lower closes below the Bullish Convergence.
Bearish Pullback: In a strong bearish market, the PPI shows higher closes above the Bullish Convergence.
Divergences:
Higher Price, Lower or Flat PPI: This indicates that while the asset’s price is rising, its underlying performance (relative to the PPI’s 100% base level) is not keeping up. Essentially, the asset is reaching new price highs, but its strength or "efficiency" of growth is weakening.
The PPI is designed to show the "return" of an asset's performance relative to its historical movement, so when it lags behind price, it suggests that the price rise may not be sustainable.
When you observe the first high of the PPI level above the bullish convergence level, followed by a second high of the PPI below the bullish convergence level in a bullish market, this creates a divergence.
Example of Divergence in image:
1. First High of PPI Above the Bullish Convergence Level:
This suggests strong bullish momentum. The asset’s performance, as measured by the PPI, is in line with or even outperforming price expectations, indicating the market is experiencing a robust bullish trend. The fact that the PPI level is above the bullish convergence line means that the asset is operating well above its base performance (above 100%) and bullish momentum is clearly dominant.
2. Second High of PPI Below the Bullish Convergence Level:
This marks a potential weakening of the bullish momentum. Although the market is still in a bullish state (since bullish convergence remains above bearish), the PPI failing to reach the bullish convergence level suggests that the asset’s performance is not keeping pace with price action or is underperforming relative to its earlier high.
The fact that this occurs while the market is still bullish (bullish convergence is greater than bearish) can signal a possible pullback or a temporary consolidation phase within the larger bullish trend.
What does a divergence mean:
Momentum Weakening: The second high of the PPI being below the bullish convergence line suggests that while prices may still be increasing, the strength behind the move is fading. The asset is not performing as strongly as it did during the first high, and the market’s confidence or momentum might be softening.
Potential Bullish Pullback: This could indicate that a pullback or correction within the larger bullish trend is underway. Traders might be taking profits, or buyers could be losing enthusiasm, causing the asset to stall temporarily. However, because the overall market remains bullish, this doesn’t necessarily mean a full reversal—just a cooling off period.
Caution in New Long Positions: If you see this divergence, it could be a sign to be more cautious about opening new long positions. It suggests that the asset may need to consolidate or correct before resuming its upward trend, and it’s worth waiting for confirmation of renewed momentum before jumping back in.
ATR Settings
Youll notice there are two ATR settings. One for short term and one for long term.
These values are based on your preferential strategy for what you consider to be long and short term.
The final ATR values are calculated against eachother and applied to the Volatility Label at the end of price.
This label shows you the current ATR as well as the previous candle ATR.
Why this is important:
If the short term ATR is greater than the long term ATR, then volatility is rising in the short term greater than the long term.
This gives your label a value greater than 1.0. This means the short term trend is about to move.
If the long term ATR is greater than the short term ATR, there is no volatility in the short term and only long term exists.
This gives you a value of less than 1.0. This means no volatility or ranging market in the short term.
MicroStrategy vs Bitcoin Power Law Model
This indicator provides a powerful tool for investors by modeling the relationship between MicroStrategy (MSTR) and Bitcoin (BTC) based on an observed power law correlation since August 2020, when MSTR adopted Bitcoin as its core investment strategy. The primary objective of the indicator is to identify areas where MSTR is overvalued or undervalued relative to BTC, offering investors crucial insights for making informed decisions.
Step-by-Step Creation Process:
Data Collection:
The indicator begins by gathering historical price data for both MSTR and BTC starting from August 2020. This period is significant as it marks MSTR’s strategic shift toward Bitcoin acquisition.
Power Law Analysis:
A power law relationship between MSTR and BTC is computed using a power of 1.3. This relationship models the price behavior of MSTR relative to BTC, providing a framework to track where MSTR’s price deviates from its expected value based on BTC's movements.
MSTR Price Model:
The MSTR price model based on this power law is then plotted against the actual price of MSTR. This allows investors to visualize areas where MSTR is potentially overvalued or undervalued relative to BTC.
Overvaluation is highlighted when the actual MSTR price exceeds the power law-based price, while undervaluation is noted when it falls below.
Time-Based Power Law Model:
Additionally, the indicator integrates a time-based model for MSTR, which shows that MSTR follows its own power law over time with a higher slope than BTC (7.2 vs. 5.8). This comparison provides further context, showing how MSTR's growth rate differs from BTC’s over time.
Oscillator Inclusion:
To complement the price models, an oscillator is added, which tracks the difference between the MSTR power law and the BTC power law. This oscillator helps visualize and quantify the divergence between the two, offering a clearer picture of periods where MSTR is performing above or below expectations compared to BTC.
Indicator Usefulness:
Overvaluation and Undervaluation Detection: By comparing MSTR’s current price against its expected power law-based price, investors can easily identify potential entry and exit points. When MSTR is overvalued relative to BTC, it may signal an opportunity to sell or reduce exposure. Conversely, undervaluation may suggest a buying opportunity.
Time-Based Growth Comparisons: The time-based power law model shows how MSTR has been growing relative to Bitcoin over time. This helps investors understand whether MSTR is outperforming or underperforming BTC in the long run.
Divergence Oscillator: The oscillator provides an intuitive way to gauge whether MSTR is significantly diverging from BTC’s growth trajectory, offering an additional signal to guide investment decisions.
Projections to the future
Projections of the MSTR power law to 500 days ahead is also included.
Why is this Indicator Useful for Investors?
This indicator offers a comprehensive view of how MSTR’s price behavior correlates with Bitcoin. By leveraging the power law relationship, it provides insight into whether MSTR is priced appropriately relative to BTC, which is especially valuable for those with exposure to both assets. The oscillator further refines this analysis by highlighting periods of divergence, offering potential trading opportunities based on relative value.
Volume-Supported Linear Regression Trend TableThe "Volume-Supported Linear Regression Trend Table" (VSLRT Table) script helps traders identify buy and sell opportunities by analyzing price trends and volume dynamics across multiple timeframes. It uses linear regression to calculate the trend direction and volume strength, visually representing this data with color-coded signals on the chart and in a table. Green signals indicate buying opportunities, while red signals suggest selling, with volume acting as confirmation of trend strength. Traders can use these signals for both short and long positions, with additional risk management and multi-timeframe validation to enhance the strategy.
------------------------------------------------------------------------------
To use the "Volume-Supported Linear Regression Trend Table" (VSLRT Table) script in a trading strategy, you would incorporate it into your decision-making process to identify potential buy and sell opportunities based on the trend and volume dynamics. Here’s how you could apply it for trading:
1. Understanding the Key Elements:
Trend Direction (Slope of Price): The script uses linear regression to assess the trend direction of the price. If the price slope is positive, the asset is likely in an uptrend; if it's negative, the asset is in a downtrend.
Volume-Backed Signals: The buy or sell signal is not only based on the price trend but also on volume. Volume is crucial in validating the strength of a trend; large volume often indicates strong interest in a direction.
2. Interpreting the Table and Signals:
The table displayed at the bottom-right of your TradingView chart gives you a clear overview of the trends across different timeframes:
Trend Colors:
Green hues (e.g., ccol11, ccol12, etc.): Indicate a buying trend supported by volume.
Red hues (e.g., ccol21, ccol22, etc.): Indicate a selling trend supported by volume.
Gray: Indicates weak or unclear trends where no decisive direction is present.
Buy/Sell Signals:
The script plots triangles on the chart:
Upward triangle below the bar signals a potential buy.
Downward triangle above the bar signals a potential sell.
3. Building a Trading Strategy:
Here’s how you can incorporate the script’s information into a trading strategy:
Buy Signal (Long Entry):
Look for green triangles (indicating a buy signal) below a bar.
Confirm that the trend color in the table for the relevant timeframe is green, which shows that the buy signal is supported by strong volume.
Ensure that the price is in an uptrend (positive slope) and that volume is increasing on upward moves, as this indicates buying interest.
Execute a long position when these conditions align.
Sell Signal (Short Entry):
Look for red triangles (indicating a sell signal) above a bar.
Confirm that the trend color in the table for the relevant timeframe is red, which shows that the sell signal is supported by strong volume.
Ensure that the price is in a downtrend (negative slope) and that volume is increasing on downward moves, indicating selling pressure.
Execute a short position when these conditions align.
Exiting the Trade:
Exit a long position when a sell signal (red triangle) appears, or when the trend color in the table shifts to red.
Exit a short position when a buy signal (green triangle) appears, or when the trend color in the table shifts to green.
4. Multi-Timeframe Confirmation:
The script provides trends across multiple timeframes (tf1, tf2, tf3), which can help in validating your trade:
Short-Term Trading: Use shorter timeframes (e.g., 3, 5 minutes) for intraday trades. If both short and medium timeframes align in trend direction (e.g., both showing green), it strengthens the signal.
Longer-Term Trading: If you are trading on a higher timeframe (e.g., daily or weekly), confirm that the lower timeframes align with your intended trade direction.
5. Adding Risk Management:
Stop-Loss: Place stop-losses below recent lows (for long trades) or above recent highs (for short trades) to minimize risk.
Take Profit: Consider taking profit at key support/resistance levels or based on a fixed risk-to-reward ratio (e.g., 2:1).
Example Strategy Flow:
For Long (Buy) Trade:
Signal: A green triangle appears below a candle (Buy signal).
Trend Confirmation: Check that the color in the table for your selected timeframe is green, confirming the trend is supported by volume.
Execute Long: Enter a long trade if the price is trending upward (positive price slope).
Exit Long: Exit when a red triangle appears above a candle (Sell signal) or if the trend color shifts to red in the table.
For Short (Sell) Trade:
Signal: A red triangle appears above a candle (Sell signal).
Trend Confirmation: Check that the color in the table for your selected timeframe is red, confirming the trend is supported by volume.
Execute Short: Enter a short trade if the price is trending downward (negative price slope).
Exit Short: Exit when a green triangle appears below a candle (Buy signal) or if the trend color shifts to green in the table.
6. Fine-Tuning:
Backtesting: Before trading live, use TradingView’s backtesting features to test the strategy on historical data and optimize the settings (e.g., length of linear regression, timeframe).
Combine with Other Indicators: Use this strategy alongside other technical indicators (e.g., RSI, MACD) for better confirmation.
In summary, the script helps identify trends with volume support, giving more confidence in buy/sell decisions. Combining these signals with risk management and multi-timeframe analysis can create a solid trading strategy.
Linear Regression ChannelLinear Regression Channel Indicator
Overview:
The Linear Regression Channel Indicator is a versatile tool designed for TradingView to help traders visualize price trends and potential reversal points. By calculating and plotting linear regression channels, bands, and future projections, this indicator provides comprehensive insights into market dynamics. It can highlight overbought and oversold conditions, identify trend direction, and offer visual cues for future price movements.
Key Features:
Linear Regression Bands:
Input: Plot Linear Regression Bands
Description: Draws bands based on linear regression calculations, representing overbought and oversold levels.
Customizable Parameters:
Length: Defines the look-back period for the regression calculation.
Deviation: Determines the width of the bands based on standard deviations.
Linear Regression Channel:
Input: Plot Linear Regression Channel
Description: Plots a channel using linear regression to visualize the main trend.
Customizable Parameters:
Channel Length: Defines the look-back period for the channel calculation.
Deviation: Determines the channel's width.
Future Projection Channel:
Input: Plot Future Projection of Linear Regression
Description: Projects a linear regression channel into the future, aiding in forecasting potential price movements.
Customizable Parameters:
Length: Defines the look-back period for the projection calculation.
Deviation: Determines the width of the projected channel.
Arrow Direction Indicator:
Input: Plot Arrow Direction
Description: Displays directional arrows based on future projection, indicating expected price movement direction.
Color-Coded Price Bars:
Description: Colors the price bars based on their position within the regression bands or channel, providing a heatmap-like visualization.
Dynamic Visualization:
Colors: Uses a gradient color scheme to highlight different conditions, such as uptrend, downtrend, and mid-levels.
Labels and Markers: Plots visual markers for significant price levels and conditions, enhancing interpretability.
Usage Notes
Setting the Length:
Adjust the look-back period (Length) to suit the timeframe you are analyzing. Shorter lengths are responsive to recent price changes, while longer lengths provide a broader view of the trend.
Interpreting Bands and Channels:
The bands and channels help identify overbought and oversold conditions. Price moving above the upper band or channel suggests overbought conditions, while moving below the lower band or channel indicates oversold conditions.
Using the Future Projection:
Enable the future projection channel to anticipate potential price movements. This can be particularly useful for setting target prices or stop-loss levels based on expected trends.
Arrow Direction Indicator:
Use the arrow direction indicator to quickly grasp the expected price movement direction. An upward arrow indicates a potential uptrend, while a downward arrow suggests a potential downtrend.
Color-Coded Price Bars:
The color of the price bars changes based on their relative position within the regression bands or channel. This heatmap visualization helps quickly identify bullish, bearish, and neutral conditions.
Dynamic Adjustments:
The indicator dynamically adjusts its visual elements based on user settings and market conditions, ensuring that the most relevant information is always displayed.
Visual Alerts:
Pay attention to the labels and markers on the chart indicating significant events, such as crossovers and breakouts. These visual alerts help in making informed trading decisions.
The Linear Regression Channel Indicator is a powerful tool for traders looking to enhance their technical analysis. By offering multiple regression-based visualizations and customizable parameters, it helps identify key market conditions, trends, and potential reversal points. Whether you are a day trader or a long-term investor, this indicator can provide valuable insights to improve your trading strategy.
Leading Indicator by Parag RautBreakdown of the Leading Indicator:
Linear Regression (LRC):
A linear regression line is used to estimate the current trend direction. When the price is above or below the regression line, it indicates whether the price is deviating from its mean, signaling potential reversals.
Rate of Change (ROC):
ROC measures the momentum of the price over a set period. By using thresholds (positive or negative), we predict that the price will continue in the same direction if momentum is strong enough.
Leading Indicator Calculation:
We calculate the difference between the price and the linear regression line. This is normalized using the standard deviation of price over the same period, giving us a leading signal based on price divergence from the mean trend.
The leading indicator is used to forecast changes in price behavior by identifying when the price is either stretched too far from the mean (indicating a potential reversal) or showing strong momentum in a particular direction (predicting trend continuation).
Buy and Sell Signals:
Buy Signal: Generated when ROC is above a threshold and the leading indicator shows the price is above the regression line.
Sell Signal: Generated when ROC is below a negative threshold and the leading indicator shows the price is below the regression line.
Visual Representation:
The indicator oscillates around zero. Values above zero signal potential upward price movements, while values below zero signal potential downward movements.
Background colors highlight potential buy (green) and sell (red) areas based on our conditions.
How It Works as a Leading Indicator:
This indicator attempts to predict price movements before they happen by combining the trend (via linear regression) and momentum (via ROC).
When the price significantly diverges from the trendline and momentum supports a continuation, it signals a potential entry point (either buy or sell).
It is leading in that it anticipates price movement before it becomes fully apparent in the market.
Next Steps:
You can adjust the length of the linear regression and ROC to fine-tune the indicator’s sensitivity to your trading style.
This can be combined with other indicators or used as part of a larger strategy
Aurous - Horizontal Rays Define Pip Size:
Since 1 pip for XAUUSD is usually considered as 0.1, the pip Size is set to 0.1. A 50-pip interval is therefore 50 * 0.1 = 5.0.
Nearest Pip Level Calculation:
We find the nearest 50-pip level based on the current price of XAUUSD. The formula nearestPipLevel = round(close / pipInterval) * pipInterval rounds the current price to the nearest multiple of the 50-pip interval.
Loop for Multiple Lines:
We use a loop that runs from -20 to 20 to plot horizontal ray lines 50 pips above and below the current price. The range (-20 to 20) ensures there are enough lines plotted both above and below the price.
Horizontal Ray Lines:
The line.new function is used to draw the horizontal rays, extending to the right.
Plot Current Price:
We also plot the closing price with a blue line to make it easier to track the price against the horizontal rays.
Connors RSI with Down GapThe Connors RSI with Down Gap indicator is a technical tool designed to support Larry Connors' Terror Gap Strategy, which is part of his broader framework outlined in the book "Buy the Fear, Sell the Greed: 7 Behavioral Quant Strategies for Traders." This specific indicator integrates the ConnorsRSI calculation with a focus on detecting down gaps in price, providing insights into moments when panic selling may occur.
The ConnorsRSI
ConnorsRSI is a composite indicator developed by Larry Connors that combines three core components:
RSI: A short-term relative strength index measuring the speed and magnitude of price changes.
Streak RSI: Tracks consecutive up or down closes to assess momentum.
Percent Rank: Evaluates how the current close ranks in relation to past prices.
When combined, these three elements provide a nuanced view of short-term overbought or oversold conditions. ConnorsRSI readings below a certain threshold (commonly 30 or lower) suggest that the asset has been heavily sold, indicating potential exhaustion of selling pressure.
Behavioral Finance Insights
The Terror Gap Strategy is grounded in principles from behavioral finance, which studies how psychological factors affect market participants' decision-making. Specifically, the indicator exploits the fear and irrational behavior that often arise when traders face persistent losses, especially after a down gap. According to behavioral finance theories like prospect theory (Kahneman & Tversky, 1979), people tend to overreact to losses, leading to panic selling. This creates opportunities for contrarian traders who understand the psychology behind these market movements.
The ConnorsRSI with Down Gap indicator works because it identifies:
Overextended selling through the ConnorsRSI, where persistent price declines result in low RSI values (indicating panic).
Gap down days, where the opening price is below the previous day’s close, typically amplifying the sense of loss and fear for traders already in losing positions.
Why This Indicator Works
The psychology of losses makes traders more prone to selling during periods of fear, especially when confronted with a gap down after sustained price declines. This indicator, by combining ConnorsRSI with down gaps, offers a quantitative way to spot these moments of panic. Traders can take advantage of these signals to enter positions when the market is in a state of fear, often when there is potential for a reversion to the mean.
Indicator Mechanics
In the current implementation:
The ConnorsRSI is calculated using three components: a short-term RSI, streak RSI, and percent rank.
When the ConnorsRSI drops below a user-defined lower threshold, the indicator highlights oversold conditions.
If there is a down gap (open price lower than the previous close) and the ConnorsRSI is below the threshold, a label is displayed, signaling a potential opportunity to buy.
Practical Use and Application
For traders looking to implement the Terror Gap Strategy, this indicator provides a clear visual cue (via background coloring and labels) when conditions are ripe for a contrarian trade. It can be particularly useful for traders who thrive on taking advantage of fear-driven sell-offs.
However, to fully understand and apply this strategy effectively, it is recommended to purchase Larry Connors' book "Buy the Fear, Sell the Greed." The book provides detailed explanations of how to execute the strategy with precision, including insights into exit conditions, scaling into positions, and managing risk.
Conclusion
The ConnorsRSI with Down Gap indicator combines quantitative analysis with behavioral finance principles to exploit fear-driven market behavior. By utilizing this tool within a disciplined trading strategy, traders can potentially profit from temporary market inefficiencies caused by panic selling.
References
Kahneman, D., & Tversky, A. (1979). Prospect theory: An analysis of decision under risk. Econometrica, 47(2), 263-291.
Connors, L. (2013). Buy the Fear, Sell the Greed: 7 Behavioral Quant Strategies for Traders.
This indicator can be a valuable asset, but understanding its proper use within a broader strategy framework is essential. Purchasing Connors' book is a recommended step toward mastering the approach.
Stationarity Test: Dickey-Fuller & KPSS [Pinescriptlabs]
📊 Kwiatkowski-Phillips-Schmidt-Shin Model Indicator & Dickey-Fuller Test 📈
This algorithm performs two statistical tests on the price spread between two selected instruments: the first from the current chart and the second determined in the settings. The purpose is to determine if their relationship is stationary. It then uses this information to generate **visual signals** based on how far the current relationship deviates from its historical average.
⚙️ Key Components:
• 🧪 ADF Test (Augmented Dickey-Fuller):** Checks if the spread between the two instruments is stationary.
• 🔬 KPSS Test (Kwiatkowski-Phillips-Schmidt-Shin):** Another test for stationarity, complementing the ADF test.
• 📏 Z-Score Calculation:** Measures how many standard deviations the current spread is from its historical mean.
• 📊 Dynamic Threshold:** Adjusts the trading signal threshold based on recent market volatility.
🔍 What the Values Mean:
The indicator displays several key values in a table:
• 📈 ADF Stationarity:** Shows "Stationary" or "Non-Stationary" based on the ADF test result.
• 📉 KPSS Stationarity:** Shows "Stationary" or "Non-Stationary" based on the KPSS test result.
• 📏 Current Z-Score:** The current Z-score of the spread.
• 🔗 Hedge Ratio:** The relationship coefficient between the two instruments.
• 🌐 Market State:** Describes the current market condition based on the Z-score.
📊 How to Interpret the Chart:
• The main chart displays the Z-score of the spread over time.
• The green and red lines represent the upper and lower thresholds for trading signals.
• The area between the **Z-score** and the thresholds is filled when a trading signal is active.
• Additional charts show the **statistics of the ADF and KPSS tests** and their critical values.
**📉 Practical Example: NVIDIA Corporation (NVDA)**
Looking at the chart for **NVIDIA Corporation (NVDA)**, we can see how the indicator applies in a real case:
1. **Main Chart (Top):**
• Shows the **historical price** of NVIDIA on a weekly scale.
• A general **uptrend** is observed with periods of consolidation.
2. **KPSS & ADF Indicator (Bottom):**
• The lower chart shows the KPSS & ADF Model indicator applied to NVIDIA.
• The **green line** represents the Z-score of the spread.
• The **green shaded areas** indicate periods where the Z-score exceeded the thresholds, generating trading signals.
3. **📋 Current Values in the Table:**
• **ADF Stationarity:** Non-Stationary
• **KPSS Stationarity:** Non-Stationary
• **Current Z-Score:** 3.45
• **Hedge Ratio:** -164.8557
• **Market State:** Moderate Volatility
4. **🔍 Interpretation:**
• A Z-score of **3.45** suggests that NVIDIA’s price is significantly above its historical average relative to **EURUSD**.
• Both the **ADF** and **KPSS** tests indicate **non-stationarity**, suggesting **caution** when using mean reversion signals at this moment.
• The market state "Moderate Volatility" indicates noticeable deviation, but not extreme.
---
**💡 Usage:**
• **When Both Tests Show Stationarity:**
• **🔼 If Z-score > Upper Threshold:** Consider **buying the first instrument** and **selling the second**.
• **🔽 If Z-score < Lower Threshold:** Consider **selling the first instrument** and **buying the second**.
• **When Either Test Shows Non-Stationarity:**
• Wait for the relationship to become **stationary** before trading.
• **Market State:**
• Use this information to evaluate **general market conditions** and adjust your trading strategy accordingly.
**Mirror Comparison of the Same as Symbol 2 🔄📊**
**📊 Table Values:**
• **Extreme Volatility Threshold:** This value is displayed when the **Z-score** exceeds **100%**, indicating **extreme deviation**. It signals a potential **trading opportunity**, as the spread has reached unusually high or low levels, suggesting a **reversion or correction** in the market.
• **Mean Reversion Threshold:** Appears when the **Z-score** begins returning towards the mean after a period of **high or extreme volatility**. It indicates that the spread between the assets is returning to normal levels, suggesting a phase of **stabilization**.
• **Neutral Zone:** Displayed when the **Z-score** is near **zero**, signaling that the spread between assets is within expected limits. This indicates a **balanced market** with no significant volatility or clear trading opportunities.
• **Low Volatility Threshold:** Appears when the **Z-score** is below **70%** of the dynamic threshold, reflecting a period of **low volatility** and market stability, indicating fewer trading opportunities.
Español:
📊 Indicador del Modelo Kwiatkowski-Phillips-Schmidt-Shin & Prueba de Dickey-Fuller 📈
Este algoritmo realiza dos pruebas estadísticas sobre la diferencia de precios (spread) entre dos instrumentos seleccionados: el primero en el gráfico actual y el segundo determinado en la configuración. El objetivo es determinar si su relación es estacionaria. Luego utiliza esta información para generar señales visuales basadas en cuánto se desvía la relación actual de su promedio histórico.
⚙️ Componentes Clave:
• 🧪 Prueba ADF (Dickey-Fuller Aumentada): Verifica si el spread entre los dos instrumentos es estacionario.
• 🔬 Prueba KPSS (Kwiatkowski-Phillips-Schmidt-Shin): Otra prueba para la estacionariedad, complementando la prueba ADF.
• 📏 Cálculo del Z-Score: Mide cuántas desviaciones estándar se encuentra el spread actual de su media histórica.
• 📊 Umbral Dinámico: Ajusta el umbral de la señal de trading en función de la volatilidad reciente del mercado.
🔍 Qué Significan los Valores:
El indicador muestra varios valores clave en una tabla:
• 📈 Estacionariedad ADF: Muestra "Estacionario" o "No Estacionario" basado en el resultado de la prueba ADF.
• 📉 Estacionariedad KPSS: Muestra "Estacionario" o "No Estacionario" basado en el resultado de la prueba KPSS.
• 📏 Z-Score Actual: El Z-score actual del spread.
• 🔗 Ratio de Cobertura: El coeficiente de relación entre los dos instrumentos.
• 🌐 Estado del Mercado: Describe la condición actual del mercado basado en el Z-score.
📊 Cómo Interpretar el Gráfico:
• El gráfico principal muestra el Z-score del spread a lo largo del tiempo.
• Las líneas verdes y rojas representan los umbrales superior e inferior para las señales de trading.
• El área entre el Z-score y los umbrales se llena cuando una señal de trading está activa.
• Los gráficos adicionales muestran las estadísticas de las pruebas ADF y KPSS y sus valores críticos.
📉 Ejemplo Práctico: NVIDIA Corporation (NVDA)
Observando el gráfico para NVIDIA Corporation (NVDA), podemos ver cómo se aplica el indicador en un caso real:
Gráfico Principal (Superior): • Muestra el precio histórico de NVIDIA en escala semanal. • Se observa una tendencia alcista general con períodos de consolidación.
Indicador KPSS & ADF (Inferior): • El gráfico inferior muestra el indicador Modelo KPSS & ADF aplicado a NVIDIA. • La línea verde representa el Z-score del spread. • Las áreas sombreadas en verde indican períodos donde el Z-score superó los umbrales, generando señales de trading.
📋 Valores Actuales en la Tabla: • Estacionariedad ADF: No Estacionario • Estacionariedad KPSS: No Estacionario • Z-Score Actual: 3.45 • Ratio de Cobertura: -164.8557 • Estado del Mercado: Volatilidad Moderada
🔍 Interpretación: • Un Z-score de 3.45 sugiere que el precio de NVIDIA está significativamente por encima de su promedio histórico en relación con EURUSD. • Tanto la prueba ADF como la KPSS indican no estacionariedad, lo que sugiere precaución al usar señales de reversión a la media en este momento. • El estado del mercado "Volatilidad Moderada" indica una desviación notable, pero no extrema.
💡 Uso:
• Cuando Ambas Pruebas Muestran Estacionariedad:
• 🔼 Si Z-score > Umbral Superior: Considera comprar el primer instrumento y vender el segundo.
• 🔽 Si Z-score < Umbral Inferior: Considera vender el primer instrumento y comprar el segundo.
• Cuando Alguna Prueba Muestra No Estacionariedad:
• Espera a que la relación se vuelva estacionaria antes de operar.
• Estado del Mercado:
• Usa esta información para evaluar las condiciones generales del mercado y ajustar tu estrategia de trading en consecuencia.
Comparativo en Espejo del Mismo Como Símbolo 2 🔄📊
📊 Valores de la Tabla:
• Umbral de Volatilidad Extrema: Este valor se muestra cuando el Z-score supera el 100%, indicando desviación extrema. Señala una posible oportunidad de trading, ya que el spread entre los activos ha alcanzado niveles inusualmente altos o bajos, lo que podría indicar una reversión o corrección en el mercado.
• Umbral de Reversión a la Media: Aparece cuando el Z-score comienza a volver hacia la media tras un período de alta o extrema volatilidad. Indica que el spread entre los activos está regresando a niveles normales, sugiriendo una fase de estabilización.
• Zona Neutral: Se muestra cuando el Z-score está cerca de cero, señalando que el spread entre activos está dentro de lo esperado. Esto indica un mercado equilibrado con ninguna volatilidad significativa ni oportunidades claras de trading.
• Umbral de Baja Volatilidad: Aparece cuando el Z-score está por debajo del 70% del umbral dinámico, reflejando un período de baja volatilidad y estabilidad del mercado, indicando menos oportunidades de trading.
Enhanced Local Polynomial Regression [Yosiet]Local Polynomial Regression (LPR) is an advanced statistical method that offers a flexible approach to estimating the underlying trend in financial time series data.
The Mathematical Explanation
The core idea of LPR is to fit a polynomial of degree p at each point x using weighted least squares. The weight of each data point decreases with its distance from x, controlled by a kernel function and a bandwidth parameter.
The general form of the local polynomial estimator is:
β̂(x) = argmin Σ K((Xi - x) / h) (Yi - β0 - β1(Xi - x) - ... - βp(Xi - x)^p)^2
Where:
β̂(x) is the vector of estimated coefficients
K is the kernel function
h is the bandwidth
Xi and Yi are the predictor and response variables
p is the degree of the polynomial
Our implementation uses the Epanechnikov kernel:
K(u) = 3/4 * (1 - u^2) for |u| ≤ 1, 0 otherwise
The Implementation
This script implements LPR for the easier way to interpret its values with the following key components:
Input Parameters: Can adjust the lookback period, bandwidth, and polynomial degree.
Kernel Function: The Epanechnikov kernel is used for weighting.
LPR Function: Implements the core algorithm using matrix operations.
Signal Generation: Generates buy/sell signals based on crossovers of smoothed price and LPR results.
How to Use
Apply the indicator to your chart in TradingView.
Adjust the input parameters:
Lookback Period: Controls how many past bars are considered.
Bandwidth: Affects the smoothness of the regression line.
Polynomial Degree: Determines the complexity of the local fit.
Signal Smoothing Length: Adjusts the responsiveness of buy/sell signals.
Monitor buy/sell signals for potential trade entries.
Limitations
Sensitivity to Parameters: The choice of bandwidth and polynomial degree significantly impacts the results.
Lag: Like all trend-following indicators, LPR may lag behind rapid price movements.
Edge Effects: The indicator may be less reliable at the edges of the data (recent bars).
Recommendations
Parameter Optimization: Experiment with different lookback periods, bandwidths, and polynomial degrees to find the best fit for your trading style and timeframe.
Combine with Other Indicators: Use LPR in conjunction with momentum oscillators or volume indicators for confirmation.
Multiple Timeframes: Apply LPR on different timeframes to gain a more comprehensive view of the trend.
Avoid Overfitting: Be cautious of using high polynomial degrees, as they may lead to overfitting on historical data.
Consider Market Conditions: LPR works best in trending markets; be aware of its limitations in ranging or highly volatile conditions.
Backtest Thoroughly: Always backtest strategies based on LPR across different market conditions before live trading.
Conclusion
Local Polynomial Regression offers a sophisticated approach to trend analysis in financial markets. By providing a flexible, adaptive trend line, it can help traders identify potential entry and exit points with greater precision than traditional moving averages. However, like all technical indicators, it should be used as part of a comprehensive trading strategy that includes proper risk management and consideration of fundamental factors.
if you have an strategy or idea and need to make it real through an indicator or trading bot, you can DM or comment
G.O.A.T. Scalper Diagnostics v1OVERVIEW:
The G.O.A.T. Scalper Diagnostics indicator system enables users to discover unorthodox indicator patterns, reading price charts in unusual ways, thus gaining an edge over the majority of market participants they trade against.
CONCEPTS:
Th G.O.A.T. Scalper Diagnostics is a system that aims to satisfy the fundamental condition for successful online trading - providing an edge.
It's a battle between advantages. To take other people's money, successful traders must have an advantage over everybody else. To hope for consistent success in trading, you need to do things differently and see what almost nobody else sees. Of course then you must act on it, and that's where the G.O.A.T. Scalper Diagnostic's mandate ends.
I believe the vast majority of indicators out there show you what everybody else sees. I've always been an indicator guy, I respect and cherish most indicators and I know a good indicator when I see it.
However, although most indicators are great works of art, their practicality is in most cases doubtful. Presenting great information is one thing, but providing an edge over the people you trade against is something different.
What Everybody Else Sees
The G.O.A.T. Scalper Diagnostics is based on indicators most of you have probably heard of and used:
Moving Averages (particularly the Kaufman Moving Average, among others)
ADX and DI
Bollinger Bands
Stochastic (particularly the Stochastic RSI)
Most traders should be well familiar with these classic indicators, they've provided the basis for online indicator trading for decades. But it's also true that due to how popular online trading has become all over the world, one is more and more unable to use these indicators successfully on lower timeframes.
Usually, more noteworthy success is achieved by going up in scale and discovering the timeframe where a particular indicator produces no false signals. Often times these timeframes range from bi-weekly to multi-month scale. In other words, consistently successful low timeframe trading and scalp trading in particular are now almost impossible using indicators.
Traders that dominate the scalping arena are big professional/institutional groups of traders, who have systematic access to the order books of most exchanges. This can be achieved one way or another, but not by individuals, small groups without significant capital or simply traders who lack political/social power and influence in the trading field.
In other words - giant order book traders have an edge over everybody else, who use indicators to trade on lower timeframes.
Through a series of interventions into these classical indicators, the G.O.A.T. System brings them back into the lower timeframe competitive game. Most original formulas are preserved, but these immortal classics are applied in ways popular TA would consider unorthodox.
Ingenious Indicators Built by Creators
The G.O.A.T. Scalper Diagnostics relies on the fundamental work of others. The System is developed on the basis of:
Quadratic Kernel Regression - it uses the publicly published library of Justin Dehorty: www.tradingview.com
PMARP - Price Moving Average Ratio & Percentile, publicly published by "The_Caretaker": www.tradingview.com
These Creators deserve full credit for their fundamental work and are endorsed by the G.O.A.T. Scalper Diagnostics project.
And yet... ingenious and inspired as these tools are, in my humble opinion the general public is presented with a rather unproductive way to apply them. In my own view, these wonderful tools built by JDehorty and The_Caretaker have a massive potential should they be applied and wielded in a different direction. So I tried to bring my vision about them into flesh with the G.O.A.T. Diagnostics.
What the G.O.A.T. Scalper Diagnostics Is and How to Use It
It's a System for new pattern discovery, bringing the disciplines of pattern and indicator trading together.
By using it as a stand-alone, or mixing it with other great indicators, one is able to discover new indicator patterns. Patterns can be compared, matched together and categorized. By applying statistics to differentiated historical pattern groups, we're able to derive their meaning.
Thus, the trader is able to research their own "alphabet" to read the price charts. After categorizing and differentiating pattern groups with statistically predominant meaning, the trader is then able to read into longer scenarios - price set-ups that are harder to detect due to them being stretched in time or misshapen according to the particular situation.
The G.O.A.T. Scalper leverages and encourages group trading, as different traders will probably discover different price "alphabets" for themselves, potentially giving rise to a social economy of sharing and combining "trading languages" based on indicator patterns people have discovered via the G.O.A.T. Diagnostics.
Support/Resistance Trading
The G.O.A.T. Scalper has its own way of deriving Support/Resistance.
Unlike most existing S/R indicators, The Scalper derives Support/Resistance not by measuring price highs, lows and closes, but solely by using momentum and trend strength.
This seems like a much more versatile way to plot S/R during scalping on low timeframes where time is of essence and the trader's view is too narrow to have macro S/R levels in constant consideration.
The Scalper's way to derive S/R in real time and on the go, while staying very relative to important higher timeframe S/R zones, makes it much more desirable than any other S/R indicator I've thus far encountered.
All S/R functionality is derived from the classical ADX and DI indicator. To do this, I use the ADX and DI in an unpopular way. To generate the actual plot of S/R levels I also modify the indicator's code, not by removing functional parts from it, but adding more to it in order to filter the signals it produces.
I can metaphorically describe its action in the following way:
Imagine you're Price action itself;
You're walking through a labyrinth or corridors. You're walking through one straight corridor, and it has a crossing with another corridor ahead;
Very strong wind is blowing along that other corridor. You can't see the wind, but when you reach it and try to move past it, the force of the wind resists your moving ahead and instead pushes you sideways.
At this point, the G.O.A.T. Diagnostics already knows this can only be one thing - resistance.
Orthodox TA and trading demand retests. In my opinion, this deeply rooted tradition wastes time proving the obvious, then wastes time again double-proving the validity of recent past, while scalping opportunities go to waste. Modern successful traders are way ahead of the popular strategy of testing and retesting S/R that almost every trader uses. So-called "Stops hunting" is just one expression of this situation, where wide adoption of the S/R retesting strategy actually lures unsuccessful traders into the schemes of the successful few.
In my own way of trading, I use the G.O.A.T. Diagnostics to take action on Support/Resistance as it's plotted in real time.
But probably my biggest heresy into the DI is my opinion, that the crossings of the +DI and -DI are useless and should actually be discarded.
My research shows that the DIs often show indications of being "oversold", but don't seem to exhibit an "overbought" state. Statistically, I've had much more success basing my TA on that, rather than cross-ups and cross-downs of the DI plot lines.
Therefore I discarded these crossings by presenting the DI part of the ADX and DI as a Heatmap channel rather than crossing lines.
To further enhance the ability of the System to provide S/R analysis, I plot this Heatmap onto an adjustable price offset plots (a percentage above and below current price).
In modern times, the vast majority of trading is done by automatic machines and algorithms. To give a specific example, one can easily notice, that a 5% offset of the BTC 1h price plot leads to remarkably accurate S/R charting. Following the rule to chart a S/R line connecting highs and lows on the 5% price offset often successfully "foresees" valid S/R zones before price ever visits them. Or, the levels were visited so far back in the timeframe's history that orthodox understanding considers them "invalidated" or washed away in the noise of the relevant volume profile.
My explanation for this is simple - I think Grid bots now dominate automatic trading across the majority of exchanges.
In my understanding, by adjusting the percentage offset of current price action I can often discover relevant conglomerations of dominating Grid bot cell parameters and anticipate price reaction. By plotting the DI heatmap on these price action offsets I can use the indicator for my trading decisions.
Heatmaps
Every heatmap produces different series of data. They're not the same.
Bollinger Band heatmap depicts the percentile distance between the Band's extremes.
The price candles heatmap, and the KAMA moving average heatmap, depict the percentile distance between price and the KAMA. So, it's the same thing. However, the percentile of that distance is calculated in two different ways, hence the difference in color in every particular moment. This color discrepancy aims to visualize the "strain" between price action and KAMA, like a soft and hard "springs" that go in unison with each other in sustainable moves, and in dissonance with each other during unsustainable moves.
Price offset heatmap depicts the percentile average of the +DI (above price) and the -DI (below price). A Hot temperature above price and a Cold temperature below price would mean a strong bullish sentiment, and vise versa, while Green would mean neutrality in sentiment.
There are important interplays between different heatmaps. For example, although representing totally different things, a Teal price bar would almost always (according to historical statistics) foreshadow a change in DI's heatmap sentiment. That's just one avenue of correlation between S/R analysis and sentiment analysis using the G.O.A.T. Diagnostics.
Oscillator Chart
In terms of applying Quadratic Kernel Regression, I endorse the natural principle that no center can exist without a periphery, and no periphery can exist without a center. Therefore I try to pay attention not only to the average of the regression's values, but also to the cloud of data points itself.
Following this understanding, I attempt to depict the natural cycles of price converging/diverging towards/from its regression average. To do this, I apply the classic Stochastic formula.
Thus, the Oscillator part of the System depicts the following:
Thin heatmap line displays the cycles of price converging with its quadratic kernel regression average (moving down), and diverging with its regression average (moving up). Its heatmap depicts the percentile of this oscillation.
The wider heatmap line displays the KAMA's cycles of convergence/divergence with its own quadratic kernel regression average. The reason for this is again creating discrepancy - while KAMA is based on price action, its regression data values differ from those of price action's regression. This discrepancy produces useful historic patterns that can be studied statistically.
The thin and wide purple oscillator lines depict the change of slope of price action regression average and KAMA regression average, respectively. Very often change of slope is not detectable with the naked eye, but clearly indicated by the oscillators.
By combining all these elements into a single analysis, a trader can detect hidden trends that are yet to become visible for the rest of market participants.
For example, convergence of price with its quadratic kernel regression average while the slope of the average deteriorates down in most cases (according to statistics) means a sideways consolidation in a downtrend before downtrend continuation. Conversely, deviation of price action from its regression average while the regression average slope deteriorates down usually marks the very beginning of a downtrend.
Bollinger Bands
Bollinger Bands are not modified, but are based on quadratic kernel regression values. Thus, if Bollinger Bands themselves are indicative of volatility, then based on kernel regression values, they should indicate the volatility of change of values in the regression's window.
Again, applying it to both the price and KAMA regression data series, a discrepancy is highlighted that leads to useful historical patterns subject to analysis and categorization.
SOME EXAMPLES
Support / Resistance
Support/Resistance levels are market by White Triangles with dotted lines plotted from them, in real time. The indicator plots Ghost Triangles in anticipation of Support/Resistance, preparing the trader for the eventual confirmation of a zone of interest and signaling price is feeling Support or Resistance pressure.
Dialing the length of the S/R lines to 25 makes the indicator more useful.
Dialing the setting to 500 clearly shows macro S/R zones by conglomerating and bundling individual lines. The thicker the bundling and the confluence of lines, the more significant the zone.
Thus lower timeframe scalping and trading is made more easy, without the need to do nearly as much manual S/R charting. Support/Resistance analysis and plotting is entirely based on a modified ADX.
Heatmap
Sustainable moves are generally marked by Green price color and calm KAMA colors.
Unsustainable moves are usually marked by more extreme colors of price bars and KAMA. Red usually means price is unsustainably distanced from the KAMA, while deep Blue usually means price is undesirably close to the KAMA, foreshadowing a directional distancing.
Usually Teal color of price bars and KAMA foreshadow a change of sentiment of the outside Heatmap sentiment channel.
Red color of the outside channel always signals the direction of the desired sentimental movement, while Blue signals the extent at which the counter-element suffers. Thus, one side being Green, while the other is Blue, often means the Blue will soon evolve into a warmer color, attracting price in that direction. Outside Heatmap channel is entirely based on a modified DI.
Oscillator Chart
An example of Chart Diagnosis using the Oscillator and other elements of the G.O.A.T. Scalper:
First (far left), a Resistance is plotted. This coincides with price bars being Red (distressed state). The thin colorful Oscillator line takes an Up-turn, signifying a period of price moving away from its Quadratic Kernel Regression (pink moving average).
After Price cools down to Green sustainable colors, a Support is plotted. During this time, the thin colorful line is falling down, signifying a period when the distance between price action and its quadratic kernel regression average is decreasing.
During this phase, the thin purple Oscillator line goes up. This signifies the slope of the price regression is restoring to the upside.
Next, the thin colorful line starts going up again, signifying another period of price getting further away from its regression average. This time to the upside.
Resistance is being broken and new support is established. At this point, the thin colorful line starts falling again, signifying distance between price and its regression MA is shortening. This is clearly visible as a sideways consolidation (with a slight tilt up of slope).
A moment comes when all lines - the price and KAMA lines, and price and KAMA regression slopes, all point down. A new down period is clearly starting. This is further indicated by Teal price bars and new Resistance forming. Notice how the external heatmap channel goes into more balanced Green colors with trend enthusiasm calming down.
This analysis may appear to be overwhelming and confusing at first, as these metrics are unorthodox and unpopular. But different aspects of the indicator can be toggled ON/OFF to single them out, which makes observations much simpler for new users. After some time spent discovering personal patterns, or reviewing other users' catalogues with already published pattern libraries, it soon becomes easy to read charts in this new way.
Bollinger Bands
Bollinger Bands provide another way to produce patterns that give users specific chart information.
One noteworthy indication is when the price and KAMA Bollinger Bands separate their value zones. Since the zones of these Bands are based on the kernel regression values of the respective sources, their separation is significant and too often means violent reversals or violent continuations (which usually can be judged using the other metrics the System provides, or additional indicators of choice).
Another noteworthy Bollinger Band pattern is when price action leaves a prolonged trending move.
First phase of the end of a prolonged trending move is the BB zones expanding and doing a significant overlap.
Second stage is price getting reaccepted in the Price BB. This however doesn't mean reacceptance in the KAMA BB and if the moment isn't right, usually leads to bounces and continuations.
The KAMA needs to "make space" for price to get reaccepted into the KAMA BB. While the KAMA is outside its BB or very near to its wall, price reacceptance into it is not very probable. When KAMA withdraws from its BB wall, opening an "entrance on its membrane", that's when price is eligible to get reaccepted into the KAMA BB. That's usually the moment the long awaited consolidation starts and a long trending move is over.
Users of the G.O.A.T. Scalper Diagnostics can discover many more patterns and correlations between patterns within the System. But the System itself can multiply all possible patterns when inspected in the context of additional indicators, leading to vast possibilities of signal and pattern discovery with huge potential.
A very good idea would probably be to use the G.O.A.T. Diagnostics together with the Ichimoku.
Ichimoku has always been famous for its genius simplicity and elegant profoundness, but notorious for its total lack of accuracy, as well as general uselessness on lower timeframes. The G.O.A.T. System has the potential to enhance all of Ichimoku's strengths and cure its weaknesses.
Yet another good idea may be to pair it with kindred indicators, like the Gaussian Channel, which has a stunning performance, but suffers from too high level of generalization. The Diagnostics can provide the intricate texture of price manoeuvres the Gaussian Channel fails to register, while the GC can give the Scalper even more solid context for its patterns.
The worthwhile possibilities seem endless...
Entry Table
I've added a little Entry Table at the bottom right corner. It's designed to potentially help scalpers trade faster, and to visualize a potential trade they're thinking about before they execute it. A Stop Loss is visually plotted in real time to better visualize it's placement in the chart context.
It encourages responsible risk management in its settings:
The user enters the amount of their trading portfolio;
Then specify the percentage of their portfolio they're willing to risk at every trade;
After that the user can chose to specify a flat percentage Stop Loss.
The table will calculate the size of the entry of a market order, so the user only risks the specified percentage of their portfolio should the specified Stop Loss level is hit.
There's also the option to use automatically suggested Stop Loss, based on recent volatility. The actual Stop Loss is calculated 20% away from the actual volatility level, to better protect from unforeseen wicks.
In the current example, the user with a $1000 trading portfolio has to do a $1000 entry to lose 1% of their portfolio ($10) at a 1% Stop Loss.
But the user has to do a $2,525 entry in order to lose 1% of their portfolio (%10) at a much closer Stop Loss which is less than 1%, based on recent volatility.
The Entry Table should be considered as a cosmetic convenience and not a dedicated risk management tool.
CONCLUSION:
The G.O.A.T. Scalper Diagnostics is an indicator System, based on popular, but modified and tweaked versions of indicators like the ADX and DI, Stochastic, Bollinger Bands and MAs. It also leverages the remarkable work of inspired creators: JDehorty's Quadratic Kernel Regression library, and The_Caretaker's PMARP .
The G.O.A.T. Scalper Diagnostics indicator system enables users to discover so-called new "indicator-pattern alphabets", reading price charts in new and unorthodox ways, thus gaining an edge over the majority of market participants they trade against.
The high degree of freedom when discovering new patterns, either within the System itself or correlating its output to external auxiliary indicators, highlights the System's potential for original discoveries leading to highly personalized trading strategies. Exchanging information about personal pattern libraries can potentially also give birth to new private trading communities.
Viking Fun PredictОсобая благодарность за оригинальную идею Александру Горчакову
Индикатор предсказывает вырастет или упадет цена на следующей свече
Индикатор отображает красные или зеленые кружки над каждой из свечей
Зеленый кружок прогноз роста
Красный кружок прогноз падения
Индикатор выдает прогноз для шестой свечи на основе пяти свечей
Индикатор берет цены максимумов и минимумов пяти свечей и усредняет их, получая 5 значений. На основе полученных 5 значений строится линейная регрессия
Если линия линейной регрессии возрастает, то индикатор прогнозирует рост (зеленый кружок)
Если линия линейной регрессии возрастает, то индикатор прогнозирует падение (красный кружок)
Компания Викинг предоставляет профессиональный сервис, позволяющий реализовать арбитражные стратегии и маркет-мейкинг, осуществляет обучение трейдеров-арбитражеров.
---------------------------
Special thanks for the original idea to Alexander Gorchakov
The indicator predicts whether the price will rise or fall on the next candle
The indicator displays red or green circles above each of the candles
Green circle growth forecast
Red circle forecast of the fall
The indicator gives a forecast for the sixth candle based on five candles
The indicator takes the prices of the highs and lows of five candles and averages them, getting 5 values. Based on the obtained 5 values, a linear regression is constructed
If the linear regression line increases, the indicator predicts growth (green circle)
If the linear regression line increases, the indicator predicts a fall (red circle)
Viking provides a professional service that allows you to implement arbitrage strategies and market making, and provides training for arbitrage traders.
Points of InterestIndicator for displaying a timed, intraday Range of Price as a Point of Interest (POI) that you may want to track when trading as a potential magnet for price. Quite often you will see Price return to prior days price range before continuing to move. This enables you to track specific portions of a Days Trading session to see what has been revisited and what has not yet been re traded to.
The range is tracked for each trading day between the times that you specify in the Inputs ‘POI Time’ parameter You can also set the Time zone of the Range.
It will mark the Range High and Low for the timed range with lines that can be optionally extended and can be customised in terms of colour, style and width.
It will also Plot a line showing the Equilibrium of the range which is 50% from the High to the Low point of price during the time window that you specified in the ‘POI Time’ Parameter. This can also be customised in terms of visibility, colour, style and width.
You can control an optional Label for the POI Equilibrium Line to include a combination of a user defined prefix, the Date that the POI Equilibrium Line’s range is from and the Price Level of the Equilibrium Line. The colour and size of the label is also configurable
This indicator will also track when a POI Equilibrium Line has been traded to or ‘Tapped’. The tracking can be started after a configurable number of minutes have elapsed from the end of the POI Time window. This can also be customised in terms of visibility, colour, style, extended toggle and width.
Optionally Taps of the POI Equilibrium Level can be counted as valid during specific time windows or session of the day - for example only count taps during New York Morning Trading session.
The indicator uses Lower Time Frame data to compute the Range and 50% / Equilibrium Level so will work accurately on Chart Timeframes up to and including Daily with The POI Time specified down to a Minute resolution.
Correlation Clusters [LuxAlgo]The Correlation Clusters is a machine learning tool that allows traders to group sets of tickers with a similar correlation coefficient to a user-set reference ticker.
The tool calculates the correlation coefficients between 10 user-set tickers and a user-set reference ticker, with the possibility of forming up to 10 clusters.
🔶 USAGE
Applying clustering methods to correlation analysis allows traders to quickly identify which set of tickers are correlated with a reference ticker, rather than having to look at them one by one or using a more tedious approach such as correlation matrices.
Tickers belonging to a cluster may also be more likely to have a higher mutual correlation. The image above shows the detailed parts of the Correlation Clusters tool.
The correlation coefficient between two assets allows traders to see how these assets behave in relation to each other. It can take values between +1.0 and -1.0 with the following meaning
Value near +1.0: Both assets behave in a similar way, moving up or down at the same time
Value close to 0.0: No correlation, both assets behave independently
Value near -1.0: Both assets have opposite behavior when one moves up the other moves down, and vice versa
There is a wide range of trading strategies that make use of correlation coefficients between assets, some examples are:
Pair Trading: Traders may wish to take advantage of divergences in the price movements of highly positively correlated assets; even highly positively correlated assets do not always move in the same direction; when assets with a correlation close to +1.0 diverge in their behavior, traders may see this as an opportunity to buy one and sell the other in the expectation that the assets will return to the likely same price behavior.
Sector rotation: Traders may want to favor some sectors that are expected to perform in the next cycle, tracking the correlation between different sectors and between the sector and the overall market.
Diversification: Traders can aim to have a diversified portfolio of uncorrelated assets. From a risk management perspective, it is useful to know the correlation between the assets in your portfolio, if you hold equal positions in positively correlated assets, your risk is tilted in the same direction, so if the assets move against you, your risk is doubled. You can avoid this increased risk by choosing uncorrelated assets so that they move independently.
Hedging: Traders may want to hedge positions with correlated assets, from a hedging perspective, if you are long an asset, you can hedge going long a negatively correlated asset or going short a positively correlated asset.
Grouping different assets with similar behavior can be very helpful to traders to avoid over-exposure to those assets, traders may have multiple long positions on different assets as a way of minimizing overall risk when in reality if those assets are part of the same cluster traders are maximizing their risk by taking positions on assets with the same behavior.
As a rule of thumb, a trader can minimize risk via diversification by taking positions on assets with no correlations, the proposed tool can effectively show a set of uncorrelated candidates from the reference ticker if one or more clusters centroids are located near 0.
🔶 DETAILS
K-means clustering is a popular machine-learning algorithm that finds observations in a data set that are similar to each other and places them in a group.
The process starts by randomly assigning each data point to an initial group and calculating the centroid for each. A centroid is the center of the group. K-means clustering forms the groups in such a way that the variances between the data points and the centroid of the cluster are minimized.
It's an unsupervised method because it starts without labels and then forms and labels groups itself.
🔹 Execution Window
In the image above we can see how different execution windows provide different correlation coefficients, informing traders of the different behavior of the same assets over different time periods.
Users can filter the data used to calculate correlations by number of bars, by time, or not at all, using all available data. For example, if the chart timeframe is 15m, traders may want to know how different assets behave over the last 7 days (one week), or for an hourly chart set an execution window of one month, or one year for a daily chart. The default setting is to use data from the last 50 bars.
🔹 Clusters
On this graph, we can see different clusters for the same data. The clusters are identified by different colors and the dotted lines show the centroids of each cluster.
Traders can select up to 10 clusters, however, do note that selecting 10 clusters can lead to only 4 or 5 returned clusters, this is caused by the machine learning algorithm not detecting any more data points deviating from already detected clusters.
Traders can fine-tune the algorithm by changing the 'Cluster Threshold' and 'Max Iterations' settings, but if you are not familiar with them we advise you not to change these settings, the defaults can work fine for the application of this tool.
🔹 Correlations
Different correlations mean different behaviors respecting the same asset, as we can see in the chart above.
All correlations are found against the same asset, traders can use the chart ticker or manually set one of their choices from the settings panel. Then they can select the 10 tickers to be used to find the correlation coefficients, which can be useful to analyze how different types of assets behave against the same asset.
🔶 SETTINGS
Execution Window Mode: Choose how the tool collects data, filter data by number of bars, time, or no filtering at all, using all available data.
Execute on Last X Bars: Number of bars for data collection when the 'Bars' execution window mode is active.
Execute on Last: Time window for data collection when the `Time` execution window mode is active. These are full periods, so `Day` means the last 24 hours, `Week` means the last 7 days, and so on.
🔹 Clusters
Number of Clusters: Number of clusters to detect up to 10. Only clusters with data points are displayed.
Cluster Threshold: Number used to compare a new centroid within the same cluster. The lower the number, the more accurate the centroid will be.
Max Iterations: Maximum number of calculations to detect a cluster. A high value may lead to a timeout runtime error (loop takes too long).
🔹 Ticker of Reference
Use Chart Ticker as Reference: Enable/disable the use of the current chart ticker to get the correlation against all other tickers selected by the user.
Custom Ticker: Custom ticker to get the correlation against all the other tickers selected by the user.
🔹 Correlation Tickers
Select the 10 tickers for which you wish to obtain the correlation against the reference ticker.
🔹 Style
Text Size: Select the size of the text to be displayed.
Display Size: Select the size of the correlation chart to be displayed, up to 500 bars.
Box Height: Select the height of the boxes to be displayed. A high height will cause overlapping if the boxes are close together.
Clusters Colors: Choose a custom colour for each cluster.
Intraday Percentage Drawdown from ATHTrack Intraday ATH:
The script maintains an intradayATH variable to track the highest price reached during the trading day up to the current point.
This variable is updated whenever a new high is reached.
Calculate Drawdown and Percentage Drawdown:
The drawdown is calculated as the difference between the intradayATH and the current closing price (close).
The percentage drawdown is calculated by dividing the drawdown by the intradayATH and multiplying by 100.
Plot Percentage Drawdown:
The percentageDrawdown is plotted on the chart with a red line to visually represent the drawdown from the intraday all-time high.
Draw Recession Line:
A horizontal red line is drawn at the 20.00 level, labeled "Recession". The line is styled as dotted and has a width of 2 for better visibility.
Draw Correction Line:
A horizontal yellow line is drawn at the 10.00 level, labeled "Correction". The line is styled as dotted and has a width of 2 for better visibility.
Draw All Time High Line:
A horizontal green line is drawn at the 0.0 level to represent the all-time high, labeled "All Time High". The line is styled as dotted and has a width of 2 for better visibility.
This script will display the percentage drawdown along with reference lines at 20% (recession), 10% (correction), and 0% (all-time high).
Linear Regression ChannelLinear Regression Channel with Logarithmic Scale Option
This advanced Linear Regression Channel indicator offers traders a powerful tool for technical analysis, with unique features that set it apart from standard implementations.
Key Features:
Logarithmic Scale Option: One of the most distinctive aspects of this indicator is the ability to switch between classic and logarithmic scales. This feature is particularly valuable for long-term analysis, as it ensures that equal percentage changes are represented equally, regardless of the price level.
Flexible Start Date: Unlike many indicators that rely on a fixed number of periods, this tool allows users to set a specific start date and time. This feature provides precise control over the regression analysis timeframe, enhancing its adaptability to various trading strategies.
Customizable Channel Settings: Users can adjust the upper and lower deviation multipliers, allowing for fine-tuning of the channel width to suit different market conditions and trading styles.
Trend Strength Indicator: An optional feature that displays the strength of the trend based on the Pearson correlation coefficient, offering additional insight into the reliability of the current trend.
Comprehensive Visual Customization: The indicator offers extensive color and style options for the regression line, upper and lower channel lines, and fill areas, allowing traders to create a visually appealing and easy-to-read chart setup.
Extended Line Options: Users can choose to extend the regression lines to the left, right, or both, facilitating projection and analysis of future price movements.
Multiple Alert Conditions: The indicator includes four alert conditions for crossing the upper deviation, lower deviation, and the main regression line in both directions, enhancing its utility for active traders.
Why Choose This Indicator:
The combination of logarithmic scale option and flexible start date setting makes this Linear Regression Channel uniquely suited for both short-term and long-term analysis. The logarithmic scale is particularly beneficial for analyzing assets with significant price changes over time, as it normalizes percentage moves across different price levels. This feature, coupled with the ability to set a precise start date, allows traders to perform more accurate and relevant regression analyses, especially when studying specific market cycles or events.
Moreover, the trend strength indicator and customizable visual elements provide traders with a comprehensive tool that not only identifies potential support and resistance levels but also offers insight into the reliability and strength of the current trend.
In summary, this Linear Regression Channel indicator combines flexibility, precision, and insightful analytics, making it an invaluable tool for traders seeking to enhance their technical analysis capabilities on TradingView.
Regression Indicator [BigBeluga]Regression Indicator
Indicator Overview:
The Regression Indicator is designed to help traders identify trends and potential reversals in price movements. By calculating a regression line and a normalized regression indicator, it provides clear visual signals for market direction, aiding in making informed trading decisions. The indicator dynamically updates with the latest market data, ensuring timely and relevant signals.
Key Features:
⦾ Calculations
Regression Indicator: Calculates the linear regression coefficients (slope and intercept) and derives the normalized distance close from the regression line.
// @function regression_indicator is a Normalized Ratio of Regression Lines with close
regression_indicator(src, length) =>
sum_x = 0.0
sum_y = 0.0
sum_xy = 0.0
sum_x_sq = 0.0
distance = 0.0
// Calculate Sum
for i = 0 to length - 1 by 1
sum_x += i + 1
sum_y += src
sum_xy += (i + 1) * src
sum_x_sq += math.pow(i + 1, 2)
// Calculate linear regression coefficients
slope = (length * sum_xy - sum_x * sum_y)
/ (length * sum_x_sq - math.pow(sum_x, 2))
intercept = (sum_y - slope * sum_x) / length
// Calculate Regression Indicator
y1 = intercept + slope
distance := (close - y1)
distance_n = ta.sma((distance - ta.sma(distance, length1))
/ ta.stdev(distance, length1), 10)
⦿ Reversion Signals:
Marks potential trend reversal points.
⦿ Trend Identification:
Highlights when the regression indicator crosses above or below the zero line, signaling potential trend changes.
⦿ Color-Coded Candles:
Changes candle colors based on the regression indicator's value.
⦿ Arrow Markers:
Indicate trend directions on the chart.
⦿ User Inputs
Regression Length: Defines the period for calculating the regression line.
Normalization Length: Period used to normalize the regression indicator.
Signal Line: Length for averaging the regression indicator to generate signals.
Main Color: Color used for plotting the regression line and signals.
The Regression Indicator is a powerful tool for analyzing market trends and identifying potential reversal points. With customizable inputs and clear visual aids, it enhances the trader's ability to make data-driven decisions. The dynamic nature of the indicator ensures it remains relevant with up-to-date market information, making it a valuable addition to any trading strategy."
Market Cycle Phases IndicatorOverview
The Market Cycle Phases Indicator is a powerful tool designed to help traders identify and visualize the different phases of market cycles. By distinguishing between Accumulation, Uptrend, Distribution, and Downtrend phases, this indicator provides a clear and color-coded representation of market conditions, aiding in better decision-making and strategy development. It is especially useful for long-term investors to observe and understand market cycles over extended periods. The phases are color-coded for easy identification: Green for Accumulation, Blue for Uptrend, Yellow for Distribution, and Red for Downtrend.
Key Features
Identifies four key market phases: Accumulation, Uptrend, Distribution, and Downtrend
Uses a combination of moving averages and volatility measures
Color-coded background for easy visualization of market phases
Adjustable parameters for moving average length, volatility length, and volatility threshold
Plots the moving average and Average True Range (ATR) for reference
Suitable for both short-term trading and long-term investing
Concepts Underlying the Calculations
The calculations behind the Market Cycle Phases Indicator are straightforward, combining the principles of moving averages and volatility measures:
Moving Average (MA): A simple moving average is used to determine the overall trend direction.
Average True Range (ATR): This measures market volatility over a specified period.
Volatility Threshold: A multiplier is applied to the ATR to distinguish between high and low volatility conditions.
How It Works
The indicator first calculates a moving average (MA) of the closing prices and the Average True Range (ATR) to measure market volatility. Based on the position of the price relative to the MA and the current volatility level, the indicator determines the current market phase:
Accumulation Phase: Price is below the MA, and volatility is low (Green background). This phase often indicates a period of consolidation and potential buying interest before an uptrend.
Uptrend Phase: Price is above the MA, and volatility is high (Blue background). This phase represents a strong upward movement in price, often driven by increased buying activity.
Distribution Phase: Price is above the MA, and volatility is low (Yellow background). This phase suggests a period of consolidation at the top of an uptrend, where selling interest may start to increase.
Downtrend Phase: Price is below the MA, and volatility is high (Red background). This phase indicates a strong downward movement in price, often driven by increased selling activity.
How Traders Can Use It
Traders can use the Market Cycle Phases Indicator to:
Identify potential entry and exit points based on market phase transitions.
Confirm trends and avoid false signals by considering both trend direction and volatility.
Develop and refine trading strategies tailored to specific market conditions.
Enhance risk management by recognizing periods of high and low volatility.
Observe long-term market cycles to make informed investment decisions.
Example Usage Instructions
Add the Market Cycle Phases Indicator to your chart.
Adjust the input parameters as needed:
Base Length: Default is 50.
Volatility Length: Default is 14.
Volatility Threshold: Default is 1.5.
Observe the color-coded background to identify the current market phase
Use the identified phases to inform your trading decisions:
Consider buying during the Accumulation or Uptrend phases.
Consider selling or shorting during the Distribution or Downtrend phases.
Combine with other indicators and analysis techniques for comprehensive market insights.
By incorporating the Market Cycle Phases Indicator into your trading toolkit, you can gain a clearer understanding of market dynamics and enhance your ability to navigate different market conditions, making it a valuable asset for long-term investing.
Double Top, Double Bottom & Head and Shoulders Patterns [ST]Double Top, Double Bottom & Head and Shoulders Patterns
Description in English:
This indicator identifies double top, double bottom, head and shoulders, and inverse head and shoulders patterns on a 4-hour timeframe. It marks the pivot points with circles and outlines the structures with lines, providing clear visual signals of these important reversal patterns.
The colors are customizable for each pattern type.
Detailed Explanation:
Configuration:
Pivot Length: This input defines the period over which pivot points are calculated. The default value is 10.
Circle Color: This input sets the color of the circles that mark the identified double top and double bottom patterns. The default color is blue.
Line Color: This input sets the color of the lines that circle the identified structures of double top and double bottom patterns. The default color is red.
Head and Shoulders Color: This input sets the color of the circles and lines that mark the head and shoulders patterns. The default color is orange.
Inverse Head and Shoulders Color: This input sets the color of the circles and lines that mark the inverse head and shoulders patterns. The default color is purple.
Pattern Identification:
Pivot High and Low: The script uses the pivothigh and pivotlow functions to identify local maxima and minima, essential for detecting the patterns.
Double Top: Identified when there are two pivot highs within the pivot length, and the second high is equal to the first. This pattern typically indicates a potential reversal from an uptrend to a downtrend.
Double Bottom: Identified when there are two pivot lows within the pivot length, and the second low is equal to the first. This pattern typically indicates a potential reversal from a downtrend to an uptrend.
Head and Shoulders: Identified when there is a higher pivot high (head) between two lower pivot highs (shoulders), indicating a potential reversal from an uptrend to a downtrend.
Inverse Head and Shoulders: Identified when there is a lower pivot low (head) between two higher pivot lows (shoulders), indicating a potential reversal from a downtrend to an uptrend.
Drawing Circles and Lines:
Double Top: Marked with blue circles and red lines.
Double Bottom: Marked with blue circles and red lines.
Head and Shoulders: Marked with orange circles and lines.
Inverse Head and Shoulders: Marked with purple circles and lines.
Indicator Benefits:
Pattern Identification: Helps traders identify key reversal patterns (double top, double bottom, head and shoulders, and inverse head and shoulders) on the 4-hour timeframe.
Visual Cues: Provides clear visual signals for these patterns, aiding in making informed trading decisions.
Customizable Parameters: Allows traders to adjust the pivot length, circle color, line color, head and shoulders color, and inverse head and shoulders color to suit different trading strategies and market conditions.
Justification of Component Combination:
Combining pivot point identification with pattern recognition provides a robust method for detecting significant reversal patterns. The visual cues enhance the trader's ability to quickly spot these patterns on the chart.
How Components Work Together:
The script first identifies pivot points based on the specified pivot length.
It then checks for the presence of double top, double bottom, head and shoulders, and inverse head and shoulders patterns using these pivot points.
When a pattern is identified, it is marked with a circle on the chart, and lines are drawn around the structure to provide a clear visual indication of the pattern's presence.
Título: Padrões de Morro Duplo, Fundo Duplo e Ombro-Cabeça-Ombro
Descrição em Português:
Este indicador identifica padrões de morro duplo, fundo duplo, ombro-cabeça-ombro e ombro-cabeça-ombro invertido no gráfico de 4 horas.
Ele marca os pontos de pivô com círculos e contorna as estruturas com linhas, fornecendo sinais visuais claros desses importantes padrões de reversão. As cores são personalizáveis para cada tipo de padrão.
Explicação Detalhada:
Configuração:
Comprimento do Pivô: Este input define o período sobre o qual os pontos de pivô são calculados. O valor padrão é 10.
Cor do Círculo: Este input define a cor dos círculos que marcam os padrões identificados de morro duplo e fundo duplo. A cor padrão é azul.
Cor da Linha: Este input define a cor das linhas que contornam as estruturas identificadas de morro duplo e fundo duplo. A cor padrão é vermelha.
Cor de Ombro-Cabeça-Ombro: Este input define a cor dos círculos e linhas que marcam os padrões de ombro-cabeça-ombro. A cor padrão é laranja.
Cor de Ombro-Cabeça-Ombro Invertido: Este input define a cor dos círculos e linhas que marcam os padrões de ombro-cabeça-ombro invertido. A cor padrão é lilás.
Identificação de Padrões:
Pivô Alto e Baixo: O script usa as funções pivothigh e pivotlow para identificar máximas e mínimas locais, essenciais para detectar os padrões.
Morro Duplo: Identificado quando há duas máximas de pivô dentro do comprimento do pivô, e a segunda máxima é igual à primeira. Este padrão geralmente indica uma reversão potencial de uma tendência de alta para uma tendência de baixa.
Fundo Duplo: Identificado quando há duas mínimas de pivô dentro do comprimento do pivô, e a segunda mínima é igual à primeira. Este padrão geralmente indica uma reversão potencial de uma tendência de baixa para uma tendência de alta.
Ombro-Cabeça-Ombro: Identificado quando há uma máxima de pivô mais alta (cabeça) entre duas máximas de pivô mais baixas (ombros), indicando uma reversão potencial de uma tendência de alta para uma tendência de baixa.
Ombro-Cabeça-Ombro Invertido: Identificado quando há uma mínima de pivô mais baixa (cabeça) entre duas mínimas de pivô mais altas (ombros), indicando uma reversão potencial de uma tendência de baixa para uma tendência de alta.
Desenho de Círculos e Linhas:
Morro Duplo: Marcado com círculos azuis e linhas vermelhas.
Fundo Duplo: Marcado com círculos azuis e linhas vermelhas.
Ombro-Cabeça-Ombro: Marcado com círculos e linhas laranjas.
Ombro-Cabeça-Ombro Invertido: Marcado com círculos e linhas lilás.
Benefícios do Indicador:
Identificação de Padrões: Ajuda os traders a identificar padrões-chave de reversão (morro duplo, fundo duplo, ombro-cabeça-ombro e ombro-cabeça-ombro invertido) no gráfico de 4 horas.
Sinais Visuais: Fornece sinais visuais claros para esses padrões, auxiliando na tomada de decisões informadas.
Parâmetros Personalizáveis: Permite que os traders ajustem o comprimento do pivô, a cor do círculo, a cor da linha, a cor de ombro-cabeça-ombro e a cor de ombro-cabeça-ombro invertido para se adequar a diferentes estratégias de negociação e condições de mercado.
Justificação da Combinação de Componentes:
Combinar a identificação de pontos de pivô com o reconhecimento de padrões fornece um método robusto para detectar padrões de reversão significativos. Os sinais visuais melhoram a capacidade do trader de identificar rapidamente esses padrões no gráfico.
Como os Componentes Funcionam Juntos:
O script primeiro identifica os pontos de pivô com base no comprimento do pivô especificado.
Em seguida, verifica a presença de padrões de morro duplo, fundo duplo, ombro-cabeça-ombro e ombro-cabeça-ombro invertido usando esses pontos de pivô.
Quando um padrão é identificado, ele é marcado com um círculo no gráfico, e linhas são desenhadas ao redor da estrutura para fornecer uma indicação visual clara da presença do padrão.