OPEN-SOURCE SCRIPT

Average Bullish & Bearish Percentage Change

Mis à jour
Average Bullish & Bearish Percentage Change
Processes two key aspects of directional market movements relative to price levels. Unlike traditional momentum tools, it separately calculates the average of positive and negative percentage changes in price using user-defined independent counts of actual past bullish and bearish candles. This approach delivers comprehensive and precise view of average percentage changes.


FEATURES:
  • Count-Based Averages: Separate averaging of bullish and bearish %𝜟 based on their respective number of occurrences ensures reliable and precise momentum calculations.
  • Customizable Averaging: User-defined number of candle count sets number of past bullish and bearish candles used in independent averaging.
  • Two Methods of Candle Metrics:1. Net Move: Focuses on the body range of the candle, emphasizing the net directional movement.
    2. Full Capacity: Incorporates wicks and gaps to capture full potential of the bar.
  • The indicator classifies Doji candles contextually, ensuring they are appropriately factored into the bullish or bearish metrics to avoid mistakes in calculation:
    1. Standard Doji - open equals close.
    2. Flat Close Doji - Candles where the close matches the previous close.
  • Timeframe Flexibility:
    The indicator can be applied across any desired timeframe, allowing for seamless multi-timeframe analysis.



HOW TO USE
  1. Select Method of Bar Metrics:

    Net Move: For analyzing markets where price changes are consistent and bars are close to each other.
    snapshot

    Full Capacity: Incorporates wicks and gaps, providing relevant figures for markets like stocks
    snapshot
  2. Set the number of past candles to average:
    🟩 Average Past Bullish Candles (Default: 10)
    🟥 Average Past Bullish Candles (Default: 10)



Why Percentage Change Is Important
Standardized Measurement Across Assets:
Percentage change normalizes price movements, making it easier to compare different assets with varying price levels. For example, a $1 move in a $10 stock is significant, but the same $1 move in a $1,000 stock is negligible.
Highlights Relative Impact:
By measuring the price change as a percentage of the close, traders can better understand the relative impact of a move on the asset’s overall value.
Volatility Insights:
A high percentage change indicates heightened volatility, which can be a signal of potential opportunities or risks, making it more actionable than raw price changes. Percents directly reflect the strength of buying or selling pressure, providing a clearer view of momentum compared to raw price moves, which may not account for the relative size of the move.


By focusing on percentage change, this indicator provides a normalized, actionable, and insightful measure of market momentum, which is critical for comparing, analyzing, and acting on price movements across various assets and conditions.
Notes de version
  • Line 23,24: Fixed mistake after Doji2 (Flat Close) condition. Had "open[1]" by a mistake.
  • Upon realizing that the outputs were originally based on a simple arithmetic averaging method, I took the opportunity to introduce additional 2 averaging options where weights are not equally distributed as in Arithmetic.

    snapshot

    1. Exponential Averaging:
    Assigns greater weight to recent data while rapidly reducing the influence of older data. This makes it highly responsive and effective at capturing momentum shifts in the market.
    2. Weighted Averaging:
    Applies linearly increasing weights to newer candles, providing a balanced approach that blends smoothness with responsiveness, making it ideal for identifying trends with moderate sensitivity.
  • Arithmetic avg will remain as default

Notes de version
Updates
  • Removed Doji candles from classification logic. Previously, conditions like close == close[1] or open == close affected the accurate targeting of bullish/bearish candles for averaging. This issue has been resolved using simple mathematical sign checks.
  • Added "Show corresponding average of candle color" BOOL: When Enabled it will show the output of corresponding average. Otherwise it will show the average based on the change of closing price.
    DISABLED:
    snapshot
    ENABLED:
    snapshot
  • Full Capacity uses True Range because during a move price reaches extreme point and leaves wick as traces. (Full potential range during bullish/bearish change)
  • After careful observation, the Exponential Averaging is set to default.
Bearish PatternsBullish PatternschangepercentagestatisticsVolatility

Script open-source

Dans le plus pur esprit TradingView, l'auteur de ce script l'a publié en open-source, afin que les traders puissent le comprendre et le vérifier. Bravo à l'auteur! Vous pouvez l'utiliser gratuitement, mais la réutilisation de ce code dans une publication est régie par nos Règles. Vous pouvez le mettre en favori pour l'utiliser sur un graphique.

Vous voulez utiliser ce script sur un graphique ?

Clause de non-responsabilité