TEWMA Supertrend - [JTCAPITAL]TEWMA Supertrend - is a modified way to use Triple Exponential Weighted Moving Average (TEWMA) combined with ATR-based Supertrend logic for Trend-Following.
The idea behind this indicator is to merge the smoothness and responsiveness of TEWMA with the robustness of ATR-based Supertrend volatility filtering. This results in a tool that not only reacts quickly to price changes but also adapts to market volatility, providing reliable trend detection with reduced noise.
The indicator works by calculating in the following steps:
Source Selection
The user can select the price source (default is Close). This price series is the foundation of all calculations, and changing the source allows the indicator to adapt to different analytical perspectives, such as Open, High, Low, or HL2.
TEWMA Calculation
The script calculates a Weighted Moving Average (WMA) of the selected source, and then applies a Triple Exponential Moving Average (TEMA) smoothing on top of it. The result is what we call TEWMA. This hybrid method achieves two goals simultaneously:
-WMA adds sensitivity by giving more weight to recent data.
-TEMA reduces lag by combining multiple EMA calculations while keeping smoothness.
ATR Volatility Measurement
In parallel, the Average True Range (ATR) is calculated over the user-defined Supertrend length . ATR measures volatility and dynamically scales the upper and lower bands to adjust to different market conditions.
Upper and Lower Band Construction
The indicator builds two envelopes around the TEWMA:
- Upper Band = TEWMA + (Multiplier × ATR)
- Lower Band = TEWMA – (Multiplier × ATR)
These bands expand and contract depending on volatility, creating a dynamic channel.
Band Adjustment Logic
To prevent false flips, the current upper/lower band values are compared to their previous values. If price has not broken above or below the prior band, the bands “stick” to their previous values, thereby filtering noise and avoiding unnecessary trend changes.
Trend Detection
-If price closes above the adjusted upper band, the direction is bullish.
-If price closes below the adjusted lower band, the direction is bearish.
-Otherwise, the trend direction continues from its prior state.
The Trend line is then set to either the upper band (bearish) or lower band (bullish).
Visual Representation
-The TEWMA line itself is plotted and color-coded (blue for bullish, purple for bearish).
-The active Supertrend line is plotted depending on trend direction.
-Shaded regions are added around the lines for enhanced clarity, visually separating bullish and bearish phases.
Buy and Sell Conditions :
- Buy Signal : Triggered when price closes above the Supertrend line, confirming a bullish shift.
- Sell Signal : Triggered when price closes below the Supertrend line, confirming a bearish shift.
Features and Parameters :
- TEWMA Source – Select the input price (Close, Open, High, Low, etc.).
- TEWMA Length – Defines the lookback for the Weighted MA and subsequent TEMA smoothing.
- Supertrend Length – Defines the ATR period used for volatility measurement.
- Multiplier – Determines how far the Supertrend bands are placed from the TEWMA. Higher values mean wider bands and fewer trend flips, while lower values mean tighter bands and more frequent signals.
Specifications :
Weighted Moving Average (WMA)
The WMA gives more importance to recent price points while still considering past values. This makes it more responsive to recent moves than a Simple Moving Average (SMA).
Triple Exponential Moving Average (TEMA)
TEMA reduces lag by combining multiple layers of EMA calculations. Unlike a simple EMA, which can be slow to react, TEMA anticipates changes faster, while still maintaining smoothness to avoid false signals.
TEWMA (TEMA of WMA)
By applying TEMA on top of WMA, we create a hybrid smoothing technique. This retains the responsiveness of WMA but reduces its lag via TEMA’s structure. The result is a highly adaptive moving average, ideal for fast trend detection.
Average True Range (ATR)
ATR measures the degree of volatility by looking at the full trading range of each candle. It ensures that the Supertrend bands expand in volatile markets and contract in calm markets, keeping signals relevant to current conditions.
Supertrend Bands
The upper and lower envelopes built around TEWMA act as dynamic support and resistance. Their adaptive nature reduces false trend shifts during choppy sideways markets.
Band Adjustment Logic
Instead of recalculating bands every candle, the script uses a memory mechanism (previous values) to prevent unnecessary trend switches. This stabilizes the indicator and avoids excessive noise.
Trend Line
The final output is a line that follows price in trending phases while holding steady during consolidations. Its placement above or below price clearly signals bullish or bearish market structure.
Color Coding and Visuals
The use of shaded fills and line coloring enhances readability. Traders can quickly distinguish trend direction and momentum without deep numerical analysis.
Enjoy!
Moving Averages
Kalman Ema Crosses - [JTCAPITAL]Kalman EMA Crosses - is a modified way to use Kalman Filters applied on Exponential Moving Averages (EMA Crosses) for Trend-Following.
The Kalman filter is a recursive smoothing algorithm that reduces noise from raw price or indicator data, and in this script it is applied both directly to price and on top of EMA calculations. The goal is to create cleaner, more reliable crossover signals between two EMAs that are less prone to false triggers caused by volatility or market noise.
The indicator works by calculating in the following steps:
Source Selection
The script starts by selecting the price input (default is Close, but can be adjusted). This chosen source is the foundation for all further smoothing and EMA calculations.
Kalman Filtering on Price
Depending on user settings, the selected source is passed through one of two independent Kalman filters. The filter takes into account process noise (representing expected market randomness) and measurement noise (representing uncertainty in the price data). The Kalman filter outputs a smoothed version of price that minimizes noise and preserves underlying trend structure.
EMA Calculation
Two exponential moving averages (EMA 1 and EMA 2) are then computed on the Kalman-smoothed price. The lengths of these EMAs are fully customizable (default 15 and 25).
Kalman Filtering on EMA Values
Instead of directly using raw EMA curves, the script applies a second layer of Kalman filtering to the EMA values themselves. This step significantly reduces whipsaw behavior, creating smoother crossovers that emphasize real momentum shifts rather than temporary volatility spikes.
Trend Detection via EMA Crossovers
-A bullish trend is detected when EMA 1 (fast) crosses above EMA 2 (slow).
-A bearish trend is detected when EMA 1 crosses below EMA 2.
The detected trend state is stored and used to dynamically color the plots.
Visual Representation
Both EMAs are plotted on the chart. Their colors shift to blue during bullish phases and purple during bearish phases. The area between the two EMAs is filled with a shaded region to clearly highlight trending conditions.
Buy and Sell Conditions :
- Buy Condition : When the Kalman-smoothed EMA 1 crosses above the Kalman-smoothed EMA 2, a bullish crossover is confirmed.
- Sell Condition : When EMA 1 crosses below EMA 2, a bearish crossover is confirmed.
Users may enhance the robustness of these signals by adjusting process noise, measurement noise, or EMA lengths. Lower measurement noise values make the filter react faster (but potentially noisier), while higher values make it smoother (but slower).
Features and Parameters :
- Source : Selectable price input (Close, Open, High, Low, etc.).
- EMA 1 Length : Defines the fast EMA period.
- EMA 2 Length : Defines the slow EMA period.
- Process Noise : Controls how much randomness the Kalman filter assumes in price dynamics.
- Measurement Noise : Controls how much uncertainty is assumed in raw input data.
- Kalman Usage : Option to apply Kalman filtering either before EMA calculation (on price) or after (on EMA values).
Specifications :
Kalman Filter
The Kalman filter is an optimal recursive algorithm that estimates the state of a system from noisy measurements. In trading, it is used to smooth prices or indicator values. By balancing process noise (expected volatility) with measurement noise (data uncertainty), it generates a smoothed signal that reacts adaptively to market conditions.
Exponential Moving Average (EMA)
An EMA is a weighted moving average that emphasizes recent data more heavily than older data. This makes it more responsive than a simple moving average (SMA). EMAs are widely used to identify trends and momentum shifts.
EMA Crossovers
The crossing of a fast EMA above a slow EMA suggests bullish momentum, while the opposite suggests bearish momentum. This is a cornerstone technique in trend-following systems.
Dual Kalman Filtering
Applying Kalman both to raw price and to the EMAs themselves reduces whipsaws further. It creates crossover signals that are not only smoothed but also validated across two levels of noise reduction. This significantly enhances signal reliability compared to traditional EMA crossovers.
Process Noise
Represents the filter’s assumption about how much the underlying market can randomly change between steps. Higher values make the filter adapt faster to sudden changes, while lower values make it more stable.
Measurement Noise
Represents uncertainty in price data. A higher measurement noise value means the filter trusts the model more than the observed data, leading to smoother results. A lower value makes the filter more reactive to observed price fluctuations.
Trend Coloring & Fill
The use of dynamic colors and filled regions provides immediate visual recognition of trend states, helping traders act faster and with greater clarity.
Enjoy!
Anchored EMA/VWAP### Anchored EMA/VWAP Indicator
**Description:**
The **Anchored EMA/VWAP Indicator** is a powerful and versatile tool designed for traders seeking to analyze price trends and momentum from a user-defined anchor point in time. Built for TradingView using Pine Script v6, this indicator calculates and displays multiple **Exponential Moving Averages (EMAs)**, **Volume-Weighted Exponential Moving Averages (VWEMAs)**, and a **Volume-Weighted Average Price (VWAP)**, all anchored to a specific date and time chosen by the user. By anchoring these calculations, traders can focus on price action relative to significant market events, such as news releases, earnings reports, or key support/resistance levels.
The indicator supports multi-timeframe (MTF) analysis, allowing users to compute EMAs, VWEMAs, and VWAP on a higher or custom timeframe (e.g., 5-minute, 1-hour, daily) while overlaying the results on the current chart. It also includes customizable cross signals for EMA and VWEMA pairs, marked with distinct shapes (circles, diamonds, squares) to highlight potential trend changes or reversals. These features make the indicator ideal for trend-following, momentum trading, and identifying key price levels across various markets, including stocks, forex, cryptocurrencies, and commodities.
**Key Features:**
- **Anchored Calculations**: EMAs, VWEMAs, and VWAP start calculations from a user-specified anchor time, enabling analysis relative to significant market moments.
- **Multi-Timeframe Support**: Compute indicators on any timeframe (e.g., 60-minute, daily) and display them on the chart’s timeframe for flexible analysis.
- **Customizable EMAs and VWEMAs**: Four EMAs and four VWEMAs with adjustable lengths (default: 9, 21, 50, 100) and colors, with options to show or hide each.
- **Volume-Weighted Metrics**: VWAP and VWEMAs incorporate volume data, providing a more robust representation of market activity compared to standard EMAs.
- **Cross Signals**: Visual markers (circles, diamonds, squares) for crossovers between EMA and VWEMA pairs, with customizable visibility to highlight bullish (up) or bearish (down) signals.
- **User-Friendly Interface**: Organized input groups for General, EMA, VWEMA, VWAP, Arrow Settings, and Cross Visibility, with intuitive inline inputs for length and color customization.
- **Visual Clarity**: Overlaid on the price chart with distinct colors and line styles (dotted for EMAs, dashed for VWEMAs, solid for VWAP) to ensure easy interpretation.
**How to Use:**
1. **Set the Anchor Time**: Click a specific bar or enter a date/time (default: June 1, 2025) to start calculations from a significant market event.
2. **Select Timeframe**: Choose a timeframe (e.g., "5" for 5-minute, "D" for daily) to compute the indicators, allowing alignment with your trading strategy.
3. **Customize EMAs and VWEMAs**: Adjust lengths and colors for up to four EMAs and VWEMAs, and toggle their visibility to focus on relevant lines.
4. **Enable VWAP**: Display the anchored VWAP to identify volume-weighted price levels, useful as dynamic support/resistance.
5. **Monitor Cross Signals**: Enable cross visibility for specific EMA or VWEMA pairs to spot potential trend changes. Bullish crosses (e.g., shorter EMA crossing above longer EMA) are marked with green shapes below the bar, while bearish crosses are marked with red shapes above the bar.
6. **Interpret Signals**: Use EMA/VWEMA crossovers for trend confirmation, VWAP as a mean-reversion level, and volume-weighted VWEMAs for momentum analysis in high-volume markets.
**Use Cases:**
- **Trend Trading**: Identify trend direction using EMA and VWEMA crossovers, with shorter lengths (e.g., 9, 21) for faster signals and longer lengths (e.g., 50, 100) for trend confirmation.
- **Mean Reversion**: Use the anchored VWAP as a dynamic support/resistance level to trade pullbacks or breakouts.
- **Event-Based Analysis**: Anchor the indicator to significant events (e.g., earnings, economic data releases) to analyze price behavior post-event.
- **Multi-Timeframe Strategies**: Combine higher timeframe EMAs/VWAPs with lower timeframe price action for high-probability setups.
**Settings:**
- **Anchor Time**: Set the starting point for calculations (default: June 1, 2025).
- **Timeframe**: Choose the timeframe for calculations (default: 5-minute).
- **EMA/VWEMA Lengths**: Default lengths of 9, 21, 50, and 100 for both EMAs and VWEMAs, adjustable per user preference.
- **Colors**: Customizable colors with slight transparency for visual clarity.
- **Cross Visibility**: Toggle specific EMA and VWEMA cross signals (e.g., EMA1/EMA2, VWEMA1/VWEMA3) to reduce chart clutter.
- **Arrow Colors**: Green for bullish crosses, red for bearish crosses.
**Notes:**
- The indicator is overlaid on the price chart, ensuring seamless integration with price action analysis.
- VWEMAs and VWAP are volume-sensitive, making them particularly effective in markets with significant volume fluctuations.
- Ensure the anchor time is set to a valid historical or future bar to avoid calculation errors.
- Cross signals are conditional on non-NA values to prevent false positives during initialization.
**Author**: NEPOLIX
**Version**: 6 (Pine Script v6)
**Published**: For TradingView Community
This indicator is a must-have for traders looking to combine anchored, volume-weighted, and multi-timeframe analysis into a single, customizable tool. Whether you're a day trader, swing trader, or long-term investor, the Anchored EMA/VWAP Indicator provides actionable insights for informed trading decisions.
Uptrick: Volatility Weighted CloudIntroduction
The Volatility Weighted Cloud (VWC) is a trend-tracking overlay that combines adaptive volatility-based bands with a multi-source smoothed price cloud to visualize market bias. It provides users with a dynamic structure that adapts to volatility conditions while maintaining a persistent visual record of trend direction. By incorporating configurable smoothing techniques, percentile-ranked volatility, and multi-line cloud construction, the indicator allows traders to interpret price context more effectively without relying on raw price movement alone.
Overview
The script builds a smoothed price basis using the open, and close prices independently, and uses these to construct a layered visual cloud. This cloud serves both as a reference for price structure and a potential area of dynamic support and resistance. Alongside this cloud, adaptive upper and lower bands are plotted using volatility that scales with percentile rank. When price closes above or below these bands, the script interprets that as a breakout and updates the trend bias accordingly.
Candle coloring is persistent and reflects the most recent confirmed signal. Labels can optionally be placed on the chart when the trend bias flips, giving traders additional visual reference points. The indicator is designed to be both flexible and visually compact, supporting different strategies and timeframes through its detailed configuration options.
Originality
This script introduces originality through its combined use of percentile-ranked volatility, adaptive envelope sizing, and multi-source cloud construction. Unlike static-band indicators, the Volatility Weighted Cloud adjusts its band width based on where current volatility ranks within a defined lookback range. This dynamic scaling allows for smoother signal behavior during low-volatility environments and more responsive behavior during high-volatility phases.
Additionally, instead of using a single basis line, the indicator computes two separate smoothed lines for open and close. These are rendered into a shaded visual cloud that reflects price structure more completely than traditional moving average overlays. The use of ALMA and MAD, both less commonly applied in volatility-band overlays, adds further control over smoothing behavior and volatility measurement, enhancing its adaptability across different market types.
Inputs
Group: Core
Basis Length (short-term): The number of bars used for calculating the primary basis line. Affects how quickly the basis responds to price changes.
Basis Type: Option to choose between EMA and ALMA. EMA provides a standard exponential average; ALMA offers a centered, Gaussian-weighted average with reduced lag.
ALMA Offset: Determines the balance point of the ALMA window. Only applies when ALMA is selected.
Sigma: Sets the width of the ALMA smoothing window, influencing how much smoothing is applied.
Basis Smoothing EMA: Adds additional EMA-based smoothing to the computed basis line for noise reduction.
Group: Volatility & Bands
Volatility: Choose between StDev (standard deviation) and MAD (median absolute deviation) for measuring price volatility.
Vol Length (short-term): Length of the window used for calculating volatility.
Vol Smoothing EMA: Smooths the raw volatility value to stabilize band behavior.
Min Multiplier: Minimum multiplier applied to volatility when forming the adaptive bands.
Max Multiplier: Maximum multiplier applied at high volatility percentile.
Volatility Rank Lookback: Number of bars used to calculate the percentile rank of current volatility.
Show Adaptive Bands: Enables or disables the display of upper and lower volatility bands on the chart.
Group: Trend Switch Labels
Show Trend Switch Labels: Toggles the appearance of labels when the trend direction changes.
Label Anchor: Defines whether the labels are anchored to recent highs/lows or to the main basis line.
ATR Length (offset): Length used for calculating ATR, which determines label offset distance.
ATR Offset (multiplier): Multiplies the ATR value to place labels away from price bars for better visibility.
Label Size: Allows selection of label size (tiny to huge) to suit different chart setups.
Features
Adaptive Volatility Bands: The indicator calculates volatility using either standard deviation or MAD. It then applies an EMA smoothing layer and scales the band width dynamically based on the percentile rank of volatility over a user-defined lookback window. This avoids fixed-width bands and allows the indicator to adapt to changing volatility regimes in real time.
Volatility Method Options: Users can switch between two volatility measurement methods:
➤ Standard Deviation (StDev): Captures overall price dispersion, but may be sensitive to spikes.
➤ Median Absolute Deviation (MAD): A more robust measure that reduces the effect of outliers, making the bands less jumpy during erratic price behavior.
Basis Type Options: The core price basis used for cloud and bands can be built from:
➤ Exponential Moving Average (EMA): Fast-reacting and widely used in trend systems.
➤ Arnaud Legoux Moving Average (ALMA): A smoother, more centered alternative that offers greater control through offset and sigma parameters.
Multi-Line Basis Cloud: The cloud is formed by plotting two individually smoothed basis lines from open and close prices. A filled area is created between the open and close basis lines. This cloud serves as a dynamic support or resistance zone, allowing users to identify possible reversal areas. Price moving through or rejecting from the cloud can be interpreted contextually, especially when combined with band-based signals.
Persistent Trend Bias Coloring: The indicator uses the last confirmed breakout (above upper band or below lower band) to determine bias. This bias is reflected in the color of every subsequent candle, offering a persistent visual cue until a new signal is triggered. It helps simplify trend recognition, especially in choppy or sideways markets.
Trend Switch Labels: When enabled, the script places labeled markers at the exact bar where the bias direction switches. Labels are anchored either to recent highs/lows or to the main basis line, and spaced vertically using an ATR-based offset. This allows the trader to quickly locate historical trend transitions.
Alert Conditions: Two built-in alert conditions are available:
➤ Long Signal: Triggered when the close crosses above the upper adaptive band.
➤ Short Signal: Triggered when the close crosses below the lower adaptive band.
These conditions can be used for custom alerts, automation, or external signaling tools.
Display Control and Flexibility: Users can disable the adaptive bands for a cleaner layout while keeping the basis cloud and candle coloring active. The indicator can be tuned for fast or slow response depending on the strategy in use, and is suitable for intraday, swing, or position trading.
Summary
The Volatility Weighted Cloud is a configurable trend-following overlay that uses adaptive volatility bands and a structured cloud system to help visualize market bias. By combining EMA or ALMA smoothing with percentile-ranked volatility and a four-line price structure, it provides a flexible and informative charting layer. Its key strengths lie in the use of dynamic envelopes, visually persistent trend indication, and clearly defined breakout zones that adapt to current volatility conditions.
Disclaimer
This indicator is for informational and educational purposes only. Trading involves risk and may not be suitable for all investors. Past performance does not guarantee future results.
Best MA Finder: Sharpe/Sortino ScannerThis script, Best MA Finder: Sharpe/Sortino Scanner, is a tool designed to identify the moving average (SMA or EMA) that best acts as a dynamic trend threshold on a chart, based on risk-adjusted historical performance. It scans a wide range of MA lengths (SMA or EMA) and selects the one whose simple price vs MA crossover delivered the strongest results using either the Sharpe ratio or the Sortino ratio. Reading it is intuitive: when price spent time above the selected MA, conditions were on average more favorable in the backtest; below, less favorable. It is a trend and risk gauge, not an overbought or oversold signal.
What it does:
- Runs individual long-only crossover backtests for many MA lengths across short to very long horizons.
- For each length, measures the total number of trades, the annualized Sharpe ratio, and the annualized Sortino ratio.
- Uses the chosen metric value (Sharpe or Sortino) as the score to rank candidates.
- Applies a minimum trade filter to discard statistically weak results.
- Optionally applies a local stability filter to prefer a length that also outperforms its close neighbors by at least a small margin.
- Selects the optimal MA and displays it on the chart with a concise summary table.
How to use it:
- Choose MA type: SMA or EMA.
- Choose the metric: Sharpe or Sortino.
- Set the minimum trade count to filter out weak samples.
- Select the risk-free mode:
Auto: uses a short-term risk-free rate for USD-priced symbols when available.
Manual: you provide a risk-free ticker.
None: no risk-free rate.
- Optionally enable stability controls: neighbor radius and epsilon.
- Toggle the on-chart summary table as needed.
On-chart output:
- The selected optimal MA is plotted.
- The optional table shows MA length, number of trades, chosen metric value annualized, and the annual risk-free rate used.
Key features:
- Risk-adjusted optimization via Sharpe or Sortino for fair, comparable assessment.
- Broad MA scan with SMA and EMA support.
- Optional stability filter to avoid one-off spikes.
- Clear and auditable presentation directly on the chart.
Use cases:
- Traders who want a defensible, data-driven trend threshold without manual trial and error.
- Swing and trend-following workflows across timeframes and asset classes.
- Quick SMA vs EMA comparisons using risk-adjusted results.
Limitations:
- Not a full trading strategy with position sizing, costs, funding, slippage, or stops.
- Long-only, one position at a time.
- Discrete set of MA lengths, not a continuous optimizer.
- Requires sufficient price history and, if used, a reliable risk-free series.
This script is open-source and built from original logic. It does not replicate closed-source scripts or reuse significant external components.
MACD (The Moving Average Convergence Divergence)The Moving Average Convergence Divergence (MACD) is a momentum indicator used in technical analysis to identify trends, measure their strength, and signal potential reversals. It is calculated by subtracting the 26-period Exponential Moving Average (EMA) from the 12-period EMA, creating the MACD line. A 9-period EMA of the MACD line, known as the signal line, is then plotted to generate buy or sell signals. Positive MACD values suggest upward momentum, while negative values indicate downward momentum. Traders often watch for crossovers, divergences, and movements relative to the zero line to make informed decisions.
FSVZO | Lyro RSFSVZO | Lyro RS
This script is a technical analysis tool called the FSVZO, or Fourier Smoothed Volume Zone Oscillator. It is designed to analyze market momentum and trend strength by combining price and volume data with advanced smoothing techniques. The goal is to help identify potential trends, overbought/oversold conditions, and divergence signals in a clear visual format.
Understanding the Indicator's Components
The indicator plots a main oscillator line and several supporting elements on a separate pane below the chart.
The Main Oscillator: This is the primary, colored wave. Its movement and color are key to interpretation.
Trend Direction: The color shifts between bullish and bearish tones based on the momentum of the oscillator. This provides a quick visual reference for the prevailing short-term trend.
Key Levels: Horizontal lines mark significant levels such as +60, +85, -60, and -85. Movements above +60 or below -60 can indicate strong momentum, while approaches to the extreme levels (+85/-85) may suggest overbought or oversold conditions.
Divergence Detection: The indicator can plot labels ("ℝ" for Regular, "ℍ" for Hidden) on the oscillator to signal potential divergences. These occur when the indicator's direction differs from the price action on the main chart and can sometimes foreshadow reversals or continuations.
Moving Average (MA): A central moving average line, based on the oscillator, helps to smooth out the data further and can act as a dynamic support or resistance level within the indicator pane.
White Noise Filter (Optional): This feature displays a histogram that represents market noise. It can be toggled on or off. Analyzing the histogram's behavior may provide additional context on the stability or volatility of the current trend.
Dynamic Background: The background of the indicator pane can change color to highlight periods where the momentum is particularly strong, based on the position of the moving average.
Suggested Use and Interpretation
Traders might use this indicator in several ways:
Trend Identification: Observe the color and position of the main oscillator. A predominantly bullish-colored oscillator above the zero line may suggest an upward trend, while a bearish-colored one below zero may suggest a downward trend.
Signal Confirmation: Look for the oscillator to cross key levels (like +/-40 or +/-60) in the direction of a suspected trend as a confirmation signal.
Divergence Analysis: When the price makes a new high or low that is not confirmed by a new high or low on the FSVZO oscillator (a divergence), it can be a warning of potential weakness in the trend. The "ℝ" and "ℍ" labels help to identify these scenarios.
Extreme Readings: Readings near the +85 or -85 levels can indicate that a price move may be overextended, which could precede a pause or reversal.
Customization Options
The indicator includes settings groups that allow you to adjust its behavior and appearance:
FSVZO Settings: Adjust parameters like Length and Sensitivity to make the oscillator more or less responsive to market movements.
Signals & Display: Modify visual aspects such as Smooth Length and Glowing Amount, or toggle features like the dynamic background on and off.
Colors: Choose from several pre-set color palettes to suit your visual preferences.
⚠️Disclaimer
This indicator is a tool for technical analysis and does not provide guaranteed results. It should be used in conjunction with other analysis methods and proper risk management practices. The creators of this indicator are not responsible for any financial decisions made based on its signals.
VIX BanditThis is a momentum indicator that identifies potential VIX bottoms by using seven configurable Williams %R oscillators simultaneously.
Green dots🟢appear below the bar when all %R series agree the VIX is extremely oversold.
Fuchsia dots🟣appear above the bar when VIX reverts to its long-term average (an EMA).
I hope this helps you spot moments of maximum optimism and trade the subsequent panic, somehow.
TEWMA - [JTCAPITAL]TEWMA - is a modified way to use Triple Exponential Moving Average (TEMA) combined with Weighted Moving Average (WMA) and adaptive multi-length averaging for Trend-Following.
The indicator blends short- and extended-length smoothed signals into a single adaptive line, then assigns directional bias to highlight bullish or bearish phases more clearly.
The indicator works by calculating in the following steps:
Source Selection
The script begins with a selectable price source (default: Close, but can be changed to Open, High, Low, HL2, etc.). This ensures flexibility depending on the user’s preferred market perspective.
Dual-Length Calculation
A base length ( len ) is chosen, and then multiplied by a factor ( multi , default 1.75). This produces a secondary, longer period ( len2 ) that adapts proportionally to the base.
Weighted + Triple Exponential Smoothing
-First, a WMA (Weighted Moving Average) is applied to the price source.
-Then, the TEMA (Triple Exponential Moving Average) is applied to smooth the WMA even further.
-This process is repeated for both len and len2 , producing TEWMA1 and TEWMA2 .
Adaptive Averaging
The final TEWMA line is calculated as the average of TEWMA1 and TEWMA2, creating a blend between the short-term and extended-term signals. This balances reactivity and stability, reducing lag while avoiding excessive noise.
Trend Direction Detection
-If TEWMA is greater than its previous value → Bullish .
-If TEWMA is lower than its previous value → Bearish .
-A Signal variable is used to store this directional bias, ensuring continuity between bars.
Visual Plotting
-The main TEWMA is plotted with bold coloring (Blue for bullish, Purple for bearish).
-TEWMA1 and TEWMA2 are plotted as thinner supporting lines.
-Each line is given a shadow-fill (between 100% and 90% of its value) for emphasis and visual clarity.
Alerts
Custom alerts are defined:
- TEWMA Long → when bullish.
- TEWMA Short → when bearish.
-These alerts can be integrated into TradingView’s alerting system for automated notifications.
Buy and Sell Conditions :
- Buy : Triggered when TEWMA rises (bullish slope). The indicator colors the line blue and an alert can be fired.
- Sell : Triggered when TEWMA declines (bearish slope). The line turns purple, signaling potential short or exit points.
Features and Parameters :
- Source → Selectable price input (Close, Open, HL2, etc.).
- Length (len) → Base period for the WMA/TEMA calculation.
- Multiplier (multi) → Scales the secondary length to create a longer-term smoothing.
- Color-coded Trend Lines → Blue for bullish, Purple for bearish.
- Shadow Fill Effects → Provides depth and easier visualization of trend direction.
- Alert Conditions → Prebuilt alerts for both Long and Short scenarios.
Specifications :
Weighted Moving Average (WMA)
The WMA assigns more weight to recent price values, making it more responsive than a Simple Moving Average (SMA). This enhances early detection of market turns while reducing lag compared to longer-term averages.
Triple Exponential Moving Average (TEMA)
TEMA is designed to minimize lag by combining multiple EMA layers (EMA of EMA of EMA). It is smoother and more adaptive than traditional EMAs, making it ideal for detecting true market direction without overreacting to small fluctuations.
Multi-Length Averaging
By calculating two versions of WMA → TEMA with different lengths and then averaging them, the indicator balances responsiveness (short-term sensitivity) and reliability (long-term confirmation). This prevents whipsawing while keeping signals timely.
Adaptive Signal Assignment
Instead of simply flipping signals at crossovers, the indicator checks slope direction of TEWMA. This ensures smoother trend-following behavior, reducing false positives in sideways conditions.
Color-Coding & Visual Shading
Visual clarity is achieved by coloring bullish periods differently from bearish ones, with shaded fills beneath each line. This allows traders to instantly identify trend conditions and compare short- vs long-term signals.
Alert Conditions
Trading decisions can be automated by attaching alerts to the TEWMA’s bullish and bearish states. This makes it practical for active trading, swing setups, or algorithmic strategies.
Enjoy!
Ultra Simple ReversalThis is a simple script that combines Key Features:
✅ No plotting - Only text labels and candle color changes
✅ Reversal candle detection - Changes candle color on high-probability signals
✅ BUY/SELL text labels - Clear directional signals
✅ Four-module confluence - SSL + Squeeze + MTF Pivots + ORB Breakout
✅ Non-repainting - Reliable signals using proper security calls
✅ Pine Script v6 compatible - All syntax errors fixed
Sols Day Trading Signals (5m / 10m)This indicator is designed for day trading on the 5-minute and 10-minute charts.
Includes:
EMA 9 & EMA 21 crossover signals
MACD momentum confirmation
RSI trend filter (50+)
Buy/Sell labels directly on the chart
💡 How to Use:
Go long when EMA 9 crosses above EMA 21, MACD is positive, and RSI is above 50
Go short when EMA 9 crosses below EMA 21, MACD is negative, and RSI is below 50
Best used with proper risk management (1-2% per trade)
⚠️ Disclaimer: This is for educational purposes only — always backtest and trade responsibly.
RSI: alternative derivationMost traders accept the Relative Strength Index (RSI) as a standard tool for measuring momentum. But what if RSI is actually a position indicator?
This script introduces an alternative derivation of RSI, offering a fresh perspective on its true nature. Instead of relying on the traditional calculation of average gains and losses, this approach directly considers the price's position relative to its equilibrium (moving average), adjusted for volatility.
While the final value remains identical to the standard RSI, this alternative derivation offers a completely new understanding of the indicator.
Key components:
Price (Close)
Utilizes the closing price, consistent with the original RSI formula.
normalization factor
Transforms raw calculations into a fixed range between -1 and +1.
normalization_factor = 1 / (Length - 1)
EMA of Price
Applies Wilder’s Exponential Moving Average (EMA) to the price, serving as the anchor point for measuring price position, similar to the traditional RSI formula.
myEMA = ta.rma(close,Length)
EMA of close-to-close absolute changes (unit of volatility)
Adjusts for market differences by applying a Wilder’s EMA to absolute price changes (volatility), ensuring consistency across various assets.
CC_vol = ta.rma(math.abs(close - close ),Length)
Calculation Breakdown
DISTANCE:
Calculate the difference between the closing price and its Wilder's EMA. A positive value indicates the price is above the EMA; a negative value indicates it is below.
distance = close - myEMA
STANDARDIZED DISTANCE
Divide the distance by the unit of volatility to standardize the measurement across different markets.
S_distance = distance / CC_vol
NORMALIZED DISTANCE
Normalize the standardized distance using the normalization factor (n-1) to adjust for the lookback period.
N_distance = S_distance * normalization_factor
RSI
Finally, scale the normalized distance to fit within the standard RSI range of 0 to 100.
myRSI = 50 * (1 + N_distance)
The final equation:
RSI = 50 ×
What This Means for RSI
Same RSI Values, Different Interpretation
The standard RSI formula may obscure its true measurement, whereas this approach offers clarity.
RSI primarily indicates the price's position relative to its equilibrium, rather than directly measuring momentum.
RSI can still be used to analyze momentum, but in a more intuitive and well-informed way.
TW All in OneIts a overlap strategy, giving signals for buy and sell.
Mostly suitable for Bank Nifty. Nifty and crude oil
Yasser Buy/Sell Signal Indicator 001Coded by: Yasser Mahmoud (YWMAAAWORLD):
For any assistance contact me at: yarm.global@gmail.com
# 🚀 **EMA Trend & Signal Indicator - The Ultimate Anti-Chop Trading System**
## **Finally! An Indicator That Eliminates False Signals and Maximizes Trending Profits**
Are you tired of getting whipsawed in choppy markets? Frustrated by indicators that give you 10 signals when you need just 1 good one? **This changes everything.**
---
## 🎯 **What Makes This Indicator Revolutionary?**
### **🔥 INNOVATIVE 7-FILTER CONFIRMATION SYSTEM**
This isn't just another EMA crossover indicator. It's a **complete trading system** that combines:
✅ **Multi-EMA Trend Analysis** (8, 13, 21, 50, 200 EMAs)
✅ **Volume Surge Detection** (1.5x average volume confirmation)
✅ **RSI Momentum Filter** (Avoids overbought/oversold traps)
✅ **EMA Slope Confirmation** (All short-term EMAs must align)
✅ **Advanced Anti-Chop Technology** (Patent-pending 5-filter system)
### **🚫 REVOLUTIONARY ANTI-CHOP FILTERS**
**The game-changer that separates amateurs from professionals:**
1. **Trend Strength Analyzer** - Measures EMA separation strength
2. **EMA Bunching Detector** - Prevents signals when EMAs are too close
3. **Market Structure Scanner** - Identifies genuine trending vs ranging markets
4. **Enhanced Volatility Filter** - Waits for sufficient market movement
5. **Smart Chop Detection** - Multi-timeframe chopiness analysis
**Result: 3 out of 5 filters must pass = Only HIGH-PROBABILITY setups trigger signals!**
---
## 📈 **TRADING RULES - COPY & PASTE STRATEGY**
### **🟢 BUY SIGNALS (Long Entry)**
**When ALL conditions align:**
- Price above 50 EMA **AND** 50 EMA above 200 EMA (Uptrend confirmed)
- 8 EMA > 13 EMA > 21 EMA (Perfect alignment)
- Volume > 1.5x average (Institutional participation)
- RSI between 50-70 (Bullish momentum, not overbought)
- All EMA slopes positive (True trending, not fake breakout)
- Anti-Chop Score ≥ 3/5 (Market conditions suitable)
**📍 Entry:** When green "BUY" label appears
**🛡️ Stop Loss:** Below nearest swing low or 50 EMA
**🎯 Take Profit:** 2:1 or 3:1 risk/reward ratio
### **🔴 EXIT BUY SIGNALS (Risk Management)**
**Automatic protection when:**
- EMAs lose perfect alignment (8>13>21 breaks)
- Trend remains intact but short-term weakness detected
**📍 Action:** Exit position when "EXIT BUY" appears
**💡 Strategy:** Wait for "BUY" signal to re-enter if trend continues
### **🟥 SELL SIGNALS (Short Entry)**
**Mirror logic for downtrends:**
- Price below 50 EMA **AND** 50 EMA below 200 EMA
- 8 EMA < 13 EMA < 21 EMA (Perfect bearish alignment)
- Same volume, RSI, and anti-chop confirmations
### **🔸 EXIT SELL SIGNALS**
**Smart exit when bearish alignment breaks**
---
## 💰 **PROFIT-MAXIMIZING FEATURES**
### **📊 REAL-TIME STATUS DASHBOARD**
Never guess market conditions again! Live display shows:
- Current trend direction
- Signal state (BUY/SELL/EXIT/NONE)
- EMA alignment status
- Volume surge detection
- RSI level with color coding
- Anti-chop score (X/5)
- **Signal quality assessment**
### **🎨 CLEAN VISUAL SYSTEM**
- **Large, clear text labels** (no tiny arrows to miss)
- **Color-coded status panel** (optimized for white backgrounds)
- **Only long-term EMAs visible** (reduces chart clutter)
- **Smart sizing** (signals visible but not overwhelming)
### **🔔 BUILT-IN ALERTS**
Set and forget! Get notified instantly when:
- New BUY/SELL signals trigger
- EXIT signals protect your profits
- All confirmations align for high-probability setups
---
## 🏆 **WHY TRADERS CHOOSE THIS OVER EVERYTHING ELSE**
### ❌ **OTHER INDICATORS:**
- Give signals in every market condition
- Generate 50+ signals per day (analysis paralysis)
- No differentiation between high/low probability setups
- Leave you guessing about market structure
### ✅ **THIS SYSTEM:**
- **Selective Excellence** - Only 3-7 high-quality signals per week
- **Built-in Intelligence** - Automatically avoids choppy markets
- **Complete Transparency** - Shows you exactly why each signal triggers
- **Professional Grade** - Used by institutional-level confirmation methods
---
## 🎓 **PERFECT FOR:**
✅ **Swing Traders** - Clean entries on major trend moves
✅ **Day Traders** - High-probability intraday setups
✅ **Position Traders** - Long-term trend following
✅ **Beginners** - Clear, unambiguous signals with built-in education
✅ **Professionals** - Advanced filtering reduces noise, maximizes edge
---
## ⚡ **QUICK SETUP GUIDE**
1. **Add indicator to chart**
2. **Enable all default filters** (optimized settings included)
3. **Watch the status panel** - Wait for Chop Score ≥ 3/5
4. **Enter on BUY/SELL signals** - Exit on EXIT signals
5. **Profit from trending moves** while avoiding choppy losses!
---
## 🌟 **THE BOTTOM LINE**
**Stop fighting the market. Start trading WITH institutional-grade intelligence.**
This isn't just an indicator - it's your **competitive advantage** in a market where 90% of traders lose money due to poor timing and choppy market entries.
**Join the 10% who consistently profit by trading only when conditions are optimal.**
---
### 🔥 **"Finally, an indicator that thinks like a professional trader - selective, patient, and deadly accurate when it matters most."**
**Download now and experience the difference between trading signals and trading INTELLIGENCE.**
*Results may vary. Past performance does not guarantee future results. Always use proper risk management.*
Price–MA Separation (Z-Score)Price–MA Separation (Z-Score + Shading)
This indicator measures how far price is from a chosen moving average and shows it in a separate pane.
It helps traders quickly spot overextended moves and mean-reversion opportunities.
⸻
What it does
• Calculates the separation between price and a moving average (MA):
• In Points (Price − MA)
• In Percent ((Price / MA − 1) × 100%)
• Converts that separation into a Z-Score (statistical measure of deviation):
• Z = (Separation − Mean) ÷ StdDev
• Highlights when price is unusually far from the MA relative to its recent history.
⸻
Visuals
• Histogram bars:
• Green = above the MA,
• Orange = below the MA.
• Intensity increases with larger Z-Scores.
• Zero line: red baseline (price = MA).
• Z threshold lines:
• +T1 = light red (mild overbought)
• +T2 = dark red (strong overbought)
• −T1 = light green (mild oversold)
• −T2 = dark green (strong oversold)
• Default thresholds: ±1 and ±2.
⸻
Settings
• MA Type & Length: Choose between SMA, EMA, WMA, VWMA, or SMMA (RMA).
• Units: Show separation in Points or Percent.
• Plot Mode:
• Raw = distance in points/percent.
• Z-Score = standardized deviation (default).
• Absolute Mode: Show only magnitude (ignore direction).
• Smoothing: Overlay a smoothed line on the histogram.
• Z-Bands: Visual guides at ± thresholds.
⸻
How to use
• Look for large positive Z-Scores (red zones): price may be stretched far above its MA.
• Look for large negative Z-Scores (green zones): price may be stretched far below its MA.
• Use as a mean-reversion signal or to confirm trend exhaustion.
• Works well with:
• Swing entries/exits
• Overbought/oversold conditions
• Filtering other signals (RSI, MACD, VWAP)
⸻
Notes
• Z-Scores depend on the lookback window (default = 100 bars). Adjust for shorter/longer memory.
• Strong deviations don’t always mean reversal—combine with other tools for confirmation.
• Not financial advice. Always manage risk.
⸻
Try adjusting the MA length and Z-Score thresholds to fit your trading style.
AI Trading Alerts v6 — SL/TP + Confidence + Panel (Fixed)Overview
This Pine Script is designed to identify high-probability trading opportunities in Forex, commodities, and crypto markets. It combines EMA trend filters, RSI, and Stochastic RSI, with automatic stop-loss (SL) & take-profit (TP) suggestions, and provides a confidence panel to quickly assess the trade setup strength.
It also includes TradingView alert conditions so you can set up notifications for Long/Short setups and EMA crosses.
⚙️ Features
EMA Trend Filter
Uses EMA 50, 100, 200 for trend confirmation.
Bull trend = EMA50 > EMA100 > EMA200
Bear trend = EMA50 < EMA100 < EMA200
RSI Filter
Bullish trades require RSI > 50
Bearish trades require RSI < 50
Stochastic RSI Filter
Prevents entries during overbought/oversold extremes.
Bullish entry only if %K and %D < 80
Bearish entry only if %K and %D > 20
EMA Proximity Check
Price must be near EMA50 (within ATR × adjustable multiplier).
Signals
Continuation Signals:
Long if all bullish conditions align.
Short if all bearish conditions align.
Cross Events:
Long Cross when price crosses above EMA50 in bull trend.
Short Cross when price crosses below EMA50 in bear trend.
Automatic SL/TP Suggestions
SL size adjusts depending on asset:
Gold/Silver (XAU/XAG): 5 pts
Bitcoin/Ethereum: 100 pts
FX pairs (default): 20 pts
TP = SL × Risk:Reward ratio (default 1:2).
Confidence Score (0–4)
Based on conditions met (trend, RSI, Stoch, EMA proximity).
Labels:
Strongest (4/4)
Strong (3/4)
Medium (2/4)
Low (1/4)
Visual Panel on Chart
Shows ✅/❌ for each condition (trend, RSI, Stoch, EMA proximity, signal now).
Confidence row with color-coded strength.
Alerts
Long Setup
Short Setup
Long Cross
Short Cross
🖥️ How to Use
1. Add the Script
Open TradingView → Pine Editor.
Paste the full script.
Click Add to chart.
Save as "AI Trading Alerts v6 — SL/TP + Confidence + Panel".
2. Configure Inputs
EMA Lengths: Default 50/100/200 (works well for swing trading).
RSI Length: 14 (standard).
Stochastic Length/K/D: Default 14/3/3.
Risk:Reward Ratio: Default 2.0 (can change to 1.5, 3.0, etc.).
EMA Proximity Threshold: Default 0.20 × ATR (adjust to be stricter/looser).
3. Read the Panel
Top-right of chart, you’ll see ✅ or ❌ for:
Trend → Are EMAs aligned?
RSI → Above 50 (bull) or below 50 (bear)?
Stoch OK → Not extreme?
Near EMA50 → Close enough to EMA50?
Above/Below OK → Price position vs. EMA50 matches trend?
Signal Now → Entry triggered?
Confidence row:
🟢 Green = Strongest
🟩 Light green = Strong
🟧 Orange = Medium
🟨 Yellow = Low
⬜ Gray = None
4. Alerts Setup
Go to TradingView Alerts (⏰ icon).
Choose the script under “Condition”.
Select alert type:
Long Setup
Short Setup
Long Cross
Short Cross
Set notification method (popup, sound, email, mobile).
Click Create.
Now TradingView will notify you automatically when signals appear.
5. Example Workflow
Wait for Confidence = Strong/Strongest.
Check if market session supports volatility (e.g., XAU in London/NY).
Review SL/TP suggestions:
Long → Entry: current price, SL: close - risk_pts, TP: close + risk_pts × RR.
Short → Entry: current price, SL: close + risk_pts, TP: close - risk_pts × RR.
Adjust based on your own price action analysis.
📊 Best Practices
Use on H1 + D1 combo → align higher timeframe bias with intraday entries.
Risk only 1–2% of account per trade (position sizing required).
Filter with market sessions (Asia, Europe, US).
Strongest signals work best with trending pairs (e.g., XAUUSD, USDJPY, BTCUSD).
Adaptive Jump Moving AverageAdaptive Jump Moving Average - Description
This indicator solves the classic moving average lag problem during significant price moves. Traditional MAs (like the 200-day) take forever to catch up after a major drop or rally because they average across all historical periods equally.
How it works:
Tracks price smoothly during normal market conditions
When price moves 20%+ away from the MA, it immediately "resets" to the current price level
Treats that new level as the baseline and continues smooth tracking from there
Advantages over normal MA:
No lag on major moves: A 40% crash doesn't get diluted over 200 days - the MA instantly adapts
Reduces false signals: You won't get late "death cross" signals months after a crash already happened
Better support/resistance: The MA stays relevant to current price action instead of reflecting outdated levels
Keeps the smoothness: During normal volatility, it behaves like a traditional MA without the noise of shorter periods
Capitulation DayThe idea is that when US indexes are >10% below their 50,100,200sma it is a capitulation day.
MA Divergence中文介绍:
均线背离指标是一款用于分析价格与均线(如EMA或SMA)之间的背离情况的技术分析工具。该指标结合了标准差、波动性分析和背离信号的检测,旨在帮助交易者识别市场中的潜在反转信号。
主要功能:
背离检测: 该指标根据价格与指定均线(EMA或SMA)之间的乖离(百分比差异),绘制背离柱状图,便于快速识别背离信号。
标准差与阈值: 根据过去一段时间内的历史数据,自动计算标准差并设置动态阈值,用以判断价格背离的异常程度。当背离信号超出设定的阈值时,柱状图将标记为蓝色,突出显示潜在的反转信号。
警报功能: 为用户提供警报设置,当背离信号突破上阈值或下阈值时,能够及时提醒交易者,帮助做出决策。
适用对象:
短期交易者: 用于快速捕捉反转信号,帮助制定更具针对性的交易策略。
中长期交易者: 通过背离与均线的结合,帮助识别趋势的潜在转折点。
技术分析爱好者: 提供了一种新的背离分析视角,帮助用户理解市场行为。
英文介绍:
The Moving Average Divergence (MA Divergence) Indicator is a technical analysis tool designed to analyze the divergence between price and a moving average (such as EMA or SMA). The indicator combines standard deviation, volatility analysis, and divergence signal detection to help traders identify potential reversal signals in the market.
Key Features:
Divergence Detection: The indicator plots divergence histograms based on the percentage difference between price and the selected moving average (EMA or SMA), making it easy to spot divergence signals at a glance.
Standard Deviation & Thresholds: The indicator automatically calculates the standard deviation based on historical data over a specified period and sets dynamic thresholds to assess the abnormality of price divergence. When the divergence signal exceeds the set thresholds, the histogram is highlighted in blue, emphasizing potential reversal signals.
Alert Functionality: The indicator includes alert conditions, allowing users to receive notifications when the divergence breaks above or below a defined threshold, helping traders take timely actions.
Target Audience:
Short-term traders: Designed for quick identification of reversal signals to formulate more targeted trading strategies.
Mid-to-long-term traders: Helps to identify potential trend reversal points by combining divergence with moving averages.
Technical analysis enthusiasts: Provides a new perspective on divergence analysis, helping users better understand market behavior.
总结:
无论是短期的交易决策,还是长期的市场趋势判断,“均线背离”指标都能为交易者提供强大的支持。通过标准差、波动性分析、警报提醒等功能,帮助用户实时捕捉市场中的背离信号,并快速做出反应。
Dwaggy Scalping Trio (VWAP + EMA + RSI)First attempt at pine script this is a scalping indicator that combines VWAP, EMA, and RSI to signal entry/exit for scalping lower time frames
EMA Regime (9/20/50/100/200) — Stacked with 200 FilterEMA Regime (9/20/50/100/200) — Stacked Long/Short Box
Plots the 9, 20, 50, 100, and 200 EMAs on the chart.
Checks if price is above or below each EMA and whether the EMAs are stacked in order.
LONG signal: price above all selected EMAs and EMAs stacked 9 > 20 > 50 > 100 >(> 200 if strict mode on).
SHORT signal: price below all selected EMAs and EMAs stacked 9 < 20 < 50 < 100 (< 200 if strict mode on).
Shows a two-row table (LONGS / SHORTS) so you can quickly see which EMAs are aligned.
Optionally colors candles green/red when a full long/short regime is active.
Can show labels when a new LONG or SHORT condition appears.
Has alerts you can use for automated notifications when the regime flips.
“Use 200 EMA in the stack” lets you choose ultra-strict mode (9>20>50>100>200) or lighter mode (9>20>50>100 but price & 9 above 200).
Guided Advisor with DXY ContextThis indicator will constantly will be looking for DXY direction in the background.
Double Moving Average█ OVERVIEW
The Double Moving Average (DMA) smooths one moving average with a second moving average.
Includes moving average type, higher timeframe, offset, alerts, and style settings for all of the indicator's visual components. This indicator includes an optional line and label to indicate the latest value of the DMA that repaints.
█ CONCEPTS
Shorter term moving averages, especially in choppy markets, can rapidly increase and decrease their slope. Which could lead some traders into assuming that the series trend may continue at that steeper slope. By smoothing a moving average with another one, the magnitude of rapid choppy movements is mitigated.
█ FEATURES
DMA Customization
Most inputs have a tooltip that can be read by interacting with the information icon to guide users.
For both moving averages in the DMA, users can set the lookback length and moving average type independently. Available moving average types include:
Simple Moving Average
Exponential Moving Average
Hull Moving Average
Weighted Moving Average
Volume Weighted Moving Average
A bar offset setting is included for shifting the indicator's placement. Using different lookback combinations for both averages alongside an offset can create equivalent values of other types of moving averages not included in this indicator. For example, if the default lookback settings are offset by 1 bar, this duplicates a 4 period centered moving average.
Colors for the DMA's plot can toggle between a single "base" color, or using increasing and decreasing colors. Changing the plot's style, line style, and width is also supported.
Latest Value Line and Label
The latest value of the DMA plot is replaced by default with a feature called the Latest Value Line and Label: a stylized line and label to help indicate the part of the indicator that can repaint from the parts that don't repaint. Data used to draw this feature is calculated separately from the indicator's confirmed historical calculations.
A label is included to display the latest value of the DMA which includes complete style settings. The style of both the line and label are completely customizable; every style feature that can be included has a corresponding input you can set.
Toggling off the Latest Value Line and Label feature will cause all the respective style inputs to deactivate so that they're no longer in focus or editable until the feature is toggled on again.
Higher Timeframes
Users can plot the DMA from higher timeframes on their chart.
As new bars print, the non-repainting DMA historical plot uses the last confirmed higher timeframe value. The repainting Latest Value Line and Label will update with the most recent higher timeframe value only for the latest bar. If the Latest Value Line feature is toggled off, the last confirmed higher timeframe DMA value is plotted up to the latest bar.
The built-in Moving Average Simple (SMA) indicator includes several of the features in this indicator, like an option for using higher timeframe. However, by default, it plots no values except on bars with higher timeframe close updates. Disabling "Wait for timeframe closes" to get values between updates causes repainting in both replay mode and realtime bars.
Since the calculations that repaint are separate and optional in the DMA indicator, historical plotted values will not repaint in replay mode or on realtime bars while using higher timeframes.
Alerts
There are two DMA value options when creating an alert:
DMA Latest Value: Use the latest updating DMA Value. The same value as the Latest Value Line.
DMA Last Confirmed Value: Use the last historical closed DMA value.
The default alert option is DMA Latest because most users expect alerts when the price crosses the latest updating DMA value. The Last Confirmed Value alert option uses the DMA value from the latest confirmed historical bar.
When creating an alert you should see a "Caution!" warning saying, "This is due to calculations being based on an indicator or strategy that can get repainted." This warning is intentional because the DMA indicator's Latest Value Line and Label feature is supposed to repaint in order to display the latest value.
█ FOR Pine Script™ CODERS
StyleLibrary is used to create user-friendly plot, line, and label style enum type inputs. The library's functions then take those user inputs and convert them into the appropriate values/built-in constants to customize styles for plot, line, and label functions.
Titles for #region blocks are included after #endregion statements for clarity when multiple #endregion statements occur.
This indicator utilizes the new active parameter for style inputs of togglable features.