OPEN-SOURCE SCRIPT
ที่อัปเดต: Market Environment Analyzer

■ Overview
This indicator acts as your personal market analyst, automatically outputting a comprehensive "market environment" report directly on your chart. Instead of a simple scoring system, it uses a meticulously constructed logic tree to understand the market's "context," providing objective and contradiction-free analysis just like a professional trader would in their mind.
■ The Core Feature: The "Subtraction" Logic
To solve common indicator flaws—like MACD fakeouts in ranging markets or oscillator traps (staying overbought/oversold) during strong trends—this system features the ability to intentionally ignore unnecessary indicators depending on the context.
Hyper-Trend Restriction: When ADX exceeds 40 (anomalous trend), the system deems oscillators (RSI/Stoch) as "paralyzed" and warns against dangerous counter-trend signals.
Dead Range Exclusion: When ADX drops below 20 (dead volatility), MACD crossovers are flagged as "noise/fakeouts," and their internal logic evaluation is skipped.
■ 5 Blocks of Analysis
Spatial Analysis: Evaluates macro trends and current phases (pullbacks, ranges, etc.) based on Moving Averages (20/50/200) alignment (Perfect Order) and price positioning.
Volatility & Momentum: Measures market heat using ATR and trend propulsion via ADX.
Internal Logic: Analyzes vector synchronization between MACD and DMI, including high-resolution momentum acceleration/deceleration via MACD histograms.
Local Stress: Combines RSI, Stochastics, and Bollinger Bands (±2σ, ±3σ) to calculate local overbought/oversold conditions and support/resistance.
Final Verdict: Synthesizes the macro context and local stress to provide optimal strategies like "Buy the Dip," "Avoid Chasing," or "Stand Aside."
--------
■ Overview (UK English)
This indicator serves as your bespoke market strategist, automatically generating a comprehensive "market environment" brief directly onto your chart. Rather than relying on a rudimentary scoring system, it utilises a meticulously constructed logic tree to interpret the market's "context," delivering objective and contradiction-free analysis akin to the mindset of an institutional trader in the City.
■ The Core Feature: The Philosophy of "Subtraction"
To resolve common indicator flaws—such as MACD whipsaws in ranging markets or oscillator traps during fierce trends—this system is equipped to intentionally disregard redundant indicators based on the prevailing context.
Hyper-Trend Restriction: When ADX exceeds 40 (runaway trend), the system deems oscillators (RSI/Stoch) "paralysed" and explicitly warns against perilous counter-trend operations.
Dead Range Exclusion: When ADX falls below 20 (stagnant volatility), MACD crossovers are identified as "noise," and their internal vector analysis is entirely skipped.
■ 5 Blocks of Analysis
Spatial Analysis: Evaluates macro trends and current phases (retracements, consolidations) based on Moving Averages (20/50/200) alignment and price structure.
Volatility & Momentum: Measures market heat using ATR and trend propulsion via ADX.
Internal Logic: Analyses vector synchronisation between MACD and DMI, detailing momentum acceleration or deceleration via MACD histograms.
Local Stress: Synthesises RSI, Stochastics, and Bollinger Bands (±2σ, ±3σ) to gauge local overheating and key support/resistance zones.
Final Verdict: Combines the macro context with local stress to deliver actionable intelligence such as "Buy the Dip," "Do Not Chase," or "Stand Aside."
--------
■ 概要 (Japanese)
このインジケーターは、現在の相場環境を複数のテクニカル指標から総合的に読み解き、プロのトレーダーが頭の中で行っている「環境認識」をテキストレポートとしてチャート上に自動出力するシステムです。単なる点数制ではなく、緻密に構築された論理ツリーにより相場の「文脈(コンテキスト)」を理解し、矛盾のない客観的な分析結果を提示します。
■ 最大の特徴:「プロの引き算」ロジック
多くのインジケーターが抱える「レンジ相場でのMACDのダマシ」や「強いトレンド相場でのオシレーターの張り付き(逆張りの罠)」を解決するため、本システムは状況に応じて**【不要な指標をあえて無視する】**機能を搭載しています。
ハイパートレンド時の機能制限: ADXが40を超える異常なトレンド相場では、オシレーター(RSI/Stoch)の買われすぎ・売られすぎ判定を「機能不全(張り付き)」とみなし、危険な逆張りシグナルを警告・遮断します。
デッドレンジ時の評価除外: ADXが20を下回るボラティリティの死んだ相場では、MACD等の追従指標によるクロスを「ノイズ(ダマシ)」と判定し、内部ロジックの評価をスキップします。
■ 5つの解析ブロック
空間認識: 移動平均線(20/50/200)の並び(パーフェクトオーダー等)と価格の位置関係から、大局のトレンドと現在のフェーズ(押し目・戻り・レンジ等)を判定。
市場熱量とモメンタム: ATRによるボラティリティと、ADXによるトレンドの推進力を計測。
内部ロジック解析: MACDとDMIのベクトル同期に加え、MACDヒストグラムの増減から「モメンタムの加速/減速」まで高解像度に分析。
局所ストレス: RSI、ストキャスティクス、ボリンジャーバンド(±2σ, ±3σ)を複合し、局所的な過熱感とサポート/レジスタンスを算出。
総合判定: 上位の文脈と局所ストレスを掛け合わせ、「押し目買い」「突っ込み売り警戒」「ノートレード」などの最適解を提示。
This indicator acts as your personal market analyst, automatically outputting a comprehensive "market environment" report directly on your chart. Instead of a simple scoring system, it uses a meticulously constructed logic tree to understand the market's "context," providing objective and contradiction-free analysis just like a professional trader would in their mind.
■ The Core Feature: The "Subtraction" Logic
To solve common indicator flaws—like MACD fakeouts in ranging markets or oscillator traps (staying overbought/oversold) during strong trends—this system features the ability to intentionally ignore unnecessary indicators depending on the context.
Hyper-Trend Restriction: When ADX exceeds 40 (anomalous trend), the system deems oscillators (RSI/Stoch) as "paralyzed" and warns against dangerous counter-trend signals.
Dead Range Exclusion: When ADX drops below 20 (dead volatility), MACD crossovers are flagged as "noise/fakeouts," and their internal logic evaluation is skipped.
■ 5 Blocks of Analysis
Spatial Analysis: Evaluates macro trends and current phases (pullbacks, ranges, etc.) based on Moving Averages (20/50/200) alignment (Perfect Order) and price positioning.
Volatility & Momentum: Measures market heat using ATR and trend propulsion via ADX.
Internal Logic: Analyzes vector synchronization between MACD and DMI, including high-resolution momentum acceleration/deceleration via MACD histograms.
Local Stress: Combines RSI, Stochastics, and Bollinger Bands (±2σ, ±3σ) to calculate local overbought/oversold conditions and support/resistance.
Final Verdict: Synthesizes the macro context and local stress to provide optimal strategies like "Buy the Dip," "Avoid Chasing," or "Stand Aside."
--------
■ Overview (UK English)
This indicator serves as your bespoke market strategist, automatically generating a comprehensive "market environment" brief directly onto your chart. Rather than relying on a rudimentary scoring system, it utilises a meticulously constructed logic tree to interpret the market's "context," delivering objective and contradiction-free analysis akin to the mindset of an institutional trader in the City.
■ The Core Feature: The Philosophy of "Subtraction"
To resolve common indicator flaws—such as MACD whipsaws in ranging markets or oscillator traps during fierce trends—this system is equipped to intentionally disregard redundant indicators based on the prevailing context.
Hyper-Trend Restriction: When ADX exceeds 40 (runaway trend), the system deems oscillators (RSI/Stoch) "paralysed" and explicitly warns against perilous counter-trend operations.
Dead Range Exclusion: When ADX falls below 20 (stagnant volatility), MACD crossovers are identified as "noise," and their internal vector analysis is entirely skipped.
■ 5 Blocks of Analysis
Spatial Analysis: Evaluates macro trends and current phases (retracements, consolidations) based on Moving Averages (20/50/200) alignment and price structure.
Volatility & Momentum: Measures market heat using ATR and trend propulsion via ADX.
Internal Logic: Analyses vector synchronisation between MACD and DMI, detailing momentum acceleration or deceleration via MACD histograms.
Local Stress: Synthesises RSI, Stochastics, and Bollinger Bands (±2σ, ±3σ) to gauge local overheating and key support/resistance zones.
Final Verdict: Combines the macro context with local stress to deliver actionable intelligence such as "Buy the Dip," "Do Not Chase," or "Stand Aside."
--------
■ 概要 (Japanese)
このインジケーターは、現在の相場環境を複数のテクニカル指標から総合的に読み解き、プロのトレーダーが頭の中で行っている「環境認識」をテキストレポートとしてチャート上に自動出力するシステムです。単なる点数制ではなく、緻密に構築された論理ツリーにより相場の「文脈(コンテキスト)」を理解し、矛盾のない客観的な分析結果を提示します。
■ 最大の特徴:「プロの引き算」ロジック
多くのインジケーターが抱える「レンジ相場でのMACDのダマシ」や「強いトレンド相場でのオシレーターの張り付き(逆張りの罠)」を解決するため、本システムは状況に応じて**【不要な指標をあえて無視する】**機能を搭載しています。
ハイパートレンド時の機能制限: ADXが40を超える異常なトレンド相場では、オシレーター(RSI/Stoch)の買われすぎ・売られすぎ判定を「機能不全(張り付き)」とみなし、危険な逆張りシグナルを警告・遮断します。
デッドレンジ時の評価除外: ADXが20を下回るボラティリティの死んだ相場では、MACD等の追従指標によるクロスを「ノイズ(ダマシ)」と判定し、内部ロジックの評価をスキップします。
■ 5つの解析ブロック
空間認識: 移動平均線(20/50/200)の並び(パーフェクトオーダー等)と価格の位置関係から、大局のトレンドと現在のフェーズ(押し目・戻り・レンジ等)を判定。
市場熱量とモメンタム: ATRによるボラティリティと、ADXによるトレンドの推進力を計測。
内部ロジック解析: MACDとDMIのベクトル同期に加え、MACDヒストグラムの増減から「モメンタムの加速/減速」まで高解像度に分析。
局所ストレス: RSI、ストキャスティクス、ボリンジャーバンド(±2σ, ±3σ)を複合し、局所的な過熱感とサポート/レジスタンスを算出。
総合判定: 上位の文脈と局所ストレスを掛け合わせ、「押し目買い」「突っ込み売り警戒」「ノートレード」などの最適解を提示。
Release Note
■ Overview (US English)This system comprehensively reads the current market environment from multiple technical indicators and automatically outputs the context as a text report directly on your chart.
Instead of a mere scoring system, it utilizes a constructed logic tree to analyze the market context and provide objective results.
■ Core Feature: Logic
To solve common indicator flaws such as "fakeouts in ranging markets" and "oscillators sticking in strong trends," it features the ability to intentionally ignore unnecessary indicators depending on the situation.
Hyper-Trend Restriction:
In abnormal trends where the ADX exceeds 40, oscillator overbought/oversold states are deemed "dysfunctional" to warn against and block dangerous counter-trend signals.
Dead Range Exclusion:
In dead volatility markets where the ADX falls below 20, crosses from lagging indicators like MACD are deemed "noise," and internal logic evaluation is skipped.
■ 5 Analysis Blocks
Spatial Analysis:
Determines the macro trend and current phase based on moving average alignment and price positioning.
Market Heat & Momentum:
Measures volatility using ATR and trend propulsion using ADX.
Internal Logic Analysis:
Analyzes MACD and DMI vector synchronization, alongside momentum acceleration/deceleration from MACD histogram fluctuations.
Local Stress:
Combines RSI, Stochastics, and Bollinger Bands to calculate local overheating and support/resistance.
Final Verdict:
Synthesizes the macro context and local stress to present optimal solutions such as "Buy the dip," "Beware of chasing shorts," or "No trade."
■ Update & Bug Fix
2026/04/13
Fixed a time lag in the multi-timeframe analysis where the script was fetching the previous closed bar (historical data) instead of the currently forming candlestick.
■ Overview (UK English)
This system comprehensively interprets the current market environment from multiple technical indicators and automatically generates the context as a text report directly onto your chart.
Rather than a rudimentary scoring system, it utilises a meticulously constructed logic tree to analyse the market context and deliver objective results.
■ Core Feature: Logic
To resolve common indicator flaws such as "whipsaws in ranging markets" and "oscillators sticking in fierce trends," it is equipped to intentionally disregard redundant indicators depending on the situation.
Hyper-Trend Restriction:
In anomalous trends where the ADX exceeds 40, oscillator overbought/oversold states are deemed "dysfunctional" to warn against and block perilous counter-trend signals.
Dead Range Exclusion:
In stagnant volatility markets where the ADX falls below 20, crosses from lagging indicators like MACD are identified as "noise," and internal vector evaluation is entirely skipped.
■ 5 Analysis Blocks
Spatial Analysis:
Evaluates the macro trend and current phase based on moving average alignment and price structure.
Market Heat & Momentum:
Measures volatility using ATR and trend propulsion using ADX.
Internal Logic Analysis:
Analyses MACD and DMI vector synchronisation, detailing momentum acceleration/deceleration via MACD histogram fluctuations.
Local Stress:
Synthesises RSI, Stochastics, and Bollinger Bands to gauge local overheating and support/resistance zones.
Final Verdict:
Combines the macro context and local stress to deliver actionable intelligence such as "Buy the dip," "Beware of chasing shorts," or "Stand aside."
■ Update & Bug Fix
13/04/2026
Addressed a time lag in the multi-timeframe analysis where the script retrieved the previous closed bar (historical data) rather than the actively forming candlestick.
■ 概要 (Japanese)
現在の相場環境を複数のテクニカル指標から総合的に読み解き
環境認識をテキストレポートとしてチャート上に自動出力するシステムです。
単なる点数制ではなく、構築された論理ツリーにより相場のコンテキストを分析し、
客観的な分析結果を提示します。
■ 最大の特徴:ロジック
多くのインジケーターが抱える「レンジ相場でのダマシ」や「強いトレンド相場でのオシレーターの張り付き」を解決するため、状況に応じて不要な指標をあえて無視する機能を搭載しています。
ハイパートレンド時の機能制限:
ADXが40を超える異常なトレンド相場では、オシレーターの買われすぎ・売られすぎ判定を
「機能不全」とみなし、危険な逆張りシグナルを警告・遮断します。
デッドレンジ時の評価除外:
ADXが20を下回るボラティリティの死んだ相場では、
MACD等の追従指標によるクロスを「ノイズ」と判定し、内部ロジックの評価をスキップします。
■ 5つの解析ブロック
空間認識: 移動平均線の並びと価格の位置関係から、
大局のトレンドと現在のフェーズを判定。
市場熱量とモメンタム:
ATRによるボラティリティと、ADXによるトレンドの推進力を計測。
内部ロジック解析:
MACDとDMIのベクトル同期に加え、
MACDヒストグラムの増減から「モメンタムの加速/減速」まで分析。
局所ストレス:
RSI、ストキャスティクス、ボリンジャーバンドを複合し、
局所的な過熱感とサポート/レジスタンスを算出。
総合判定:
上位の文脈と局所ストレスを掛け合わせ、
「押し目買い」「突っ込み売り警戒」「ノートレード」などの最適解を提示。
■ アップデート&バグ修正
2026/04/13
マルチタイムフレーム分析において
現在形成中のローソク足ではなく
1本前の確定足(過去のデータ)を取得してしまうタイムラグを修正しました。
Release Note
bug fixสคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน