OPEN-SOURCE SCRIPT
已更新

RSI Footprint Profile

2 149
・Overview

The RSI Footprint Profile is a refined order flow visualization tool designed for absolute clarity. It integrates price-level volume distribution with volume-weighted RSI, filtering out market noise to focus strictly on the most critical area of any session: the Point of Control (POC).

・Key Features
快照
Volume-Weighted RSI Coloring
Each price node is colored based on the internal momentum of the volume traded at that level. Red indicates an overbought state (OB), blue indicates an oversold state (OS), and gray represents neutral volume.

・Exclusive POC Extension
快照
To eliminate false signals from low-volume price extremes, the forward-looking extension line is strictly limited to the Point of Control (POC). If the session's thickest volume node aligns with an extreme RSI state, it extends to the right, creating an institutional-grade future support or resistance line.

・Stealth UI & Dynamic Highlighting

Built with a "less is more" philosophy. The profile remains semi-transparent so your candlesticks are never obstructed. It aggressively highlights only the POC and the Current Price Zone, providing precise Total Volume and Delta metrics exactly where you need them.

・How to Use

Setup: This indicator calculates footprint data using a lower timeframe (LTF). Ensure your specified LTF (default: 5m) is shorter than your current chart's timeframe.
Performance: The drawing engine is optimized to render from the oldest session to the newest. This ensures that TradingView's drawing limits will never erase your most critical recent data.

Author's Note (Please Read)
I am a Japanese developer and not a native English speaker. Please understand that it may take some time for me to reply to your comments, and there might be slight nuances lost in translation. However, I will read every message and reply sincerely. Thank you for your understanding and support!

[Japanese]

概要

RSI Footprint Profileは、圧倒的な視認性を追求して洗練されたオーダーフロー可視化ツールです。価格帯別出来高と出来高加重RSIを統合し、市場のノイズを排除して、セッション内で最も重要な領域である「POC(最大出来高帯)」に焦点を絞ります。

主要機能

出来高加重RSIによる色分け
各価格帯は、そこで取引された出来高の内部モメンタムに基づいて色分けされます。赤は買われすぎ(OB)、青は売られすぎ(OS)、グレーは中立な状態を示します。

POC限定の防衛線延長

出来高が薄い価格帯でのフェイクシグナルを排除するため、未来への延長線は「POC(Point of Control)」のみに厳格に制限されています。セッションで最も分厚い壁(POC)が極端なRSI状態と重なった場合、そのラインが右側に延長され、将来の強力なサポート/レジスタンスとして機能します。

ステルスUIと動的ハイライト

「少ないほど豊かである」という哲学で設計されています。プロファイルは半透明を維持し、ローソク足を決して邪魔しません。POCと現在地の価格帯のみに枠線を付け、正確な総出来高とデルタの数値を表示します。

使用上の注意

設定: 内部計算に下位足(LTF)を使用します。設定したLTF(デフォルト5分)が、現在のチャートの時間足よりも短いことを確認してください。
パフォーマンス: TradingViewの描画制限によって最新のデータが消去されるのを防ぐため、過去のセッションから順に描画を上書きするようエンジンが最適化されています。

開発者よりお知らせ
私は英語のネイティブスピーカーではないため、海外の方からのコメントへの返信にお時間をいただいたり、翻訳によるニュアンスの違いが生じる場合がございます。いただいたメッセージには真摯に対応させていただきますので、あらかじめご了承いただけますと幸いです。
版本注释
Update: Improved Visibility for Dark/Light Themes

Added color customization settings for Overbought (OB), Oversold (OS), and Neutral volume profiles.

Users can now change the default neutral gray color to white (or any other color) to prevent it from blending into dark backgrounds.

The RSI Alert signboard colors now dynamically sync with user-defined settings.

[日本語訳(参考)]
アップデート: ダーク/ライトテーマの視認性向上

買われすぎ(OB)、売られすぎ(OS)、中立の出来高プロファイルに対するカラーカスタマイズ設定を追加しました。

デフォルトの中立色であるグレーが暗い背景に溶け込むのを防ぐため、ユーザーが白(またはその他の任意の色)に変更できるようになりました。

RSIアラートの看板の色が、ユーザー定義の設定と動的に同期するようになりました。
版本注释
This indicator, "RSI Footprint Profile," is an advanced order flow visualization tool designed to filter out market noise. It uniquely integrates a traditional price-level volume distribution (Volume Profile) with a Volume-Weighted RSI, allowing traders to see not just *where* the volume was traded, but the *internal momentum* of that volume.

◼️ Originality & Underlying Concepts
Unlike standard volume profiles that only show volume size or simple buy/sell delta, this script calculates the momentum of the volume at specific price nodes using the following logic:
1. LTF Data Aggregation: The script fetches intrabar data (default: 5m) using `request.security_lower_tf` to accurately measure volume and RSI values within a higher timeframe session. Buy and sell volumes are estimated based on the LTF close relative to its open.
2. Volume-Weighted RSI Calculation: For each specific price row, the script calculates a volume-weighted RSI. The internal math accumulates the RSI value multiplied by the volume for each LTF bar, then divides it by the total volume at that price level: [ Sum of (RSI * Volume) / Sum of Volume ].
3. Dynamic Momentum Coloring: The resulting price row is colored based on this aggregated RSI. Red indicates Overbought (OB > 70) volume momentum, Blue indicates Oversold (OS < 30) momentum, and a user-defined color represents neutral volume.
4. Strict POC Extension: To eliminate false signals from low-volume extremes, the forward-looking extension line is strictly limited to the Point of Control (POC) — the price level with the highest total volume in that specific session.

◼️ How to Read & Trade
- Purple Box (Active Price Zone): The purple highlighted box dynamically tracks the current price row in real-time. It explicitly displays the live Total Volume and Delta metrics for that specific level, keeping your candlestick analysis unobstructed (Stealth UI).
- Identify Exhaustion Zones: If a prominent volume node (especially the POC) turns Red (OB) near resistance or Blue (OS) near support, it indicates that the momentum driving that volume is exhausted, signaling a high-probability reversal zone.
- Institutional S/R Lines: The extended POC lines act as critical future support/resistance. A POC that was formed under extreme RSI conditions (colored red or blue) carries more weight than a neutral POC, indicating trapped traders or strong absorption.

◼️ Setup Instructions
- You must ensure the "Analysis Lower Timeframe (LTF)" setting (default 5m) is strictly lower than your current chart's timeframe for the `request.security_lower_tf` function to calculate the footprint correctly.

[Important Notice]
I am a Japanese developer and not a native English speaker. Please understand that it may take some time for me to reply to your comments, and nuances might be lost in translation. Thank you for your understanding.
版本注释
RSI Footprint Profile v2

A massive thank you to everyone who has been using the indicator! Your continued support and active use in the markets are what made this major "v2" update possible.

We have completely overhauled the core drawing engine and logic to provide a more practical and visually intuitive charting experience.

Key Updates & Features

■Transition to Anchored Box Profiles
We have moved away from fixed-bar-count periods. The profiles are now anchored to Higher Timeframe (HTF) boundaries (e.g., Weekly with 1W or Monthly with 1M). This allows for more logical, calendar-aligned volume analysis.

Dynamic Width Normalization

The length of the profile histograms is now automatically normalized to fit perfectly within the width of each specific box, dynamically adjusting to varying period lengths (like different days in a month) for a much cleaner chart.

■Overbought/Oversold (OB/OS) Zone Extensions
In addition to extending the POC (Point of Control) line, you can now extend the Overbought and Oversold RSI blocks to the right. These extended zones act as highly effective visual cues for future support and resistance levels.

IMPORTANT: Note on MTF Time Settings
Please be extremely careful with your timeframe settings. The "Footprint Data (LTF)" in the settings must always be shorter than your current chart's timeframe. Setting it to a timeframe that is equal to or larger than your current chart will result in a runtime error and the indicator will fail to load.

RSI Footprint Profile - Anchored Box Edition v2
いつも本インジケーターをご利用いただき、本当にありがとうございます!皆様の日々のトレードでのご活用とフィードバックが、このアップデートの実現に繋がりました。
今回の「v2」では、より実践的で視覚的にわかりやすいチャート分析をサポートするため、コアとなる描画エンジンとロジックを大幅に刷新しています。

主なアップデート内容

■時間軸ベース(Anchored)のボックス分割
過去の「固定バー本数」による区切りから、上位足(HTF)に基づく区切り(例:1Wで週ごと、1Mで月ごと)へと設計を完全移行しました。これにより、カレンダーの節目に合わせた正確なプロファイル分析が可能になります。

■プロファイル幅の動的正規化
各ボックスの期間の長さ(月による日数の違いなど)に合わせて、ヒストグラムの横幅がボックス内に美しく収まるように自動計算されるようになりました。チャートがよりクリーンに保たれます。

■RSI異常値(OB/OS)のライン延長機能
従来のPOC(最大出来高)ラインの延長に加え、RSIの買われすぎ(OB)・売られすぎ(OS)ゾーンのブロックも将来の価格帯へ延長できるようになりました。強力なサポート/レジスタンスの目安として機能します。

【重要】MTF(マルチタイムフレーム)時間設定に関するご注意
設定画面の「Footprint Data (LTF)」には、必ず現在表示しているチャートの時間足よりも短い時間(下位足)を指定してください。現在のチャートと同じ、またはそれ以上の長い時間足を指定すると、内部計算の仕様上エラーが発生してインジケーターが描画されなくなりますのでご注意ください。

版本注释
[English]
Update Details: RSI Footprint Profile v2.1.2
1. New Dual Calculation Engine
We have integrated two distinct calculation methods to suit different trading styles:
V1 Mode (Fixed Bars):
Logic: Uses bar_index - (bar_index % box_bars) - (p * box_bars).
Purpose: The modulo operator (%) forces the box to start at exact, repeating bar intervals. This is ideal for strategy backtesting where consistent bar counts are required for statistical reliability.
V2 Mode (HTF Timeframe):
Logic: Uses ta.change(time(box_tf)) to anchor the profile to calendar boundaries.
Purpose: Aligns the volume profile with time-based structures (e.g., weekly or monthly sessions), which is standard for institutional-grade market structure analysis.
2. Enhanced Runtime Safety
Feature: Implemented a strict check using timeframe.in_seconds to validate that the "Footprint Data (LTF)" is always shorter than the chart's current timeframe.
Benefit: This prevents calculation errors and indicator failure, ensuring stability even if you change chart timeframes dynamically.
[日本語]
アップデート詳細:RSI Footprint Profile v2.1.2
1. 新しいデュアル計算エンジン
異なるトレードスタイルに対応するため、2つの計算メソッドを統合しました。
V1モード(固定バー数):
ロジック: bar_index - (bar_index % box_bars) - (p * box_bars) を使用。
目的: 剰余演算子(%)により、現在のバーインデックスから必ず一定の間隔でボックスの起点を算出します。統計的信頼性が求められるバックテストや、一定のリズムでの分析に最適です。
V2モード(上位足アンカー):
ロジック: ta.change(time(box_tf)) を使用し、カレンダー時間にプロファイルを固定。
目的: 週足や月足といった「時間の節目」に合わせて出来高を可視化します。機関投資家レベルのマーケット構造分析において標準的な手法です。
2. 実行時安全性の強化
機能: timeframe.in_seconds を使用し、「Footprint Data (LTF)」が現在のチャート時間足よりも常に短いことを厳格にチェックします。
メリット: 計算エラーによるインジケーターの停止を未然に防ぎ、チャートの時間足を動的に変更しても安定して動作するように設計されています。
版本注释
[Important] Apology and Transition to Optimized Version (Lite) for "RSI Footprint Profile V2.1.2"

Thank you for using our indicator.

I am writing to sincerely apologize for critical calculation flaws and severe performance crashes identified in the currently published "V2.1.2". I deeply regret releasing a tool with incomplete logic that may have caused confusion in your market analysis.

I would also like to apologize regarding the recently published TradingView Idea. Although the core macro analysis (such as RSI extremes and volume voids) remains valid, I deeply regret publishing an Idea using a chart with inaccurate Footprint data.

To resolve these issues, an emergency update to a safe and stable "Lite Version" has been implemented. Below are the technical details of the bugs and calculation flaws.

■ Major Issues Identified

1. Lower Timeframe (LTF) Volume Misallocation (Loss of Profile Resolution)
There was a fatal logic flaw in the internal calculations meant to accurately display the Point of Control (POC).

Why the calculation was done (Intent):
To extract and classify exactly "at which price level" buying and selling occurred within the current timeframe (e.g., 1H) by pulling precise volume data from a lower timeframe (e.g., 5m).

Calculation Flaw:
When distributing this extracted volume into the price rows on the chart, the script ignored the LTF price data entirely. Instead, it executed the following formula, which divided the volume evenly across the entire High-Low range of the current candle:
[Formula] vol_per_row = (b_buy + b_sell) / rows_touched

Actual Output Values:
For example, inside a 1H candle (Low 100 JPY to High 150 JPY), suppose "a massive buy volume of 1,000" occurred specifically at the absolute bottom (100–105 JPY) on the 5m chart. Ideally, 1,000 should be recorded in the bottom block. However, the script outputted meaningless values by taking that 1,000 and spreading it evenly across all 50 rows between 100 and 150 JPY (outputting exactly 20 volume per row). This completely destroyed the core function of visualizing pinpoint resistance zones.

2. Indicator Crash (Timeout) in V2 Mode (HTF Anchoring)
In V2 Mode, which automatically anchored profiles to higher timeframes, the data processing volume completely exceeded TradingView's system limits.

Why the calculation was done (Intent):
To continuously update the profiles in real-time aligned with higher timeframe boundaries, such as Weekly or Monthly closes.

Calculation Flaw and Actual Error Output:
Within barstate.islast (every time the latest tick moves), a massive multiple-loop process was executed to look back across the entire historical period and redistribute volume row by row. For example, if V2 Mode "1W (Weekly)" was applied on a 5m chart, every single price tick triggered a calculation loop going back over ~6,000 candles and distributing them into 24 rows (tens of thousands of calculations instantly). As a result, this exceeded Pine Script's execution time limit (~500ms), outputting a "Study Error" and forcefully crashing/deleting the indicator from the chart.

■ Actions Taken in the Lite Version

To prevent the chart from freezing or the indicator from crashing, the following immediate actions were taken:

Completely removed the "V2 Mode (HTF Anchoring)" (the cause of the infinite loop) and the "LTF Security Call" (the cause of the inaccurate volume distribution).

Rebuilt the script as "V2.1.2 Lite", a lightweight and safe version that strictly uses the stable "V1 Mode (Fixed Bars)" drawing engine, utilizing the current timeframe's volume to form the profile reliably.

These were fatal mistakes that should have been caught during testing, and I deeply apologize for wasting your valuable time. Moving forward, I will prioritize stability and mathematical accuracy above all else. Thank you for your continued support.




【重要】「RSI Footprint Profile V2.1.2」に関するお詫びと最適化版(Lite)への移行について

日頃より当インジケーターをご利用いただき、誠にありがとうございます。

現在公開中の「V2.1.2」において、インジケーターの根幹に関わる計算の欠陥と、動作が停止する深刻なエラーが確認されました。不完全なロジックを含んだツールを公開し、皆様の分析に混乱を招いてしまったことを深くお詫び申し上げます。

また、先日公開した関連するトレードアイディア(急落後の真空地帯・底値に関する考察)においても、不正確な描写を含むチャートを掲載してしまいました。マクロな環境認識(RSIの極値や真空地帯というプライスアクション)の根拠自体は変わりませんが、精度の低いデータを用いて考察を発信してしまったことを重ねてお詫び申し上げます。

問題を解消し、安全に動作する「Lite版」への緊急アップデートを実施いたしました。発生していた問題の詳細と計算の欠陥について、以下の通り報告いたします。

■ 発生していた重大な問題

1. 下位足(LTF)出来高の均等割りエラー(プロファイルの解像度喪失)
最も取引された価格帯(POC)を正確に表示するための内部計算において、致命的なロジックの欠陥がありました。

・なぜその計算を行っていたか(意図)
現在表示している時間枠(例:1時間足)の中で発生した出来高を、より細かい下位足(例:5分足)のデータを用いて「どの価格帯で買い/売りが発生したか」を正確に抽出・分類するためです。

・計算の欠陥
抽出した出来高をチャートの価格帯(行)に振り分ける際、下位足の価格データを参照せず、現在のローソク足の高値・安値の幅で均等に分割する以下の数式が実行されていました。
[計算式] vol_per_row = (b_buy + b_sell) / rows_touched

・実際に出力されていた値
例えば1時間足(安値100円〜高値150円)の内部で、「100円〜105円の底値圏だけで1,000の強烈な買い出来高」が発生したとします。本来であれば一番下のブロックに1,000が記録されるべきですが、スクリプト上は100円〜150円のすべての価格帯(例えば50行)に対して、「全行に均等に20ずつ出来高を描画する」という無意味な値が出力されていました。これにより、ピンポイントな抵抗帯を視覚化するという本来の機能が失われていました。

2. V2モード(HTF連動)によるTradingViewの強制終了(処理タイムアウト)
上位足の期間に合わせてプロファイルを自動描画するV2モードにおいて、データ処理量がシステムの限界値を完全に超過していました。

・なぜその計算を行っていたか(意図)
週足や月足といった上位足の区切りに合わせて、リアルタイムでプロファイルを最新の状態に更新し続けるためです。

・計算の欠陥と実際の出力エラー
barstate.islast(最新のティックが動くタイミング)において、指定された全プロファイル期間のローソク足を遡り、行ごとに出来高を再配分する多重ループ処理が組まれていました。例えば5分足チャートで「週足(1W)」のV2モードを適用した場合、最新の価格が1ティック動くたびに「過去約6,000本のローソク足を24行に分配する」という数万回の計算ループが発生します。結果として、Pine Scriptの計算時間上限(約500ミリ秒)を超過し、「Study Error」を出力してインジケーターが完全に消滅(クラッシュ)する事態を引き起こしていました。

■ Lite版(修正版)での対応

チャートが重くて使えない、あるいはエラーで消えてしまうという事態を最優先で防ぐため、以下の対応を行いました。

・即死ループの原因となっていた「V2モード(HTF連動)」および、不正確な描画の原因となっていた「下位足(LTF)の参照ロジック」を完全に削除しました。
・安定して動作していた「V1モード(固定バー数)」の描画エンジンのみを残し、現在表示している時間軸の出来高を使用してプロファイルを形成する、軽量で安全な「V2.1.2 Lite」として再構築しました。

本来であれば検証段階で気づくべき致命的なミスであり、皆様の貴重な時間を奪ってしまったことを重ねてお詫び申し上げます。今後はツールの安定性と計算の正確性を第一に開発を進めてまいります。引き続きよろしくお願いいたします。

免责声明

这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。