OPEN-SOURCE SCRIPT

User Defined Momentum Change with Swing Visuals

By Crypto_Moses
Updated
This script is a groundbreaking, math-centric technical analysis tool that blends two well-established indicators, the Stochastic Oscillator and the Exponential Moving Average (EMA), to deliver a unique and visually engaging way of identifying momentum swings and stochastic indicators. Unlike mashups, this script is tailored to accommodate a wide range of trading strategies, providing traders with a distinctive perspective on market trends.

The innovation in this script lies in its mathematically-driven ability to effectively combine the Stochastic Oscillator and EMA, setting it apart from other available tools that simply offer a rehash of old ideas or slight modifications to popular indicators. The EMA is employed instead of a Simple Moving Average (SMA), enhancing the uniqueness of the calculations. This novel approach creates a new dimension for traders to evaluate potential momentum swings and visualize them on the chart, proving it to be more than just a mere mashup of existing indicators.

Central to the script's utility is its extensive customization options, which allow traders to adjust various inputs to suit their preferences and trading strategies. Users can modify the EMA length, swing range signal offsets, and smoothing factors for both the fast and slow components of the Stochastic Oscillator. Additionally, the script offers the ability to personalize the color thresholds, transparency, and line properties for the Stochastic Oscillator and swing range signal.

This script's visually dynamic representation of momentum swings empowers traders to make more informed trading decisions, particularly on the 6-hour timeframe. The swing range signal, represented by vertical lines on the chart, acts as a valuable visual aid for identifying potential entry or exit points. Furthermore, the Stochastic Oscillator provides insights into the strength and direction of momentum, which is beneficial for confirming potential trade signals.

To conclude, this script is not just another combination of MAs or a slightly modified version of a popular indicator. Instead, it offers traders a comprehensive, visually appealing, and customizable tool for technical analysis, which is both original and useful. By uniquely combining the EMA and the Stochastic Oscillator with a strong mathematical foundation, and allowing traders to adjust a variety of settings, this script adds value to the TradingView community and enhances the body of knowledge available for traders. It is designed to support traders in tailoring their analysis based on their own strategies and preferences, enabling them to make well-informed decisions in the financial markets.
Release Notes
This script is a groundbreaking, math-centric technical analysis tool that blends two well-established indicators, the Stochastic Oscillator and the Exponential Moving Average (EMA), with an extended set of 21 color-coded stochastic oscillators to deliver a unique and visually engaging way of identifying momentum swings and stochastic indicators both on the chart and in the bar color scheme. Unlike mashups, this script is tailored to accommodate a wide range of trading strategies, providing traders with a distinctive perspective on market trends.

The innovation in this script lies in its mathematically-driven ability to effectively combine the Stochastic Oscillator and EMA, setting it apart from other available tools that simply offer a rehash of old ideas or slight modifications to popular indicators. The EMA is employed instead of a Simple Moving Average (SMA), enhancing the uniqueness of the calculations. This novel approach creates a new dimension for traders to evaluate potential momentum swings and visualize them on the chart, proving it to be more than just a mere mashup of existing indicators.

Central to the script's utility is its extensive customization options, which allow traders to adjust various inputs to suit their preferences and trading strategies. Users can modify the EMA length, swing range signal offsets, and smoothing factors for both the fast and slow components of the Stochastic Oscillator. Additionally, the script offers the ability to personalize the color thresholds, transparency, and line properties for the Stochastic Oscillator and swing range signal. With 21 color-coded levels for stochastic values, traders can now visually interpret different ranges of momentum more precisely.

A significant enhancement in this script is the bar coloring feature, where specific color thresholds are set by default to highlight extreme overbought, oversold, and neutral conditions. These defaults can be further customized, providing a highly tailored visual representation. The script uses a default set of colors: most oversold (red), fully yellow for a critical midpoint, 85% orange and 75% red for key momentum ranges, and fully white for the most overbought condition, with all other colors set to transparent by default.

This script's visually dynamic representation of momentum swings empowers traders to make more informed trading decisions, particularly on the 6-hour timeframe. The swing range signal, represented by vertical lines on the chart, acts as a valuable visual aid for identifying potential entry or exit points. Furthermore, the Stochastic Oscillator provides insights into the strength and direction of momentum, which is beneficial for confirming potential trade signals.

To conclude, this script is not just another combination of MAs or a slightly modified version of a popular indicator. Instead, it offers traders a comprehensive, visually appealing, and customizable tool for technical analysis, which is both original and useful. By uniquely combining the EMA and the Stochastic Oscillator with a strong mathematical foundation and allowing traders to adjust a variety of settings, this script adds value to the TradingView community and enhances the body of knowledge available for traders. It is designed to support traders in tailoring their analysis based on their own strategies and preferences, enabling them to make well-informed decisions in the financial markets.
Release Notes
update 07.24.2024: verticle lines representing potential momentum changes are dependent on user settings, but in low time frames are distracting by default so I got rid of them. You can turn them on as you like in settings and styles tabs.
Release Notes
7.27.24 Version 2.0 out now!:

This updated script builds upon the technical analysis tool introduced in version 1.0. It continues to blend the Stochastic Oscillator and the Exponential Moving Average (EMA) with a refined set of color-coded stochastic oscillators. The enhancements in version 2.0 make it an even more effective and visually engaging way of identifying momentum swings and stochastic indicators, catering to a broad range of trading strategies.

Key Enhancements in Version 2.0:

1. Simplified and Enhanced Color Coding:
The original 21 color-coded levels have been optimized to 10 distinct colors. This change streamlines the visualization process, making it easier for traders to interpret momentum swings without losing critical information. The new color scheme focuses on key momentum ranges, with transparency levels that improve the visual clarity of the chart.

2. Transparent Color Adjustments:
Transparency settings are now directly embedded within the color definitions, eliminating the need for a separate transparency input. This enhancement simplifies the customization process and ensures that the color-coded bars are visually cohesive and less cluttered.

3. Improved Vertical Line Calculation:
The vertical line calculation has been optimized by calculating the highest and lowest values outside the loop, improving the script's performance and accuracy. This change ensures that the visual representation of swing range signals is precise and less resource-intensive.

4. User-Friendly Vertical Line Options:
While the vertical lines indicating potential momentum changes remain optional, their display has been fine-tuned for better usability. The lines are now calculated more efficiently, reducing potential distractions, especially on lower timeframes. Users can still enable or disable these lines based on their preference through the settings and styles tabs.

5. Refined Bar Coloring Function:
A new function, getColour(a), has been introduced to determine bar colors based on stochastic values. This function simplifies the color determination process and ensures that the bar colors accurately reflect the current momentum conditions.

Why Version 2.0 is Better:

1. Simplified Visualization:
The reduction from 21 to 10 colors makes the chart less cluttered and easier to interpret. This change enhances the user's ability to quickly identify key momentum changes without overwhelming visual information.

2. Enhanced Performance:
Optimizing the vertical line calculation and embedding transparency within color definitions improves the script's performance. Traders will experience faster and more responsive chart updates, which is crucial for making timely trading decisions.

3. Improved Customization:
While maintaining extensive customization options, the script now offers a more intuitive setup process. Users can easily adjust settings to match their trading strategies without dealing with redundant inputs.

4. Better Usability on Multiple Timeframes:
The updated script addresses the issue of visual clutter on lower timeframes by refining how vertical lines and colors are displayed. This improvement ensures that the script remains useful and non-distracting across different timeframes.

Conclusion:

Version 2.0 of the User Defined Momentum Change with Swing Visuals script builds on the strong foundation of version 1.0 by introducing key enhancements that simplify visualization, improve performance, and maintain extensive customization options. This update provides traders with an even more powerful tool for technical analysis, helping them to make informed trading decisions with greater ease and accuracy. By refining the color coding, optimizing performance, and enhancing usability, version 2.0 sets a new standard for visually dynamic momentum analysis on TradingView.

please note: The vertical lines representing potential momentum changes have been optimized for better performance and visual clarity. These lines are turned off by default on lower timeframes to reduce distractions but can be easily enabled in the settings and styles tabs.
Release Notes
07.27.2024 update of chart and default coloring so one can see what a user defined chart design looks like when one uses the full details of this indicator to their preferences. The simplified coloring matches the various oscillators they're influenced by, creating an aesthetic approach to the technical tools built into this indicator. Enjoy!
Release Notes
The "User Defined Momentum Change with Swing Visuals (Optimized with New Colors)" indicator is a powerful and flexible tool for detecting momentum changes and potential swing points in the market. With the new improvements, it is even more adaptable to different market conditions, easier to interpret with the preferred color scheme, and offers more control over how momentum is measured and visualized.

Improvements Made to the Indicator:

Enhanced Bar Coloring System (Based on User Preferences):

The bar coloring logic from the original version was replaced with a new color scheme that you preferred. This coloring scheme uses red, orange, transparent black, transparent purple, blue (75% transparent), green, and yellow to represent different momentum conditions. The new color scheme provides clearer visual cues for overbought and oversold conditions, as well as a smooth transition between high and low momentum, improving the interpretability of the indicator for better decision-making.

Dynamic Swing Signal Offsets Based on Volatility:

Instead of using static offsets for swing signals, the indicator now dynamically adjusts the swing signal offsets based on market volatility (standard deviation). This helps ensure that swing signals are more adaptive in both volatile and calm markets. In volatile markets, using larger offsets for swing signals helps filter out false signals and focuses on more significant price movements. In quieter markets, smaller offsets ensure that the indicator remains responsive to smaller price swings.

Granular Smoothing Controls:

Fine-tuning controls for smoothing were added, allowing users to adjust the smoothing parameters for the stochastic oscillator with greater precision. This provides more flexibility in how momentum is measured, allowing traders to fine-tune the indicator's sensitivity based on the specific asset being traded. More smoothing reduces noise, while less smoothing provides faster signals.

Simplified and Optimized Coloring Logic:

The original nested if-else structure for determining bar colors based on the stochastic %D value was simplified into a more efficient and readable format. This optimization reduces the complexity of the code, making it easier to maintain and slightly more efficient in execution. It also improves readability, making it easier to understand and modify the logic if needed.

Line Drawing Optimization:

The way vertical lines were drawn on swing signals was simplified. Rather than looping through bars, the new version directly draws lines at significant swing highs and lows. This reduces computational load and ensures that only meaningful lines are drawn, preventing excessive or unnecessary visual clutter on the chart.

This version enhances the visual and functional elements of the original indicator while keeping the core principles intact. It helps traders quickly assess overbought/oversold conditions, identify significant swings, and fine-tune their analysis based on the current volatility of the market.
Candlestick analysisChart patternsMoving AveragesstochasticoscillatorswingtradingTechnical Analysisuser-defined
Crypto_Moses

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?

Disclaimer