Median For Loop | viResearchMedian For Loop | viResearch
Conceptual Foundation and Innovation
The "Median For Loop" indicator provides an innovative approach to analyzing market data by combining the power of the Median Price with a dynamic scoring system based on a for loop mechanism. This unique script evaluates the median price of the market over a user-defined period, then applies a loop function to generate a score that helps traders detect trends, reversals, and market momentum.
The median, being a robust measure of central tendency, helps filter out noise and better represent the middle of a price range. By applying a loop function that compares the current median to historical values, this script offers a detailed view of price momentum, allowing traders to detect potential trend changes with improved accuracy.
Technical Composition and Calculation
The "Median For Loop" script is composed of two primary components:
Median Calculation: The indicator calculates the median price of the market based on the chosen input source (default is HLC3: the average of high, low, and close) and the specified length. This creates a central value around which market movements can be evaluated.
For Loop Scoring System: This system compares the current median value with past values within a user-defined range, generating a score that reflects how the market is trending. The loop mechanism dynamically sums the score based on whether the current median is higher or lower than historical medians, providing a clear signal of trend strength and direction.
Key Calculations:
Median Calculation: The median is calculated using the percentile_nearest_rank function, providing the 50th percentile of the selected price data over the given length.
For Loop Scoring:
The loop evaluates the median over a defined range (from and to), comparing the current median to historical values.
If the current median is higher than a previous value, a positive score is added; if it is lower, a negative score is added. This forms the final total score, indicating the trend strength.
Features and User Inputs
The "Median For Loop" script offers flexibility and customization options for traders to adapt it to various market conditions and trading strategies:
Median Length: Control the period over which the median price is calculated, affecting the responsiveness of the indicator to price changes.
Loop Range (From and To): Define the range over which the loop evaluates historical median values, allowing traders to adjust how far back the script looks when assessing momentum.
Thresholds: User-defined thresholds are available to specify when the score indicates an uptrend or downtrend. This provides traders with control over the sensitivity of the trend signals.
Practical Applications
The "Median For Loop" indicator is ideal for traders seeking a balanced, noise-filtered approach to trend detection. It is particularly effective for:
Detecting Early Trend Reversals: The loop-based scoring system offers early signals of potential reversals by comparing the current median with past medians, giving traders an advantage in volatile markets.
Confirming Trend Strength: By analyzing the median over time, the script helps confirm whether trends are gaining or losing momentum, improving the accuracy of trade entries and exits.
Strategic Positioning: The customizable parameters allow traders to adapt the script to various market conditions, enhancing their ability to position themselves effectively in both trending and ranging markets.
Advantages and Strategic Value
The key advantage of the "Median For Loop" script is its ability to reduce market noise by focusing on the median price while providing a dynamic scoring system for trend detection. The combination of median calculation and loop-based evaluation offers a more refined view of market momentum, reducing false signals and increasing the reliability of trend identification. This makes it a valuable tool for traders aiming to enhance their market timing and strategy development.
Alerts and Visual Cues
The script includes built-in alerts to notify traders of potential trend changes:
Median For Loop Long: Triggers when the score exceeds the upper threshold, indicating a possible upward trend.
Median For Loop Short: Triggers when the score falls below the lower threshold, signaling a potential downward trend.
Visual cues are also provided, with background colors highlighting potential trend shifts when the score crosses certain levels, offering traders an easy-to-read signal on the chart.
Summary and Usage Tips
The "Median For Loop | viResearch" indicator provides a powerful combination of median price smoothing and dynamic trend scoring, allowing traders to gain a clearer understanding of market momentum. By incorporating this script into your trading strategy, you can improve your ability to detect trends and reversals while reducing the noise that often affects price data. Whether you're focusing on early reversals or confirming the strength of existing trends, this indicator offers a reliable and customizable solution.
Note: Backtests are based on past results and are not indicative of future performance.
Oscillators
Lsma For Loop | viResearchLsma For Loop | viResearch
Conceptual Foundation and Innovation
The "Lsma For Loop" indicator offers a unique combination of the Least Squares Moving Average (LSMA) with a dynamic scoring system based on a loop function. By comparing the current LSMA value with historical values over a user-defined range, this indicator generates a detailed score that helps detect trend strength and potential reversals. This approach provides traders with a more nuanced analysis of price action, allowing them to identify trends earlier and with more accuracy.
The LSMA, which minimizes lag compared to traditional moving averages, is ideal for detecting trends as it provides a smooth and quick-to-respond line. When combined with the loop-based scoring system, traders can benefit from a powerful tool for analyzing market momentum and capturing profitable trends.
Technical Composition and Calculation
The "Lsma For Loop" script features two essential components:
Least Squares Moving Average (LSMA): The LSMA is calculated over a user-defined length using a linear regression model. It provides a smooth line that follows price trends more closely, reducing the noise that is often present in simple moving averages.
For Loop Scoring System: This system evaluates the LSMA over a range of previous values, generating a score based on whether the current LSMA is higher or lower than its previous values within the specified range. The resulting score reflects the strength of the trend, with higher scores indicating a stronger uptrend and lower scores signaling a downtrend.
Key Calculations:
LSMA Calculation: The LSMA is derived from the closing price over the selected period (len), providing a smooth moving average that fits the price data closely.
For Loop Scoring:
The loop iterates over a range of previous LSMA values, comparing the current LSMA to each past value.
If the current LSMA is higher than a previous value, a positive score is added; if it is lower, a negative score is added. The sum of these comparisons forms the overall score.
Features and User Inputs
The "Lsma For Loop" script offers a range of customization options, allowing traders to tailor the indicator to their specific trading strategies and market conditions:
LSMA Length: Adjust the length of the LSMA, controlling the smoothness of the indicator and how quickly it reacts to price changes.
Loop Range (From and To): Define the range over which the for loop evaluates LSMA values. This provides flexibility in assessing momentum over different timeframes.
Thresholds: Customizable threshold levels are used to define when the score indicates an uptrend or downtrend. This allows traders to fine-tune the sensitivity of the indicator to market movements.
Practical Applications
The "Lsma For Loop" is a versatile tool for traders who want to leverage the advantages of LSMA smoothing while gaining a more detailed view of trend strength. This indicator is particularly useful for:
Identifying Trend Reversals: The loop-based scoring system provides an early indication of potential trend reversals, allowing traders to react before major market movements.
Confirming Trend Strength: By evaluating the LSMA against a range of previous values, the script helps confirm whether a trend is strengthening or weakening.
Enhanced Market Positioning: The customizable range and thresholds enable traders to adapt the script to different market conditions, whether they are day trading or swing trading.
Advantages and Strategic Value
The primary advantage of the "Lsma For Loop" script lies in its ability to provide a more granular analysis of LSMA behavior through the use of the for loop. This dynamic approach reduces the likelihood of false signals and offers greater accuracy in detecting trends. The indicator’s versatility makes it a valuable tool for both short-term and long-term trading strategies.
Alerts and Visual Cues
The script includes built-in alert conditions to notify traders of key trend changes:
Lsma For Loop Long: Indicates a potential upward trend when the score exceeds the upper threshold.
Lsma For Loop Short: Signals a potential downward trend when the score falls below the lower threshold.
Additionally, visual cues such as background color changes highlight when the score crosses certain key levels, providing an easy-to-read representation of market trends directly on the chart.
Summary and Usage Tips
The "Lsma For Loop | viResearch" indicator provides traders with a powerful tool that combines LSMA smoothing with a dynamic loop-based scoring system for trend detection. Incorporating this script into your trading strategy can help improve trend identification and enhance decision-making around entries and exits. Whether you are trading in trending markets or looking for early reversal signals, this script offers a reliable and flexible solution.
Note: Backtests are based on past results and are not indicative of future performance.
RSI Standard Deviation | viResearchRSI Standard Deviation | viResearch
The "RSI Standard Deviation" indicator, developed by viResearch, introduces a new approach to combining the Relative Strength Index (RSI) with a standard deviation measure to offer a more dynamic view of market momentum. By applying standard deviation to the RSI values, this indicator refines the traditional RSI, providing a more precise and adaptive way to measure overbought and oversold conditions. This unique combination allows traders to better understand the underlying volatility in RSI movements, leading to more informed decisions in trending and ranging markets.
Technical Composition and Calculation:
The core of the "RSI Standard Deviation" lies in calculating the RSI based on user-defined input parameters and then applying standard deviation to these RSI values. This method enhances the sensitivity of the RSI, making it more responsive to market volatility.
RSI Calculation:
RSI Length (len): The script computes the Relative Strength Index over a customizable length (default: 21), offering a traditional measure of momentum in the market. The RSI tracks the speed and change of price movements, oscillating between 0 and 100 to indicate overbought and oversold conditions.
Standard Deviation Applied to RSI:
Standard Deviation Length (sdlen): The script calculates the standard deviation of the RSI values over a user-defined period (default: 35). This standard deviation represents the volatility in RSI movements, adding a new layer of analysis to traditional RSI.
Upper (u) and Lower (d) Bands:
The standard deviation values are used to create upper and lower bands around the RSI, offering an adaptive range that expands or contracts based on market volatility. This helps traders identify moments when the market is more likely to reverse or continue its trend.
Trend Identification:
Uptrend (L): The script identifies an uptrend when the RSI moves above the lower band and stays above the midline (50). This indicates that the market is gaining upward momentum, potentially signaling a long position.
Downtrend (S): A downtrend is identified when the RSI moves below 50, suggesting a weakening market and a potential short position.
Features and User Inputs:
The "RSI Standard Deviation" script offers various customization options, enabling traders to tailor it to their specific needs and strategies:
RSI Length: Traders can adjust the length of the RSI calculation to control how quickly the indicator responds to price movements.
Standard Deviation Length: Adjusting the standard deviation length allows users to control the sensitivity of the upper and lower bands, fine-tuning the indicator’s responsiveness to market volatility.
Source Input: The script can be applied to different price sources, offering flexibility in how it calculates RSI and standard deviation values.
Practical Applications:
The "RSI Standard Deviation" indicator is particularly useful in volatile markets, where traditional RSI may produce false signals due to rapid price movements. By adding a standard deviation measure, traders can filter out noise and better identify trends.
Key Uses:
Trend Following: The standard deviation bands provide a clearer view of momentum shifts in the RSI, allowing traders to follow the trend more confidently.
Volatility Assessment: The indicator dynamically adjusts to market volatility, making it easier to assess when the market is overbought or oversold and when a trend reversal is likely.
Signal Confirmation: By comparing the RSI to the adaptive standard deviation bands, traders can confirm signals and avoid false entries during periods of high volatility.
Advantages and Strategic Value:
The "RSI Standard Deviation" offers several advantages:
Enhanced Precision: The combination of RSI and standard deviation results in a more refined momentum indicator that adapts to market conditions.
Noise Reduction: The standard deviation bands help filter out short-term market noise, making it easier to identify significant trend changes.
Dynamic Volatility Awareness: By using standard deviation, the indicator adjusts its bands based on real-time volatility, providing more accurate overbought and oversold signals.
Summary and Usage Tips:
The "RSI Standard Deviation" is a powerful tool for traders looking to enhance their RSI analysis with volatility measures. For optimal performance, traders should experiment with different RSI and standard deviation lengths to suit their trading timeframe and strategy. Whether used to follow trends or confirm momentum signals, the "RSI Standard Deviation" provides a reliable and adaptive solution for modern trading environments.
HMA Smoothed RSI [Pinescriptlabs]This indicator uses a modified version of the RSI (Relative Strength Index) weighted by volume. This means it not only takes into account the price but also the amount of volume supporting those price movements, making the indicator more sensitive to real market fluctuations.
Hull Moving Average (HMA) Applied to RSI: To smooth the volume-weighted RSI, a Hull Moving Average (HMA) is applied. The HMA is known for its ability to reduce market "noise" and quickly react to trend changes. This process helps better identify when an asset is overbought or oversold.
Overbought and Oversold Regions: The indicator sets clear overbought and oversold levels, which are adjustable. By default, the overbought level is set at 20 and the oversold level at -20, but you can customize these values. Additionally, there are extreme overbought and oversold levels to help identify more extreme market conditions where a price reversal is more likely.
Buy and Sell Signals:
Buy Signal: This is generated when the modified RSI crosses above the oversold level. This indicates that the price has dropped enough and may be about to rise.
Sell Signal: This occurs when the RSI crosses below the overbought level. This suggests that the price has risen too much and could be about to fall.
Dynamic Visualization and Colors: The indicator is displayed with different colors based on its behavior:
When the RSI is within normal levels, the color is neutral.
If it is above the overbought level, the color turns red (sell alert).
If it is below the oversold level, the color turns green (buy alert).
Alerts: This indicator also allows you to set up alerts. You will receive automatic notifications when buy or sell signals are generated, helping you make decisions without constantly monitoring the chart.
Español:
Este indicador utiliza una versión modificada del RSI (Índice de Fuerza Relativa), ponderado por volumen. Esto significa que no solo tiene en cuenta el precio, sino también la cantidad de volumen que respalda esos movimientos de precios, haciendo que el indicador sea más sensible a las fluctuaciones reales del mercado.
Media Móvil Hull (HMA) aplicada al RSI: Para suavizar el RSI ponderado por volumen, se le aplica una Media Móvil Hull (HMA). La HMA es conocida por su capacidad para reducir el "ruido" del mercado y reaccionar rápidamente a los cambios de tendencia. Este proceso ayuda a identificar mejor cuándo un activo está sobrecomprado o sobrevendido.
Regiones de sobrecompra y sobreventa: El indicador establece niveles claros de sobrecompra y sobreventa que son ajustables. Por defecto, el nivel de sobrecompra está en 20 y el de sobreventa en -20, pero puedes personalizar estos valores. Además, hay niveles extremos de sobrecompra y sobreventa que te ayudan a identificar condiciones más extremas del mercado, donde una reversión de precio es más probable.
Señales de compra y venta:
Señal de compra: Se genera cuando el RSI modificado cruza hacia arriba el nivel de sobreventa. Esto indica que el precio ha bajado lo suficiente y puede estar a punto de subir.
Señal de venta: Se produce cuando el RSI cruza hacia abajo el nivel de sobrecompra. Esto indica que el precio ha subido demasiado y podría estar a punto de bajar.
Visualización y colores dinámicos: El indicador se muestra con diferentes colores según su comportamiento:
Cuando el RSI está dentro de los niveles normales, el color es neutro.
Si está por encima del nivel de sobrecompra, el color se vuelve rojo (señal de alerta de venta).
Si está por debajo del nivel de sobreventa, el color se vuelve verde (señal de alerta de compra).
Alertas: Este indicador también te permite configurar alertas. Así, recibirás notificaciones automáticas cuando se generen señales de compra o venta, ayudándote a tomar decisiones sin estar constantemente monitoreando el gráfico.
Inverted SD Dema RSI | viResearchInverted SD Dema RSI | viResearch
The "Inverted SD Dema RSI" developed by viResearch introduces a new approach to trend analysis by combining the Double Exponential Moving Average (DEMA), Standard Deviation (SD), and Relative Strength Index (RSI). This unique indicator provides traders with a tool to capture market trends by integrating volatility-based thresholds. By using the smoothed DEMA along with standard deviation, the indicator offers improved responsiveness to price fluctuations, while RSI thresholds offer insight into overbought and oversold market conditions.
At the core of the "Inverted SD Dema RSI" is the combination of DEMA and standard deviation for a more nuanced view of market volatility. The use of RSI further aids in detecting price extremes and potential trend reversals.
DEMA Calculation (sublen): The Double Exponential Moving Average (DEMA) smoothes out price data over a user-defined period, reducing lag compared to traditional moving averages. This provides a clearer representation of the market's overall direction.
Standard Deviation Calculation (sublen_2): The standard deviation of the DEMA is used to define the upper (u) and lower (d) bands, highlighting areas where price volatility may signal a change in trend. These dynamic bands help traders gauge price volatility and potential breakouts or breakdowns.
RSI Calculation (len): The script applies the Relative Strength Index (RSI) to the smoothed DEMA values, allowing traders to detect momentum shifts based on a modified data set. This provides a more accurate reflection of market strength when combined with the DEMA.
Thresholds: The RSI is compared to user-defined thresholds (70 for overbought and 55 for oversold conditions). These thresholds help in identifying potential market reversals, especially when the price breaks outside of the calculated standard deviation bands.
Uptrend (L): An uptrend signal is generated when the RSI exceeds the upper threshold (70) and the price is not above the upper standard deviation band, indicating that there may be room for further price appreciation.
Downtrend (S): A downtrend signal occurs when the RSI falls below the lower threshold (55), indicating that the price may continue to decline.
The "Inverted SD Dema RSI" offers a wide range of customizable settings, allowing traders to adjust the indicator based on their trading style or market conditions.
DEMA Length (sublen): Controls the period used to smooth the price data, impacting the sensitivity of the DEMA to recent price movements.
Standard Deviation Length (sublen_2): Defines the length over which the standard deviation is calculated, helping traders control the width of the upper and lower bands.
RSI Length (len): Adjusts the period used for the RSI calculation, providing flexibility in determining overbought and oversold conditions.
RSI Thresholds: Traders can define their own levels for detecting trend reversals, with default values of 70 for an uptrend and 55 for a downtrend.
The "Inverted SD Dema RSI" is particularly well-suited for traders looking to capture trends while accounting for volatility and momentum. By using a smoothed DEMA as the foundation, it effectively filters out noise, making it ideal for detecting reliable trends in volatile markets.
Key Uses:
Trend Following: The indicator’s combination of DEMA, standard deviation, and RSI helps traders follow trends more effectively by reducing noise and identifying key momentum shifts.
Volatility Filtering: The use of standard deviation bands provides a dynamic measure of volatility, ensuring that traders are aware of potential breakouts or breakdowns in the market.
Momentum Detection: The inclusion of RSI ensures that the indicator is not only focused on trend direction but also on the strength of the underlying momentum, helping traders avoid entering trades during weak trends.
The "Inverted SD Dema RSI" provides several key advantages over traditional trend-following indicators:
Reduced Lag: The use of DEMA ensures faster trend detection, reducing the lag associated with simple moving averages.
Noise Reduction: The integration of standard deviation helps filter out irrelevant price movements, making it easier to identify significant trends.
Momentum Awareness: The addition of RSI provides valuable insight into the strength of trends, helping traders avoid false signals during periods of weak momentum.
The "Inverted SD Dema RSI" offers a powerful blend of trend-following and momentum detection, making it a versatile tool for modern traders. By integrating DEMA, standard deviation, and RSI, the indicator provides a comprehensive view of market trends and volatility. Traders are encouraged to experiment with different settings for the DEMA length, standard deviation, and RSI thresholds to fine-tune the indicator for their specific trading strategies. Whether used for trend confirmation, volatility assessment, or momentum analysis, the "Inverted SD Dema RSI" offers a valuable tool for traders seeking a comprehensive approach to market analysis.
Composite Momentum█ Introduction
The Composite Momentum Indicator is a tool we came across that we found to be useful at detecting implied tops and bottoms within quick market cycles. Its approach to analyzing momentum through a combination of moving averages and summation techniques makes it a useful addition to the range of available indicators on TradingView.
█ How It Works
This indicator operates by calculating the difference between two moving averages—one fast and one slow, which can be customized by the user. The difference between these two averages is then expressed as a percentage of the fast moving average, forming the core momentum value which is then smoothed with an Exponential Moving Average is applied. The smoothed momentum is then compared across periods to identify directional changes in direction
Furthermore, the script calculates the absolute differences between consecutive momentum values. These differences are used to determine periods of momentum acceleration or deceleration, aiming to establish potential reversals.
In addition to tracking momentum changes, the indicator sums positive and negative momentum changes separately over a user-defined period. This summation is intended to provide a clearer picture of the prevailing market bias—whether it’s leaning towards strength or weakness.
Finally, the summed-up values are normalized to a percentage scale. This normalization helps in identifying potential tops and bottoms by comparing the relative strength of the momentum within a given cycle.
█ Usage
This indicator is primarily useful for traders who focus on detecting quick cycle tops and bottoms. It provides a view of momentum shifts that can signal these extremes, though it’s important to use it in conjunction with other tools and market analysis techniques. Given its ability to highlight potential reversals, it may be of interest to those who seek to understand short-term market dynamics.
█ Disclaimer
This script was discovered without any information about its author or original intent but was nonetheless ported from its original format that is available publicly. It’s provided here for educational purposes and should not be considered a guaranteed method for market analysis. Users are encouraged to test and understand the indicator thoroughly before applying it in real trading scenarios.
Uptrick: Dual Moving Average Volume Oscillator
Title: Uptrick: Dual Moving Average Volume Oscillator (DPVO)
### Overview
The "Uptrick: Dual Moving Average Volume Oscillator" (DPVO) is an advanced trading tool designed to enhance market analysis by integrating volume data with price action. This indicator is specially developed to provide traders with deeper insights into market dynamics, making it easier to spot potential entry and exit points based on volume and price interactions. The DPVO stands out by offering a sophisticated approach to traditional volume analysis, setting it apart from typical volume indicators available on the TradingView platform.
### Unique Features
Unlike traditional indicators that analyze volume and price movements separately, the DPVO combines these two critical elements to offer a comprehensive view of market behavior. By calculating the Volume Impact, which involves the product of the exponential moving averages (EMAs) of volume and the price range (close - open), this indicator highlights significant trading activities that could indicate strong buying or selling pressure. This method allows traders to see not just the volume spikes, but how those spikes relate to price movements, providing a clearer picture of market sentiment.
### Customization and Inputs
The DPVO is highly customizable, catering to various trading styles and strategies:
- **Oscillator Length (`oscLength`)**: Adjusts the period over which the volume and price difference is analyzed, allowing traders to set it according to their trading timeframe.
- **Fast and Slow Moving Averages (`fastMA` and `slowMA`)**: These parameters control the responsiveness of the DPVO. A shorter `fastMA` coupled with a longer `slowMA` can help in identifying trends quicker or smoothing out market noise for more conservative approaches.
- **Signal Smoothing (`signalSmooth`)**: This input helps in reducing signal noise, making the crossover and crossunder points between the DVO and its smoothed signal line clearer and easier to interpret.
### Functionality Details
The DPVO operates through a sequence of calculated steps that integrate volume data with price movement:
1. **Volume Impact Calculation**: This is the foundational step where the product of the EMA of volume and the EMA of price range (close - open) is calculated. This metric highlights trading sessions where significant volume accompanies substantial price movements, suggesting a strong market response.
2. **Dynamic Volume Oscillator (DVO)**: The heart of the indicator, the DVO, is derived by calculating the difference between the fast EMA and the slow EMA of the Volume Impact. This result is then normalized by dividing by the EMA of the volume over the same period to scale the output, making it consistent across various trading environments.
3. **Signal Generation**: The final output is smoothed using a simple moving average of the DVO to filter out market noise. Buy and sell signals are generated based on the crossover and crossunder of the DVO with its smoothed version, providing clear cues for market entry or exit.
### Originality
The DPVO's originality lies in its innovative integration of volume and price movement, a novel approach not typically observed in other volume indicators. By analyzing the product of volume and price change EMAs, the DPVO captures the essence of market dynamics more holistically than traditional tools, which often only reflect volume levels without contextualizing them with price actions. This dual analysis provides traders with a deeper understanding of market forces, enabling them to make more informed decisions based on a combination of volume surges and significant price movements. The DPVO also introduces a unique normalization and smoothing technique that refines the oscillator's output, offering cleaner and more reliable signals that are adaptable to various market conditions and trading styles.
### Practical Application
The DPVO excels in environments where volume plays a crucial role in validating price movements. Traders can utilize the buy and sell signals generated by the DPVO to enhance their decision-making process. The signals are plotted directly on the trading chart, with buy signals appearing below the price bars and sell signals above, ensuring they are prominent and actionable. This setup is particularly useful for day traders and swing traders who rely on timely and accurate signals to maximize their trading opportunities.
### Best Practices
To maximize the effectiveness of the DPVO, traders should consider the following best practices:
- **Market Selection**: Use the DPVO in markets known for strong volume-price correlation such as major forex pairs, popular stocks, and cryptocurrencies.
- **Signal Confirmation**: While the DPVO provides powerful signals, confirming these signals with additional indicators such as RSI or MACD can increase trade reliability.
- **Risk Management**: Always use stop-loss orders to manage risks associated with trading signals. Adjust the position size based on the volatility of the asset to avoid significant losses.
### Practical Example + How to use it
Practical Example1: Day Trading Cryptocurrencies
For a day trader focusing on the highly volatile cryptocurrency market, the DPVO can be an effective tool on a 15-minute chart. Suppose a trader is monitoring Bitcoin (BTC) during a period of high market activity. The DPVO might show an upward crossover of the DVO above its smoothed signal line while also indicating a significant increase in volume. This could signal that strong buying pressure is entering the market, suggesting a potential short-term rally. The trader could enter a long position based on this signal, setting a stop-loss just below the recent support level to manage risk. If the DPVO later shows a crossover in the opposite direction with decreasing volume, it might signal a good exit point, allowing the trader to lock in profits before a potential pullback.
- **Swing Trading Stocks**: For a swing trader looking at stocks, the DPVO could be applied on a daily chart. If the oscillator shows a consistent downward trend along with increasing volume, this could suggest a potential sell-off, providing a sell signal before a significant downturn.
You can look for:
--> Increase in volume - You can use indicators like 24-hour-Volume to have a better visualization
--> Uptrend/Downtrend in the indicator (HH, HL, LL, LH)
--> Confirmation (Buy signal/Sell signal)
--> Correct Price action (Not too steep moves up or down. Stable moves.) (Optional)
--> Confirmation with other indicators (Optional)
Quick image showing you an example of a buy signal on SOLANA:
### Technical Notes
- **Calculation Efficiency**: The DPVO utilizes exponential moving averages (EMAs) in its calculations, which provides a balance between responsiveness and smoothing. EMAs are favored over simple moving averages in this context because they give more weight to recent data, making the indicator more sensitive to recent market changes.
- **Normalization**: The normalization of the DVO by the EMA of the volume ensures that the oscillator remains consistent across different assets and timeframes. This means the indicator can be used on a wide variety of markets without needing significant adjustments, making it a versatile tool for traders.
- **Signal Line Smoothing**: The final signal line is smoothed using a simple moving average (SMA) to reduce noise. The choice of SMA for smoothing, as opposed to EMA, is intentional to provide a more stable signal that is less prone to frequent whipsaws, which can occur in highly volatile markets.
- **Lag and Sensitivity**: Like all moving average-based indicators, the DPVO may introduce a slight lag in signal generation. However, this is offset by the indicator’s ability to filter out market noise, making it a reliable tool for identifying genuine trends and reversals. Adjusting the `fastMA`, `slowMA`, and `signalSmooth` inputs allows traders to fine-tune the sensitivity of the DPVO to match their specific trading strategy and market conditions.
- **Platform Compatibility**: The DPVO is written in Pine Script™ v5, ensuring compatibility with the latest features and functionalities offered by TradingView. This version takes advantage of optimized functions for performance and accuracy in calculations, making it well-suited for real-time analysis.
Conclusion
The "Uptrick: Dual Moving Average Volume Oscillator" is a revolutionary tool that merges volume analysis with price movement to offer traders a more nuanced understanding of market trends and reversals. Its ability to provide clear, actionable signals based on a unique combination of volume and price changes makes it an invaluable addition to any trader's toolkit. Whether you are managing long-term positions or looking for quick trades, the DPVO provides insights that can help refine any trading strategy, making it a standout choice in the crowded field of technical indicators.
Nothing from this indicator or any other Uptrick Indicators is financial advice. Only you are ultimately responsible for your choices.
Combo 2/20 EMA & CCI
This is another part of my research work, where I test a combination of two strategies, receiving a combined signal. In order to understand which indicator combinations work better, which work worse, as filters for trades. This is combo strategies for get a cumulative signal.
First strategy
This indicator plots 2/20 exponential moving average. For the Mov Avg X 2/20 Indicator, the EMA bar will be painted when the Alert criteria is met.
Second strategy
The Commodity Channel Index (CCI) is best used with markets that display cyclical or seasonal characteristics, and is formulated to detect the beginning and ending of the cycles by incorporating a moving average together with a divisor that reflects both possible and actual trading ranges. The final index measures the deviation from normal, which indicates major changes in market trend.
Strategy tester settings:
Initial capital: 1000
Order size: 0.5
Commission: 0.1%
Other as default.
Indicator settings:
EMA Length: 50
CCI Length: 10
Fast MA Length: 15
Slow MA Length: 20
Other as default.
WARNING:
- For purpose educate only
- This script to change bars colors.
True Strength Index with Buy/Sell Signals and AlertsThe True Strength Index (TSI) is a momentum oscillator that helps traders identify trends and potential reversal points in the market. Here’s how it works:
1. **Price Change Calculation**:
- **`pc = ta.change(price)`**: This calculates the change in price (current price minus the previous price).
2. **Double Smoothing**:
- **`double_smooth(src, long, short)`**: This function smooths the price change data twice using two Exponential Moving Averages (EMAs):
- The first EMA smooths the raw data.
- The second EMA smooths the result of the first EMA.
- **`double_smoothed_pc`**: The double-smoothed price change.
- **`double_smoothed_abs_pc`**: The double-smoothed absolute price change, which helps normalize the TSI value.
3. **TSI Calculation**:
- **`tsi_value = 100 * (double_smoothed_pc / double_smoothed_abs_pc)`**: This calculates the TSI by dividing the double-smoothed price change by the double-smoothed absolute price change, then multiplying by 100 to scale the value.
- The TSI oscillates around the zero line, indicating momentum. Positive values suggest bullish momentum, while negative values suggest bearish momentum.
4. **Signal Line**:
- **`signal_line = ta.ema(tsi_value, signal)`**: This creates a signal line by applying another EMA to the TSI value. The signal line is typically used to identify entry and exit points.
5. **Buy and Sell Signals**:
- **Buy Signal**: Occurs when the TSI crosses above the signal line (`ta.crossover(tsi_value, signal_line)`), indicating that bullish momentum is strengthening, which might suggest a buying opportunity.
- **Sell Signal**: Occurs when the TSI crosses below the signal line (`ta.crossunder(tsi_value, signal_line)`), indicating that bearish momentum is strengthening, which might suggest a selling opportunity.
6. **Visual Representation**:
- The TSI line and the signal line are plotted on the chart.
- Buy signals are marked with green "BUY" labels below the bars, and sell signals are marked with red "SELL" labels above the bars.
**How to Use It**:
- **Trend Identification**: When the TSI is above zero, it suggests an uptrend; when it's below zero, it suggests a downtrend.
- **Buy/Sell Signals**: Traders often enter a buy trade when the TSI crosses above the signal line and enter a sell trade when the TSI crosses below the signal line.
- **Divergences**: TSI can also be used to spot divergences between the indicator and price action, which can signal potential reversals.
The TSI is particularly useful in identifying the strength of a trend and the potential turning points, making it valuable for trend-following and swing trading strategies.
Standardized PSAR Oscillator [AlgoAlpha]Enhance your trading experience with the "Standardized PSAR Oscillator" 🪝, a powerful tool that combines the Parabolic Stop and Reverse (PSAR) with standardization techniques to offer more nuanced insights into market trends and potential reversals.
🔑 Key Features:
- 🛠 Customizable PSAR Settings: Adjust the starting point, increment, and maximum values for the PSAR to tailor the indicator to your strategy.
- 📏 Standardization: Smooth out volatility by standardizing the PSAR values using a customizable EMA, making reversals easier to identify.
- 🎨 Dynamic Color-Coding: The oscillator changes colors based on market conditions, helping you quickly spot bullish and bearish trends.
- 🔄 Divergence Detection: Automatic detection of bullish and bearish divergences with customizable sensitivity and confirmation settings.
- 🔔 Alerts: Set up alerts for key events like zero-line crossovers and trend weakening, ensuring you never miss a critical market move.
🚀 How to Use:
✨ Add the Indicator: Add the indicator to favorites by pressing the star icon, adjust the settings to suite your needs.
👀 Monitor Signals: Watch for the automatic plotting of divergences and reversal signals to identify potential market entries and exits.
🔔 Set Alerts: Configure alerts to get notified of key changes without constantly monitoring the charts.
🔍 How It Works:
The Standardized PSAR Oscillator is an advanced trading tool that refines the traditional PSAR (Parabolic Stop and Reverse) indicator by incorporating several key enhancements to improve trend analysis and signal accuracy. The script begins by calculating the PSAR, a widely used indicator known for its effectiveness in identifying trend reversals. To make the PSAR more adaptive and responsive to market conditions, it is standardized using an Exponential Moving Average (EMA) of the high-low range over a user-defined period. This standardization helps to normalize the PSAR values, making them more comparable across different market conditions.
To further enhance signal clarity, the standardized PSAR is then smoothed using a Weighted Moving Average (WMA). This combination of EMA and WMA creates an oscillator that not only captures trend direction but also smooths out market noise, providing a cleaner signal. The oscillator's values are color-coded to visually indicate its position relative to the zero line, with additional emphasis on whether the WMA is rising or falling—this helps traders quickly interpret the trend’s strength and direction.
The oscillator also includes built-in divergence detection by comparing pivot points in price action with those in the oscillator. This feature helps identify potential discrepancies between the price and the oscillator, signaling possible trend reversals. Alerts can be configured for when the oscillator crosses the zero line or when a trend shows signs of weakening, ensuring that traders receive timely notifications to act on emerging opportunities. These combined elements make the Standardized PSAR Oscillator a robust tool for enhancing your trading strategy with more reliable and actionable signals
Periodical Trend [BigBeluga]The Periodical Trend indicator is designed to provide a detailed analysis of market trends and volatility. It utilizes a combination of Moving Averages and volatility measures to plot trend line, highlight potential trend reversals, and indicate mean reversion opportunities. The indicator offers customizable display options, allowing traders to adjust for sensitivity, volatility bands, and price deviation visibility.
🔵 KEY FEATURES
● Periodical Trend Analysis
Uses (high + volatility) or (low - volatility) as the foundation for trend analysis with a set period.
// Condition to update the AVG array based on the selected mode
if mode == "Normal"
? bar_index == 122
: bar_index % period == 0
AVG.push(close) // Add the close price to the AVG array
// Update AVG array based on the period and price comparison
if bar_index % period == 0
if close > AVG.last() // If the current close is greater than the last stored value in AVG
AVG.push(low - vlt) // Add the low price minus volatility to the array
if close < AVG.last() // If the current close is lower than the last stored value in AVG
AVG.push(high + vlt) // Add the high price plus volatility to the array
Provides adjustable sensitivity modes ("Normal" and "Sensitive") for different market conditions.
Trend direction is visualized with dynamic color coding based on the relationship between the trend line and price.
● Volatility Bands
Displays upper and lower volatility bands derived from a moving average of price volatility (high-low).
The bands help identify potential breakout zones, overbought, or oversold conditions.
Users can toggle the visibility of the bands to suit their trading style.
● Mean Reversion Signals
Detects mean reversion opportunities when price deviates significantly from the trend line.
Includes both regular and strong mean reversion signals, marked directly on the chart.
Signals are based on oscillator crossovers, offering potential entry and exit points.
● Price Deviation Oscillator
Plots an oscillator that measures the deviation of price from the average trend line.
The oscillator is normalized using standard deviation, highlighting extreme price deviations.
Traders can choose to display the oscillator for in-depth analysis of price behavior relative to the trend.
● Dynamic Trend Coloring
The indicator colors the background on the direction of the trend.
Green indicates bullish trends, while blue indicates bearish trends.
The trend colors adapt dynamically to market conditions, providing clear visual cues for traders.
🔵 HOW TO USE
● Trend Analysis
The trend line represents the current market direction. A green trend line suggests a bullish trend, while a blue trend line indicates a bearish trend.
Use the trend line in conjunction with volatility bands to confirm potential breakouts or areas of consolidation.
● Volatility Bands
Volatility bands offer insight into potential overbought or oversold conditions.
Price exceeding these bands can signal a strong trend continuation or a possible reversal.
● Mean Reversion Strategies
Look for mean reversion signals (regular and strong) when price shows signs of reverting to the trend line after significant deviation.
Regular signals are represented by small dots, while strong signals are represented by larger circles.
These signals can be used as entry or exit points, depending on the market context.
● Price Deviation Analysis
The oscillator provides a detailed view of price deviations from the trend line.
A positive oscillator value indicates that the price is above the trend, while a negative value suggests it is below.
Use the oscillator to identify potential overbought or oversold conditions within the trend.
🔵 USER INPUTS
● Period
Defines the length of the period used for calculating the trend line. A higher period smooths out the trend, while a shorter period makes the trend line more sensitive to price changes.
● Mode
Choose between "Normal" and "Sensitive" modes for trend detection. The "Sensitive" mode responds more quickly to price changes, while the "Normal" mode offers smoother trend lines.
● Volatility Bands
Toggle the display of upper and lower volatility bands. These bands help identify potential areas of price exhaustion or continuation.
● Price Deviation
Toggle the display of the price deviation oscillator. This oscillator shows the deviation of the current price from the trend line and highlights extreme conditions.
● Mean Reversion Signals
Toggle the display of mean reversion signals. These signals highlight potential reversal points when the price deviates significantly from the trend.
● Strong Mean Reversion Signals
Toggle the display of stronger mean reversion signals, which occur at more extreme deviations from the trend.
● Width
Adjust the thickness of the trend line for better visibility on the chart.
🔵 CONCLUSION
The Periodical Trend indicator combines trend analysis, volatility bands, and mean reversion signals to provide traders with a comprehensive tool for market analysis. By offering customizable display options and dynamic trend coloring, this indicator can adapt to different trading styles and market conditions. Whether you are a trend follower or a mean reversion trader, the Periodical Trend indicator helps identify key market opportunities and potential reversals.
For optimal results, it is recommended to use this indicator alongside other technical analysis tools and within the context of a well-structured trading strategy.
Pulse Oscillator [UAlgo]The "Pulse Oscillator " is a trading tool designed to capture market momentum and trend changes by combining the strengths of multiple well-known technical indicators. By integrating the RSI (Relative Strength Index), CCI (Commodity Channel Index), and Stochastic Oscillator, this indicator provides traders with a comprehensive view of market conditions, offering both trend filtering and precise buy/sell signals. The oscillator is customizable, allowing users to fine-tune its parameters to match different trading strategies and timeframes. With its built-in smoothing techniques and level adjustments, the Pulse Oscillator aims to be a reliable tool for both trend-following and counter-trend trading strategies.
🔶 Key Features
Multi-Indicator Integration: Combines RSI, CCI, and Stochastic Oscillator to create a weighted momentum oscillator.
Why Use Multi-Indicator Integration?
Script uses Multi-Indicator Integration to combine the strengths of different technical indicators—such as RSI, CCI, and Stochastic Oscillator—into a single tool. This approach helps to reduce the weaknesses of individual indicators, providing a more comprehensive and reliable analysis of market conditions. By integrating multiple indicators, we can generate more accurate signals, filter out noise, and enhance our trading decisions.
Customizable Parameters: Allows users to adjust weights, periods, and smoothing techniques, providing flexibility to adapt the indicator to various market conditions.
Trend Filtering Option: An optional trend filter is available to enhance the accuracy of buy and sell signals, reducing the risk of false signals in choppy markets.
Dynamic Levels: The indicator dynamically calculates multiple levels of support and resistance, adjusting to market conditions with customizable decay factors and offsets.
Visual Clarity: The indicator visually represents different levels and trends with color-coded plots and fills, making it easier for traders to interpret market conditions at a glance.
Alerts: Configurable alerts for buy and sell signals, as well as trend changes, enabling traders to stay informed of key market movements without constant monitoring.
🔶 Interpreting the Indicator
Buy Signal: A buy signal is generated when the Slow Line crosses under the Fast Line during an uptrend or when the trend filter is disabled. This indicates a potential bullish reversal or continuation of an upward trend.
Sell Signal: A sell signal occurs when the Slow Line crosses above the Fast Line during a downtrend or when the trend filter is disabled, signaling a potential bearish reversal or continuation of a downward trend.
Trend Change: The indicator detects trend changes when the Fast Line shifts from increasing to decreasing or vice versa, providing early warning of possible market reversals.
Dynamic Levels: The indicator calculates upper and lower levels based on the Fast Line's values. These levels can be used to identify overbought or oversold conditions and potential areas of support or resistance.
🔶 Disclaimer
Use with Caution: This indicator is provided for educational and informational purposes only and should not be considered as financial advice. Users should exercise caution and perform their own analysis before making trading decisions based on the indicator's signals.
Not Financial Advice: The information provided by this indicator does not constitute financial advice, and the creator (UAlgo) shall not be held responsible for any trading losses incurred as a result of using this indicator.
Backtesting Recommended: Traders are encouraged to backtest the indicator thoroughly on historical data before using it in live trading to assess its performance and suitability for their trading strategies.
Risk Management: Trading involves inherent risks, and users should implement proper risk management strategies, including but not limited to stop-loss orders and position sizing, to mitigate potential losses.
No Guarantees: The accuracy and reliability of the indicator's signals cannot be guaranteed, as they are based on historical price data and past performance may not be indicative of future results.
Realized Price Oscillator [InvestorUnknown]Overview
The Realized Price Oscillator is a fundamental analysis tool designed to assess Bitcoin's price dynamics relative to its realized price. The indicator calculates various metrics using data from the realized market capitalization and total supply. It applies normalization techniques to scale values within a specified range, helping investors identify overbought or oversold conditions over the long time horizon. The oscillator also features DCA-based signals to assist in strategic market entry and exit.
Key Features
1. Normalization and Scaling:
The indicator scales values using a limit that can be adjusted for decimal precision (Limit). It allows for both positive and negative values, providing flexibility in analysis.
Decay functionality is included to progressively reduce the extreme values over time, ensuring recent data impacts the oscillator more than older data.
f_rescale(float value, float min, float max, float limit, bool negatives) =>
((limit * (negatives ? 2 : 1)) * (value - min) / (max - min)) - (negatives ? limit : 0)
2. Realized Price Oscillator Calculation:
Realized Price Oscillator is computed using logarithmic differences between the open, high, low, and close prices and the realized price. This helps in identifying how the current market price compares with the average cost basis of the Bitcoin supply.
f_realized_price_oscillator(float realized_price) =>
rpo_o = math.log(open / realized_price)
rpo_h = math.log(high / realized_price)
rpo_l = math.log(low / realized_price)
rpo_c = math.log(close / realized_price)
3. Oscillator Normalization:
The normalized oscillator calculates the range between the maximum and minimum values over time. It adjusts the oscillator values based on these bounds, considering a decay factor. This normalized range assists in consistent signal generation.
normalized_oscillator(float x, float b) =>
float oscillator = b
var float min = na
var float max = na
if (oscillator > max or na(max)) and time >= normalization_start_date
max := oscillator
if (min > oscillator or na(min)) and time >= normalization_start_date
min := oscillator
if time >= normalization_start_date
max := max * decay
min := min * decay
normalized_oscillator = f_rescale(x, min, max, lim, neg)
4. Dollar-Cost Averaging (DCA) Signals:
DCA-based signals are generated using user-defined thresholds (DCA IN and DCA OUT). The oscillator triggers buy signals when the normalized low value falls below the DCA IN threshold and sell signals when the normalized high value exceeds the DCA OUT threshold.
5. Visual Representation:
The indicator plots candlestick representations of the normalized Realized Price Oscillator values (open, high, low, close) over time, starting from a specified date (plot_start_date).
Colors are dynamically adjusted using a gradient to represent the state of the oscillator, ranging from green (buy zone) to red (sell zone). Background and bar colors also change based on DCA conditions.
How It Works
Data Sourcing: Realized price data is sourced using Bitcoin’s realized market cap (BTC_MARKETCAPREAL) and total supply (BTC_SUPPLY).
Realized Price Oscillator Metrics: Logarithmic differences between price and realized price are computed to generate Realized Price Oscillator values for open, high, low, and close.
Normalization: The indicator rescales the oscillator values based on a defined limit, adjusting for negative values if allowed. It employs a decay factor to reduce the influence of historical extremes.
Conclusion
The Realized Price Oscillator is a sophisticated tool that combines market price analysis with realized price metrics to offer a robust framework for understanding Bitcoin's valuation. By leveraging normalization techniques and DCA thresholds, it provides actionable insights for long-term investing strategies.
Dynamic Rate of Change OscillatorDynamic Rate of Change (RoC) Oscillator with Color-Coded Histogram
Detailed Description for Publication
The Dynamic Rate of Change (RoC) Oscillator with Color-Coded Histogram is a sophisticated technical analysis tool designed to enhance your understanding of market momentum. Created using Pine Script v5 on the TradingView platform, this indicator integrates multiple Rate of Change (RoC) calculations into a unified momentum oscillator. The resulting data is displayed as a color-coded histogram, providing a clear visual representation of momentum changes.
Key Features and Functionality
Multi-Length RoC Calculation:
Short-term RoC: Calculated over a user-defined period (shortRoCLength), this captures variations in price momentum over a shorter duration, offering insights into the immediate price action.
Long-term RoC: This uses a longer period (longRoCLength) to provide a broader view of momentum, helping to smooth out short-term fluctuations and highlight more established trends.
Mid-term RoC: A weighted average of the short-term and long-term RoCs, the mid-term RoC (midRoCWeight) allows you to balance sensitivity and stability in the oscillator's behavior.
Weighted RoC Calculation:
The indicator calculates a single weighted average RoC by integrating short-term, long-term, and mid-term RoCs. The weighting factor can be adjusted to prioritize different market dynamics according to the trader’s strategy. This flexible approach enables the oscillator to remain applicable across diverse market conditions.
Oscillator Calculation and Smoothing:
The oscillator value is computed by subtracting a 14-period Weighted Moving Average (WMA) from the weighted RoC, which helps to normalize the oscillator, making it more responsive to changes in momentum.
The oscillator is then smoothed using a Simple Moving Average (SMA) over a user-defined period (smoothLength). This process reduces market noise, making the oscillator's signals clearer and easier to interpret.
Color-Coded Histogram:
The smoothed oscillator is displayed as a histogram, which is color-coded to reflect bullish or bearish momentum. You can customize the colors to match your charting style, with green typically representing upward momentum and red representing downward momentum.
The color-coded histogram allows for quick visual identification of momentum changes on the chart, aiding in your market analysis.
Zero-Line Reference:
A horizontal line at the zero level is plotted as a reference point. This zero-line helps in identifying when the histogram shifts from positive to negative or vice versa, which can be useful in understanding momentum shifts.
The zero-line offers a straightforward visual cue, making it easier to interpret the oscillator's signals in relation to market movements.
Customization and Versatility
The Dynamic RoC Oscillator with Histogram is designed with flexibility in mind, making it suitable for a wide range of trading styles, from short-term trading to longer-term analysis. Users have the ability to fine-tune the indicator’s input parameters to align with their specific needs:
Adjustable RoC Periods: Customize the short-term and long-term RoC lengths to match the timeframes you focus on.
Weighted Sensitivity: Adjust the mid-term RoC weight to emphasize different aspects of momentum according to your analysis approach.
Smoothing Options: Modify the smoothing moving average length to control the sensitivity of the oscillator, allowing you to balance responsiveness with noise reduction.
Use Cases
Momentum Analysis: Gain a clearer understanding of momentum changes within the market, which can aid in the evaluation of market trends.
Trend Analysis: The oscillator can help in assessing trends by highlighting when momentum is increasing or decreasing.
Chart Visualization: The color-coded histogram provides a visually intuitive method for monitoring momentum, helping you to more easily interpret market behavior.
Conclusion
The Dynamic Rate of Change (RoC) Oscillator with Color-Coded Histogram is a versatile and powerful tool for traders who seek a deeper analysis of market momentum. With its dynamic calculation methods and high degree of customization, this indicator can be tailored to suit a variety of trading strategies. By integrating it into your TradingView charts, you can enhance your technical analysis capabilities, gaining valuable insights into market momentum.
This indicator is easy to use and highly customizable, making it a valuable addition to any trader’s toolkit. Add it to your charts on the TradingView platform and start exploring its potential to enrich your market analysis.
RSI Trend Following StrategyOverview
The RSI Trend Following Strategy utilizes Relative Strength Index (RSI) to enter the trade for the potential trend continuation. It uses Stochastic indicator to check is the price is not in overbought territory and the MACD to measure the current price momentum. Moreover, it uses the 200-period EMA to filter the counter trend trades with the higher probability. The strategy opens only long trades.
Unique Features
Dynamic stop-loss system: Instead of fixed stop-loss level strategy utilizes average true range (ATR) multiplied by user given number subtracted from the position entry price as a dynamic stop loss level.
Configurable Trading Periods: Users can tailor the strategy to specific market windows, adapting to different market conditions.
Two layers trade filtering system: Strategy utilizes MACD and Stochastic indicators measure the current momentum and overbought condition and use 200-period EMA to filter trades against major trend.
Trailing take profit level: After reaching the trailing profit activation level script activates the trailing of long trade using EMA. More information in methodology.
Wide opportunities for strategy optimization: Flexible strategy settings allows users to optimize the strategy entries and exits for chosen trading pair and time frame.
Methodology
The strategy opens long trade when the following price met the conditions:
RSI is above 50 level.
MACD line shall be above the signal line
Both lines of Stochastic shall be not higher than 80 (overbought territory)
Candle’s low shall be above the 200 period EMA
When long trade is executed, strategy set the stop-loss level at the price ATR multiplied by user-given value below the entry price. This level is recalculated on every next candle close, adjusting to the current market volatility.
At the same time strategy set up the trailing stop validation level. When the price crosses the level equals entry price plus ATR multiplied by user-given value script starts to trail the price with trailing EMA(by default = 20 period). If price closes below EMA long trade is closed. When the trailing starts, script prints the label “Trailing Activated”.
Strategy settings
In the inputs window user can setup the following strategy settings:
ATR Stop Loss (by default = 1.75)
ATR Trailing Profit Activation Level (by default = 2.25)
MACD Fast Length (by default = 12, period of averaging fast MACD line)
MACD Fast Length (by default = 26, period of averaging slow MACD line)
MACD Signal Smoothing (by default = 9, period of smoothing MACD signal line)
Oscillator MA Type (by default = EMA, available options: SMA, EMA)
Signal Line MA Type (by default = EMA, available options: SMA, EMA)
RSI Length (by default = 14, period for RSI calculation)
Trailing EMA Length (by default = 20, period for EMA, which shall be broken close the trade after trailing profit activation)
Justification of Methodology
This trading strategy is designed to leverage a combination of technical indicators—Relative Strength Index (RSI), Moving Average Convergence Divergence (MACD), Stochastic Oscillator, and the 200-period Exponential Moving Average (EMA)—to determine optimal entry points for long trades. Additionally, the strategy uses the Average True Range (ATR) for dynamic risk management to adapt to varying market conditions. Let's look in details for which purpose each indicator is used for and why it is used in this combination.
Relative Strength Index (RSI) is a momentum indicator used in technical analysis to measure the speed and change of price movements in a financial market. It helps traders identify whether an asset is potentially overbought (overvalued) or oversold (undervalued), which can indicate a potential reversal or continuation of the current trend.
How RSI Works? RSI tracks the strength of recent price changes. It compares the average gains and losses over a specific period (usually 14 periods) to assess the momentum of an asset. Average gain is the average of all positive price changes over the chosen period. It reflects how much the price has typically increased during upward movements. Average loss is the average of all negative price changes over the same period. It reflects how much the price has typically decreased during downward movements.
RSI calculates these average gains and losses and compares them to create a value between 0 and 100. If the RSI value is above 70, the asset is generally considered overbought, meaning it might be due for a price correction or reversal downward. Conversely, if the RSI value is below 30, the asset is considered oversold, suggesting it could be poised for an upward reversal or recovery. RSI is a useful tool for traders to determine market conditions and make informed decisions about entering or exiting trades based on the perceived strength or weakness of an asset's price movements.
This strategy uses RSI as a short-term trend approximation. If RSI crosses over 50 it means that there is a high probability of short-term trend change from downtrend to uptrend. Therefore RSI above 50 is our first trend filter to look for a long position.
The MACD (Moving Average Convergence Divergence) is a popular momentum and trend-following indicator used in technical analysis. It helps traders identify changes in the strength, direction, momentum, and duration of a trend in an asset's price.
The MACD consists of three components:
MACD Line: This is the difference between a short-term Exponential Moving Average (EMA) and a long-term EMA, typically calculated as: MACD Line = 12 period EMA − 26 period EMA
Signal Line: This is a 9-period EMA of the MACD Line, which helps to identify buy or sell signals. When the MACD Line crosses above the Signal Line, it can be a bullish signal (suggesting a buy); when it crosses below, it can be a bearish signal (suggesting a sell).
Histogram: The histogram shows the difference between the MACD Line and the Signal Line, visually representing the momentum of the trend. Positive histogram values indicate increasing bullish momentum, while negative values indicate increasing bearish momentum.
This strategy uses MACD as a second short-term trend filter. When MACD line crossed over the signal line there is a high probability that uptrend has been started. Therefore MACD line above signal line is our additional short-term trend filter. In conjunction with RSI it decreases probability of following false trend change signals.
The Stochastic Indicator is a momentum oscillator that compares a security's closing price to its price range over a specific period. It's used to identify overbought and oversold conditions. The indicator ranges from 0 to 100, with readings above 80 indicating overbought conditions and readings below 20 indicating oversold conditions.
It consists of two lines:
%K: The main line, calculated using the formula (CurrentClose−LowestLow)/(HighestHigh−LowestLow)×100 . Highest and lowest price taken for 14 periods.
%D: A smoothed moving average of %K, often used as a signal line.
This strategy uses stochastic to define the overbought conditions. The logic here is the following: we want to avoid long trades in the overbought territory, because when indicator reaches it there is a high probability that the potential move is gonna be restricted.
The 200-period EMA is a widely recognized indicator for identifying the long-term trend direction. The strategy only trades in the direction of this primary trend to increase the probability of successful trades. For instance, when the price is above the 200 EMA, only long trades are considered, aligning with the overarching trend direction.
Therefore, strategy uses combination of RSI and MACD to increase the probability that price now is in short-term uptrend, Stochastic helps to avoid the trades in the overbought (>80) territory. To increase the probability of opening long trades in the direction of a main trend and avoid local bounces we use 200 period EMA.
ATR is used to adjust the strategy risk management to the current market volatility. If volatility is low, we don’t need the large stop loss to understand the there is a high probability that we made a mistake opening the trade. User can setup the settings ATR Stop Loss and ATR Trailing Profit Activation Level to realize his own risk to reward preferences, but the unique feature of a strategy is that after reaching trailing profit activation level strategy is trying to follow the trend until it is likely to be finished instead of using fixed risk management settings. It allows sometimes to be involved in the large movements.
Backtest Results
Operating window: Date range of backtests is 2023.01.01 - 2024.08.01. It is chosen to let the strategy to close all opened positions.
Commission and Slippage: Includes a standard Binance commission of 0.1% and accounts for possible slippage over 5 ticks.
Initial capital: 10000 USDT
Percent of capital used in every trade: 30%
Maximum Single Position Loss: -3.94%
Maximum Single Profit: +15.78%
Net Profit: +1359.21 USDT (+13.59%)
Total Trades: 111 (36.04% win rate)
Profit Factor: 1.413
Maximum Accumulated Loss: 625.02 USDT (-5.85%)
Average Profit per Trade: 12.25 USDT (+0.40%)
Average Trade Duration: 40 hours
These results are obtained with realistic parameters representing trading conditions observed at major exchanges such as Binance and with realistic trading portfolio usage parameters.
How to Use
Add the script to favorites for easy access.
Apply to the desired timeframe and chart (optimal performance observed on 2h BTC/USDT).
Configure settings using the dropdown choice list in the built-in menu.
Set up alerts to automate strategy positions through web hook with the text: {{strategy.order.alert_message}}
Disclaimer:
Educational and informational tool reflecting Skyrex commitment to informed trading. Past performance does not guarantee future results. Test strategies in a simulated environment before live implementation
Multi-Length RSI **Multi-Length RSI Indicator**
This script creates a custom Relative Strength Index (RSI) indicator with the ability to plot three different RSI lengths on the same chart, allowing traders to analyze momentum across various timeframes simultaneously. The script also includes features to enhance visual clarity and usability.
**Key Features:**
1. **Customizable RSI Lengths:**
- The script allows you to input and customize three different RSI lengths (7, 14, and 28 by default) via user inputs. This flexibility enables you to track short-term, medium-term, and long-term momentum in the market.
2. **Dynamic Colour Coding:**
- The RSI lines are color-coded based on their current value:
- **Above 70 (Overbought)**: The line turns red.
- **Below 30 (Oversold)**: The line turns green.
- **Between 30 and 70**: The line retains its user-defined colour (blue, yellow, orange by default).
- This dynamic colouring helps to quickly identify overbought and oversold conditions.
3. **Adjustable Line Widths and Colours:**
- Users can customize the colour and thickness of each RSI line, allowing for a personalized visual experience that fits different trading strategies.
4. **Overbought, Oversold, and Midline Levels:**
- The script includes static horizontal lines at the 70 (Overbought) and 30 (Oversold) levels, with a red and green colour, respectively.
- A midline at the 50 level is also included in gray and dashed, helping to visualize the neutral zone.
5. **Dynamic RSI Value Labels:**
- The current values of each RSI line are displayed directly on the chart as labels at the most recent bar, with colours matching their corresponding lines. This feature provides an immediate reference to the exact RSI values without the need to hover or look at the data window.
6. **Alerts for Crosses:**
- The script includes built-in alert conditions for when any of the RSI values cross above the overbought level (70) or below the oversold level (30). These alerts can be configured to notify you in real-time when significant momentum shifts occur.
**How to Use:**
1. **Customization**:
- Input your preferred RSI lengths, colours, and line widths through the script’s settings menu.
2. **Visual Analysis**:
- The indicator plots all three RSI values on a separate pane below the price chart. Use the color-coded lines and levels to quickly identify overbought, oversold, and neutral conditions across multiple timeframes.
3. **Set Alerts**:
- You can configure alerts based on the built-in alert conditions to get notified when the RSI crosses critical levels.
**Ideal For:**
- **Traders looking to analyze momentum across multiple timeframes**: The ability to view short-term, medium-term, and long-term RSIs simultaneously offers a comprehensive view of market strength.
- **Those who prefer visual clarity**: The dynamic colouring, clear labels, and customizable settings make it easy to interpret RSI data at a glance.
- **Traders who rely on alerts**: The built-in alert system allows for proactive trading based on significant RSI level crossings.
---
This script is a powerful tool for any trader looking to leverage RSI analysis across multiple timeframes, offering both customization and clarity in a single indicator.
Intramarket Difference Index StrategyIntramarket Difference Indicator (IDI) Strategy:
In layman’s terms this strategy compares two indicators across (correlated) markets and exploits their differences.
📍 Import Notes:
This Strategy calculates trade position size independently, this means that the ‘Order size’ input in the ‘Properties’ tab will have no effect on the strategy. Why ? because this allows us to define custom position size algorithms which we can use to improve our risk management and equity growth over time. Here we have the option to have fixed quantity or fixed percentage of equity ATR (Average True Range) based stops in addition to the turtle trading position size algorithm.
‘Pyramiding’ does not work for this strategy’, similar to the order size input togeling this input will have no effect on the strategy as the strategy explicitly defines the maximum order size to be 1.
This strategy is not perfect, and as of writing of this post I have not traded this algo.
Always take your time to backtests and debug the strategy.
🔷 The IDI Strategy:
By default this strategy pulls data from your current TV chart and then compares it to the base market, be default BINANCE:BTCUSD . The strategy pulls SMA and RSI data from either market (we call this the difference data), standardizes the data (solving the different unit problem across markets) such that it is comparable and then differentiates the data, calling the result of this transformation and difference the Intramarket Difference (ID). The formula for the the ID is
ID = market1_diff_data - market2_diff_data (1)
Where
market(i)_diff_data = diff_data / ATR(j)_market(i)^0.5,
where i = {1, 2} and j = the natural numbers excluding 0
Formula (1) interpretation is the following
When ID > 0: this means the current market outperforms the base market
When ID = 0: Markets are at long run equilibrium
When ID < 0: this means the current market underperforms the base market
To form the strategy we define one of two strategy type’s which are Trend and Mean Revesion respectively.
🔸 Trend Case:
Given the ‘‘Strategy Type’’ is equal to TREND we define a threshold for which if the ID crosses over we go long and if the ID crosses under the negative of the threshold we go short.
The motivating idea is that the ID is an indicator of the two symbols being out of sync, and given we know volatility clustering, momentum and mean reversion of anomalies to be a stylised fact of financial data we can construct a trading premise. Let's first talk more about this premise.
For some markets (cryptocurrency markets - synthetic symbols in TV) the stylised fact of momentum is true, this means that higher momentum is followed by higher momentum, and given we know momentum to be a vector quantity (with magnitude and direction) this momentum can be both positive and negative i.e. when the ID crosses above some threshold we make an assumption it will continue in that direction for some time before executing back to its long run equilibrium of 0 which is a reasonable assumption to make if the market are correlated. For example for the BTCUSD - ETHUSD pair, if the ID > +threshold (inputs for MA and RSI based ID thresholds are found under the ‘‘INTRAMARKET DIFFERENCE INDEX’’ group’), ETHUSD outperforms BTCUSD, we assume the momentum to continue so we go long ETHUSD.
In the standard case we would exit the market when the IDI returns to its long run equilibrium of 0 (for the positive case the ID may return to 0 because ETH’s difference data may have decreased or BTC’s difference data may have increased). However in this strategy we will not define this as our exit condition, why ?
This is because we want to ‘‘let our winners run’’, to achieve this we define a trailing Donchian Channel stop loss (along with a fixed ATR based stop as our volatility proxy). If we were too use the 0 exit the strategy may print a buy signal (ID > +threshold in the simple case, market regimes may be used), return to 0 and then print another buy signal, and this process can loop may times, this high trade frequency means we fail capture the entire market move lowering our profit, furthermore on lower time frames this high trade frequencies mean we pay more transaction costs (due to price slippage, commission and big-ask spread) which means less profit.
Note it is possible that after printing a buy the strategy then prints many sell signals before returning to a buy, which again has the same implications. The image below showcases the theory above, by allowing our winner to run we may capture more profit.
Valid trades are denoted by solid green and red arrows respectively and all other valid trades which occur within the original signal are light green and red small arrows, if we were to close our trades when the IDI returns to its equilibrium of 0 our average bars per trade would be very low and we would not capture the general trend.
Note by capturing the sum of many momentum moves we are essentially following the trend hence the trend following strategy type.
Here we also print the IDI (with default strategy settings with the MA difference type), we can see that by letting our winners run we may catch many valid momentum moves, that results in a larger final pnl that if we would otherwise exit based on the equilibrium condition.
Note if you would like to plot the IDI separately copy and paste the following code in a new Pine Script indicator template.
indicator("IDI")
// INTRAMARKET INDEX
var string g_idi = "intramarket diffirence index"
ui_index_1 = input.symbol("BINANCE:BTCUSD", title = "Base market", group = g_idi)
// ui_index_2 = input.symbol("BINANCE:ETHUSD", title = "Quote Market", group = g_idi)
type = input.string("MA", title = "Differrencing Series", options = , group = g_idi)
ui_ma_lkb = input.int(24, title = "lookback of ma and volatility scaling constant", group = g_idi)
ui_rsi_lkb = input.int(14, title = "Lookback of RSI", group = g_idi)
ui_atr_lkb = input.int(300, title = "ATR lookback - Normalising value", group = g_idi)
ui_ma_threshold = input.float(5, title = "Threshold of Upward/Downward Trend (MA)", group = g_idi)
ui_rsi_threshold = input.float(20, title = "Threshold of Upward/Downward Trend (RSI)", group = g_idi)
//>>+----------------------------------------------------------------+}
// CUSTOM FUNCTIONS |
//<<+----------------------------------------------------------------+{
// construct UDT (User defined type) containing the IDI (Intramarket Difference Index) source values
// UDT will hold many variables / functions grouped under the UDT
type functions
float Close // close price
float ma // ma of symbol
float rsi // rsi of the asset
float atr // atr of the asset
// the security data
getUDTdata(symbol, malookback, rsilookback, atrlookback) =>
indexHighTF = barstate.isrealtime ? 1 : 0
= request.security(symbol, timeframe = timeframe.period,
expression = [close , // Instentiate UDT variables
ta.sma(close, malookback) ,
ta.rsi(close, rsilookback) ,
ta.atr(atrlookback) ])
data = functions.new(close_, ma_, rsi_, atr_)
data
// Intramerket Difference Index
idi(type, symbol1, malookback, rsilookback, atrlookback, mathreshold, rsithreshold) =>
threshold = float(na)
index1 = getUDTdata(symbol1, malookback, rsilookback, atrlookback)
index2 = getUDTdata(syminfo.tickerid, malookback, rsilookback, atrlookback)
// declare difference variables for both base and quote symbols, conditional on which difference type is selected
var diffindex1 = 0.0, var diffindex2 = 0.0,
// declare Intramarket Difference Index based on series type, note
// if > 0, index 2 outpreforms index 1, buy index 2 (momentum based) until equalibrium
// if < 0, index 2 underpreforms index 1, sell index 1 (momentum based) until equalibrium
// for idi to be valid both series must be stationary and normalised so both series hae he same scale
intramarket_difference = 0.0
if type == "MA"
threshold := mathreshold
diffindex1 := (index1.Close - index1.ma) / math.pow(index1.atr*malookback, 0.5)
diffindex2 := (index2.Close - index2.ma) / math.pow(index2.atr*malookback, 0.5)
intramarket_difference := diffindex2 - diffindex1
else if type == "RSI"
threshold := rsilookback
diffindex1 := index1.rsi
diffindex2 := index2.rsi
intramarket_difference := diffindex2 - diffindex1
//>>+----------------------------------------------------------------+}
// STRATEGY FUNCTIONS CALLS |
//<<+----------------------------------------------------------------+{
// plot the intramarket difference
= idi(type,
ui_index_1,
ui_ma_lkb,
ui_rsi_lkb,
ui_atr_lkb,
ui_ma_threshold,
ui_rsi_threshold)
//>>+----------------------------------------------------------------+}
plot(intramarket_difference, color = color.orange)
hline(type == "MA" ? ui_ma_threshold : ui_rsi_threshold, color = color.green)
hline(type == "MA" ? -ui_ma_threshold : -ui_rsi_threshold, color = color.red)
🔸 Mean Reversion Case:
We stated prior that mean reversion of anomalies is an standerdies fact of financial data, how can we exploit this ?
We exploit this by normalizing the ID by applying the Ehlers fisher transformation. We now assume our series is approximately normally distributed. To form the strategy we employ the same logic as for e the z score, if the FT normalized ID >< 2.5 or -2.5 respectively we buy or short respectively. We also employ the same exit conditions (fixed ATR stop and trailing Donchian Trailing stop)
🔷 Position Sizing:
If ‘‘Fixed Risk From Initial Balance’’ is toggled true this means we risk a fixed percentage of our initial balance, if false we risk a fixed percentage of our equity (current balance).
Note we also employ a volatility adjusted position sizing formula, the turtle training method which is defined as follows.
Turtle position size = (1/ r * ATR * DV) * C
Where,
r = risk factor coefficient (default is 20)
ATR(j) = risk proxy, over j times steps
DV = Dollar Volatility, where DV = (1/Asset Price) * Capital at Risk
🔷 Risk Management:
Correct money management means we can limit risk and increase reward (theoretically). Here we employ
Max loss and gain per day
Max loss per trade
Max number of consecutive losing trades until trade skip
To read more see the tooltips (info circle).
Note the ATR stop losses and take profits are defined, with the prior being default.
ATR SL and TP defined
🔷 Hurst Regime (Regime Filter):
The Hurst Exponent (H) aims to segment the market into three different states, Trending (H > 0.5), Random Geometric Brownian Motion (H = 0.5) and Mean Reverting / Contrarian (H < 0.5). In my interpretation this can be used as a trend filter that eliminates market noise.
We utilize the trending and mean reverting based states, as extra conditions required for valid trades both strategy types respectively, in the process increasing our trade entry quality.
🔷 Example model Architecture:
Here is an example of one configuration of this strategy, combining all aspect discussed in this post.
TrendFusion [CrypTolqa]This code colors the SMA line red when the RSI is below 50 and the CCI is below 0, and green when the RSI is above 50 and the CCI is above 0. For cases that do not meet the specified details, the line is displayed in gray.
RSI Divergence and GradientThe RSI Divergence and Gradient Indicator simplifies the process of identifying the relationship between price action and the Relative Strength Index (RSI). By integrating RSI data directly into the price chart, traders no longer need to open a separate pane to monitor RSI or manually compare price action and RSI.
This indicator allows traders to easily spot overbought or oversold conditions and detect divergences between price and RSI. These signals can help identify potential reversal points and more effectively assess trend strength.
Features
RSI Divergences: The script identifies and plots bullish and bearish RSI divergences, which can signal potential reversals. Bullish divergences are indicated by an upward triangle below the price bars, while bearish divergences are indicated by a downward triangle above the price bars.
Overbought/Oversold Gradient: The script uses a color gradient to highlight overbought and oversold conditions on the chart, helping traders visualize momentum and trend strength. The gradient dynamically adjusts based on RSI values, transitioning through different colors to represent the intensity of overbought or oversold conditions.
Customizable Gradient: The gradient is customizable, allowing traders to set their own thresholds for overbought and oversold levels, and to choose the colors that best suit their trading style. This flexibility ensures the indicator can be tailored to individual preferences.
How It Works
RSI Calculation: The indicator calculates RSI using the standard 14-period length by default, but this can be adjusted to suit the trader's needs.
Divergence Detection: The script identifies divergences by comparing the highest and lowest points of the RSI with the corresponding price levels over the RSI period length. When a divergence is detected, it is plotted on the chart to indicate a potential reversal.
Gradient Coloring: The gradient coloring system changes the bar colors based on RSI levels. The color transitions from a neutral tone to specified start and end colors as RSI approaches overbought or oversold thresholds, providing a visual cue for potential overextended market conditions.
Intended Use
This indicator is particularly useful for traders who want to combine momentum analysis with divergence signals to identify potential reversal points or confirm trend strength. The visual gradient aids in quickly assessing market conditions, making it easier to spot high-probability trading opportunities.
DEMA Adaptive DMI [BackQuant]DEMA Adaptive DMI
PLEASE Read the following, knowing what an indicator does at its core before adding it into a system is pivotal. The core concepts can allow you to include it in a logical and sound manner.
Conceptual Foundation and Innovation
The DEMA Adaptive DMI blends the Double Exponential Moving Average (DEMA) with the Directional Movement Index (DMI) to offer a unique approach to trend-following. By applying DEMA to the high and low prices, this indicator refines the traditional DMI calculation, enhancing its responsiveness to price changes. This results in a more adaptive and timely measure of market trends and momentum, providing traders with a more refined tool for capturing directional movements in the market.
Technical Composition and Calculation
At its core, the DEMA Adaptive DMI calculates the DEMA for both the high and low prices over a user-defined period. This dual application of DEMA serves to smooth out price fluctuations while retaining sensitivity to market movements. The DMI is then derived from the changes in these DEMA values, producing a set of plus and minus directional indicators that reflect the prevailing trend. Additionally, an Average Directional Index (ADX) is computed to measure the strength of the trend, with the entire process being dynamically adjusted based on the DEMA calculations.
DEMA Application:
The DEMA is applied to both high and low prices to reduce lag and provide a smoother representation of price action.
Directional Movement Calculation: The DMI is calculated using the smoothed price changes, resulting in plus and minus indicators that accurately reflect market trends.
ADX Calculation:
The ADX is computed to quantify the strength of the trend, offering traders insight into whether the market is trending strongly or is in a phase of consolidation.
Features and User Inputs The DEMA Adaptive DMI offers a range of customizable options to suit different trading styles and market conditions:
DEMA Calculation Period: Users can set the period for the DEMA calculation, allowing for adjustments based on the desired sensitivity.
DMI Length: The length of the DMI calculation can be adjusted, providing flexibility in how trends are measured.
ADX Smoothing Period: The smoothing period for the ADX can be customized to fine-tune the trend strength measurement.
Divergence Detection: Optional divergence detection features allow traders to spot potential reversals based on the DMI and price action.
Visualization options include static high and low levels to mark extreme DMI thresholds, the ability to color bars according to trend direction, and background hues to highlight overbought and oversold conditions.
Practical Applications
The DEMA Adaptive DMI is particularly effective in markets where trend strength and direction are crucial for successful trading. Traders can leverage this indicator to:
Identify Trend Reversals:
Detect potential trend reversals by monitoring the DMI and ADX in conjunction with divergence signals.
Trend Confirmation:
Use the DEMA-based DMI to confirm the strength and direction of a trend, aiding in the timing of entries and exits.
Strategic Positioning:
The indicator's responsiveness allows traders to position themselves effectively in fast-moving markets, reducing the risk of late entries or exits.
Advantages and Strategic Value
By integrating the DEMA with the DMI, this indicator provides a more adaptive and timely measure of market trends. The reduced lag from the DEMA ensures that traders receive signals that are closely aligned with current market conditions, while the dynamic DMI calculation offers a more accurate representation of trend direction and strength. This makes the DEMA Adaptive DMI a valuable tool for traders looking to enhance their trend-following strategies with a focus on precision and adaptability.
Summary and Usage Tips
The DEMA Adaptive DMI is a sophisticated trend-following indicator that combines the benefits of DEMA and DMI into a single, powerful tool. Traders are encouraged to incorporate this indicator into their trading systems for a more nuanced and responsive approach to trend detection and confirmation. Whether used for identifying trend reversals, confirming trend strength, or strategically positioning in the market, the DEMA Adaptive DMI offers a versatile and reliable solution for trend-following strategies.
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: DPO Signal & Zone Indicator
## **Uptrick: DPO Signal & Zone Indicator**
### **Introduction:**
The **Uptrick: DPO Signal & Zone Indicator** is a sophisticated technical analysis tool tailored to provide insights into market momentum, identify potential trading signals, and recognize extreme market conditions. It leverages the Detrended Price Oscillator (DPO) to strip out long-term trends from price movements, allowing traders to focus on short-term fluctuations and cyclical behavior. The indicator integrates multiple components, including a Detrended Price Oscillator, a Signal Line, a Histogram, and customizable alert levels, to deliver a robust framework for market analysis and trading decision-making.
### **Detailed Breakdown:**
#### **1. Detrended Price Oscillator (DPO):**
- **Purpose and Functionality:**
- The DPO is designed to filter out long-term trends from the price data, isolating short-term price movements. This helps in understanding the cyclical patterns and momentum of an asset, allowing traders to detect periods of acceleration or deceleration that might be overlooked when focusing solely on long-term trends.
- **Calculation:**
- **Formula:** `dpo = close - ta.sma(close, smaLength)`
- **`close`:** The asset’s closing price for each period in the dataset.
- **`ta.sma(close, smaLength)`:** The Simple Moving Average (SMA) of the closing prices over a period defined by `smaLength`.
- The DPO is derived by subtracting the SMA value from the current closing price. This calculation reveals how much the current price deviates from the moving average, effectively detrending the price data.
- **Interpretation:**
- **Positive DPO Values:** Indicate that the current price is higher than the moving average, suggesting bullish market conditions and a potential upward trend.
- **Negative DPO Values:** Indicate that the current price is lower than the moving average, suggesting bearish market conditions and a potential downward trend.
- **Magnitude of DPO:** Reflects the strength of momentum. Larger positive or negative values suggest stronger momentum in the respective direction.
#### **2. Signal Line:**
- **Purpose and Functionality:**
- The Signal Line is a smoothed average of the DPO, intended to act as a reference point for generating trading signals. It helps to filter out short-term fluctuations and provides a clearer perspective on the prevailing trend.
- **Calculation:**
- **Formula:** `signalLine = ta.sma(dpo, signalLength)`
- **`ta.sma(dpo, signalLength)`:** The SMA of the DPO values over a period defined by `signalLength`.
- The Signal Line is calculated by applying a moving average to the DPO values. This smoothing process reduces noise and highlights the underlying trend direction.
- **Interpretation:**
- **DPO Crossing Above Signal Line:** Generates a buy signal, suggesting that short-term momentum is turning bullish relative to the longer-term trend.
- **DPO Crossing Below Signal Line:** Generates a sell signal, suggesting that short-term momentum is turning bearish relative to the longer-term trend.
- **Signal Line’s Role:** Provides a benchmark for assessing the strength of the DPO. The interaction between the DPO and the Signal Line offers actionable insights into potential entry or exit points.
#### **3. Histogram:**
- **Purpose and Functionality:**
- The Histogram visualizes the difference between the DPO and the Signal Line. It provides a graphical representation of momentum strength and direction, allowing traders to quickly gauge market conditions.
- **Calculation:**
- **Formula:** `histogram = dpo - signalLine`
- The Histogram is computed by subtracting the Signal Line value from the DPO value. Positive values indicate that the DPO is above the Signal Line, while negative values indicate that the DPO is below the Signal Line.
- **Interpretation:**
- **Color Coding:**
- **Green Bars:** Represent positive values, indicating bullish momentum.
- **Red Bars:** Represent negative values, indicating bearish momentum.
- **Width of Bars:** Indicates the strength of momentum. Wider bars signify stronger momentum, while narrower bars suggest weaker momentum.
- **Zero Line:** A horizontal gray line that separates positive and negative histogram values. Crosses of the histogram through this zero line can signal shifts in momentum direction.
#### **4. Alert Levels:**
- **Purpose and Functionality:**
- Alert levels define specific thresholds to identify extreme market conditions, such as overbought and oversold states. These levels help traders recognize potential reversal points and extreme market conditions.
- **Inputs:**
- **`alertLevel1`:** Defines the upper threshold for identifying overbought conditions.
- **Default Value:** 0.5
- **`alertLevel2`:** Defines the lower threshold for identifying oversold conditions.
- **Default Value:** -0.5
- **Interpretation:**
- **Overbought Condition:** When the DPO exceeds `alertLevel1`, indicating that the market may be overbought. This condition suggests that the asset could be due for a correction or reversal.
- **Oversold Condition:** When the DPO falls below `alertLevel2`, indicating that the market may be oversold. This condition suggests that the asset could be poised for a rebound or reversal.
#### **5. Visual Elements:**
- **DPO and Signal Line Plots:**
- **DPO Plot:**
- **Color:** Blue
- **Width:** 2 pixels
- **Purpose:** To visually represent the deviation of the current price from the moving average.
- **Signal Line Plot:**
- **Color:** Red
- **Width:** 1 pixel
- **Purpose:** To provide a smoothed reference for the DPO and generate trading signals.
- **Histogram Plot:**
- **Color Coding:**
- **Green:** For positive values, signaling bullish momentum.
- **Red:** For negative values, signaling bearish momentum.
- **Style:** Histogram bars are displayed with varying width to represent the strength of momentum.
- **Zero Line:** A gray horizontal line separating positive and negative histogram values.
- **Overbought/Oversold Zones:**
- **Background Colors:**
- **Green Shading:** Applied when the DPO exceeds `alertLevel1`, indicating an overbought condition.
- **Red Shading:** Applied when the DPO falls below `alertLevel2`, indicating an oversold condition.
- **Horizontal Lines:**
- **Dotted Green Line:** At `alertLevel1`, marking the upper alert threshold.
- **Dotted Red Line:** At `alertLevel2`, marking the lower alert threshold.
- **Purpose:** To provide clear visual cues for extreme market conditions, aiding in the identification of potential reversal points.
#### **6. Trading Signals and Alerts:**
- **Buy Signal:**
- **Trigger:** When the DPO crosses above the Signal Line.
- **Visual Representation:** A "BUY" label appears below the price bar in the specified buy color.
- **Purpose:** Indicates a potential buying opportunity as short-term momentum turns bullish.
- **Sell Signal:**
- **Trigger:** When the DPO crosses below the Signal Line.
- **Visual Representation:** A "SELL" label appears above the price bar in the specified sell color.
- **Purpose:** Indicates a potential selling opportunity as short-term momentum turns bearish.
- **Overbought/Oversold Alerts:**
- **Overbought Alert:** Triggered when the DPO crosses below `alertLevel1`.
- **Oversold Alert:** Triggered when the DPO crosses above `alertLevel2`.
- **Visual Representation:** Labels "OVERBOUGHT" and "OVERSOLD" appear with distinctive colors and sizes to highlight extreme conditions.
- **Purpose:** To signal potential reversal points and extreme market conditions that may lead to price corrections or trend reversals.
- **Alert Conditions:**
- **DPO Cross Above Signal Line:** Alerts traders when the DPO crosses above the Signal Line, generating a buy signal.
- **DPO Cross Below Signal Line:** Alerts traders when the DPO crosses below the Signal Line, generating a sell signal.
- **DPO Above Upper Alert Level:** Alerts when the DPO is above `alertLevel1`, indicating an overbought condition.
- **DPO Below Lower Alert Level:** Alerts when the DPO is below `alertLevel2`, indicating an oversold condition.
- **Purpose:** To provide real-time notifications of significant market events, enabling traders to make informed decisions promptly.
### **Practical Applications:**
#### **1. Trend Following Strategies:**
- **Objective:**
- To capture and ride the prevailing market trends by entering trades that align with the direction of the momentum.
- **How to Use:**
- Monitor buy and sell signals generated by the DPO crossing the Signal Line. A buy signal suggests a bullish trend and a potential long trade, while a sell signal suggests a bearish trend and a potential short trade.
- Use the Histogram to confirm the strength of the trend. Expanding green bars indicate strong bullish momentum, while expanding red bars indicate strong bearish momentum.
- **Advantages:**
- Helps traders stay aligned with the market trend, increasing the likelihood of capturing substantial price moves.
#### **2. Reversal Trading:**
- **Objective:**
- To identify potential market reversals
by detecting overbought and oversold conditions.
- **How to Use:**
- Look for overbought and oversold signals based on the DPO crossing `alertLevel1` and `alertLevel2`. These conditions suggest that the market may be due for a reversal.
- Confirm reversal signals with the Histogram. A decrease in histogram bars (from green to red or vice versa) may support the reversal hypothesis.
- **Advantages:**
- Provides early warnings of potential market reversals, allowing traders to position themselves before significant price changes occur.
#### **3. Momentum Analysis:**
- **Objective:**
- To gauge the strength and direction of market momentum for making informed trading decisions.
- **How to Use:**
- Analyze the Histogram to assess momentum strength. Positive and expanding histogram bars indicate increasing bullish momentum, while negative and expanding bars suggest increasing bearish momentum.
- Use momentum insights to validate or question existing trading positions and strategies.
- **Advantages:**
- Offers valuable information about the market's momentum, helping traders confirm the validity of trends and trading signals.
### **Customization and Flexibility:**
The **Uptrick: DPO Signal & Zone Indicator** offers extensive customization options to accommodate diverse trading preferences and market conditions:
- **SMA Length and Signal Line Length:**
- Adjust the `smaLength` and `signalLength` parameters to control the sensitivity and responsiveness of the DPO and Signal Line. Shorter lengths make the indicator more responsive to price changes, while longer lengths provide smoother, less volatile signals.
- **Alert Levels:**
- Modify `alertLevel1` and `alertLevel2` to fit varying market conditions and volatility. Setting these levels appropriately helps tailor the indicator to different asset classes and trading strategies.
- **Color and Shape Customization:**
- Customize the colors and sizes of buy/sell signals, histogram bars, and alert levels to enhance visual clarity and align with personal preferences. This customization helps ensure that the indicator integrates seamlessly with a trader's charting setup.
### **Conclusion:**
The **Uptrick: DPO Signal & Zone Indicator** is a multifaceted analytical tool that combines the power of the Detrended Price Oscillator with customizable visual elements and alert levels to deliver a comprehensive approach to market analysis. By offering insights into momentum strength, trend direction, and potential reversal points, this indicator equips traders with valuable information to make informed decisions and enhance their trading strategies. Its flexibility and customization options ensure that it can be adapted to various trading styles and market conditions, making it a versatile addition to any trader's toolkit.
Xtrender and TSI FusionXtrender and TSI Fusion Indicator
I created this indicator for myself. I was inspired by the indicators created by Bjorgum, Duyck and QuantTherapy and decided to create multiple indicators that either work well combined with their indicators or something new that applies some of their indicator concepts. I decided to share all of the indicator I have created because I believe in learning and earing together as a community. If you guys have any questions or suggestions write them.
Overview: The Xtrender and TSI Fusion Indicator is a powerful tool designed to help traders analyze market momentum, trends, and potential reversals. By combining Xtrender with the True Strength Index (TSI), this indicator provides a comprehensive view of market dynamics, making it easier to identify trading opportunities.
Image: Timeframe is set to daily
Features:
1.Xtrender Analysis:
Short-Term Xtrender: Visualizes short-term momentum using RSI-based calculations on EMA differences. This helps in identifying immediate market trends and pullbacks.
Image above: showcases Short-Term Xtrender
Xtrender T3: A smoothed version of the Xtrender that reduces noise and highlights significant trend changes.
Image above: showcases Xtrender T3 with Xtrender T3 color
2.TSI (True Strength Index):
TSI Value: Measures momentum by comparing price changes over two time periods, offering a clear view of trend strength.
TSI Signal Line: A smoothed version of the TSI value, used to generate buy and sell signals when crossed by the TSI.
Image: showcases TSI Value with TSI Signal Line
TSI Histogram: Shows the difference between the TSI and its signal line, highlighting potential reversals and trend continuations.
Image: showcases TSI Histogram
3.Color Coding and Visual Cues:
Trend Colors: The indicator uses dynamic colors to represent bullish or bearish conditions, making it easy to interpret market sentiment.
Background Color : The background changes color based on TSI signals, further aiding in visual trend analysis.
Image: showcases Background color and Zero line
How to Use
1.Xtrender Analysis:
Short-Term Xtrender: The short-term Xtrender is plotted as columns, changing color based on its direction and value. Green or lime indicates positive momentum, while red or maroon indicates negative momentum.
Xtrender T3: The Xtrender T3 line (black) represents a smoothed version of the short-term Xtrender, providing a clearer picture of the overall trend. The color of this line changes based on the Xtrender's value, helping you spot potential trend changes.
2.TSI (True Strength Index):
TSI Value and Signal Line: The TSI value is plotted as a line, with its color changing based on its relationship to the signal line. A crossover of the TSI above the signal line suggests a potential bullish move, while a crossover below indicates a bearish trend.
TSI Histogram: The histogram represents the difference between the TSI and its signal line. Positive values indicate bullish momentum, while negative values suggest bearish momentum.
3.Background Color:
The background color changes based on the TSI signal, with a greenish hue indicating bullish conditions and a reddish hue indicating bearish conditions. This provides a quick visual reference for market sentiment.
4.Zero Line:
A horizontal gray dotted line at the zero level helps you easily identify when the Xtrender or TSI crosses into positive or negative territory, signaling potential trend shifts.
Image above: Timeframe on daily with the individual elements combined
Example of Use:
•Trend Confirmation: Use the Xtrender and Xtrender T3 to confirm the direction of the trend. If both are aligned with the same color and direction, it increases the probability of a strong trend.
•Momentum Reversals: Watch for TSI crosses and histogram shifts to identify potential reversals. For example, a TSI crossover above its signal line with a corresponding change in the histogram from negative to positive could signal a buying opportunity.
•Pullbacks: Identify pullbacks within a trend by observing temporary shifts in the short-term Xtrender or TSI histogram. Use these signals to enter trades in the direction of the overall trend.
Image above: Showcases, Trend confirmation, reversal and pullbacks on daily timeframe.
Customization:
•TSI Speed: Choose between "Fast" and "Slow" TSI settings based on your trading style. Fast settings are more responsive to price changes, while slow settings offer smoother signals.
•Color Settings: Customize the colors for bullish, bearish, and neutral TSI conditions to match your personal preferences or chart theme.
This indicator is versatile and can be used for various trading strategies, from trend following to momentum trading, making it a valuable tool in any trader's arsenal.
My Scripts/Indicators/Ideas /Systems that I share are only for educational purposes
Uptrick: TimeFrame Trends: Performance & Sentiment Indicator### **Uptrick: TimeFrame Trends: Performance & Sentiment Indicator (TFT) - In-Depth Explanation**
#### **Overview**
The **Uptrick: TimeFrame Trends: Performance & Sentiment Indicator (TFT)** is a sophisticated trading tool designed to provide traders with a comprehensive view of market trends across multiple timeframes, combined with a sentiment gauge through the Relative Strength Index (RSI). This indicator offers a unique blend of performance analysis, sentiment evaluation, and visual signal generation, making it an invaluable resource for traders who seek to understand both the macro and micro trends within a financial instrument.
#### **Purpose**
The primary purpose of the TFT indicator is to empower traders with the ability to assess the performance of an asset over various timeframes while simultaneously gauging market sentiment through the RSI. By analyzing price changes over periods ranging from one week to one year, and complementing this with sentiment signals, TFT enables traders to make informed decisions based on a well-rounded analysis of historical price performance and current market conditions.
#### **Key Components and Features**
1. **Multi-Timeframe Performance Analysis:**
- **Performance Lookback Periods:**
- The TFT indicator calculates the percentage price change over several predefined timeframes: 7 days (1 week), 14 days (2 weeks), 30 days (1 month), 180 days (6 months), and 365 days (1 year). These timeframes provide a layered view of how an asset has performed over short, medium, and long-term periods.
- **Percentage Change Calculation:**
- The indicator computes the percentage change for each timeframe by comparing the current closing price to the closing price at the start of each period. This gives traders insight into the strength and direction of the trend over different periods, helping them identify consistent trends or potential reversals.
2. **Sentiment Analysis Using RSI:**
- **Relative Strength Index (RSI):**
- RSI is a widely-used momentum oscillator that measures the speed and change of price movements. It oscillates between 0 and 100 and is typically used to identify overbought or oversold conditions. In TFT, the RSI is calculated using a 14-period lookback, which is standard for most RSI implementations.
- **RSI Smoothing with EMA:**
- To refine the RSI signal and reduce noise, TFT applies a 10-period Exponential Moving Average (EMA) to the RSI values. This smoothed RSI is then used to generate buy, sell, and neutral signals based on its position relative to the 50 level:
- **Buy Signal:** Triggered when the smoothed RSI crosses above 50, indicating bullish sentiment.
- **Sell Signal:** Triggered when the smoothed RSI crosses below 50, indicating bearish sentiment.
- **Neutral Signal:** Triggered when the smoothed RSI equals 50, suggesting indecision or a balanced market.
3. **Visual Signal Generation:**
- **Signal Plots:**
- TFT provides clear visual cues directly on the price chart by plotting shapes at the points where buy, sell, or neutral signals are generated. These shapes are color-coded (green for buy, red for sell, yellow for neutral) and are positioned below or above the price bars for easy identification.
- **First Occurrence Trigger:**
- To avoid clutter and focus on significant market shifts, TFT only triggers the first occurrence of each signal type. This feature helps traders concentrate on the most relevant signals without being overwhelmed by repeated alerts.
4. **Customizable Performance & Sentiment Table:**
- **Table Display:**
- The TFT indicator includes a customizable table that displays the calculated percentage changes for each timeframe. This table is positioned on the chart according to user preference (top-left, top-right, bottom-left, bottom-right) and provides a quick reference to the asset’s performance across multiple periods.
- **Dynamic Text Color:**
- To enhance readability and provide immediate visual feedback, the text color in the table changes based on the direction of the percentage change: green for positive (upward movement) and red for negative (downward movement). This color-coding helps traders quickly assess whether the asset is in an uptrend or downtrend for each period.
- **Customizable Font Size:**
- Traders can adjust the font size of the table to fit their chart layout and personal preferences, ensuring that the information is accessible without being intrusive.
5. **Flexibility and Customization:**
- **Lookback Period Customization:**
- While the default lookback periods are set for common trading intervals (7 days, 14 days, etc.), these can be adjusted to match different trading strategies or market conditions. This flexibility allows traders to tailor the indicator to focus on the timeframes most relevant to their analysis.
- **RSI and EMA Settings:**
- The length of the RSI calculation and the smoothing EMA can also be customized. This is particularly useful for traders who prefer shorter or longer periods for their momentum analysis, allowing them to fine-tune the sensitivity of the indicator.
- **Table Position and Appearance:**
- The table’s position on the chart, along with its font size and colors, is fully customizable. This ensures that the indicator can be integrated seamlessly into any chart setup without obstructing key price data.
#### **Use Cases and Applications**
1. **Trend Identification and Confirmation:**
- **Short-Term Traders:**
- Traders focused on short-term movements can use the 7-day and 14-day performance metrics to identify recent trends and momentum shifts. The RSI signals provide additional confirmation, helping traders enter or exit positions based on the latest market sentiment.
- **Swing Traders:**
- For those holding positions over days to weeks, the 30-day and 180-day performance data are particularly useful. These metrics highlight medium-term trends, and when combined with RSI signals, they provide a robust framework for swing trading strategies.
- **Long-Term Investors:**
- Long-term investors can benefit from the 1-year performance data to gauge the overall health and direction of an asset. The indicator’s ability to track performance across different periods helps in identifying long-term trends and potential reversal points.
2. **Sentiment Analysis and Market Timing:**
- **Market Sentiment Tracking:**
- By using RSI in conjunction with performance metrics, TFT provides a clear picture of market sentiment. Traders can use this information to time their entries and exits more effectively, aligning their trades with periods of strong bullish or bearish sentiment.
- **Avoiding False Signals:**
- The smoothing of RSI helps reduce noise and avoid false signals that are common in volatile markets. This makes the TFT indicator a reliable tool for identifying true market trends and avoiding whipsaws that can lead to losses.
3. **Comprehensive Market Analysis:**
- **Multi-Timeframe Analysis:**
- TFT’s ability to analyze multiple timeframes simultaneously makes it an excellent tool for comprehensive market analysis. Traders can compare short-term and long-term performance to understand the broader market context, making it easier to align their trading strategies with the overall trend.
- **Performance Benchmarking:**
- The percentage change metrics provide a clear benchmark for an asset’s performance over time. This information can be used to compare the asset against broader market indices or other assets, helping traders make more informed decisions about where to allocate their capital.
4. **Custom Strategy Development:**
- **Tailoring to Specific Markets:**
- TFT can be customized to suit different markets, whether it’s stocks, forex, commodities, or cryptocurrencies. For instance, traders in volatile markets may opt for shorter lookback periods and more sensitive RSI settings, while those in stable markets may prefer longer periods for a smoother analysis.
- **Integrating with Other Indicators:**
- TFT can be used alongside other technical indicators to create a more comprehensive trading strategy. For example, combining TFT with moving averages, Bollinger Bands, or MACD can provide additional layers of confirmation and reduce the likelihood of false signals.
#### **Best Practices for Using TFT**
- **Regularly Adjust Lookback Periods:**
- Depending on the market conditions and the asset being traded, it’s important to regularly review and adjust the lookback periods for the performance metrics. This ensures that the indicator remains relevant and responsive to current market trends.
- **Combine with Volume Analysis:**
- While TFT provides a solid foundation for trend and sentiment analysis, combining it with volume indicators can further enhance its effectiveness. Volume can confirm the strength of a trend or signal potential reversals when divergences occur.
- **Use RSI with Other Momentum Indicators:**
- Although RSI is a powerful tool on its own, using it alongside other momentum indicators like Stochastic Oscillator or MACD can provide additional confirmation and help refine entry and exit points.
- **Customize Table Settings for Clarity:**
- Ensure that the performance table is positioned and sized appropriately on the chart. It should be easily readable without obstructing important price data. Adjust the text size and colors as needed to maintain clarity.
- **Monitor Multiple Timeframes:**
- Utilize the multi-timeframe analysis feature of TFT to monitor trends across different periods. This helps in identifying the dominant trend and avoiding trades that go against the broader market direction.
#### **Conclusion**
The **Uptrick: TimeFrame Trends: Performance & Sentiment Indicator (TFT)** is a comprehensive and versatile tool that combines the power of multi-timeframe performance analysis with sentiment gauging through RSI. Its ability to customize and adapt to various trading strategies and markets makes it a valuable asset for traders at all levels. By offering a clear visual representation of trends and market sentiment, TFT empowers traders to make more informed and confident trading decisions, whether they are focusing on short-term price movements or long-term investment opportunities. With its deep integration of performance metrics and sentiment analysis, TFT stands out as a must-have indicator for any trader looking to gain a holistic understanding of market dynamics.