tkarolak

Heikin-Ashi Rolling Time Decay Volume Oscillator

tkarolak 已更新   
The indicator calculates a time-decayed moving sum of volume data for both bullish (green) and bearish (red) candles. It then generates a volume share oscillator as a smoothed and weighted (time-decayed) moving sum of bullish volume (positive share) or bearish volume (negative share) relative to the total volume.

The volume share is displayed as an area chart with gradient fills representing overbought and oversold regions. Additionally, an Arnaud Legoux Moving Average (ALMA) of the volume oscillator is plotted on the chart.

Trend Momentum and Price Control:
This indicator serves as a powerful tool for traders to gauge trend momentum and identify which side, bulls or bears, is controlling price movements. When the volume oscillator trends strongly in the green territory, it suggests that bulls are in control of price movements, indicating a potential uptrend. Conversely, when the oscillator tilts into the red, it indicates bearish dominance and a potential downtrend. With the incorporation of ALMA for smoothing, this indicator becomes an essential tool for traders and analysts navigating the dynamics of traded assets.

Source Candles:
This indicator is designed to work with Heiken Ashi or Japanese candlesticks to discern candle bias, whether it's red or green. Heiken Ashi tends to produce red candles during downtrends and green candles during uptrends, providing a clearer trend indication. In contrast, traditional candlesticks alternate colors regardless of the dominant price direction. Users can select between "Heikin-Ashi Candles" and regular "Japanese Candles" as the source for price direction."

A time decay cumulative sum, also known as a weighted moving sum or exponentially weighted moving sum, offers several advantages when it comes to determining market dynamics compared to other methods:

  • Responsive to Recent Data: Time decay cumulative sum gives more weight to recent data points and gradually reduces the impact of older data. This responsiveness is crucial in rapidly changing market conditions where recent price and volume information is more relevant for analysis.
  • Adaptive to Market Volatility: It adapts to changes in market volatility. When markets are highly volatile, it places more emphasis on recent data to reflect the current market environment accurately. Conversely, during calmer periods, it considers older data less important.
  • Effective for Identifying Turning Points: Time decay cumulative sums are particularly effective at identifying turning points in market dynamics. They can indicate shifts from bullish to bearish sentiment and vice versa, providing early signals of potential trend reversals.
  • Reduces Lag: Traditional cumulative sums or simple moving averages can lag behind actual market changes, making them less effective for real-time decision-making. Time decay cumulative sums reduce this lag by giving more weight to recent events.
  • Dynamic Weighting: The weighting scheme can be adjusted to fit specific market dynamics or trading strategies. Traders can customize the decay rate or smoothing factor to align with their analysis goals and timeframes.
  • Improved Signal Clarity: The time decay cumulative sum can provide clearer and more precise signals for overbought and oversold conditions, as well as trend strength, due to its ability to emphasize recent relevant data.

In summary, a time decay cumulative sum is a valuable tool in determining market dynamics because it adapts to changing market conditions, reduces noise, and provides timely and accurate insights into trends, turning points, and the relative strength of bullish and bearish forces. Its responsiveness and adaptability make it an essential component of many technical analysis and trading strategies.
版本注释:
removed Arnaud Legoux Moving Average from indicator
版本注释:
Code refactor
版本注释:
Code refactor
版本注释:
Incorporated an indicator description as comments within the code to provide better context and understanding
版本注释:
Change Log

  • Function Addition: Added the decayedVolumes function to compute decayed green and red volumes based on historical close and open prices, enhancing the volume analysis by including decay factors in the computation.

  • Code Modularization: Refactored the volume calculation logic into a separate function (decayedVolumes), simplifying the main code block and improving readability and maintainability.

  • Function Integration: Integrated the decayedVolumes function directly into the main indicator calculation, replacing the previously inline computation for red and green volume sums. This change modularizes the volume calculation, centralizing adjustments to decay logic in one function.
版本注释:
Added the heikinAshiValues function to compute Heikin-Ashi candle values, aiding in trend identification and smoothing out price data. This function returns a tuple with Heikin-Ashi close, open, high, and low values.
版本注释:
Change Log:

  1. Decay Method Setting Added: A new setting for selecting the decay method has been introduced. Users can now choose from "No Decay," "Linear Decay Weighting," or "Quadratic Decay Weighting." This change allows for more flexible volume calculations based on user preferences.
  2. Updated Parameter in decayedVolumes Function: The function now accepts an additional parameter, decayMethod, which allows the selection of the decay method at runtime. This parameter controls whether no decay, linear, or quadratic weighting is applied.

开源脚本

本着真正的TradingView精神,该脚本的作者将其开源发布,以便交易者可以理解和验证它。为作者喝彩!您可以免费使用它,但在出版物中重复使用此代码受网站规则的约束。 您可以收藏它以在图表上使用。

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。

想在图表上使用此脚本?