PT Least Squares Moving AveragePT LSMA Multi-Period Indicator
The PT Least Squares Moving Average (LSMA) Multi-Period Indicator is a powerful tool designed for investors who want to track market trends across multiple time horizons in a single, convenient indicator. This indicator calculates the LSMA for four different periods— 25 bars, 50 bars, 450 bars, and 500 bars providing a comprehensive view of short-term and long-term market movements.
Key Features:
- Multi-Timeframe Trend Analysis: Tracks both short-term (25 & 50 bars) and long-term (450 & 500 bars) market trends, helping investors make informed decisions.
- Smoothing Capability: The LSMA reduces noise by fitting a linear regression line to past price data, offering a clearer trend direction compared to traditional moving averages.
- One-Indicator Solution: Combines multiple LSMA periods into a single chart, reducing clutter and enhancing visual clarity.
- Versatile Applications: Suitable for trend identification, market timing, and spotting potential reversals across different timeframes.
- Customizable Styling: Allows users to customize colors and line styles for each period to suit their preferences.
How to Use:
1. Short-Term Trends (25 & 50 bars):Ideal for identifying recent price movements and short-term trade opportunities.
2. Long-Term Trends (450 & 500 bars): Helps investors gauge broader market sentiment and position themselves accordingly for longer holding periods.
3. Trend Confirmation: When shorter LSMA periods cross above longer ones, it may signal bullish momentum, whereas the opposite may indicate bearish sentiment.
4. Support and Resistance: The LSMA lines can act as dynamic support and resistance levels during trending markets.
Best For:
- Long-term investors looking to align their positions with dominant market trends.
- Swing traders seeking confirmation from multiple time horizons.
- Portfolio managers tracking price momentum across various investment durations.
This LSMA Multi-Period Indicator equips investors with a well-rounded perspective on price movements, offering a strategic edge in navigating market cycles with confidence.
Created by Prince Thomas
Moyennes mobiles
Tandem EMA TrendsThis indicator helps to identify trends using 2 (tandem) EMAs: a fast EMA and a slow EMA. Set the lengths of the EMAs in the inputs (fast EMA should be a smaller number than the slow EMA).
The trend is bullish if the current value of the fast EMA > current value of the slow EMA AND the current value of the fast EMA > the prior bar's value of the fast EMA.
The trend is bearish if the current value of the fast EMA < current value of the slow EMA AND the current value of the fast EMA < the prior bar's value of the fast EMA.
The fast EMA is countertrend to the slow EMA if either of the following 2 conditions exist:
The current value of the fast EMA > current value of the slow EMA AND the current value of the fast EMA < the prior bar's value of the fast EMA (bullish countertrend).
-OR-
The current value of the fast EMA < current value of the slow EMA AND the current value of the fast EMA > the prior bar's value of the fast EMA (bearish countertrend).
Use this script to set custom alerts based off of the current trend like sending webhooks when specific conditions exist.
Customize the colors of the plots.
Trend with ADX/EMA - Buy & Sell SignalsThis script is designed to help traders make buy and sell decisions based on trend analysis using two key methods: ADX (Average Directional Index) and EMA (Exponential Moving Averages). Here's a breakdown in simple terms:
What Does It Do?
Identifies the Trend's Strength and Direction:
Uses the ADX indicator to determine how strong the trend is.
Compares two lines (DI+ and DI−) to identify whether the trend is moving up or down.
Generates Buy and Sell Signals:
Uses two EMAs (a fast one and a slow one) to check when the price crosses key levels, signaling a possible buy or sell opportunity.
Plots visual indicators (arrows and labels) for easy interpretation.
Color-Codes the Chart:
Highlights the background in green when the trend is bullish (uptrend).
Highlights the background in red when the trend is bearish (downtrend).
Alerts the User:
Creates alerts when specific conditions for buying or selling are met.
Key Components:
1. ADX (Trend Strength & Direction)
What is ADX?
ADX measures how strong the trend is (not the direction). Higher ADX means a stronger trend.
It also calculates two lines:
DI+: Measures upward movement strength.
DI−: Measures downward movement strength.
How It Works in the Script:
If DI+ is greater than DI−, it’s a bullish trend (upward).
If DI− is greater than DI+, it’s a bearish trend (downward).
The background turns green for an uptrend and red for a downtrend.
2. EMA (Buy and Sell Decisions)
What is EMA?
EMA is a moving average that gives more weight to recent prices. It’s used to smooth out price fluctuations.
How It Works in the Script:
The script calculates two EMAs:
Fast EMA (short-term average): Reacts quickly to price changes.
Slow EMA (long-term average): Reacts slower and shows overall trends.
When the Fast EMA crosses above the Slow EMA, it’s a signal to Buy.
When the Fast EMA crosses below the Slow EMA, it’s a signal to Sell.
These signals are marked on the chart as "Buy" and "Sell" labels.
3. Buy and Sell Alerts
The script sets up alerts for the user:
Buy Alert: When a crossover indicates a bullish signal.
Sell Alert: When a crossunder indicates a bearish signal.
Visual Elements on the Chart:
Background Colors:
Green: When the DI+ line indicates an uptrend.
Red: When the DI− line indicates a downtrend.
EMA Lines:
Green Line: Fast EMA.
Red Line: Slow EMA.
Buy/Sell Labels:
"Buy" label: Shown when the Fast EMA crosses above the Slow EMA.
"Sell" label: Shown when the Fast EMA crosses below the Slow EMA.
Why Use This Script?
Trend Analysis: Helps you quickly identify the strength and direction of the market trend.
Buy/Sell Signals: Gives clear signals to enter or exit trades based on trend and EMA crossovers.
Custom Alerts: Ensures you never miss a trading opportunity by notifying you when conditions are met.
Visual Simplicity: Makes it easy to interpret trading signals with color-coded backgrounds and labeled arrows.
Timeframe-Based Dynamic MA [odnac]
This code is a Timeframe-Based Dynamic MA indicator, written in Pine Script, that dynamically calculates and displays the Simple Moving Average (SMA), Exponential Moving Average (EMA), and Volume Weighted Moving Average (VWMA) based on a 24-hour period, according to the selected timeframe. It automatically adjusts the length of the moving averages for each timeframe, showing the appropriate value optimized for that specific timeframe.
Code Explanation:
Settings:
inputLength: A user input that allows setting the base time (24 hours by default). This value determines the reference for calculating the length of the moving averages according to the timeframe.
transp: A setting for the transparency of the moving average lines. It can accept values from 0 to 100 (0 is opaque, 100 is fully transparent).
Timeframe-Based Moving Average Calculation:
The length variable is dynamically calculated based on the current chart's timeframe.
For shorter timeframes like 1-minute, 2-minute, 3-minute, 5-minute, 10-minute, 15-minute, 30-minute, and 45-minute, the length is calculated by multiplying 60 / selected timeframe to obtain the moving average length based on a 24-hour period.
For longer timeframes like 1 hour, 4 hours, and 1 day, fixed values are used to set the moving average length.
Moving Average Calculation:
sma, ema, vwma: These are the Simple Moving Average, Exponential Moving Average, and Volume Weighted Moving Average calculated based on the length.
else_sma, else_ema, else_vwma: These represent the moving averages fetched from the 1-hour chart. For timeframes that are not calculated directly, the values are taken from the 1-hour chart.
Displaying the Moving Averages:
The moving averages are plotted according to the length calculated for the current timeframe.
If the length for the current timeframe is valid, the corresponding SMA, EMA, and VWMA values are displayed. Otherwise, the values fetched from the 1-hour chart are used.
The moving averages are displayed with the transparency (transp) value set by the user, controlling their opacity on the chart.
How to Use:
Base Time: The user sets a base time. For example, setting inputLength to 24 will calculate the moving average length based on a 24-hour period, which will be dynamically adjusted and displayed according to the selected timeframe.
Transparency Setting: The transparency of the moving average lines can be adjusted using the transp value.
Supported Timeframes:
For shorter timeframes (1-minute, 2-minute, 3-minute, 5-minute, 10-minute, 15-minute, 30-minute, 45-minute), the moving average lengths are dynamically calculated and displayed.
For longer timeframes (1 hour, 4 hours, 1 day), fixed length values are used.
This indicator allows you to dynamically calculate daily moving averages across different timeframes and visually check which moving average is the most appropriate for the selected timeframe.
Emergent Rays - NovaTheMachineEmergent Rays
An emergent ray is a refracted ray of light that exits a medium or channel. Emergent rays can be created when light passes through a prism, glass slab, or mirror
This visual indicator has been designed to aid in developing psychological understanding of price action. Many traders often struggle with developing strategy that they can act on, repeatedly. The difference between gambling and trading successfully comes down to following a plan, that you have tested and determined to be profitable over the long term.
Some traders experience anxiety when trading trends, trying to time a reversal, or entering a trade based on emotions and are unsure where they should place a stop - if they bother to place one at all.
I developed this indicator to help traders practice responsible trading practices and develop discipline. When applied to a chart an array of light rays will be plotted, similarly to those that are emitted from light passing through a medium such as a prism. These rays are a series of EMAs high & low values, filled with an assigned color.
The indicator does not suggest an entry or exit, it allows for freedom of user interpretation, however - when in a trending market you may notice that the rays are tested multiple times when the market is trending in the same direction. When trading trends it makes sense to enter at the discounted value (pullbacks) and exit on extensions. There are two main reasons for this; first is manage risk, second is to profit from a successful trade.
To practice discipline and remove emotions from trading, one must be willing to accept the outcome of a trade - regardless of whether it was profitable or not, based on their strategy.
The visual gradient of the rays signifies the pullback to stoploss risk. As price expands it is clear to see that the distance from red to blue rays increases, which means entering a trade on a touch of the red ray requires a larger stoploss than entering a pullback to the green or blue rays. When price closes on the opposite side of a ray from where it was trending - we accept the trend may have ended and must wait for the next trend cycle. If the price action is range bound we will notice the rays melting together to create a grey ray that signifies this is not the best place to be trading any type of trend following strategy.
Using this indicator in an uptrend (price expansion upwards), we look to enter long positions of retests (pullbacks) into the rays - with a stoploss set below the lowest rays; as we do not believe the uptrend is over until the trend has been broken.
Using this indicator in a downtrend (price expansion downwards), we look to enter short positions of retests (pullbacks) into the rays - with a stoploss set below the lowest rays; as we do not believe the uptrend is over until the trend has been broken.
When price is range bound or consolidating, we do not enter trades; wait for clear trend to be established.
By practicing discipline, we are able to overcome the emotions involved with trading, remove hesitation, and trade our plans more confidently through appropriate risk management and radical acceptance.
PDF MA For Loop [BackQuant]PDF MA For Loop
Introducing the PDF MA For Loop, an innovative trading indicator that combines Probability Density Function (PDF) smoothing with a dynamic for-loop scoring mechanism. This advanced tool provides traders with precise trend-following signals, helping to identify long and short opportunities with improved clarity and adaptability to market conditions.
If you would like to check out the stand alone PDF Moving Average:
Core Concept: Probability Density Function (PDF) Smoothing
The PDF smoothing method is a unique approach that applies adaptive weights to price data based on a Probability Density Function. This ensures that recent data points receive appropriate emphasis while maintaining a smooth transition across the data set. The result is a moving average that is not only smoother but also more responsive to market changes.
Key parameters in PDF smoothing:
Variance : Controls the spread of the PDF, where a higher value results in broader smoothing and a lower value makes the moving average more sensitive.
Mean : Centers the PDF around a specific value, influencing the weighting and responsiveness of the smoothing process.
By combining PDF smoothing with traditional moving averages (EMA or SMA), the indicator creates a hybrid signal that balances responsiveness and reliability.
For-Loop Scoring Mechanism
At the heart of this indicator is the for-loop scoring mechanism, which evaluates the smoothed PDF moving average over a defined range of historical data points. This process assigns a score to the current market condition based on whether the PDF moving average is greater than or less than previous values.
Long Signal: A long signal is generated when the score exceeds the Long Threshold (default set at 40), indicating upward momentum.
Short Signal: A short signal is triggered when the score crosses below the Short Threshold (default set at -10), suggesting potential downward momentum.
This dynamic scoring system ensures that the indicator remains adaptive, capturing trends and shifts in market sentiment effectively.
Customization Options
The PDF MA For Loop includes a variety of customizable settings to fit different trading styles and strategies:
Calculation Settings
Price Source : Select the input price for the calculation (default is the close price).
Smoothing Method : Choose between EMA or SMA for the additional smoothing layer, providing flexibility to adapt to market conditions.
Smoothing Period : Adjust the lookback period for the smoothing function, with shorter periods providing more sensitivity and longer periods offering greater stability.
Variance & Mean : Fine-tune the PDF function parameters to control the weighting of the smoothing process.
Signal Settings
Thresholds : Customize the upper and lower thresholds to define the sensitivity of the long and short signals.
For Loop Range : Set the range of historical data points analyzed by the for-loop, influencing the depth of the scoring mechanism.
UI Settings
Signal Line Width: Adjust the thickness of the plotted signal line for better visibility.
Candle Coloring: Enable or disable the coloring of candlesticks based on trend direction (green for long, red for short, gray for neutral).
Background Coloring: Add background shading to highlight long and short signals for an enhanced visual experience.
Alerts and Automation
The indicator includes built-in alert conditions to notify traders of important market events:
Long Signal Alert: Notifies when the score exceeds the upper threshold, indicating a bullish trend.
Short Signal Alert: Notifies when the score crosses below the lower threshold, signaling a bearish trend.
These alerts can be configured for real-time notifications, allowing traders to respond quickly to market changes without constant chart monitoring.
Trading Applications
The PDF MA For Loop is versatile and can be applied across various trading strategies and market conditions:
Trend Following: The PDF smoothing method combined with for-loop scoring makes this indicator particularly effective for identifying and following trends.
Reversal Trading: By observing the thresholds and score, traders can anticipate potential reversals when the trend shifts from long to short (or vice versa).
Risk Management: The dynamic thresholds and scoring provide clear signals, allowing traders to enter and exit trades with greater confidence and precision.
Final Thoughts
The PDF MA For Loopis merges advanced mathematical concepts with practical trading tools. By leveraging Probability Density Function smoothing and a dynamic for-loop scoring system, it provides traders with clear, actionable signals while adapting to market conditions.
Whether you’re looking for an edge in trend-following strategies or seeking precision in identifying reversals, this indicator offers the flexibility and power to enhance your trading decisions
As always, backtesting and integrating the PDF MA For Loop into a comprehensive trading strategy is recommended for optimal performance, as no single indicator should be used in isolation.
Thus following all of the key points here are some sample backtests on the 1D Chart
Disclaimer: Backtests are based off past results, and are not indicative of the future.
INDEX:BTCUSD
INDEX:ETHUSD
BINANCE:SOLUSD
Uptrick: Zero Lag HMA Trend Suite1. Name and Purpose
Uptrick: Zero Lag HMA Trend Suite is a Pine Version 6 script that builds upon the Hull Moving Average (HMA) to offer an advanced trend analysis tool. Its purpose is to help traders identify trend direction, potential reversals, and overall market momentum with reduced lag compared to traditional moving averages. By combining the HMA with Average True Range (ATR) thresholds, slope-dependent coloring, Volume Weighted Average Price (VWAP) ribbons, and optional reversal signals, the script aims to give a detailed view of price activity in various market environments.
2. Overview
This script begins with the calculation of a Hull Moving Average, a method that blends Weighted Moving Averages in a way designed to cut down on lag while still smoothing out price fluctuations. Next, several enhancements are applied. The script compares current HMA values to previous ones for slope-based coloring, which highlights uptrends and downtrends at a glance. It also plots buy and sell signals when price moves beyond or below thresholds determined by the ATR and the user’s chosen signal multiplier. An optional VWAP ribbon can be shown to confirm bullish or bearish conditions relative to a volume-weighted benchmark. Additionally, the script can plot reversal signals (labeled with B) at points where price crosses back toward the HMA from above or below. Taken together, these elements allow traders to visualize both the short-term momentum and the broader context of how price interacts with volatility and overall market direction.
3. Why These Indicators Have Been Linked Together
The reason the Hull Moving Average, the Average True Range, and the VWAP have been integrated into one script is to tackle multiple facets of market analysis in a single tool. The Zero Lag Hull Moving Average provides a responsive trend line, the ATR offers a measure of volatility that helps distinguish significant price shifts from typical fluctuations, and the VWAP acts as a reference for fair value based on traded volume. By layering all three, the script helps traders avoid the need to juggle multiple separate indicators and offers a holistic perspective. The slope-based coloring focuses on trend direction, the ATR-based thresholds refine possible buy and sell zones, and the VWAP ribbons provide insight into how price stands relative to an important volume-weighted level. The inclusion of up and down signals and reversal B labels further refines entries and exits.
4. Why Use Uptrick: Zero Lag HMA Trend Suite
The Hull Moving Average is already known for reacting more quickly to price changes compared to other moving averages while retaining a degree of smoothness. This suite enhances the basic HMA by showing colored gradients that make it easy to spot trend direction changes, highlighting potential entry or exit points based on volatility-driven thresholds, and optionally layering a volume-based measure of bullish or bearish market sentiment. By relying on a zero lag approach and additional data points, the script caters to those wanting a more responsive method of identifying shifts in market dynamics. The added reversal signals and up or down alerts give traders extra confirmation for potential turning points.
5. How This Extension Improves on the Basic HMA
This extension not only plots the Hull Moving Average but also includes data-driven alerts and visual cues that traditional HMA lines do not provide. First, it offers multi-layered slope coloring, making up or down trends quickly apparent. Second, it uses ATR-based thresholds to pinpoint moments when price may be extending beyond normal volatility, thus generating buy or sell signals. Third, the script introduces an optional VWAP ribbon to indicate whether the market is trading above or below this pivotal volume-weighted benchmark, adding a further confirmation step for bullish or bearish conditions. Finally, it incorporates optional reversal signals labeled with B, indicating points where price might swing back toward the main HMA line.
6. Core Components
The script can be broken down into several primary functions and features.
a. Zero Lag HMA Calculation
Uses two Weighted Moving Averages (half-length and full-length) combined through a smoothing step based on the square root of the chosen length. This approach is designed to reduce lag significantly compared to other moving averages.
b. Slope Detection
Compares current and prior HMA values to determine if the trend is up or down. The slope-based coloring changes between turquoise shades for upward movement and magenta shades for downward movement, making trend direction immediately visible.
c. ATR-Based Thresholding for Up and Down Signals
The script calculates an Average True Range over a user-defined period, then multiplies it by a signal factor to form two bands around the HMA. When price crosses below the lower band, an up (buy) signal appears; when it crosses above the upper band, a down (sell) signal is shown.
d. Reversal Signals (B Labels)
Tracks when price transitions back toward the main HMA from an extreme zone. When enabled, these reversal points are labeled with a B and can help traders see potential turning points or mean-reversion setups.
e. VWAP Bands
An optional Volume Weighted Average Price ribbon that plots above or below the HMA, indicating bullish or bearish conditions relative to a volume-weighted price benchmark. This can also act as a kind of support/ resistance.
7. User Inputs
a. HMA Length
Controls how quickly the moving average responds to price changes. Shorter lengths react faster but can lead to more frequent signals, whereas longer lengths produce smoother lines.
b. Source
Specifies the price input, such as close or an alternative source, for the calculation. This can help align the HMA with specific trading strategies.
c. ATR Length and Signal Multiplier
Defines how the script calculates average volatility and sets thresholds for buy or sell alerts. Adjusting these values can help filter out noise or highlight more aggressive signals.
d. Slope Index
Determines how many bars to look back for detecting slope direction, influencing how sensitive the slope coloring is to small fluctuations.
e. Show Buy and Sell Signals, Reversal Signals, and VWAP
Lets users toggle the display of these features. Turning off certain elements can reduce chart clutter if traders prefer a simpler layout.
8. Calculation Process
The script’s calculation follows a step-by-step approach. It first computes two Weighted Moving Averages of the selected price source, one over half the specified length and one over the full length. It then combines these using 2*wma1 minus wma2 to reduce lag, followed by applying another weighted average using the square root of the length. Simultaneously, it computes the ATR for a user-defined period. By multiplying ATR by the signal multiplier, it establishes upper and lower bands around the HMA, where crossovers generate buy (up) or sell (down) signals. The script can also plot reversal signals (B labels) when price crosses back from these bands in the opposite direction. For the optional VWAP feature, Pine Script’s ta.vwap function is used, and differences between the HMA and VWAP levels determine the color and opacity of the ribbon.
9. Signal Generation and Filtering
The ATR-based thresholds reduce the influence of small, inconsequential price swings. When price falls below the lower band, the script issues an up (buy) signal. If price breaks above the upper band, a down (sell) signal appears. These signals are visible through labels placed near the bars. Reversal signals, labeled with B, can be turned on to help detect when price retraces from an extended area back toward the main HMA line. Traders can disable or enable these signals to match their preferred level of chart detail or risk tolerance.
10. Visualization on the Chart
The Zero HMA Lag Trend Suite aims for visual clarity. The HMA line is plotted multiple times with increasing transparency to create a gradient effect. Turquoise gradients indicate upward slopes, and magenta gradients signify downward slopes. Bar coloring can be configured to align with the slope direction, providing quick insight into current momentum. When enabled, buy or sell labels are placed under or above the bars as price crosses the ATR-defined boundaries. If the reversal option is active, B labels appear around areas where price changes direction. The optional VWAP ribbons form background bands, using distinct coloration to signal whether price is above or below the volume-weighted metric.
11. Market Adaptability
Because the script’s parameters (HMA length, ATR length, signal multiplier, and slope index) are user-configurable, it can adapt to a wide range of markets and timeframes. Intraday traders may prefer a shorter HMA length for quick signals, while swing or position traders might use a longer HMA length to filter out short-lived price changes. The source setting can also be adjusted, allowing for specialized data inputs beyond just close or open values.
12. Risk Management Considerations
The script’s signals and labels are based on past price data and volatility readings, and they do not guarantee profitable outcomes. Sharp market reversals or unforeseen fundamental events can produce false signals. Traders should combine this tool with broader risk management strategies, including stop-loss placement, position sizing, and independent market analyses. The Zero HMA Lag Trend Suite can help highlight potential opportunities, but it should not be relied upon as the sole basis for trade decisions.
13. Combining with Other Tools
Many traders choose to verify signals from the Zero HMA Lag Trend Suite using popular indicators like the Relative Strength Index (RSI), Moving Average Convergence Divergence (MACD), or even simple volume-based metrics to confirm whether a price movement has sufficient momentum. Conventional techniques such as support and resistance levels, chart patterns, or candlestick analysis can also supplement signals generated by the script’s up, down, or reversal B labels.
14. Parameter Customization and Examples
a. Short-Term Day Trading
Using a shorter HMA length (for instance, 9 or 14) and a slightly higher ATR multiplier might provide timely buy and sell signals, though it may also produce more whipsaws in choppy markets.
b. Swing or Position Trading
Selecting a longer HMA length (such as 50 or 100) with a moderate ATR multiplier can help users track more significant and sustained market moves, potentially reducing the effect of minor fluctuations.
c. Multiple Timeframe Blends
Some traders load two versions of the indicator on the same chart, one for short-term signals (with frequent B label reversals) and another for the broader trend direction, aligning entry and exit decisions with the bigger picture.
15. Realistic Expectations
Even though the Hull Moving Average helps minimize lag and the script incorporates volatility-based filters and optional VWAP overlays, it cannot predict future market behavior with complete accuracy. Periods of low liquidity or sudden market shocks can still lead to signals that do not reflect longer-term trends. Frequent parameter review and manual confirmation are advised before executing trades based solely on the script’s outputs.
16. Theoretical Background
The Hull Moving Average formula aims to balance smoothness with reactivity, accomplished by combining Weighted Moving Averages at varying lengths. By subtracting a slower average from a faster one and then applying another smoothing step with the square root of the original length, the HMA is designed to respond more promptly to price changes than typical exponential or simple moving averages. The ATR component, introduced by J. Welles Wilder, calculates the average range of price movement over a user-defined period, allowing the script to assess volatility and adapt signals accordingly. VWAP provides a volume-weighted benchmark that many institutional traders track to gauge fair intraday value.
17. Originality and Uniqueness
Although multiple HMA-based indicators can be found, Uptrick: Zero Lag HMA Trend Suite sets itself apart by merging slope-based coloring, ATR thresholds, VWAP ribbons, up or down labels, and optional reversal signals all in one cohesive platform. This synergy aims to reduce chart clutter while still giving traders a comprehensive look at trend direction, volatility, and volume-based sentiment.
18. Summary
Uptrick: Zero Lag HMA Trend Suite is a specialized trading script designed to highlight potential market trends and reversals with minimal delay. It leverages the Hull Moving Average for an adaptive yet smooth price line, pairs ATR-based thresholds for detecting possible breakouts or dips, and provides VWAP-based ribbons for added volume-weighted context. Traders can further refine their entries and exits by enabling up or down signals and reversal labels (B) where price may revert toward the HMA. Suitable for a wide range of timeframes and instrument types, the script encourages a disciplined approach to trade management and risk control.
19. Disclaimer
This script is provided for informational and educational purposes only. Trading and investing involve significant financial risk, and no indicator can guarantee success under all conditions. Users should practice robust risk management, including the placement of stop losses and position sizing, and should confirm signals with additional analysis tools. The developer of this script assumes no liability for any trading decisions or outcomes resulting from its use.
Machine Learning Moving Average [LuxAlgo]The Machine Learning Moving Average (MLMA) is a responsive moving average making use of the weighting function obtained Gaussian Process Regression method. Characteristic such as responsiveness and smoothness can be adjusted by the user from the settings.
The moving average also includes bands, used to highlight possible reversals.
🔶 USAGE
The Machine Learning Moving Average smooths out noisy variations from the price, directly estimating the underlying trend in the price.
A higher "Window" setting will return a longer-term moving average while increasing the "Forecast" setting will affect the responsiveness and smoothness of the moving average, with higher positive values returning a more responsive moving average and negative values returning a smoother but less responsive moving average.
Do note that an excessively high "Forecast" setting will result in overshoots, with the moving average having a poor fit with the price.
The moving average color is determined according to the estimated trend direction based on the bands described below, shifting to blue (default) in an uptrend and fushia (default) in downtrends.
The upper and lower extremities represent the range within which price movements likely fluctuate.
Signals are generated when the price crosses above or below the band extremities, with turning points being highlighted by colored circles on the chart.
🔶 SETTINGS
Window: Calculation period of the moving average. Higher values yield a smoother average, emphasizing long-term trends and filtering out short-term fluctuations.
Forecast: Sets the projection horizon for Gaussian Process Regression. Higher values create a more responsive moving average but will result in more overshoots, potentially worsening the fit with the price. Negative values will result in a smoother moving average.
Sigma: Controls the standard deviation of the Gaussian kernel, influencing weight distribution. Higher Sigma values return a longer-term moving average.
Multiplicative Factor: Adjusts the upper and lower extremity bounds, with higher values widening the bands and lowering the amount of returned turning points.
🔶 RELATED SCRIPTS
Machine-Learning-Gaussian-Process-Regression
SuperTrend-AI-Clustering
Bollingers Bands Fibonacci ratios_copy of FOMOBollinger Bands Fibonacci Ratios (FiBB)
This TradingView script is a powerful tool that combines the classic Bollinger Bands with Fibonacci ratios to help traders identify potential support and resistance zones based on market volatility.
Key Features:
Dynamic Fibonacci Levels: The script calculates additional levels around a Simple Moving Average (SMA) using Fibonacci ratios (default: 1.618, 2.618, and 4.236). These levels adapt to market volatility using the Average True Range (ATR).
Customizable Parameters: Users can modify the length of the SMA and the Fibonacci ratios to fit their trading strategy and time frame.
Visual Representation: The indicator plots three upper and three lower bands, with color-coded transparency for easy interpretation.
Central SMA Line: The core SMA line provides a baseline for price movement and trend direction.
Shaded Range: The script visually fills the area between the outermost bands to highlight the overall range of price action.
How to Use:
Use the upper bands as potential resistance zones and the lower bands as potential support zones.
Look for price interactions with these levels to identify opportunities for breakout, trend continuation, or reversal trades.
Combine with other indicators or price action analysis to enhance decision-making.
This script is ideal for traders who want a unique blend of Fibonacci-based analysis and Bollinger Bands to better navigate market movements.
Cumulative Price AverageThe Cumulative Price Average (CPA) indicator calculates and plots the overall average of candlestick prices, providing a smoothed representation of the market's long-term price trend. This is achieved by aggregating the averages of each candle (Open, High, Low, Close) and dynamically updating the overall average as new candles are added.
Key Features
Long-Term Price Perspective: Displays the cumulative average of all candles from the start of the chart.
Trend Visualization: Smooths out short-term price fluctuations to highlight the overall trend.
Dynamic Updates: The average adjusts with each new bar for real-time analysis.
Usage
Trend Analysis:
Identify long-term bullish or bearish trends by observing the slope of the CPA line.
Support/Resistance:
The CPA line can act as a dynamic support or resistance level for the price.
Price Comparison:
Compare the current price to the CPA to assess whether the market is overbought or oversold relative to its historical average.
This indicator is especially useful for traders seeking to incorporate a historical perspective into their analysis, providing insights into the broader market behavior beyond short-term volatility.
Composite Indicator (CCI + ATR)Composite Indicator (CCI + ATR)
The Composite Indicator (CCI + ATR) combines the Commodity Channel Index (CCI) with the Average True Range (ATR) , providing traders with a dynamic tool for identifying entry and exit points based on momentum and volatility. This indicator is particularly useful for markets like cryptocurrencies, which often exhibit sharp sell-offs and gradual upward trends.
Key Features
Momentum Analysis with CCI: The CCI calculates price momentum by comparing the current price level to its average over a specific period. The indicator generates signals when CCI crosses predefined thresholds.
- Buy Signal: Triggered when CCI crosses above the lower threshold (e.g., -100).
- Sell Signal: Triggered when CCI crosses below the upper threshold (e.g., +100).
Volatility Filtering with ATR: The ATR measures market volatility, ensuring signals occur only during significant price movements.
Separate multipliers for buy and sell signals allow tailored filtering based on market behavior.
Stop Loss Calculation: Dynamic stop loss levels are calculated using the ATR multiplier to adapt to market volatility, offering better risk management.
How It Works
CCI Calculation: The CCI is calculated using the typical price ((High + Low + Close) / 3) and a user-defined length. It detects momentum changes by measuring deviations from the average price.
ATR Calculation: The ATR determines the average price range over a specified period, identifying the market’s volatility. The ATR SMA acts as a baseline to filter signals.
Buy Signal: A buy signal is triggered when:
- CCI crosses above the lower threshold (e.g., -100).
- ATR exceeds its SMA multiplied by the buy multiplier (e.g., 1.0).
Sell Signal: A sell signal is triggered when:
- CCI crosses below the upper threshold (e.g., +100).
- ATR exceeds its SMA multiplied by the sell multiplier (e.g., 0.95).
Stop Loss Integration:
- Long positions: Stop loss = Low – (ATR * ATR Multiplier)
- Short positions: Stop loss = High + (ATR * ATR Multiplier)
Advantages
Combines momentum (CCI) and volatility (ATR) for precise signal generation.
Customizable thresholds and multipliers for different market conditions.
Dynamic stop loss ensures better risk management in volatile markets.
Suggested Parameter Settings
CCI Length: 20 (default). Adjust as follows:
- 10–15: Shorter timeframes (e.g., 5-15 minutes).
- 20: General use for 1-hour timeframes.
- 30–50: Longer timeframes (e.g., 4-hour or daily charts).
CCI Threshold: 100 (default). Adjust as follows:
- 50–75: For more frequent signals in ranging markets.
- 100: Balanced for most trading conditions.
- 150–200: For strong trends to reduce noise.
ATR Length: 14 (default). Adjust as follows:
- 10–14: For assets with moderate volatility.
- 20: For assets with lower volatility.
ATR Buy Multiplier: 1.0 (default). Adjust as follows:
- 0.9–1.0: For gradual uptrends in crypto markets.
- 1.1–1.2: For stronger trend filtering.
ATR Sell Multiplier: 0.95 (default). Adjust as follows:
- 0.8–0.95: For sharp sell-offs.
- 1.0–1.1: For stable downward trends.
ATR Multiplier (Stop Loss): 1.5 (default). Adjust as follows:
- 1.0–1.2: For shorter timeframes or less volatile markets.
- 2.0–2.5: For highly volatile markets like cryptocurrencies.
Example Use Cases
Scalping (5-15 minute charts): Use CCI Length = 10, CCI Threshold = 75, ATR Buy Multiplier = 0.9, ATR Sell Multiplier = 0.8.
Day Trading (1-hour charts): Use CCI Length = 20, CCI Threshold = 100, ATR Buy Multiplier = 1.0, ATR Sell Multiplier = 0.95.
Swing Trading (4-hour or daily charts): Use CCI Length = 30, CCI Threshold = 150, ATR Buy Multiplier = 1.2, ATR Sell Multiplier = 1.0.
Final Thoughts The Composite Indicator (CCI + ATR) is a versatile tool designed to enhance trading decisions by combining momentum analysis with volatility filtering. Whether scalping or swing trading, this indicator provides actionable insights and robust risk management to navigate complex markets effectively.
Composite Indicator (Donchian + OBV)Composite Indicator (Donchian + OBV)
The Composite Indicator (Donchian + OBV) is a powerful tool designed to evaluate the strength of market breakouts and momentum trends , offering traders a comprehensive perspective on price action. This indicator combines the Donchian Channel with On-Balance Volume (OBV) to create a dynamic and easy-to-interpret metric scaled between -1 and 1 .
Key Features
Breakout Strength Analysis:
- The indicator assesses the strength of price breakouts relative to the upper and lower bounds of the Donchian Channel.
- Positive values close to 1 indicate a strong bullish breakout.
- Negative values close to -1 indicate a strong bearish breakout.
Momentum Detection with OBV:
- On-Balance Volume (OBV) tracks the cumulative buying and selling volume to gauge market momentum.
- The smoothed OBV trend ensures the momentum component aligns with price action, reducing noise.
Integrated Composite Value:
- Combines breakout strength and OBV momentum into a single metric for enhanced clarity.
- The final composite value highlights whether the market is bullish, bearish, or neutral.
Divergence Detection:
- Spot bullish divergences when the indicator rises while price falls, suggesting a potential upward reversal.
- Identify bearish divergences when the indicator falls while price rises, hinting at a potential downward reversal.
How It Works
Donchian Channel Analysis:
- Calculates the highest high and lowest low over a user-defined period to establish the upper and lower channels .
- Breakouts beyond these channels contribute to the breakout strength component.
OBV Momentum:
- Measures cumulative volume trends to validate price movements.
- Momentum is derived from the rate of change in smoothed OBV values.
Composite Calculation:
- Combines breakout strength and OBV momentum, normalized and scaled to -1 to 1 for clarity.
How to Use
Bullish Breakout:
- When the indicator value approaches 1 , it signals a strong upward breakout supported by positive OBV momentum.
- Example Action: Consider a Buy if price breaks the upper Donchian Channel with increasing OBV.
Bearish Breakout:
- When the indicator value approaches -1 , it indicates a strong downward breakout supported by negative OBV momentum.
- Example Action: Consider a Sell if price breaks the lower Donchian Channel with decreasing OBV.
Neutral Market:
- When the value is near 0 , the market is likely balanced with no significant breakout or momentum detected.
Divergence Opportunities:
- Bullish Divergence: Price makes lower lows, but the indicator trends upward → Potential upward reversal.
- Bearish Divergence: Price makes higher highs, but the indicator trends downward → Potential downward reversal.
Customization Options
Donchian Channel Length: Adjust the period for the upper and lower bounds.
OBV Smoothing Length: Modify the smoothing period for OBV to fine-tune momentum detection.
Scaling Adjustments: The composite value is automatically normalized for consistency across timeframes.
Ideal Use Cases
Breakout Trading: Identify and confirm strong breakouts in volatile markets.
Momentum Confirmation: Validate price movements with volume-based momentum.
Reversal Detection: Leverage divergences to spot potential market reversals.
Example Applications
Strong Bullish Signal:
- Price breaks the upper channel , and OBV shows increasing volume → Composite value near 1 .
- Action: Enter a Buy position and set a Stop Loss below the upper channel.
Strong Bearish Signal:
- Price breaks the lower channel , and OBV shows decreasing volume → Composite value near -1 .
- Action: Enter a Sell position and set a Stop Loss above the lower channel.
Neutral Market:
- Composite value near 0 suggests indecision or consolidation. Wait for a breakout.
Limitations
Best used alongside additional tools like RSI or MACD for filtering noise and improving decision-making.
Requires careful parameter tuning based on the asset and timeframe.
Final Thoughts
The Composite Indicator (Donchian + OBV) offers traders a versatile tool to navigate complex markets. By blending breakout analysis with volume-based momentum, this indicator provides an actionable edge for identifying high-probability opportunities and potential reversals.
Dynamic EMA CrossoverThe Dynamic EMA Crossover indicator is designed to help traders identify trend transitions, visually understand market direction, and detect sideways consolidation zones. It simplifies decision-making by dynamically changing colors and highlighting areas of interest.
Key Features:
1. Dynamic EMA Crossovers:
• Uses two EMAs (default: 9 and 26 ) to identify bullish and bearish trends.
• EMAs and the area between them turn green during bullish trends and red during bearish trends for easy visualization.
2. Sideways Market Detection:
• Automatically detects periods of market consolidation when EMAs overlap for 10 consecutive candles and the price movement remains narrow.
• Sideways zones are highlighted with grey background, helping traders avoid false breakouts and trendless markets.
3. Customizable Inputs:
• Adjust the lengths of the two EMAs and the sensitivity of the overlap detection to match your trading style and market conditions.
How It Works:
• Trend Identification:
• When the shorter EMA crosses above the longer EMA, a bullish trend is indicated.
• When the shorter EMA crosses below the longer EMA, a bearish trend is indicated.
• The indicator dynamically adjusts the colors of the EMAs and fills the area between them for clear trend visibility.
• Sideways Market Detection:
• When the shorter EMA and longer EMA stay close (within a customizable sensitivity) for a fixed period (hardcoded to 10 candles), the indicator identifies a sideways market.
• This feature helps traders avoid entering trades during choppy or indecisive market conditions.
Who Is This For?
This indicator is ideal for:
• Trend traders looking for clear signals of trend direction.
• Swing traders who want to avoid trading in sideways markets.
• Scalpers who need quick and reliable visual cues for short-term market behavior.
Use Cases:
1. Bullish/Bearish Trends:
• Enter trades in the direction of the trend as the crossover occurs and colors change.
2. Sideways Zones:
• Avoid trades during periods of consolidation and wait for a clear breakout.
Mashup Logic:
This indicator combines:
1. EMA Crossovers:
• A tried-and-tested method for trend detection using two moving averages.
• Dynamic visual cues for bullish and bearish market phases.
2. Sideways Market Detection:
• Innovative logic to highlight sideways zones based on EMA overlap and price range analysis.
• Helps reduce noise and avoid trading during trendless periods.
3. Customization and Flexibility:
• Fully adjustable EMA lengths and overlap sensitivity to adapt to different markets and trading styles.
BK Multiple MA, RMA, SMA, HMA, VWAP, Rolling VWAP **Indicator Description**
I’m incredibly proud to introduce my third indicator to the TradingView community: **BK Multiple MA with HMA, VWAP, and Rolling VWAP**! This tool has been a game-changer in my trading strategy, and I’m excited to share it with others who are navigating the markets.
This indicator holds a special place in my heart because it represents the first technical analysis concept introduced to me by my mentor when I began apprenticing under him. His wisdom, guidance, and passion for trading—and for life—left an indelible mark on my journey. I dedicate this work, and every indicator I introduce, to the foundation he helped me build, while giving glory first and foremost to God.
**Moving Averages (MAs)** are one of the most widely used tools in technical analysis, and this indicator takes them to the next level. It allows you to plot **six fully customizable moving averages simultaneously**, with options including:
- **Exponential Moving Average (EMA)**
- **Simple Moving Average (SMA)**
- **Relative Moving Average (RMA)**
- **Hull Moving Average (HMA)**
- **Volume Weighted Average Price (VWAP)**
- **Rolling VWAP**
This flexibility makes the indicator highly versatile, whether you’re a day trader, swing trader, or long-term investor. By customizing periods, colors, and line widths for each MA, you can tailor the indicator to perfectly suit your trading style.
**Key Features**
1. **Six Fully Customizable MAs**:
- Adjust periods, line colors, and widths to match your preferences.
- Select from EMA, SMA, RMA, HMA, VWAP, or Rolling VWAP for each line.
2. **Unique Rolling VWAP Option**:
- Rolling VWAP calculates the volume-weighted average price over a user-defined period, such as 200 candles.
- This feature is ideal for traders seeking volume-weighted levels that don’t reset with each session, making it invaluable for trend-following and swing trading.
3. **HMA for Smoother Trends**:
- The Hull Moving Average (HMA) is designed to reduce lag and provide a responsive, noise-free view of price trends.
- It’s a powerful tool for spotting reversals and confirming directional momentum.
4. **Session VWAP**:
- Traditional VWAP resets with each trading session, making it a reliable benchmark for intraday support and resistance levels.
**How It Works**
- **VWAP**: Reflects the average price weighted by volume for the current trading session, commonly used by institutional traders to identify key price levels.
- **Rolling VWAP**: Extends VWAP functionality by calculating over a user-defined period, allowing for flexible multi-timeframe analysis.
- **HMA**: A fast, smooth moving average that reacts quickly to price changes while filtering out noise.
The combination of these options provides traders with a comprehensive view of market dynamics, enabling better decision-making.
**Final Thoughts**
This indicator is deeply meaningful to me because it represents the first concept my mentor introduced when I began apprenticing under him. His wisdom, guidance, and passion for trading—and for life—left an indelible mark on my journey. I dedicate this work, and every indicator I introduce, to the foundation he helped me build, while giving glory first and foremost to God.
If this indicator helps you succeed, I humbly ask that you honor the blessings in your life by giving back—whether through acts of kindness, philanthropy, or helping others in need.
May the Almighty guide us all toward wisdom and success in our endeavors. All glory belongs to God!
Smart Moving AveragesSmart Moving Averages analyzes the dynamic interplay between price action and multiple moving averages to identify high-probability support and resistance zones.
The script's distinguishing features include:
Bounce detection that filters out noise by requiring specific penetration thresholds (0.1-1.5%), helping traders identify genuine support tests versus false signals
Real-time MA clustering analysis that reveals zones where multiple moving averages converge, indicating potentially stronger support/resistance levels
Statistical tracking of bounce success rates for each MA, allowing traders to identify which moving averages are most reliable for the current market conditions
Power bounce detection that combines EMA spread analysis with trend confirmation, highlighting especially strong bullish setups
Visual stack status system that instantly communicates market health through an intuitive color-coded display showing how many MAs are below price
The script helps traders make more informed decisions by quantifying the historical reliability of different moving averages while providing real-time analysis of MA interactions with price. This systematic approach moves beyond simple MA crossovers to identify higher probability trading opportunities.
OHLC/4 Daily vs Quarterly CrossOHLC/4 Daily vs Quarterly Cross
The "OHLC/4 Daily vs Quarterly Cross" indicator is a powerful tool designed to provide traders with insights into trend alignment and potential market turning points. By calculating the average of the open, high, low, and close prices (OHLC/4), this script compares the daily average price action with the quarterly average to identify significant crossover events.
This indicator features two distinct lines: the Daily OHLC/4 and the Quarterly OHLC/4, each plotted in different colors for easy differentiation. A crossover occurs when the daily OHLC/4 moves above the quarterly average, potentially signaling bullish momentum or a shift in market direction. Conversely, a crossunder marks the daily OHLC/4 moving below the quarterly level, indicating potential bearish sentiment or a reversal.
With real-time plotting and built-in alert conditions, this script enables traders to stay ahead of critical market movements by setting automated notifications for crossover events. Whether you're seeking to confirm trends or identify new opportunities, the "OHLC/4 Daily vs Quarterly Cross" delivers clarity and actionable insights for more informed decision-making.
Buy Signal Forex & Crypto v0 ImprovedPurpose of the Script:
This script is designed to generate buy and sell signals for trading Forex and cryptocurrencies by analyzing price trends using exponential moving averages (EMAs), volatility, and volume filters. The signals are displayed as arrows on the chart.
What the Script Does
Input Settings:
The script allows the user to configure various settings, such as the lengths of EMAs, a higher timeframe for trend confirmation, and thresholds for volume and volatility (ATR - Average True Range).
Key settings:
5 EMA Length – Length of the short-term EMA.
13 EMA Length – Length of the medium-term EMA.
26 EMA Length – Length of the long-term EMA.
21 EMA Length – Used for trend confirmation on a higher timeframe.
Higher Timeframe – Lets you select a timeframe (e.g., daily) for confirming the overall trend.
ATR Threshold – Filters out signals when the market's volatility is too low.
Volume Filter – Ensures sufficient trading activity before generating signals.
Calculating EMAs (Exponential Moving Averages):
Four EMAs are calculated:
ema5 (short-term), ema13 (medium-term), ema26 (long-term), and ema21 (higher timeframe confirmation).
These EMAs help determine price trends and crossovers, which are critical for identifying buy and sell opportunities.
Trend Confirmation Using a Higher Timeframe:
The 21 EMA on the higher timeframe (e.g., daily) is used to confirm the overall direction of the market.
Defining Signal Conditions:
Buy Signal:
A buy signal is generated when:
ema5 crosses above ema13 (indicating a bullish trend).
ema5 crosses above ema26 (stronger bullish confirmation).
The closing price is above ema5, ema13, ema26, and the 21 EMA on the higher timeframe.
The market's volatility (ATR) is above the defined threshold.
The volume meets the conditions or volume filtering is disabled.
Sell Signal:
A sell signal is generated when:
ema5 crosses below ema13 (indicating a bearish trend).
ema5 crosses below ema26 (stronger bearish confirmation).
The closing price is below ema5, ema13, ema26, and the 21 EMA on the higher timeframe.
The market's volatility (ATR) is above the defined threshold.
The volume meets the conditions or volume filtering is disabled.
Volume Filtering:
Ensures there’s enough trading activity by comparing the current volume to a 20-period moving average of volume.
Persistent Variables:
These variables (crossed13 and crossed13Sell) help track whether the short-term EMA (ema5) has crossed the medium-term EMA (ema13). This prevents false or repeated signals.
Displaying Signals on the Chart:
Buy signals are displayed as green upward arrows below the price.
Sell signals are displayed as red downward arrows above the price.
How It Helps Traders:
This script provides visual cues for potential entry and exit points by combining moving average crossovers, volatility, volume, and higher timeframe trend confirmation. It works well for trending markets and ensures signals are filtered for stronger conditions to reduce noise.
VWAP Divergence | dobofulopOverview :
This script identifies potential bullish and bearish divergence signals using the Volume Weighted Average Price (VWAP). It calculates VWAP resets based on a selected “Anchor Period” (Session, Week, Month, Quarter, Year, Decade, Century, or corporate events like Earnings, Dividends, Splits). When price action and VWAP move in opposite directions with a sufficiently large ATR-based move over a chosen lookback period, the script plots divergence dots on the chart.
Key Features:
VWAP Anchoring : Choose an anchor period for resetting VWAP. This could be daily, weekly, monthly, or based on specific corporate events (Earnings, Dividends, Splits).
Divergence Detection : Looks for instances where the price is moving up while VWAP moves down (potential bullish divergence), and vice versa for bearish divergence.
ATR Filter : Uses the ATR (Average True Range) to filter out minor or insignificant price moves, helping to reduce noise.
Gap Check : Automatically invalidates signals if large price gaps occur within the lookback range.
Visual Signals : Bullish divergences are plotted below the bar, while bearish divergences are plotted above, making it easy to spot potential reversal zones.
How to Us
Inputs:
- Anchor Period (Session, Week, Month, etc.) – determines when the VWAP calculation restarts.
- Source (Default: HLC3) – Price source for the VWAP.
- ATR Multiplier and Lookback Period – Fine-tune the threshold for detecting significant moves vs. VWAP.
Interpretation:
- Bullish Divergence Dot: Suggests potential price strength when price moves higher but VWAP moves lower.
- Bearish Divergence Dot: Suggests potential price weakness when price moves lower but VWAP moves higher.
Disclaimer:
This script is provided for educational purposes only and should not be interpreted as financial advice. Past performance does not guarantee future results. Always conduct your own analysis and consider consulting a financial professional before making trading decisions.
BTCUSDT Premium Prices and EMA360The Exponential Moving Average (EMA) is a widely used technical indicator in trading that helps analysts and traders identify price trends over a specified period. Unlike the Simple Moving Average (SMA), which treats all data points equally, the EMA gives more weight to recent prices, making it more sensitive to recent price movements. This characteristic allows the EMA to react quickly to changes in market conditions, providing timely insights into potential trends.
## **Key Features of EMA**
- **Weighting Mechanism**: The EMA uses a smoothing factor that emphasizes recent price data while still considering older observations. This leads to a more dynamic representation of price trends compared to the SMA .
- **Trend Identification**: The EMA is particularly effective for identifying the direction of a stock's price movement. A rising EMA indicates an uptrend, while a declining EMA suggests a downtrend. Traders often use multiple EMAs with different periods to spot crossovers, which can signal potential buy or sell opportunities .
- **Calculation**: To calculate the EMA, one typically starts with an initial Simple Moving Average (SMA) for the first period, then applies the following formula for subsequent periods:
$$
\text{EMA}_{\text{today}} = \left(\text{Price}_{\text{today}} \times \left(\frac{2}{N + 1}\right)\right) + \left(\text{EMA}_{\text{yesterday}} \times \left(1 - \frac{2}{N + 1}\right)\right)
$$
Where $$N$$ is the number of periods .
## **Applications in Trading**
Traders utilize the EMA in various strategies, including:
- **Crossover Strategies**: By monitoring two EMAs of different lengths (e.g., 50-day and 200-day), traders can identify bullish or bearish signals when one crosses above or below the other .
- **Combining Indicators**: The EMA can be combined with other indicators like the Relative Strength Index (RSI) or Moving Average Convergence Divergence (MACD) for enhanced decision-making .
In summary, the Exponential Moving Average is a crucial tool for traders seeking to navigate market trends effectively. Its ability to prioritize recent data makes it an essential component of many trading strategies, providing insights that can lead to informed investment decisions.
Golden/Death Cross HighlighterThis indicator helps you easily identify and visualize Golden Cross and Death Cross patterns combined with price action confirmation. It highlights chart backgrounds when specific conditions are met, making it easy to spot potential trend changes.
🔑 Key Features:
Highlights Golden Cross conditions (50 SMA crosses above 200 SMA) when price closes above both MAs
Highlights Death Cross conditions (50 SMA crosses below 200 SMA) when price closes below both MAs
Customizable MA lengths (default: 50 and 200)
Adjustable highlight opacity
Built-in alerts for cross events
Clear visualization of both moving averages
📈 Color Guide:
Yellow Background: Golden Cross active + price above both MAs
Red Background: Death Cross active + price below both MAs
⚙️ Settings:
Fast MA Length: Length of faster moving average (default 50)
Slow MA Length: Length of slower moving average (default 200)
Golden Cross Highlight Opacity: Adjust visibility of bullish highlights
Death Cross Highlight Opacity: Adjust visibility of bearish highlights
💡 Usage Tips:
Use in combination with other indicators for confirmation
Set up alerts for potential trend changes
Adjust opacity to match your chart style
Works best on higher timeframes (4H, Daily, Weekly)
Mean Reversion Pro Strategy [tradeviZion]Mean Reversion Pro Strategy : User Guide
A mean reversion trading strategy for daily timeframe trading.
Introduction
Mean Reversion Pro Strategy is a technical trading system that operates on the daily timeframe. The strategy uses a dual Simple Moving Average (SMA) system combined with price range analysis to identify potential trading opportunities. It can be used on major indices and other markets with sufficient liquidity.
The strategy includes:
Trading System
Fast SMA for entry/exit points (5, 10, 15, 20 periods)
Slow SMA for trend reference (100, 200 periods)
Price range analysis (20% threshold)
Position management rules
Visual Elements
Gradient color indicators
Three themes (Dark/Light/Custom)
ATR-based visuals
Signal zones
Status Table
Current position information
Basic performance metrics
Strategy parameters
Optional messages
📊 Strategy Settings
Main Settings
Trading Mode
Options: Long Only, Short Only, Both
Default: Long Only
Position Size: 10% of equity
Starting Capital: $20,000
Moving Averages
Fast SMA: 5, 10, 15, or 20 periods
Slow SMA: 100 or 200 periods
Default: Fast=5, Slow=100
🎯 Entry and Exit Rules
Long Entry Conditions
All conditions must be met:
Price below Fast SMA
Price below 20% of current bar's range
Price above Slow SMA
No existing position
Short Entry Conditions
All conditions must be met:
Price above Fast SMA
Price above 80% of current bar's range
Price below Slow SMA
No existing position
Exit Rules
Long Positions
Exit when price crosses above Fast SMA
No fixed take-profit levels
No stop-loss (mean reversion approach)
Short Positions
Exit when price crosses below Fast SMA
No fixed take-profit levels
No stop-loss (mean reversion approach)
💼 Risk Management
Position Sizing
Default: 10% of equity per trade
Initial capital: $20,000
Commission: 0.01%
Slippage: 2 points
Maximum one position at a time
Risk Control
Use daily timeframe only
Avoid trading during major news events
Consider market conditions
Monitor overall exposure
📊 Performance Dashboard
The strategy includes a comprehensive status table displaying:
Strategy Parameters
Current SMA settings
Trading direction
Fast/Slow SMA ratio
Current Status
Active position (Flat/Long/Short)
Current price with color coding
Position status indicators
Performance Metrics
Net Profit (USD and %)
Win Rate with color grading
Profit Factor with thresholds
Maximum Drawdown percentage
Average Trade value
📱 Alert Settings
Entry Alerts
Long Entry (Buy Signal)
Short Entry (Sell Signal)
Exit Alerts
Long Exit (Take Profit)
Short Exit (Take Profit)
Alert Message Format
Strategy name
Signal type and direction
Current price
Fast SMA value
Slow SMA value
💡 Usage Tips
Consider starting with Long Only mode
Begin with default settings
Keep track of your trades
Review results regularly
Adjust settings as needed
Follow your trading plan
⚠️ Disclaimer
This strategy is for educational and informational purposes only. It is not financial advice. Always:
Conduct your own research
Test thoroughly before live trading
Use proper risk management
Consider your trading goals
Monitor market conditions
Never risk more than you can afford to lose
📋 Release Notes
14 January 2025
Added New Fast & Slow SMA Options:
Fibonacci-based periods: 8, 13, 21, 144, 233, 377
Additional period: 50
Complete Fast SMA options now: 5, 8, 10, 13, 15, 20, 21, 34, 50
Complete Slow SMA options now: 100, 144, 200, 233, 377
Bug Fixes:
Fixed Maximum Drawdown calculation in the performance table
Now using strategy.max_drawdown_percent for accurate DD reporting
Previous version showed incorrect DD values
Performance metrics now accurately reflect trading results
Performance Note:
Strategy tested with Fast/Slow SMA 13/377
Test conducted with 10% equity risk allocation
Daily Timeframe
For Beginners - How to Modify SMA Levels:
Find this line in the code:
fastLength = input.int(title="Fast SMA Length", defval=5, options= )
To add a new Fast SMA period: Add the number to the options list, e.g.,
To remove a Fast SMA period: Remove the number from the options list
For Slow SMA, find:
slowLength = input.int(title="Slow SMA Length", defval=100, options= )
Modify the options list the same way
⚠️ Note: Keep the periods that make sense for your trading timeframe
💡 Tip: Test any new combinations thoroughly before live trading
"Trade with Discipline, Manage Risk, Stay Consistent" - tradeviZion
MA RSI MACD Signal SuiteThis Pine Script™ is designed for use in Trading View and generates trading signals based on moving average (MA) crossovers, RSI (Relative Strength Index) signals, and MACD (Moving Average Convergence Divergence) indicators. It provides visual markers on the chart and can be configured to suit various trading strategies.
1. Indicator Overview
The indicator includes signals for:
Moving Averages (MA): It tracks crossovers between different types of moving averages.
RSI: Signals based on RSI crossing certain levels or its signal line.
MACD: Buy and sell signals generated by MACD crossovers.
2. Inputs and Customization
Moving Averages (MAs):
You can customize up to 6 moving averages with different types, lengths, and colors.
MA Type: Choose from different types of moving averages:
SMA (Simple Moving Average)
EMA (Exponential Moving Average)
HMA (Hull Moving Average)
SMMA (RMA) (Smoothed Moving Average)
WMA (Weighted Moving Average)
VWMA (Volume Weighted Moving Average)
T3, DEMA, TEMA
Source: Select the price to base the MA on (e.g., close, open, high, low).
Length: Define the number of periods for each moving average.
Examples:
MA1: Exponential Moving Average (EMA) with a period of 9
MA2: Exponential Moving Average (EMA) with a period of 21
RSI Settings:
RSI is calculated based on a user-defined period and is used to identify potential overbought or oversold conditions.
RSI Length: Lookback period for RSI (default 14).
Overbought Level: Defines the overbought threshold for RSI (default 70).
Oversold Level: Defines the oversold threshold for RSI (default 30).
You can also adjust the smoothing for the RSI signal line and customize when to trigger buy and sell signals based on the RSI crossing these levels.
MACD Settings:
MACD is used for identifying changes in momentum and trends.
Fast Length: The period for the fast moving average (default 12).
Slow Length: The period for the slow moving average (default 26).
Signal Length: The period for the signal line (default 9).
Smoothing Method: Choose between SMA or EMA for both the MACD and the signal line.
3. Signal Logic
Moving Average (MA) Crossover Signals:
Crossover: A bullish signal is generated when a fast MA crosses above a slow MA.
Crossunder: A bearish signal is generated when a fast MA crosses below a slow MA.
The crossovers are plotted with distinct colors, and the chart will display markers for these crossover events.
RSI Signals:
Oversold Crossover: A bullish signal when RSI crosses over its signal line below the oversold level (30).
Overbought Crossunder: A bearish signal when RSI crosses under its signal line above the overbought level (70).
RSI signals are divided into:
Aggressive (Early) Entries: Signals when RSI is crossing the oversold/overbought levels.
Conservative Entries: Signals when RSI confirms a reversal after crossing these levels.
MACD Signals:
Buy Signal: Generated when the MACD line crosses above the signal line (bullish crossover).
Sell Signal: Generated when the MACD line crosses below the signal line (bearish crossunder).
Additionally, the MACD histogram is used to identify momentum shifts:
Rising to Falling Histogram: Alerts when the MACD histogram switches from rising to falling.
Falling to Rising Histogram: Alerts when the MACD histogram switches from falling to rising.
4. Visuals and Alerts
Plotting:
The script plots the following on the price chart:
Moving Averages (MA): The selected MAs are plotted as lines.
Buy/Sell Shapes: Triangular markers are displayed for buy and sell signals generated by RSI and MACD.
Crossover and Crossunder Markers: Crosses are shown when two MAs crossover or crossunder.
Alerts:
Alerts can be configured based on the following conditions:
RSI Signals: Alerts for oversold or overbought crossover and crossunder events.
MACD Signals: Alerts for MACD line crossovers or momentum shifts in the MACD histogram.
Alerts are triggered when specific conditions are met, such as:
RSI crosses over or under the oversold/overbought levels.
MACD crosses the signal line.
Changes in the MACD histogram.
5. Example Usage
1. Trend Reversal Setup:
Buy Signal: Use the RSI oversold crossover and MACD bullish crossover to identify potential entry points in a downtrend.
Sell Signal: Use the RSI overbought crossunder and MACD bearish crossunder to identify potential exit points or short entries in an uptrend.
2. Momentum Strategy:
Combine MACD and RSI signals to identify the strength of a trend. Use MACD histogram analysis and RSI levels for confirmation.
3. Moving Average Crossover Strategy:
Focus on specific MA crossovers, such as the 9-period EMA crossing above the 21-period EMA, for buy signals. When a longer-term MA (e.g., 50-period) crosses a shorter-term MA, it may indicate a strong trend change.
6. Alerts Conditions
The script includes several alert conditions, which can be triggered and customized based on the user’s preferences:
RSI Oversold Crossover: Alerts when RSI crosses over the signal line below the oversold level (30).
RSI Overbought Crossunder: Alerts when RSI crosses under the signal line above the overbought level (70).
MACD Buy/Sell Crossover: Alerts when the MACD line crosses the signal line for a buy or sell signal.
7. Conclusion
This script is highly customizable and can be adjusted to suit different trading strategies. By combining MAs, RSI, and MACD, traders can gain multiple perspectives on the market, enhancing their ability to identify potential buy and sell opportunities.
Stochastic candles "Stochastic Candles" is designed to provide higher timeframe stochastic calculations and enhance the chart with additional visual aids like colored candles and EMA plotting.
Features of the Script:
Higher Timeframe Stochastic Calculation:
This indicator computes the stochastic %K and %D values for a specified higher timeframe and ensures these values are fetched for the higher timeframe data.
Dynamic Label Placement:
The script places labels on the chart displaying the %K and %D values above and below the bars, respectively.
Labels are dynamically deleted after being updated, ensuring only the latest values are visible.
Candle Coloring:
Candles are colored blue if %K > %D, yellow if %D > %K, and retain the default color otherwise.
Exponential Moving Average (EMA):
This indicator work fine . Consolidate market put effects on its performance .