OPEN-SOURCE SCRIPT
Diupdate

Advanced Volume Anomaly Oscillator (Multi-Period & Earnings Trac

766
Overview:
This powerful volume oscillator is designed to help traders spot institutional accumulation and validate breakout strength. Instead of just looking at raw volume, this tool visualizes the difference between the current volume and a dynamic average volume. It plots a clear histogram around a zero-line, making it incredibly easy to see when an asset is experiencing abnormal trading activity.

Key Features:

5 Dynamic Calculation Periods: Choose the baseline average that fits your strategy. You can easily switch between Custom Days, Monthly, Quarterly, Year-To-Date (YTD), or Automatic "Since Last Earnings" periods via the settings menu.

Mega Volume Highlight (% Threshold): Never miss a massive volume spike. Set a custom percentage threshold (e.g., 200%), and the indicator will automatically highlight the histogram bar in a bright color (default: yellow) when the volume exceeds that specific percentage of the average.

Smart Earnings Counter: A convenient label automatically displays the exact number of trading days that have passed since the last earnings report, helping you track post-earnings momentum.

Clear Visuals: Up-volume (above average) and down-volume (below average) are distinctly colored to provide instant environmental awareness without cluttering your main price chart.

【英文の簡単な和訳(確認用)】

概要: 機関投資家の買い集めやブレイクアウトの強さを確認するための強力な出来高オシレーターです。単純な出来高ではなく「動的な平均値との差」をゼロラインを基準にしたヒストグラムで視覚化し、異常な取引状況を簡単に見抜けます。

特徴1(5つの計算期間): あなたの戦略に合わせて、設定画面から「任意の日数、月単位、四半期、年初来(YTD)、前回決算から」の5つの基準を簡単に切り替えられます。

特徴2(特大ボリュームのハイライト): 200%など任意のパーセンテージを設定すると、出来高がその基準を超えた時に自動で棒グラフが目立つ色(初期設定:黄色)にハイライトされ、大口の資金流入を見逃しません。

特徴3(スマート決算カウンター): 前回の決算発表から何営業日経過したかをチャート上に自動でラベル表示し、決算後の勢い(モメンタム)を追跡するのに役立ちます。

特徴4(クリアな視認性): 平均より多い日と少ない日を色分けし、メインチャートを邪魔することなく瞬時に相場環境を把握できます。
Catatan Rilis
お任せください!( ゚Д゚)✨

アラート機能が追加されたことで、さらに完璧な「ブレイクアウト検知ツール」へと進化しましたね!TradingViewのコミュニティで世界中のプロトレーダーに向けて公開するのにぴったりな、魅力的な英文紹介を作成しました。

そのままコピー&ペーストしてお使いください!

Indicator Name: Advanced Volume Anomaly Oscillator & Alerts

Overview:
This powerful volume oscillator is designed to help traders spot institutional accumulation, validate breakout strength, and catch massive momentum shifts. Instead of relying on raw volume alone, this tool calculates the difference between the current volume and a dynamic moving average, plotting it as a clear zero-line histogram. With the addition of custom percentage-based alerts, you will never miss a critical volume spike again.

Key Features:

Custom Volume Alerts: Set a specific percentage threshold (e.g., 200% of the average volume). When the volume hits this target, the histogram bar highlights in bright yellow and can trigger a real-time alert, ensuring you catch institutional buying the second it happens.

5 Dynamic Baselines: Tailor the moving average calculation to your trading style. Choose from Custom Days, Monthly, Quarterly, Year-To-Date (YTD), or an Automatic "Since Last Earnings" period.

Smart Earnings Tracker: A built-in label automatically counts and displays the exact number of trading days since the company's last earnings report, helping you track post-earnings momentum.

Clean Visuals: Up-volume (above average) is distinctly colored from down-volume (below average), providing instant clarity without cluttering your main price chart.

【英文の簡単な和訳(確認用)】

概要: 機関投資家の買い集めやブレイクアウトの強さを確認し、モメンタムの急激な変化を捉えるための強力な出来高オシレーターです。単純な出来高ではなく、動的な平均値との差をゼロラインのヒストグラムとして視覚化します。カスタムのアラート機能が追加されたことで、重要な出来高の急増を二度と見逃しません。

特徴1(カスタム出来高アラート): 平均出来高の200%など、任意の基準を設定できます。到達すると棒グラフが明るい黄色にハイライトされ、リアルタイムのアラートを発動できるため、大口の買いを瞬時に捉えることができます。

特徴2(5つの動的基準): 戦略に合わせて平均の計算期間を「任意の日数、月単位、四半期、年初来(YTD)、前回決算から」の5つから選択できます。

特徴3(スマート決算カウンター): 前回の決算発表から何営業日経過したかを自動でラベル表示し、決算後の勢いを追跡できます。

特徴4(クリアな視認性): 平均より多い日と少ない日を明確に色分けし、メインチャートを邪魔することなく状況を把握できます。
Catatan Rilis
Overview:
This powerful volume oscillator is designed to help traders spot institutional accumulation, validate breakout strength, and catch massive momentum shifts. Instead of relying on raw volume alone, this tool calculates the difference between the current volume and a dynamic moving average, plotting it as a clear zero-line histogram. With the addition of custom percentage-based alerts, you will never miss a critical volume spike again.

Key Features:

Custom Volume Alerts: Set a specific percentage threshold (e.g., 200% of the average volume). When the volume hits this target, the histogram bar highlights in bright yellow and can trigger a real-time alert, ensuring you catch institutional buying the second it happens.

5 Dynamic Baselines: Tailor the moving average calculation to your trading style. Choose from Custom Days, Monthly, Quarterly, Year-To-Date (YTD), or an Automatic "Since Last Earnings" period.

Smart Earnings Tracker: A built-in label automatically counts and displays the exact number of trading days since the company's last earnings report, helping you track post-earnings momentum.

Clean Visuals: Up-volume (above average) is distinctly colored from down-volume (below average), providing instant clarity without cluttering your main price chart.

【英文の簡単な和訳(確認用)】

概要: 機関投資家の買い集めやブレイクアウトの強さを確認し、モメンタムの急激な変化を捉えるための強力な出来高オシレーターです。単純な出来高ではなく、動的な平均値との差をゼロラインのヒストグラムとして視覚化します。カスタムのアラート機能が追加されたことで、重要な出来高の急増を二度と見逃しません。

特徴1(カスタム出来高アラート): 平均出来高の200%など、任意の基準を設定できます。到達すると棒グラフが明るい黄色にハイライトされ、リアルタイムのアラートを発動できるため、大口の買いを瞬時に捉えることができます。

特徴2(5つの動的基準): 戦略に合わせて平均の計算期間を「任意の日数、月単位、四半期、年初来(YTD)、前回決算から」の5つから選択できます。

特徴3(スマート決算カウンター): 前回の決算発表から何営業日経過したかを自動でラベル表示し、決算後の勢いを追跡できます。

特徴4(クリアな視認性): 平均より多い日と少ない日を明確に色分けし、メインチャートを邪魔することなく状況を把握できます。
Catatan Rilis
Consecutive Color Streak Alerts: Detect hidden institutional accumulation or volume dry-ups! You can set a custom streak length (default: 3 consecutive bars). If the histogram maintains the same color (above average, below average, or mega spike) for that specified duration, a dedicated alert will trigger, helping you spot sustained momentum or selling exhaustion early.

【和訳】
連続ストリーク(連続記録)アラート: 隠れた機関投資家の買い集めや、売り枯れを検知します!連続するバーの数(初期設定:3本連続)をカスタム設定できます。ヒストグラムがその期間同じ色(平均以上、平均以下、または特大スパイク)を維持した場合、専用のアラートが作動し、持続的なモメンタムや売り圧の低下を早期に見抜くのに役立ちます。
Catatan Rilis
Indicator Name: Advanced Volume Oscillator & Multi-Streak Alerts

Overview:
This elite volume oscillator is designed to help traders decode institutional footprints, from silent accumulation to explosive breakouts. By visualizing the difference between current volume and a dynamic moving average as a zero-line histogram, it provides instant clarity on market participation. With our newly upgraded "Multi-Streak Alert" system, you can now set independent consecutive-day thresholds for different volume states, allowing you to catch sustained buying pressure, selling exhaustion, or massive volume anomalies on autopilot.

Key Features:

Advanced Multi-Streak Alerts: Track market phases with surgical precision! Set individual consecutive-day requirements for Mega Volume (e.g., 2 days for extreme anomalies), Above-Average Volume (e.g., 4 days for hidden accumulation), and Below-Average Volume (e.g., 4 days for selling exhaustion). Each state triggers its own specific alert.

Mega Volume Highlight (% Threshold): Set a custom percentage target (e.g., 200% of the average). When volume breaches this level, the bar highlights in bright yellow and can trigger an immediate real-time alert for sudden institutional buying.

5 Dynamic Baselines: Tailor the moving average to your exact strategy. Instantly switch between Custom Days, Monthly, Quarterly, Year-To-Date (YTD), or an Automatic "Since Last Earnings" period.

Smart Earnings Tracker: A built-in label automatically counts and displays the exact number of trading days since the company's last earnings report, making it effortless to track post-earnings momentum.

Clean Visuals: Up-volume (above average) and down-volume (below average) are distinctly colored, providing a clear read on the environment without cluttering your main price chart.

【和訳】

概要: 静かな買い集めから爆発的なブレイクアウトまで、機関投資家の足跡を解読するためのエリート出来高オシレーターです。新しくアップグレードされた「マルチ・ストリーク・アラート」システムにより、出来高の状態ごとに独立した連続日数を設定し、持続的な買い圧力や売り枯れを自動で捉えることができます。

特徴1(高度なマルチ連続アラート): 相場のフェーズを正確に追跡します!「特大(黄)が2日連続」「多い(緑)が4日連続(買い集め)」「少ない(赤)が4日連続(売り枯れ)」など、状態ごとに個別の日数を設定でき、それぞれ専用のアラートを発動させます。

特徴2(特大ボリュームのハイライト): 200%など任意の目標を設定し、突破した瞬間に黄色く光らせ、突発的な大口の買いをリアルタイムで通知します。

特徴3(5つの動的基準): 戦略に合わせて平均の計算期間を「任意の日数、月単位、四半期、年初来(YTD)、前回決算から」の5つから選択できます。

特徴4(スマート決算カウンター): 前回の決算発表から何営業日経過したかを自動でラベル表示します。

特徴5(クリアな視認性): 平均より多い日と少ない日を明確に色分けし、メインチャートをスッキリ保ちます。
Catatan Rilis
変更点の解説
独立したカウント変数 (count_mega, count_up, count_dn) の導入:
以前の current_state(現在の色だけを記憶する仕組み)を廃止し、それぞれの条件が満たされたら独立して +1 していくカウンターを作りました。

黄色の日は緑のカウントに貢献する:
黄色になる条件(is_mega)は「設定%超え」ですが、これを超えているなら当然「平均以上(is_up)」にもなっています。そのため、黄色のバーが出現した日は count_mega が増えると同時に count_up の連続カウントも途切れずに増え続けるようになっています。

アラートメニューの文言微調整:
アラートのタイトルを 【連続】多い(緑+黄)が継続 に変更し、設定時により意味が分かりやすくなるようにしました。

Key Changes and Updates
1. Independent Counters for Consecutive Days (Streaks)

Before: The code used a single current_state variable that tracked only one color at a time. If the bar changed from green to yellow, the green streak was completely reset.

After: I introduced independent tracking variables (count_mega, count_up, and count_dn). This allows the script to evaluate and count each condition separately without them interfering with one another.

2. "Mega" (Yellow) Bars Now Contribute to "Up" (Green) Streaks

Because a "Mega" volume day (yellow) is inherently an "Above Average" volume day (green), the is_up condition is still met. Now, when a yellow bar appears in the middle of a sequence of green bars, the count_up variable continues to increase without breaking the streak.

3. Code Refactoring with switch Statement

I replaced the deeply nested ternary operators (? :) used for calculating the volume moving average (vol_ma) with a switch statement. This makes the code significantly cleaner, easier to read, and simpler to maintain in Pine Script v5.

4. Updated UI Labels and Alert Messages

I updated the text in the settings menu and alert conditions to reflect this new logic (e.g., clarifying that the "Up" streak now includes both Green and Yellow bars: 多い(緑+黄)が続く日数). This ensures there is no confusion when setting up alerts in TradingView.

Pernyataan Penyangkalan

Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.