OPEN-SOURCE SCRIPT
更新済 Simple MA TPO

Simple MA TPO
■Description
■Concept & Purpose
This indicator was developed with a single core concept: to discover the "true power" and foster a deeper understanding of the Time Price Opportunity (TPO) profile—often considered a super-tool in market analysis. By combining traditional TPO mechanics with market gravity (Moving Averages), this script aims to provide traders with a clearer, more visual representation of value and price deviation over time.
■Originality & How It Works
While traditional TPO profiles use letters (A, B, C...) to denote time periods and static colors for volume/time areas, this script introduces two highly original mechanics to add value to the community:
Sequential Numbering: Instead of letters, each TPO block is numbered sequentially (1, 2, 3...) based on its formation order. This drastically simplifies reading the flow of time within a session.
MA Deviation Gradient Coloring: The most unique feature is its coloring logic. TPO blocks are not colored randomly. Instead, their color is determined by their deviation from a baseline Moving Average (acting as the market's center of gravity).
■Calculations & Output
To ensure complete transparency in how the visual data is generated, here is the specific calculation used for the block colors:
Formula: Deviation % = ((Price / MA) - 1.0) * 100.0
Why this calculation? This calculates the exact percentage distance between the TPO block's price level and the baseline Moving Average at the time that specific block was formed. It visualizes how "overextended" the market was when time was spent at that price.
Actual Output: The output is a percentage float value (e.g., if the MA is $100 and the block price is $102, the output is 2.0 or 2%). This value is then clamped by the user-defined Max Deviation % input (default 2.0%).
Color Mapping: The clamped percentage is fed into a gradient. Negative deviations (undervalued relative to MA) shift towards Cyan, while positive deviations (overvalued) shift towards Magenta.
■How to Use
Identify Value Areas: Look for the "POC" (Point of Control) line, which indicates the price level where the most time (highest number of blocks) was spent.
Assess Reversion Risk: Blocks that are bright Magenta or bright Cyan indicate that time was spent far away from the Moving Average. Traders can use this to visually gauge if a breakout is sustainable or if a mean-reversion is likely.
Customize Your View: You can adjust the TPO timeframes (Daily/Weekly/Monthly), the block interval (e.g., 30 minutes), and choose your preferred MA type (SMA, EMA, WMA, HMA).
Disclaimer: This indicator is designed for educational and analytical purposes. TPO is a tool for understanding market structure and time spent at price levels, not a standalone trading signal generator. Past performance of price around value areas does not guarantee future results.
説明文
コンセプトと開発目的
このインジケーターは「相場分析におけるスーパーツールであるTPO(マーケットプロファイル)の真の力を見出し、深い理解を得る」というコアコンセプトのもとに開発されました。伝統的なTPOの仕組みと相場の重心(移動平均線)を融合させることで、時間の経過に伴う価値の推移と価格の乖離を、より視覚的かつ明確にトレーダーに提供します。
オリジナリティと機能
従来のTPOプロファイルは時間枠をアルファベット(A、B、C...)で表し、静的な色を使用しますが、このスクリプトはコミュニティに新たな付加価値を提供するために2つの独自機能を備えています。
連番表示: アルファベットの代わりに、各TPOブロックは形成された順番に沿って(1、2、3...)と連番で表示されます。これにより、セッション内での時間の流れを直感的に読み取ることが劇的に容易になります。
MA乖離率によるグラデーション着色: 最大の特徴はその着色ロジックです。TPOブロックは、相場の重心として機能する基準移動平均線(MA)からの「乖離率」に基づいて色が決定されます。
計算式と出力値の根拠
視覚データがどのように生成されているかを完全に透明化するため、ブロックの着色に使用されている具体的な計算式を明記します:
計算式: 乖離率(%) = ((価格 / MA) - 1.0) * 100.0
なぜこの計算なのか? この式は、特定のTPOブロックが形成された瞬間において、その価格水準が基準となる移動平均線からパーセンテージでどの程度離れているか(価格がどれほど伸びきっているか)を正確に測定するために使用されます。
実際の出力値: 出力はパーセンテージの浮動小数点数になります(例:MAが100ドルで、ブロックの価格が102ドルの場合、出力は 2.0 つまり2%になります)。この値は、ユーザーが設定した「最大の限界乖離率」(デフォルト2.0%)によって制限されます。
カラーマッピング: 制限されたパーセンテージはグラデーション関数に渡されます。マイナスの乖離(MAに対して割安)はシアン(水色)に近づき、プラスの乖離(割高)はマゼンタ(赤紫)に近づくように色が変化します。
使用方法
バリューエリアの特定: 最も多くの時間(ブロック数)が費やされた価格帯を示す「POC(Point of Control)」ラインを探し、相場の中心的価値を把握します。
平均回帰リスクの評価: 鮮やかなマゼンタやシアンのブロックは、移動平均線から遠く離れた場所で時間が費やされたことを示します。トレーダーはこれを視覚的な基準として、ブレイクアウトが持続可能か、あるいは平均回帰(MAへの戻り)が起こりやすいかを判断できます。
柔軟なカスタマイズ: TPOの期間(日/週/月)、ブロックの区切り(例:30分)、そして好みのMAタイプ(SMA、EMA、WMA、HMA)を自由に変更できます。
免責事項:このインジケーターは教育および分析目的で設計されています。TPOは市場構造と価格帯での滞在時間を理解するためのツールであり、単独の売買シグナルではありません。バリューエリア周辺での過去の価格動向は、将来の結果を保証するものではありません。
リリースノート
[UPDATE] Simple MA TPO - A Return to the Pioneers' Legacy & Complete Visual UI OverhaulIn this update, alongside the addition of core TPO (Market Profile) features, a fundamental revision regarding the indicator's "visibility" has been implemented.
■ A Developer's Realization and Respect for the Pioneers
Initially, I adopted a numerical format (1, 2, 3...) thinking it was the most intuitive way to track the sequence of blocks. However, through continuous live testing, I noticed a "fatal flaw."
That flaw is the limit of human color perception.
As the profile progresses and the gradient colors loop, it becomes impossible to instantly determine whether a block belongs to the first loop or the second when using sequential numbers. Furthermore, when numbers reach double digits, the text width expands, causing the block layout itself to break and create visual noise.
"Why did the traditional Market Profile adopt the Alphabet (uppercase/lowercase) instead of numbers?"
I finally arrived at this truth only after writing the code and hitting a wall myself.
By using the 52 characters from A to Z and a to z, the 24-hour market progression can be encoded into a single character without relying on color and without increasing the text width. I cannot help but feel deep gratitude and respect for the ultimate UI/UX reached by our predecessors and their highly rational, minimalist design philosophy.
■ Update Highlights
Based on this insight, the indicator has evolved into a more practical, noise-free version designed for ultimate usability.
Text Display Mode (Alphabet / Numbers)
The classic "Alphabet (A-Z, a-z)" format is now the default, with an option to switch back to the traditional numerical sequence via the settings.
Core Market Lines (VAH / VAL)
Automatically calculates and plots the Value Area High/Low, where 70% of the trading volume is concentrated.
Initial Balance (IB) Range
Plots the price exploration range at the beginning of the session, clarifying breakout thresholds.
Full Styling Customization (Styling & Visuals)
You can now freely customize the text size within the TPO boxes, as well as the colors and label sizes for the POC, VAH, and IB lines via the settings menu to perfectly match your monitor resolution and chart background. Rightward line extension (Extend) is also available.
Please try this new TPO, which strips away visual noise and allows you to read "time and price biases" far more intuitively.
【UPDATE】Simple MA TPO - 先人たちの偉業への回帰と、視覚UIの完全アップデート
今回のアップデートでは、TPO(マーケットプロファイル)のコア機能の追加に加え、インジケーターとしての「視認性」に関する根本的な見直しを行いました。
■ 開発者としての気づきと、先人たちへの敬意
開発当初、私は「ブロックの順番を把握するには、連番(1, 2, 3...)が最も分かりやすい」と考え、数字表記を採用していました。しかし、実戦で検証を重ねるうちに「致命的な欠陥」に気づきました。
それは、人間の「色彩認知能力の限界」です。
プロファイルが進行し、グラデーションの色がループして再び同じ色が来た時、数字が連番のままでは「これは前半のループの色なのか、後半のループの色なのか」が瞬時に判断できなくなります。さらに、数字が2桁になるとテキスト幅が広がり、ブロックのレイアウト自体が崩れてしまうノイズも発生しました。
「なぜ、昔からあるマーケットプロファイルは数字ではなく『アルファベット(大文字・小文字)』を採用しているのか?」
自分でコードを組み、壁にぶつかって初めてその真理に辿り着きました。
A〜Z、a〜zの52文字を使えば、色に頼ることなく、桁数を増やすこともなく、24時間の市場の推移を1文字にエンコードできる。先人たちが到達していたUI/UXの極致と、無駄を削ぎ落とした合理的な設計思想に対し、今はただ深い感謝と敬意を禁じ得ません。
■ アップデートのハイライト
この知見をもとに、より実戦的でノイズのない「使いやすさ」を追求したバージョンへと進化しました。
テキスト表記モードの追加(Alphabet / Numbers)
クラシックな「アルファベット(A-Z, a-z)」表記をデフォルトとし、従来の連番表記と設定から切り替えられるようにしました。
市場のコアを捉える追加ライン(VAH / VAL)
全取引の70%が集中する「価値領域(Value Area)」を自動計算し、上限と下限を描画します。
Initial Balance (IB) Range
セッション序盤の価格探索レンジを描画し、ブレイクアウトの基準を明確にします。
スタイリングの完全カスタマイズ(Styling & Visuals)
ユーザーの環境(モニター解像度やチャート背景色)に合わせて、TPOボックス内の文字サイズ、POC・VAH・IBラインの色とラベルサイズを、設定画面から自由にカスタマイズできるようになりました。各ラインの右側への延長(Extend)も可能です。
視覚的ノイズを削ぎ落とし、より直感的に「時間と価格の偏り」を読み取れるようになった新しいTPOを、ぜひお試しください。
リリースノート
【V2 Release】Simple MA TPO - Single Prints & Core Optimizations
A massive thank you to everyone who uses this indicator! Thanks to your practical feedback, we are thrilled to release "V2", bringing you closer to professional Market Profile analysis.
■Key V2 Features & Updates
Single Prints Identification: We've introduced the highly requested Single Prints feature! The indicator now visually highlights price rows where only a single TPO block was printed. These low-liquidity zones serve as excellent references for future price rejection or gap fills.
Critical Bug Fix (LTF Settings): Fixed a hardcoding issue with Lower Timeframe (LTF) data retrieval. You can now safely customize the LTF input without crashing the script on lower timeframe charts.
Full Styling Control: You now have complete freedom to customize the text size of TPO boxes, as well as the colors and label sizes for POC, VAH/VAL, and IB lines.
IMPORTANT: Please Check Your MTF Time Settings
In the indicator settings, please ensure that your "LTF (Footprint)" is strictly lower than your current chart's timeframe. (e.g., If you are viewing a 1H chart, set the LTF to 15m or 5m). Setting it to the same or a higher timeframe will cause a runtime error, and the indicator will fail to load.
【V2 リリース】Simple MA TPO - シングルプリント追加&最適化
いつも本インジケーターをご利用いただき、本当にありがとうございます!皆様の実践的なフィードバックのおかげで、より本格的なTPO分析が可能になる「V2」をリリースすることができました。
V2の主な新機能とアップデート
シングルプリント(Single Prints)の描画機能: 本格的なマーケットプロファイル分析に不可欠な、流動性の低い真空地帯(1ブロックしか印字されなかった価格帯)を視覚的にハイライトする機能を追加しました。将来の反発や埋め戻しの目安として強力に機能します。
致命的なエラーの修正(LTF設定): 下位足(LTF)データの取得処理を最適化し、ユーザーが任意の時間足を安全に設定できるように修正しました。
スタイリングの完全統合: TPOボックスの文字サイズや、POC・VAH/VAL・IBラインの色とラベルサイズを完全にカスタマイズできるようになりました。
【重要】MTF(マルチタイムフレーム)時間設定にご注意ください
設定内の「LTF (Footprint)」には、必ず現在表示しているチャートの時間足よりも短い時間足を指定してください。(例:1時間足チャートを表示している場合は、LTFを15分や5分に設定する)。現在のチャートと同じ、またはそれ以上の時間を指定するとエラーとなりインジケーターが表示されなくなります。
リリースノート
Update: Improved visual presentation with a cleaner chart snapshot for better clarity. No changes to the core logic.オープンソーススクリプト
TradingViewの精神に則り、このスクリプトの作者はコードをオープンソースとして公開してくれました。トレーダーが内容を確認・検証できるようにという配慮です。作者に拍手を送りましょう!無料で利用できますが、コードの再公開はハウスルールに従う必要があります。
Script Developer.
I specialize in pushing basic, fundamental concepts to their absolute limits. Dedicated to engineering noise-free indicators that reveal true market mechanics and logical edges. Clarity over https://clutter.https://www.youtube.com/@alt.analyst
I specialize in pushing basic, fundamental concepts to their absolute limits. Dedicated to engineering noise-free indicators that reveal true market mechanics and logical edges. Clarity over https://clutter.https://www.youtube.com/@alt.analyst
免責事項
これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。
オープンソーススクリプト
TradingViewの精神に則り、このスクリプトの作者はコードをオープンソースとして公開してくれました。トレーダーが内容を確認・検証できるようにという配慮です。作者に拍手を送りましょう!無料で利用できますが、コードの再公開はハウスルールに従う必要があります。
Script Developer.
I specialize in pushing basic, fundamental concepts to their absolute limits. Dedicated to engineering noise-free indicators that reveal true market mechanics and logical edges. Clarity over https://clutter.https://www.youtube.com/@alt.analyst
I specialize in pushing basic, fundamental concepts to their absolute limits. Dedicated to engineering noise-free indicators that reveal true market mechanics and logical edges. Clarity over https://clutter.https://www.youtube.com/@alt.analyst
免責事項
これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。