Historical Swing High-Low Gann IndicatorThe Historical Swing High-Low Gann Indicator is a powerful tool designed to track and visualize key market swing points over time. This indicator identifies significant swing highs and lows within a specified time frame and draws connecting lines between these points, allowing traders to observe the natural ebb and flow of the market.
What sets this indicator apart is its ability to maintain all previously drawn swing lines, creating a comprehensive historical view of market movements. Additionally, the indicator projects Gann-style lines from the most recent swing highs and lows, providing traders with potential future support and resistance levels based on the geometric progression of price action.
Features:
Swing Detection: Automatically detects significant swing highs and lows over a user-defined period (default is 3 hours).
Persistent Historical Lines: Keeps all previously drawn lines, offering a complete visual history of the market's swing points.
Gann-Style Projections: Draws forward-looking lines from the latest swing points to help predict possible future market levels.
Customizable Parameters: Allows users to adjust the swing detection period to suit different trading styles and time frames.
This indicator is ideal for traders who rely on price action, support and resistance levels, and Gann theory for their analysis. Whether used in isolation or as part of a broader strategy, the Historical Swing High-Low Gann Indicator provides valuable insights into the market's behavior over time.
Cycles
Day-of-Week PerformanceThis Pine Script indicator calculates and displays the average performance for each weekday over a specified lookback period on a chart. The performance is computed based on the percentage change from the open to the close price of each day.
Features:
Lookback Period:
Input field to specify the number of days to look back for calculating performance. The default is set to 756 days.
Performance Calculation:
Calculates the average percentage change from open to close for each weekday (Monday through Friday) within the specified lookback period.
Histogram Plots:
Displays histograms on the chart for each weekday. Each histogram represents the average performance of that day of the week.
Histograms are plotted with distinct colors:
Monday: Blue
Tuesday: Red
Wednesday: Green
Thursday: Orange
Friday: Purple
Performance Table:
A table is displayed in the top-right corner of the chart showing the average percentage performance for each weekday.
The table updates with the lookback period and the calculated average performance values for each weekday.
Positive performance values are shown in green, and negative values are shown in red.
This indicator helps visualize day-of-the-week performance trends, providing insights into which days typically perform better or worse over the specified period.
Normalized and Smoothed Cumulative Delta for Top 5 NASDAQ StocksThis script is designed to create a TradingView indicator called **"Normalized and Smoothed Cumulative Delta for Top 5 NASDAQ Stocks."** The purpose of this indicator is to track and visualize the cumulative price delta (the change in price from one period to the next) for the top five NASDAQ stocks: Apple Inc. (AAPL), Microsoft Corporation (MSFT), Alphabet Inc. (GOOGL), Amazon.com Inc. (AMZN), and Meta Platforms Inc. (FB).
### Key Features of the Script:
1. **Ticker Selection**:
- The script focuses on the top five NASDAQ stocks by automatically setting their tickers.
2. **Price Data Retrieval**:
- It fetches the closing prices for each of these stocks using the `request.security` function for the current timeframe.
3. **Delta Calculation**:
- The script calculates the delta for each stock, which is simply the difference between the current closing price and the previous closing price.
4. **Cumulative Delta Calculation**:
- It calculates the cumulative delta for each stock by adding the current delta to the previous cumulative delta. This helps track the total change in price over time.
5. **Summing and Smoothing**:
- The cumulative deltas for all five stocks are summed together.
- The script then applies an Exponential Moving Average (EMA) with a period of 5 to smooth the summed cumulative delta, making the indicator less sensitive to short-term fluctuations.
6. **Normalization**:
- To ensure the cumulative delta is easy to interpret, the script normalizes it to a range of 0 to 1. This is done by tracking the minimum and maximum values of the smoothed cumulative delta and scaling the data accordingly.
7. **Visualization**:
- The normalized cumulative delta is plotted as a smooth line, allowing users to see the overall trend of the cumulative price changes for the top five NASDAQ stocks.
- A horizontal line is added at 0.5, serving as a midline reference, which can help traders quickly assess whether the normalized cumulative delta is above or below its midpoint.
### Usage:
This indicator is particularly useful for traders and investors who want to monitor the aggregated price movements of the top NASDAQ stocks, providing a high-level view of market sentiment and trends. By smoothing and normalizing the data, it offers a clear and concise visualization that can be used to identify potential market turning points or confirm ongoing trends.
Fear/Greed Zone Reversals [UAlgo]The "Fear/Greed Zone Reversals " indicator is a custom technical analysis tool designed for TradingView, aimed at identifying potential reversal points in the market based on sentiment zones characterized by fear and greed. This indicator utilizes a combination of moving averages, standard deviations, and price action to detect when the market transitions from extreme fear to greed or vice versa. By identifying these critical turning points, traders can gain insights into potential buy or sell opportunities.
🔶 Key Features
Customizable Moving Averages: The indicator allows users to select from various types of moving averages (SMA, EMA, WMA, VWMA, HMA) for both fear and greed zone calculations, enabling flexible adaptation to different trading strategies.
Fear Zone Settings:
Fear Source: Select the price data point (e.g., close, high, low) used for Fear Zone calculations.
Fear Period: This defines the lookback window for calculating the Fear Zone deviation.
Fear Stdev Period: This sets the period used to calculate the standard deviation of the Fear Zone deviation.
Greed Zone Settings:
Greed Source: Select the price data point (e.g., close, high, low) used for Greed Zone calculations.
Greed Period: This defines the lookback window for calculating the Greed Zone deviation.
Greed Stdev Period: This sets the period used to calculate the standard deviation of the Greed Zone deviation.
Alert Conditions: Integrated alert conditions notify traders in real-time when a reversal in the fear or greed zone is detected, allowing for timely decision-making.
🔶 Interpreting Indicator
Greed Zone: A Greed Zone is highlighted when the price deviates significantly above the chosen moving average. This suggests market sentiment might be leaning towards greed, potentially indicating a selling opportunity.
Fear Zone Reversal: A Fear Zone is highlighted when the price deviates significantly below the chosen moving average of the selected price source. This suggests market sentiment might be leaning towards fear, potentially indicating a buying opportunity. When the indicator identifies a reversal from a fear zone, it suggests that the market is transitioning from a period of intense selling pressure to a more neutral or potentially bullish state. This is typically indicated by an upward arrow (▲) on the chart, signaling a potential buy opportunity. The fear zone is characterized by high price volatility and overselling, making it a crucial point for traders to consider entering the market.
Greed Zone Reversal: Conversely, a Greed Zone is highlighted when the price deviates significantly above the chosen moving average. This suggests market sentiment might be leaning towards greed, potentially indicating a selling opportunity. When the indicator detects a reversal from a greed zone, it indicates that the market may be moving from an overbought condition back to a more neutral or bearish state. This is marked by a downward arrow (▼) on the chart, suggesting a potential sell opportunity. The greed zone is often associated with overconfidence and high buying activity, which can precede a market correction.
🔶 Why offer multiple moving average types?
By providing various moving average types (SMA, EMA, WMA, VWMA, HMA) , the indicator offers greater flexibility for traders to tailor the indicator to their specific trading strategies and market preferences. Different moving averages react differently to price data and can produce varying signals.
SMA (Simple Moving Average): Provides an equal weighting to all data points within the specified period.
EMA (Exponential Moving Average): Gives more weight to recent data points, making it more responsive to price changes.
WMA (Weighted Moving Average): Allows for custom weighting of data points, providing more flexibility in the calculation.
VWMA (Volume Weighted Moving Average): Considers both price and volume data, giving more weight to periods with higher trading volume.
HMA (Hull Moving Average): A combination of weighted moving averages designed to reduce lag and provide a smoother curve.
Offering multiple options allows traders to:
Experiment: Traders can try different moving averages to see which one produces the most accurate signals for their specific market.
Adapt to different market conditions: Different market conditions may require different moving average types. For example, a fast-moving market might benefit from a faster moving average like an EMA, while a slower-moving market might be better suited to a slower moving average like an SMA.
Personalize: Traders can choose the moving average that best aligns with their personal trading style and risk tolerance.
In essence, providing a variety of moving average types empowers traders to create a more personalized and effective trading experience.
🔶 Disclaimer
Use with Caution: This indicator is provided for educational and informational purposes only and should not be considered as financial advice. Users should exercise caution and perform their own analysis before making trading decisions based on the indicator's signals.
Not Financial Advice: The information provided by this indicator does not constitute financial advice, and the creator (UAlgo) shall not be held responsible for any trading losses incurred as a result of using this indicator.
Backtesting Recommended: Traders are encouraged to backtest the indicator thoroughly on historical data before using it in live trading to assess its performance and suitability for their trading strategies.
Risk Management: Trading involves inherent risks, and users should implement proper risk management strategies, including but not limited to stop-loss orders and position sizing, to mitigate potential losses.
No Guarantees: The accuracy and reliability of the indicator's signals cannot be guaranteed, as they are based on historical price data and past performance may not be indicative of future results.
Hurst Exponent SmoothedDescription:
The Hurst Exponent Smoothed indicator provides a dynamic analysis of market behavior by calculating the Hurst Exponent over a specified lookback period. This tool is especially useful for identifying whether a market is trending or mean-reverting.
Key Features:
Lookback Period: Set to 90 by default, this parameter controls how many periods the indicator considers for its calculations. Adjusting this value allows you to fine-tune the sensitivity of the indicator to recent price action.
Market Analysis: The Hurst Exponent gives insights into the nature of price movement:
A value near 0.5 suggests a random walk, indicating that the market is unpredictable.
Values above 0.5 indicate a trending market where price movements exhibit persistence, suggesting that the current trend may continue.
Values below 0.5 point to a mean-reverting market, where price movements tend to reverse, making it a potential signal for contrarian trading strategies.
Usage:
Trend Following: When the Hurst Exponent is consistently above 0.5, it may indicate a strong trend. Traders can use this information to align with the current market direction.
Mean Reversion: If the Hurst Exponent falls below 0.5, it could signal that the market is more likely to revert to the mean, offering opportunities for mean-reversion strategies.
Visuals:
The indicator displays a smooth line oscillating between values, giving traders a clear visual cue for the current market condition.
The script is optimized for various timeframes, as demonstrated on the BTCUSD pair on a 270-minute chart. Traders can adapt the lookback period based on their trading style and the specific asset being analyzed.
Open Source: This script is open-source and free to use. Feel free to customize and adapt it to your needs!
75: Notable Financial CrisesThe TradingView script named "75: Notable Financial Crises" visualizes and marks significant financial crises on a financial chart.
This script plots vertical lines on the a chart corresponding to specific dates associated with notable financial crises in history. These crises could include events like the Great Depression (1929), Black Monday (1987), the Dot-com Bubble (2000), the Global Financial Crisis (2008), and others. By marking these dates on a chart, traders and analysts can easily observe the impact of these events on market behavior.
High-Low of X BarOverview
The High-Low of X Bar indicator allows traders to visualize historical high and low values from a specific number of bars ago directly on the chart.
Provides insight into past price action by displaying high, low, and their difference at the most recent bar.
Customizable inputs and color settings for labels enhance usability and visual integration with your chart.
Key Features
Historical Data Analysis: Displays the high, low, and the difference between these values from a specified number of bars ago.
Customizable Inputs: Set the number of bars ago to review historical price points, with a range from 1 to 2000 bars. Premium users can exceed this range.
Dynamic Labeling: Option to show high, low, and difference values as labels on the chart, with customizable text and background colors.
Color Customization: Customize label colors for high, low, and difference values, as well as for cases with insufficient bars.
Inputs
Number of Bars Ago: Enter the number of bars back from the current bar to analyze historical high and low values.
Show High Value: Toggle to display the historical high value.
Show Low Value: Toggle to display the historical low value.
Show Difference Value: Toggle to display the difference between high and low values.
Color Settings
High Label Background Color: Set the background color of the high value label.
High Label Text Color: Choose the text color for the high value label.
Low Label Background Color: Set the background color of the low value label.
Low Label Text Color: Choose the text color for the low value label.
Difference Label Background Color: Set the background color of the difference label.
Difference Label Text Color: Choose the text color for the difference label.
Not Enough Bars Label Background Color: Set the background color for the label shown when there are insufficient bars.
Not Enough Bars Label Text Color: Choose the text color for the insufficient bars label.
Usage Instructions
Add to Chart: Apply the High-Low of X Bar indicator to your TradingView chart.
Configure Settings: Adjust the number of bars ago and display options according to your analysis needs.
Customize Appearance: Set the colors for the labels to match your chart's style.
Analyze: Review the high, low, and their difference directly on your chart for immediate insights into past price movements.
Notes
Ensure your chart has sufficient historical data for the indicator to function properly.
Customize label visibility and colors based on your preference and trading strategy.
Macro Times [Blu_Ju]About ICT Macro Times:
The Inner Circle Trader (ICT) has taught that there are certain time sessions when the Interbank Price Delivery Algorithm (IPDA) is running a macro. The macro itself could be a repricing macro, a consolidation macro, etc. - this depends on where price currently is in relation to its draw. The times the macro is active do not change however, and are always the following (in New York local time):
8:50-9:10 (premarket macro)
9:50-10:10 (AM macro 1)
10:50-11:10 (AM macro 2)
11:50-12:10 (lunch macro)
13:10-13:40 (PM macro)
15:15-15:45 (final hour macro)
Because these times are fixed, traders can anticipate a setup is likely to form in or around these sessions. Setups may involve sweeps of liquidity (highs/lows), repricing to inefficiencies (e.g., fair value gaps), breaker setups, etc. (The specific setup involved is beyond the scope of this script; this script is concerned with visually marking the time sessions only.)
About this Script:
The scope of this script is to visually identify the macro active time sessions. This script draws vertical lines to mark the start and end of the macro time sessions. Optionally, the user can use a background color for the macro session with or without the vertical lines. The user can also toggle on or off any of the macro sessions, if he or she is only interested in certain ones. The user also has the freedom to change the times of the macro sessions if he or she is interested in a different time.
What makes this script unique is that it plots the macro time sessions after midnight for each day, before the real-time bar reaches the macro times. This is advantageous to the trader, as it gives the trader a visual cue that the macro times are approaching. When watching price it is easy to lose track of time, and the purpose of this script is to help the trader maintain where price is in relation to the macro time sessions in a simple, visual way.
Flat Market Scanner [CHE]Flat Market Scanner
Introduction
Welcome to our presentation on the "Flat Market Scanner" for TradingView. This innovative indicator is designed to identify and highlight periods of sideways market movement, providing traders with crucial insights for making informed decisions. Sideways phases are characterized by alternating up and down movements within a narrow price range, lacking a clear directional trend.
The Idea Behind the Flat Market Scanner
The core concept of the Flat Market Scanner is to detect and visualize flat (sideways) market conditions. In such periods, the price of an asset does not exhibit significant upward or downward movements, remaining within a narrow range. These flat markets are often characterized by low volatility and can be challenging for trend-following traders.
How It Works:
1. RSI Analysis: The indicator utilizes the Relative Strength Index (RSI) to measure the speed and change of price movements.
2. Cumulative Test Variable: It calculates the cumulative sum of positive and negative price changes to create a test variable.
3. Flat Period Detection: By examining the highest and lowest values of the test variable over a specified period (`flatPeriod`), the indicator determines if the market is flat.
4. Consecutive Flat Periods: It tracks consecutive periods where the market is flat to identify sustained sideways movement.
5. Visualization: When a flat market is detected, a colored box is drawn on the chart to highlight the flat period. The color of the box indicates the current RSI trend.
Why Flat Markets Pose Risks
Flat markets can present several risks and challenges for traders:
1. Reduced Profit Opportunities: In a flat market, price movements are minimal, leading to limited profit opportunities for traders who rely on significant price swings.
2. False Signals: Sideways markets often generate false signals for technical indicators, leading to potential losses if traders misinterpret these signals as trends.
3. Increased Costs: Frequent trading in a flat market can result in higher transaction costs, eating into potential profits.
4. Psychological Stress: The lack of clear direction can cause frustration and stress, leading traders to make impulsive decisions that deviate from their trading strategy.
Benefits of the Flat Market Scanner
- Clarity: The Flat Market Scanner provides visual clarity on when the market is flat, helping traders avoid entering positions during low-volatility periods.
- Risk Management: By identifying flat periods, traders can better manage their risk and allocate their capital to more promising market conditions.
- Strategic Planning: Understanding when the market is flat allows traders to adjust their strategies, such as focusing on range-bound trading techniques or waiting for breakout opportunities.
Conclusion
The Flat Market Scanner is an essential tool for traders seeking to navigate the complexities of market conditions. By effectively identifying and visualizing flat markets, this indicator empowers traders to make smarter decisions, manage risks, and optimize their trading strategies. Embrace the power of the Flat Market Scanner and enhance your trading experience on TradingView.
Thank you for your attention. Happy trading!
Best regards Chervolino
BTC - Power Law OscillatorDescription:
The BTC - Power Law Oscillator is a technical analysis tool designed to help traders and investors identify potential overbought and oversold conditions in the Bitcoin market. This oscillator is based on a power law model that approximates Bitcoin's historical price trajectory, providing a framework for understanding deviations from this trajectory over time.
Key Features:
Exponential Model: The oscillator uses an exponential model that represents Bitcoin's price growth over time since its inception on January 3, 2009. This model is mathematically expressed as:
price=exp(5.71×ln(days since inception)−38.16)
This captures the long-term growth trend of Bitcoin, allowing for the analysis of deviations from this model.
Deviation Analysis: The Power Law Oscillator measures the percentage deviation of Bitcoin's closing price from the model price. This deviation is expressed as a percentage to illustrate how far the current price is from the expected model trajectory.
Normalization: The oscillator values are normalized to a 0-100 range. A quadratic transformation is applied to enhance sensitivity to higher values, allowing for better visualization and interpretation of extreme conditions.
Bands and Zones:
Upper Band (50): Indicates the 20% threshold. Values above this band suggest overbought conditions, where Bitcoin's price may be significantly above the expected trajectory.
Lower Band (15): Indicates the 5% threshold. Values below this band suggest oversold conditions, where Bitcoin's price may be significantly below the expected trajectory.
Top Zone: The area above the upper band is shaded red, highlighting potential sell or caution areas.
Bottom Zone: The area below the lower band is shaded green, highlighting potential buy or accumulation areas.
Benefits:
Trend Analysis: Helps identify long-term trends and potential reversals by analyzing price deviations from a theoretical model based on historical growth.
Market Timing: Assists in market timing decisions by indicating overbought and oversold conditions with visual bands and zones.
Enhanced Sensitivity: The quadratic normalization enhances sensitivity to changes in the oscillator, providing clearer signals for traders.
Usage Tips:
Complementary Tool: Use this oscillator in conjunction with other technical indicators and fundamental analysis for more comprehensive market insights.
Risk Management: Always employ sound risk management strategies when trading, as no single indicator can guarantee accurate predictions.
Market Context: Consider the broader market context, as Bitcoin's volatility can lead to significant short-term fluctuations.
The BTC - Power Law Oscillator provides a unique perspective on Bitcoin's price movements by leveraging a mathematical model to understand historical growth trends and deviations. Use this tool to gain deeper insights into market dynamics and enhance your trading strategy.
BTC Hash Rate to Price RatioDescription:
The BTC Hash Rate to Price Ratio indicator is a sophisticated tool designed to assist traders in identifying potential market turning points for Bitcoin by combining network health, market sentiment, and valuation metrics. This indicator integrates three key components—Hash Rate, RSI (Relative Strength Index), and MVRV (Market Value to Realized Value)—to provide a comprehensive analysis of Bitcoin's market dynamics.
Key Features:
Hash Rate Analysis: Assesses the computational power of the Bitcoin network, reflecting network health and miner confidence. Changes in the hash rate can signal shifts in market sentiment.
RSI (Relative Strength Index): A momentum oscillator that measures the speed and change of price movements, identifying overbought or oversold conditions. Smoothed RSI provides clearer insights into market momentum.
MVRV (Market Value to Realized Value): A valuation metric comparing Bitcoin's market value to its realized value, offering insights into whether Bitcoin is overvalued or undervalued. Smoothed MVRV enhances signal accuracy.
How It Works:
Red Zones (Sell Signals): Highlighted when both the MVRV and RSI are above the hash rate, indicating potential market tops.
Green Zones (Buy Signals): Highlighted when both the MVRV and RSI are below the hash rate and MVRV is under 15, suggesting potential market bottoms.
Customizable Parameters: Allows traders to adjust smoothing periods and signal thresholds, tailoring the indicator to different trading strategies and market conditions.
Visual Aids: Includes dotted lines at key RSI levels (15 and 75) for quick reference to potential overbought and oversold conditions.
Benefits:
Comprehensive Analysis: Combines technical, fundamental, and network metrics to offer a well-rounded perspective on market conditions.
Early Warning Signals: Aims to provide early indications of potential market reversals, helping traders make informed decisions.
Flexibility: Suitable for both short-term and long-term trading strategies, allowing for adaptation to various market environments.
Usage Tips:
Use this indicator in conjunction with other technical analysis tools and fundamental insights for best results.
Consider the broader market context and macroeconomic factors when interpreting signals.
Practice sound risk management techniques to optimize trading performance.
Unlock the potential of your Bitcoin trading strategy with the BTC Hash Rate to Price Ratio indicator, and gain deeper insights into market dynamics to make more informed trading decisions.
[2024] Inverted Yield CurveInverted Yield Curve Indicator
Overview:
The Inverted Yield Curve Indicator is a powerful tool designed to monitor and analyze the yield spread between the 10-year and 2-year US Treasury rates. This indicator helps traders and investors identify periods of yield curve inversion, which historically have been reliable predictors of economic recessions.
Key Features:
Yield Spread Calculation: Accurately calculates the spread between the 10-year and 2-year Treasury yields.
Visual Representation: Plots the yield spread on the chart, with clear visualization of positive and negative spreads.
Inversion Highlighting: Background shading highlights periods where the yield curve is inverted (negative spread), making it easy to spot critical economic signals.
Alerts: Customizable alerts notify users when the yield curve inverts, allowing timely decision-making.
Customizable Yield Plots: Users can choose to display the individual 2-year and 10-year yields for detailed analysis.
How It Works:
Data Sources: Utilizes the Federal Reserve Economic Data (FRED) for fetching the 2-year and 10-year Treasury yield rates.
Spread Calculation: The script calculates the difference between the 10-year and 2-year yields.
Visualization: The spread is plotted as a blue line, with a grey zero line for reference. When the spread turns negative, the background turns red to indicate an inversion.
Customizable Plots: Users can enable or disable the display of individual 2-year and 10-year yields through simple input options.
Usage:
Economic Analysis: Use this indicator to anticipate potential economic downturns by monitoring yield curve inversions.
Market Timing: Identify periods of economic uncertainty and adjust your investment strategies accordingly.
Alert System: Set alerts to receive notifications whenever the yield curve inverts, ensuring you never miss crucial economic signals.
Important Notes:
Data Accuracy: Ensure that the FRED data symbols (FRED
and FRED
) are correctly referenced and available in your TradingView environment.
Customizations: The script is designed to be flexible, allowing users to customize plot colors and alert settings to fit their preferences.
Disclaimer:
This indicator is intended for educational and informational purposes only. It should not be considered as financial advice. Always conduct your own research and consult with a financial advisor before making investment decisions.
Enhanced Alligator Trend Indicator By Er. Parvez HaleemPurpose: The Enhanced Alligator Trend Indicator aims to identify strong and reliable buy and sell signals on the price chart by combining the Alligator Indicator with trend strength and volume filters. It is specifically designed for use on a 1-minute chart to enhance precision in short-term trading decisions.
Components:
Alligator Indicator:
Jaw Line (Blue): Calculated as a simple moving average (SMA) of the closing price over a specified period (default: 13 bars). Represents the long-term trend.
Teeth Line (Red): Calculated as a simple moving average (SMA) of the closing price over a shorter period (default: 8 bars). Represents the medium-term trend.
Lips Line (Green): Calculated as a simple moving average (SMA) of the closing price over an even shorter period (default: 5 bars). Represents the short-term trend.
Trend Strength Indicator:
Relative Strength Index (RSI): Measures the strength of the current trend, using a default period of 14 bars. RSI values above 50 suggest a bullish trend, while values below 50 suggest a bearish trend.
Volume Filter:
Volume Threshold: Filters signals based on trading volume to ensure they only appear when volume exceeds a specified threshold (default: 100,000). This helps to avoid low-volume noise and enhance signal reliability.
Additional Trend Filters:
Short-Term SMA: A simple moving average with a default period of 20 bars, used to assess short-term trend direction.
Long-Term SMA: A simple moving average with a default period of 50 bars, used to assess long-term trend direction.
SMA Crossover: A bullish crossover occurs when the short-term SMA is above the long-term SMA, and a bearish crossover occurs when the short-term SMA is below the long-term SMA.
Signal Generation:
Buy Signal: Generated when:
The Lips line is above the Teeth line, and the Teeth line is above the Jaw line (indicating a bullish alignment in the Alligator Indicator).
The RSI is above 50 (indicating strong bullish trend strength).
The trading volume exceeds the specified volume threshold (indicating sufficient trading activity).
The short-term SMA is above the long-term SMA (confirming a bullish trend).
Sell Signal: Generated when:
The Lips line is below the Teeth line, and the Teeth line is below the Jaw line (indicating a bearish alignment in the Alligator Indicator).
The RSI is below 50 (indicating strong bearish trend strength).
The trading volume exceeds the specified volume threshold (indicating sufficient trading activity).
The short-term SMA is below the long-term SMA (confirming a bearish trend).
Plotting on Chart:
Alligator Lines: The Jaw, Teeth, and Lips lines are plotted directly on the price chart in blue, red, and green, respectively, to indicate the long-term, medium-term, and short-term trends.
Buy/Sell Signals: Buy signals are plotted below the price bars in green, and sell signals are plotted above the price bars in red. These signals are marked with labels ("BUY" and "SELL") to clearly indicate trading opportunities.
Debugging: RSI and SMA lines are plotted but hidden by default. They can be revealed for verification purposes to ensure the correctness of the indicator’s calculations.
Alerts:
Buy Alert: Triggers when a buy signal condition is met, sending a notification that a buy opportunity has been identified.
Sell Alert: Triggers when a sell signal condition is met, sending a notification that a sell opportunity has been identified.
Fibonacci Time PeriodsThe " Fibonacci Time Periods " indicator uses power exponents of the constant Phi based on your custom time period to generate Fibonacci sequence-based progression on a given chart. This tool can help to anticipate the timing of potential turning points by highlighting Fib time zones where significant price movements may occur.
It is different from other alternatives specifically for the ability to alter the rate of progression .
Most famous regular Fib sequence expands with 1.618^(n+1) rate which produces vast change just after few iterations.
Those ever-expanding big intervals don't allow us to cover the smaller details of the chart which we might find crucial. So, the idea was born to break down the constant Phi to a self-fraction using power exponents. In other words, reducing rate of progression to make the expansion more gradual without losing properties of Fibonacci proportions.
Default settings have a rate of 0.25 which is basically Phi^1/4
That means we expect 4x more lines than in regular sequence to cover missing bits owing to formula: 1.618^(0.25*(n+1))
(Line 0.618 is added to enhance visual orientation and perception of proportions)
How it works:
Exponential rate of progression
First, it works out the difference between your custom start (0) and end (1) period
The result is multiplied by 1.618^rate to get the step
Rest lines are created by iterations. For instance, with default rate of 0.25, the 1st generated line = start + (End-Start)*1.618^0.25* 1 , second line = start + (End-Start)*1.618^0.25* 2 , etc.
If we change the rate to 1 it will produce the regular fib sequence with 1.618^(n+1) rate
Fixed rate of progression:
In this mode, when rate is 0.25, it grows exactly with exponent step of 0.25 so first, second, third, etc generated lines also have the fixed exponent of 0.25. The distance between lines do not expand.
How to use:
Set the start and end dates
Choose the type of progression
Choose your desired rate of progression
Customize the colors to match your chart preferences.
Observe the generated Fibonacci time intervals and use them to identify potential market movements and reactions.
Moving Average Ratio [InvestorUnknown]Overview
The "Moving Average Ratio" (MAR) indicator is a versatile tool designed for valuation, mean-reversion, and long-term trend analysis. This indicator provides multiple display modes to cater to different analytical needs, allowing traders and investors to gain deeper insights into the market dynamics.
Features
1. Moving Average Ratio (MAR):
Calculates the ratio of the chosen source (close, open, ohlc4, hl2 …) to a longer-term moving average of choice (SMA, EMA, HMA, WMA, DEMA)
Useful for identifying overbought or oversold conditions, aiding in mean-reversion strategies and valuation of assets.
For some high beta asset classes, like cryptocurrencies, you might want to use logarithmic scale for the raw MAR, below you can see the visual difference of using Linear and Logarithmic scale on BTC
2. MAR Z-Score:
Computes the Z-Score of the MAR to standardize the ratio over chosen time period, making it easier to identify extreme values relative to the historical mean.
Helps in detecting significant deviations from the mean, which can indicate potential reversal points and buying/selling opportunities
3. MAR Trend Analysis:
Uses a combination of short-term (default 1, raw MAR) and long-term moving averages of the MAR to identify trend changes.
Provides a visual representation of bullish and bearish trends based on moving average crossings.
Using Logarithmic scale can improve the visuals for some asset classes.
4. MAR Momentum:
Measures the momentum of the MAR by calculating the difference over a specified period.
Useful for detecting changes in the market momentum and potential trend reversals.
5. MAR Rate of Change (ROC):
Calculates the rate of change of the MAR to assess the speed and direction of price movements.
Helps in identifying accelerating or decelerating trends.
MAR Momentum and Rate of Change are very similar, the only difference is that the Momentum is expressed in units of the MAR change and ROC is expressed as % change of MAR over chosen time period.
Customizable Settings
General Settings:
Display Mode: Select the display mode from MAR, MAR Z-Score, MAR Trend, MAR Momentum, or MAR ROC.
Color Bars: Option to color the bars based on the current display mode.
Wait for Bar Close: Toggle to wait for the bar to close before updating the MAR value.
MAR Settings:
Length: Period for the moving average calculation.
Source: Data source for the moving average calculation.
Moving Average Type: Select the type of moving average (SMA, EMA, WMA, HMA, DEMA).
Z-Score Settings:
Z-Score Length: Period for the Z-Score calculation.
Trend Analysis Settings:
Moving Average Type: Select the type of moving average for trend analysis (SMA, EMA).
Longer Moving Average: Period for the longer moving average.
Shorter Moving Average: Period for the shorter moving average.
Momentum Settings:
Momentum Length: Period for the momentum calculation.
Rate of Change Settings:
ROC Length: Period for the rate of change calculation.
Calculation and Plotting
Moving Average Ratio (MAR):
Calculates the ratio of the price to the selected moving average type and length.
Plots the MAR with a gradient color based on its Z-Score, aiding in visual identification of extreme values.
// Moving Average Ratio (MAR)
ma_main = switch ma_main_type
"SMA" => ta.sma(src, len)
"EMA" => ta.ema(src, len)
"WMA" => ta.wma(src, len)
"HMA" => ta.hma(src, len)
"DEMA" => ta.dema(src, len)
mar = (waitforclose ? src : src) / ma_main
z_col = color.from_gradient(z, -2.5, 2.5, color.green, color.red)
plot(disp_mode.mar ? mar : na, color = z_col, histbase = 1, style = plot.style_columns)
barcolor(color_bars ? (disp_mode.mar ? (z_col) : na) : na)
MAR Z-Score:
Computes the Z-Score of the MAR and plots it with a color gradient indicating the magnitude of deviation from the mean.
// MAR Z-Score
mean = ta.sma(math.log(mar), z_len)
stdev = ta.stdev(math.log(mar),z_len)
z = (math.log(mar) - mean) / stdev
plot(disp_mode.mar_z ? z : na, color = z_col, histbase = 0, style = plot.style_columns)
plot(disp_mode.mar_z ? 1 : na, color = color.new(color.red,70))
plot(disp_mode.mar_z ? 2 : na, color = color.new(color.red,50))
plot(disp_mode.mar_z ? 3 : na, color = color.new(color.red,30))
plot(disp_mode.mar_z ? -1 : na, color = color.new(color.green,70))
plot(disp_mode.mar_z ? -2 : na, color = color.new(color.green,50))
plot(disp_mode.mar_z ? -3 : na, color = color.new(color.green,30))
barcolor(color_bars ? (disp_mode.mar_z ? (z_col) : na) : na)
MAR Trend:
Plots the MAR along with its short-term and long-term moving averages.
Uses color changes to indicate bullish or bearish trends based on moving average crossings.
// MAR Trend - Moving Average Crossing
mar_ma_long = switch ma_trend_type
"SMA" => ta.sma(mar, len_trend_long)
"EMA" => ta.ema(mar, len_trend_long)
mar_ma_short = switch ma_trend_type
"SMA" => ta.sma(mar, len_trend_short)
"EMA" => ta.ema(mar, len_trend_short)
plot(disp_mode.mar_t ? mar : na, color = mar_ma_long < mar_ma_short ? color.new(color.green,50) : color.new(color.red,50), histbase = 1, style = plot.style_columns)
plot(disp_mode.mar_t ? mar_ma_long : na, color = mar_ma_long < mar_ma_short ? color.green : color.red, linewidth = 4)
plot(disp_mode.mar_t ? mar_ma_short : na, color = mar_ma_long < mar_ma_short ? color.green : color.red, linewidth = 2)
barcolor(color_bars ? (disp_mode.mar_t ? (mar_ma_long < mar_ma_short ? color.green : color.red) : na) : na)
MAR Momentum:
Plots the momentum of the MAR, coloring the bars to indicate increasing or decreasing momentum.
// MAR Momentum
mar_mom = mar - mar
// MAR Momentum
mom_col = mar_mom > 0 ? (mar_mom > mar_mom ? color.new(color.green,0): color.new(color.green,30)) : (mar_mom < mar_mom ? color.new(color.red,0): color.new(color.red,30))
plot(disp_mode.mar_m ? mar_mom : na, color = mom_col, histbase = 0, style = plot.style_columns)
MAR Rate of Change (ROC):
Plots the ROC of the MAR, using color changes to show the direction and strength of the rate of change.
// MAR Rate of Change
mar_roc = ta.roc(mar,len_roc)
// MAR ROC
roc_col = mar_roc > 0 ? (mar_roc > mar_roc ? color.new(color.green,0): color.new(color.green,30)) : (mar_roc < mar_roc ? color.new(color.red,0): color.new(color.red,30))
plot(disp_mode.mar_r ? mar_roc : na, color = roc_col, histbase = 0, style = plot.style_columns)
Summary:
This multi-purpose indicator provides a comprehensive toolset for various trading strategies, including valuation, mean-reversion, and trend analysis. By offering multiple display modes and customizable settings, it allows users to tailor the indicator to their specific analytical needs and market conditions.
Timing - Fx MGKWhat You See:
Session Boxes:
As you observe, the larger purple box represents the Asian Session, spanning from around 22:00 to 06:00 UTC. You notice how it captures the overnight market activity.
The smaller, greyish box marks the London Session, from about 08:00 to 12:00 UTC. You can see how the price action changes during this session.
The New York Session is also indicated, with vertical lines possibly marking the open and close, helping you track movements as the U.S. markets come into play.
High and Low Levels:
Horizontal lines are drawn at the high and low of each session. You can use these as potential support or resistance levels, aiding in your decision-making process.
Vertical Lines:
These lines likely correspond to specific key times, such as session opens or closes. You can quickly identify the transition between sessions, which is crucial for your timing.
Color Coding:
Each session is color-coded, making it easier for you to distinguish between them at a glance. The purple, grey, and additional lines offer a clear visual distinction.
How You Use It:
This indicator is your go-to for understanding how different market sessions affect price action. You’ll use it to:
Recognize important price levels within each session.
Identify potential entry and exit points based on session highs and lows.
Observe how the market transitions from one session to another, giving you insight into the best times to trade.
Customization:
You have the flexibility to adjust the settings. You can change session times to suit your trading hours, modify colors to match your chart theme, and even choose which sessions to display or hide based on your focus.
This tool is designed to enhance your analysis, providing you with a structured view of market sessions. With this indicator, you’re well-equipped to navigate the global markets with greater precision and confidence.
ATR X-PowerATR X-Power is a simple graphical representation of Average True Range.
The ATR is calculated on a daily basis and averaged over the "Length" specified in settings (default is 14 days).
At the start of the day, the starting price is recorded and five horizontal lines are drawn which illustrate possible ranges for the day:
Starting price
Starting price + ATR (+100%)
Starting price - ATR (-100%)
Starting price + ATR/2 (+50%)
Starting price - ATR/2 (-50%)
The final two lines are drawn using the ATR half values in such a way that a X is formed. The X represents possible motion of the price back to starting price (also known as reversion to mean). The two lines are drawn as follows:
Beginning at (Starting Price + ATR/2) and ending at (Starting Price - ATR/2)
Beginning at (Starting Price - ATR/2) and ending at (Starting Price + ATR/2)
Use cases:
ATR presents us with the average amount of price fluctuation we can expect to see in a single day on a specific instrument
If price is near the extremes (+/-100% ATR) for the day, then probability of it moving outside that range is low, which increases odds of a reversal
Bugs?
Kindly report any issues you run into and I'll try to fix them promptly.
Thank you!
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.
Entropy Volatility Index [CHE]I Entropy Volatility Index (EVI)
II An Experimental Script for Measuring Market Volatility
III Introduction
The Entropy Volatility Index (EVI) is an experimental indicator based on concepts from thermodynamics and information theory. The goal of the EVI is to quantify market uncertainty and volatility by calculating the entropy of price changes.
IV Basic Concepts
Entropy in Thermodynamics
Entropy is a measure of disorder or randomness in a system.
The second law of thermodynamics states that entropy in a closed system tends to increase over time.
Entropy in Information Theory
In information theory, entropy measures the uncertainty or information content of a random variable.
The entropy H of a random variable X with probability distribution P(x) is calculated as:
H(X) = -∑ P(x) log P(x)
V Derivation of the EVI
Calculation of Price Changes
Absolute price changes are calculated to serve as the basis for probability calculations.
Creation of the Histogram
A histogram is created and initialized to count the frequency of price changes.
Updating the Histogram
The histogram is updated by counting the frequency of each price change.
Calculation of Probabilities
The probabilities of the price changes are calculated based on their frequencies in the histogram.
Calculation of Entropy
Entropy is calculated using the probabilities of price changes. Higher entropy indicates higher uncertainty or disorder in the market.
Plotting the Indicator
The EVI is plotted to visually represent market volatility and uncertainty.
VI Interpretation of the EVI
High EVI Values
High Volatility: Strong and irregular price movements.
High Uncertainty: Increased market uncertainty.
Possible Market Turning Points: Indicators of potential trend changes.
Low EVI Values
Low Volatility: More consistent and predictable price movements.
Stability: More stable market phases.
Trend Consistency: Indicators of stable trends or sideways movements.
VII Conclusion
The Entropy Volatility Index (EVI) is an experimental script that applies concepts from thermodynamics and information theory to measure market volatility. It offers a new perspective on market uncertainty and can be used as an additional tool for traders.
VIII Example Use Cases
Identifying Volatile Phases: Use the EVI to identify periods of high volatility and prepare for potential rapid price movements.
Risk Management: Adjust your risk management strategy based on the EVI. During high EVI periods, consider hedging positions or adjusting position sizes.
Complementing Other Indicators: Combine the EVI with other technical indicators (e.g., RSI, MACD) for a more comprehensive view of market conditions.
I hope this experimental script provides valuable insights. Thank you for your feedback and suggestions for improvement.
Best regards,
Chervolino
Auto Fib GOLDEN TARGET Golden Target Auto Fib Indicator
Unlock the power of automatic Fibonacci analysis with the Golden Target Auto Fib Indicator. Designed for traders who want to effortlessly incorporate Fibonacci retracement levels into their strategy, this indicator dynamically calculates and plots key Fibonacci levels based on recent price action.
Key Features:
Automatic Fibonacci Levels: Automatically determines the critical Fibonacci retracement levels using the most recent high and low over a user-defined period.
Customizable Length: Adjust the period over which the Fibonacci levels are calculated to match your trading style and market conditions.
Dynamic Plotting: Fibonacci levels are plotted in real-time, reflecting current market conditions and potential support and resistance areas.
Color-Coded Levels: Distinguishes between different Fibonacci levels with distinct colors, making it easy to identify significant price points at a glance.
Target Labels (Optional): Optionally display labels next to the Fibonacci levels to help identify potential target zones and better visualize the key levels.
How It Works:
The Golden Target Auto Fib Indicator calculates Fibonacci retracement levels based on the highest high and lowest low over a specified length. The levels plotted include key Fibonacci ratios: 23.6%, 38.2%, 61.8%, and the 100% extension, providing valuable insights into potential support and resistance areas as well as price targets.
Usage:
Adjust Settings: Set the Length parameter to define the period over which Fibonacci levels are calculated.
Analyze Levels: Observe the plotted Fibonacci levels and their color-coded lines to identify potential price retracement zones and target areas.
Incorporate Into Strategy: Use these levels in conjunction with your trading strategy to make more informed decisions on entry and exit points.
Whether you're a day trader or a swing trader, the Golden Target Auto Fib Indicator simplifies Fibonacci analysis and integrates seamlessly into your TradingView charts, helping you make more precise trading decisions.
Get started today and enhance your technical analysis with the Golden Target Auto Fib Indicator!
Feel free to adjust the description according to the specific features or customization options of your indicator.
MACD with SAR Indicator [CHE] MACD with SAR Indicator
Introduction
"The whole is greater than the sum of its parts. " The "MACD with SAR Indicator" is an innovative technical analysis tool that combines the strengths of the Moving Average Convergence Divergence (MACD) indicator with the Parabolic Stop and Reverse (SAR) indicator. This indicator provides traders with an enhanced method to detect trend changes and determine optimal entry and exit points in the market by using the SAR based on the MACD line to better identify reversal points. The combination generates clear trend reversal signals, which are visually represented through long (L) and short (S) signals on the chart.
Originality and Usefulness
This indicator differs from traditional MACD or SAR indicators by combining the trend-following calculations of the SAR with the trend strength and momentum calculations of the MACD. This enables a more precise identification of trend changes and provides clear buy and sell signals, which is particularly useful for manual traders.
Key Features and Functionality
1. Combination of MACD and SAR
- Why this Combination?: The MACD is known for its ability to measure the strength and direction of a trend, while the SAR is specifically designed to identify reversal points. By combining these two indicators, traders can better understand both the trend strength and potential turning points in the market.
- How Components Work Together: The MACD measures the difference between fast and slow moving averages, indicating market momentum. The SAR follows the MACD line instead of the price and marks potential reversal points more accurately. When the MACD signals a new trend and the SAR confirms it, the indicator provides reliable trading opportunities.
2. Adjustable Parameters
- MACD Settings: Users can adjust the lengths of the fast and slow moving averages (default: 28 and 38 periods) and the signal smoothing (default: 9 periods) to tailor the indicator to different market conditions.
- SAR Settings: Users can adjust the start value (default: 0.01), increment (default: 0.01), and maximum value (default: 0.18) of the SAR to control sensitivity and responsiveness.
3. Visual Representation and Signals
- Color-Coded Histograms: The histogram shows the difference between the MACD and signal line and is color-coded to highlight the direction of the trend.
- Signal Labels: The indicator automatically adds "L" (Long) and "S" (Short) labels on the chart to show the current positions to traders.
4. Alert Settings
- Custom Alerts: Alerts can be set to notify traders when the MACD and SAR experience significant state changes, such as when the histogram switches from rising to falling or vice versa.
5. Toggle Display
- Display Mode: Users can toggle the display of the MACD_SAR oscillator and MACD to focus on the information most relevant to their trading strategy.
Application and Benefits
- Versatility: This indicator can be used in various market conditions and for different trading strategies, including trend following and reversal trading.
- Ease of Interpretation: The clear visual representation and automatic signals make it easier for traders to identify trading opportunities and track trends.
- Customizability: With numerous settings options, the indicator can be tailored to individual preferences and specific market conditions.
Conclusion
The "MACD with SAR Indicator" is a valuable tool for traders seeking precise and reliable signals to identify market trends and make profitable trading decisions. With its extensive customization options, powerful features, and the ability to toggle displays, this indicator provides excellent support for technical analysis.
By emphasizing the synergy between the MACD and SAR indicators, highlighting the default settings, and clarifying that the SAR is based on the MACD line and generates clear trend reversal signals through long and short labels, this revised description should help users understand the functionalities and advantages of your indicator while meeting TradingView's publication requirements.
Best regards Chervolino
Gaussian Weighted Moving Average with Forecast [CHE]Presentation for TradingView: Gaussian Weighted Moving Average with Forecast
Introduction
Welcome to our presentation on the "Gaussian Weighted Moving Average with Forecast" (GWMA). This script, written in Pine Script™, offers an enhanced method for analyzing and predicting price movements on TradingView. The script combines Gaussian Weighted Moving Averages and polynomial regression to provide accurate and customizable forecasts.
Overview
Title: Gaussian Weighted Moving Average with Forecast
Author: chervolino
License: Mozilla Public License 2.0
Main Features
1. Gaussian Weighted Moving Average (GWMA):
- Calculates a weighted moving average using a Gaussian weighting function.
- Parameters for length and standard deviation allow fine-tuning of the smoothing effect.
2. Polynomial Regression with Forecast:
- Creates a model to predict future price movements.
- Adjustable length and degree of polynomial regression.
- Option to extrapolate predictions and visualize them.
3. Visual Representation:
- Uses lines and colors to depict trend changes.
- Customizable colors for upward and downward trends.
Input Parameters
Length: Length of the moving average (default: 50)
Standard Deviation: Standard deviation for Gaussian weighting (default: 10.0)
Width: Width of the plotted lines (default: 1)
Colors: Customizable colors for upward and downward trends
Forecast Length: Length of the forecast period (default: 20)
Extrapolate Length: Length of the extrapolation (default: 50)
Polynomial Degree: Degree of the polynomial regression (default: 3)
Lock Forecast: Option to lock and stabilize the forecast
Core Algorithms
1. Gaussian Weight Calculation:
gaussian_weight(x, std_dev) =>
1 / (std_dev * math.sqrt(2 * math.pi)) * math.exp(-0.5 * math.pow(x / std_dev, 2))
2. GWMA Calculation:
calculate_gwma(length, std_dev) =>
// Algorithm to calculate the weighted moving average
3. Initialize Lines for Polynomial Regression:
initialize_lines_array(extrapolate, length) =>
// Initialize array lines
4. Create Design Matrix for Polynomial Regression:
get_design_matrix(length, degree) =>
// Create the design matrix
5. Calculate and Plot Polynomial Regression:
calculate_polynomial_regression(src, length, degree, extrapolate, lines_arr, lock, width, upward_color, downward_color) =>
// Algorithm to calculate polynomial regression and plot the forecast
Combining Indicators: Originality and Usefulness
The combination of Gaussian Weighted Moving Average and polynomial regression provides traders with a robust tool for trend analysis and prediction. The GWMA smooths out price data while emphasizing recent prices, making it sensitive to short-term trends. Polynomial regression, on the other hand, offers a mathematical approach to model and forecast future prices based on historical data. By integrating these two methodologies, traders can achieve a more comprehensive view of market trends and potential future movements, making the tool highly valuable for decision-making.
Explanation for Users
Most TradingView users are not familiar with Pine Script, so a clear description is essential for understanding how to use the script.
Gaussian Weighted Moving Average (GWMA): This indicator calculates a moving average using Gaussian weights, which gives more importance to recent prices. The length and standard deviation parameters allow users to control the sensitivity and smoothness of the average.
Polynomial Regression with Forecast: This feature uses polynomial regression to model the price trend and predict future movements. Users can adjust the length of the historical data used, the degree of the polynomial, and the length of the forecast. The script plots these predictions, making it easier for traders to visualize potential future price paths.
Visualization of Results
1. GWMA Plotting:
plot(gaussian_ma_result, title="GWMA", color=line_color, linewidth=width_input)
2. Forecast Extrapolation:
plot(forecast_val, 'Extrapolation', offset=extrapolate_setting, linewidth=width_input, style=plot.style_circles)
Conclusion
The "Gaussian Weighted Moving Average with Forecast" script provides a powerful tool for analyzing and predicting price movements on TradingView. By combining Gaussian weighting and polynomial regression, it offers a precise and customizable method for trend analysis and forecasting.
Thank you for your attention! For any questions or further information, please feel free to reach out.
Stef's Money Supply IndicatorI have been fascinated by the growth in the Money Supply. Well, I think we ALL have been fascinated by this and the corresponding inflation that followed. That's why I created my Money Supply Indicator because I always wanted to chart and analyze my symbols based on the Money Supply. This indicator gives you that capability in a way that no other indicator in this field currently offers. Let me explain:
How does the indicator work?
Chart any symbol, turn on this indicator, and instantly it will factor in the M2 money supply on the asset's underlying price. Essentially, you are seeing the price of the asset normalized for the corresponding rise in the money supply. In some ways, this is a rather unique inflation-adjusted view of a symbol's price.
More importantly, you can compare and contrast the symbol's price adjusted for the rise in the Money Supply vs. the symbol's price without that adjustment by indexing all lines to 100. This is essential for understanding if the asset is at all-time highs, lows, or possibly undervalued or overvalued based on the current money supply situation.
Why does this matter?
This tool provides a deeper understanding of how the overall money supply influences the value of assets over time. By adjusting asset prices for changes in the money supply, traders can see the true value of assets relative to the amount of money in circulation.
What features can you access with this indicator?
The ability to normalize all lines to a starting point of 100 allows traders to compare the performance of the Money Supply, the symbol price, and the symbol price adjusted for the money supply all on one readable chart. This feature is particularly useful for spotting divergences and understanding relative performance over time with a rising or falling Money Supply.
What else can you do?
This is just version 1, and so I'll be adding more features rather soon, but there are two other important features in the settings menu including the following:
• Get the capability to quickly spot the highest and lowest points on the Money Supply adjusted price of your asset.
• Get the capability to change the gradient colors of the line when going up or down.
• Turn on the Brrrrrrr printer text as a reminder of our Fed Overlord Jerome Powell... lol
• Drag this indicator onto your main chart to combine it with your candlesticks or other charting techniques.
Stef's Money Supply Indicator! I look forward to hearing your feedback.