Pure Matrix Profile [TPO & Link]Pure Matrix Profile
Description:
This indicator is a highly visual, ASCII-based environment recognition tool designed to map market structure, liquidity, and momentum within specific sessions. It is NOT a standalone entry signal generator. Rather, it provides a deep situational awareness of "price wall thickness" (Volume) and "market heat" (RSI) to help traders build robust defensive and offensive strategies.
1. Pine Script Limitations & Memory Management
In Pine Script, there is an absolute limit of 500 historical objects (Boxes, Labels, Lines) per script to prevent system overload, regardless of your account tier (Basic, Pro, Premium).
• Remaining Quota: 0 (This script maximizes the 500 limit for detailed rendering).
• How it works: To bypass this limitation and maintain a beautiful UI without crashing, the script uses a professional garbage collection technique (barstate.islast). It deletes all previous objects and recalculates/redraws the entire matrix exclusively on the most recent bar, ensuring optimal performance within the limits.
2. Core Calculations & Output Values
The visual beauty of this tool is driven by strict mathematical logic.
A. Price Bin Resolution (vp_step)
vp_step = (top_y - bot_y) / row_count
• Why: To divide the session's high-low range into equal tiers to distribute volume accurately.
• Output: A float value representing the price width of a single text row.
B. Binning (Data Assignment)
bin_idx = Math.floor( (c_price - bot_y) / vp_step )
• Why: To determine exactly which vertical "box" (row) the volume belongs to.
C. Volume-Weighted RSI (Heat)
Avg_RSI = Sum(Current_RSI * Volume) / Sum(Volume)
• Why: This reveals the true momentum only where significant institutional money was traded.
D. Histogram Normalization (Bottom-Up Heights)
val = (chunk_vol / max_chunk_vol) * hist_height
• Why: To normalize raw volume into a fixed visual height constraint for the bottom ASCII histogram.
E. ASCII Texture Logic (Wall Hardness)
The "density" of the ASCII character changes dynamically based on the Avg_RSI:
• Overheated (Avg_RSI >= 60): Renders "█" (Full Block). Represents a "Hard Wall" with strong momentum.
• Neutral (Avg_RSI 40.1 - 59.9): Renders "▒" (Medium Shade). Represents stable consolidation.
• Freezing (Avg_RSI <= 40): Renders "░" (Light Shade). Represents a "Soft Wall" with weak momentum.
3. Pros (Merits)
• Visualizing "Hardness": By combining volume depth and RSI texture, you can intuitively differentiate between strong support/resistance zones (Hard Walls) and fragile ones (Soft Walls).
• Risk Management: Helps prevent trading directly into "Hard Walls" or getting trapped in low-liquidity vacuums.
4. Cons (Limitations)
• Not an Entry Strategy: Provides zero edge as a standalone trigger.
• Lagging Nature: Session profiles form after the price has moved.
• Visual Clutter: High row counts on small screens may cause text overlap.
Japanese Description
このインジケーターは、特定のセッション内における市場構造、流動性、モメンタムをマッピングするための、ASCIIベースの視覚的な環境認識ツールです。これは単体でエントリーシグナルを生成するものではありません。トレーダーが堅牢な戦略を構築できるよう、「価格の壁の分厚さ(出来高)」と「相場の熱(RSI)」の状況認識を提供します。
1. 描画制限とメモリ管理について
Pine Scriptには、システム負荷を防ぐため、アカウントランクに関わらず1スクリプトにつき描写オブジェクトの最大上限が「500個」に厳格に設定されています。
・ 現在の残量: 0個(精密な描画のため、この500個の枠を最大限使い切る設定にしています)。
・ 動作の仕組み: 高度なメモリ管理(barstate.islast)を行っています。最新のローソク足でのみ過去のオブジェクトを全削除し、必要な分だけを一気に再計算して描き直すことで、制限枠内で安定稼働させています。
2. コアとなる計算式と出力値の解剖
A. 価格帯をスライスする計算 (VP Step)
vp_step = (top_y - bot_y) / row_count
・ なぜこの計算なのか: セッションの高安値を指定した行数で均等に分割し、1行あたりの価格幅を決定するため。
B. ローソク足の格納先判定 (Binning)
bin_idx = Math.floor( (c_price - bot_y) / vp_step )
・ なぜこの計算なのか: 出来高を正しい価格帯(行)に割り当てるため。
C. 出来高加重RSI(熱量の算出)
Avg_RSI = Sum(Current_RSI * Volume) / Sum(Volume)
・ なぜこの計算なのか: 大口の取引(出来高)が集中した価格帯のモメンタムだけを抽出するため。
D. ボトムヒストグラムの高さ計算 (Normalization)
val = (chunk_vol / max_chunk_vol) * hist_height
・ なぜこの計算なのか: 出来高を、指定した最大の高さ(行数)に正規化して当てはめるため。
E. ASCIIテクスチャ・ロジック(壁の硬度)
Avg_RSIの値に基づいて、描画される文字の密度(硬さ)が3段階で変化します。
・ 加熱帯 (RSI 60以上): 「█」(フルブロック)を描画。モメンタムを伴う「硬い壁」を意味します。
・ 中立帯 (RSI 40.1 - 59.9): 「▒」(ミディアムシェード)を描画。安定した攻防が行われているゾーンです。
・ 冷却帯 (RSI 40以下): 「░」(ライトシェード)を描画。モメンタムが弱まっている「柔らかい壁」を意味します。
3. メリット(優位性)
・ 壁の硬度の視覚化: 出来高の厚みとRSIのテクスチャを組み合わせることで、突破困難な「硬い壁」と、崩れやすい「柔らかい壁」を直感的に判別できます。
・ 無駄な被弾の回避: 強力な壁への無謀な突撃を防ぐための強力な環境認識根拠となります。
4. デメリット(限界と注意点)
・ エントリー戦略にはならない: 本ツール単体ではエントリーの優位性は一切ありません。
・ 遅行指標の性質: プロファイルは価格が動いた「後」に形成されます。
・ 視覚的なノイズ: 低解像度の環境で行数を大きく設定しすぎるとテキストが重なります。
אינדיקטור Pine Script®






















