OPEN-SOURCE SCRIPT
Advanced Market Theory

ADVANCED MARKET THEORY (AMT)
This is not an indicator. It is a lens through which to see the true nature of the market.
Welcome to the definitive application of Auction Market Theory. What you have before you is the culmination of decades of market theory, fused with state-of-the-art data analysis and visual engineering. It is an institutional-grade intelligence engine designed for the serious trader who seeks to move beyond simplistic indicators and understand the fundamental forces that drive price.
This guide is your complete reference. Read it. Study it. Internalize it. The market is a complex story, and this tool is the language with which to read it.
PART I: THE GRAND THEORY - A UNIVERSE IN AN AUCTION
To understand the market, you must first understand its purpose. The market is a mechanism of discovery, organized by a continuous, two-way auction.
This foundational concept was pioneered by the legendary trader J. Peter Steidlmayer at the Chicago Board of Trade in the 1980s. He observed that beneath the chaotic facade of ticking prices lies a beautifully organized structure. The market's primary function is not to go up or down, but to facilitate trade by seeking a price level that encourages the maximum amount of interaction between buyers and sellers. This price is "value."
The Organizing Principle: The Normal Distribution
Over any given period, the market's activity will naturally form a bell curve (a normal distribution) turned on its side. This is the blueprint of the auction.
The Point of Control (POC): This is the peak of the bell curve—the single price level where the most trade occurred. It represents the point of maximum consensus, the "fairest price" as determined by the market participants. It is the gravitational center of the session.
The Value Area (VA): This is the heart of the bell curve, typically containing 70% of the session's activity (one standard deviation). This is the zone of "accepted value." Prices within this area are considered fair and are where the market is most comfortable conducting business.
The Extremes: The thin areas at the top and bottom of the curve are the "unfair" prices. These are levels where one side of the auction (buyers at the top, sellers at the bottom) was shut off, and trade was quickly rejected. These are areas of emotional trading and excess.
The Narrative of the Day: Balance vs. Imbalance
Every trading session is a story of the market's search for value.
Balance: When the market rotates and builds a symmetrical, bell-shaped profile, it is in a state of balance. Buyers and sellers are in agreement, and the market is range-bound.
Imbalance: When the market moves decisively away from a balanced area, it is in a state of imbalance. This is a trend. The market is actively seeking new information and a new area of value because the old one was rejected.
Your Purpose as a Trader
Your job is to read this story in real-time. Are we in balance or imbalance? Is the auction succeeding or failing at these new prices? The Advanced Market Theory engine is your Rosetta Stone to translate this complex narrative into actionable intelligence.
PART II: THE AMT ENGINE - AN EVOLUTION IN MARKET VISION
A standard market profile tool shows you a picture. The AMT Engine gives you the architect's full schematics, the engineer's stress tests, and the psychologist's behavioral analysis, all at once.
This is what makes it the Advanced Market Theory. We have fused the timeless principles with layers of modern intelligence:
TRINITY ANALYSIS: You can view the market through three distinct lenses. A Volume Profile shows where the money traded. A TPO (Time) Profile shows where the market spent its time. The revolutionary Hybrid Profile fuses both, giving you a complete picture of market conviction—marrying volume with duration.
AUTOMATED STRUCTURAL DECODING: The engine acts as your automated analyst, identifying critical structural phenomena in real-time:
Poor Highs/Lows: Weak auction points that signal a high probability of reversal.
Single Prints & Ledges: Footprints of rapid, aggressive market moves and areas of strong institutional acceptance.
Day Type Classification: The engine analyzes the session's personality as it develops ("Trend Day," "Normal Day," etc.), allowing you to adapt your strategy to the market's current character.
MACRO & MICRO FUSION: Via the Composite Profile, the engine merges weeks of data to reveal the major institutional battlegrounds that govern long-term price action. You can see the daily skirmish and the multi-month war on a single chart.
ORDER FLOW INTELLIGENCE: The ultimate advancement is the integrated Cumulative Volume Delta (CVD) engine. This moves beyond structure to analyze the raw aggression of buyers versus sellers. It is your window into the market's soul, automatically detecting critical Divergences that often precede major trend shifts.
ADAPTIVE SIGNALING: The engine's signal generation is not static; it is a thinking system. It evaluates setups based on a multi-factor Confluence Score, understands the market Regime (e.g., High Volatility), and adjusts its own confidence (Probability %) based on the complete context.
This is not a tool that gives you signals. This is a tool that gives you understanding.
PART III: THE VISUAL KEY - A LEXICON OF MARKET STRUCTURE
Every element on your chart is a piece of information. This is your guide to reading it fluently.
--- THE CORE ARCHITECTURE ---
The Profile Histogram: The primary visual on the left of each session. Its shape is the story. A thin profile is a trend; a fat, symmetrical profile is balance.
Blue Box [Value Area]: The zone of accepted, "fair" value. The heart of the session's business.
Bright Orange Line & Label [POC]: The Point of Control. The gravitational center. The price of maximum consensus. The most significant intraday level.
Dashed Blue Lines & Labels [VAH/VAL]: The boundaries of value. Critical inflection points where the market decides to either remain in balance or seek value elsewhere.
Dashed Cyan Lines & Labels [Composite Levels]: The major, long-term structural levels derived from weeks of data. These are institutional reference points and carry immense weight. Treat them as primary support and resistance.
Dashed Orange Lines & Labels [Poor High/Low]: Marks a Poor or Unfinished Auction. These represent emotional, weak extremes and are high-probability targets for future price action.
Diamond Markers [◆ SP]: Mark Single Prints, which are footprints of aggressive, one-sided moves that left a "liquidity vacuum." Price is often drawn back to these levels to "repair" the poor structure.
Arrow Markers [◄ LDG]: Mark Ledges, which are areas of strong horizontal acceptance. They often act as powerful support/resistance in the future.
Dotted Gray Lines & Labels [IB Projections]: The projected daily range based on multiples of the Initial Balance. Use them to set realistic profit targets and gauge the day's potential.
--- THE SIGNAL SUITE ---
Colored Triangles [▲ ▼]: These are your high-probability entry signals. The color is a strategic playbook:
Gold Triangle [🔶]: ELITE Signal. An A+ setup with overwhelming confluence. This is the highest quality signal the engine can produce.
Yellow Triangle [🟡]: FADE Signal. A counter-trend setup against an exhausted move at a structural extreme.
Cyan Triangle [💧]: BREAKOUT Signal. A momentum setup attempting to capitalize on a breakout from the value area.
Purple Triangle [🟣]: ROTATION Signal. A mean-reversion setup within the value area, typically from one edge towards the POC.
Magenta Triangle [💓]: LIQUIDITY Signal. A sophisticated setup that identifies a "stop run" or liquidity sweep.
Percentage [%] Number: The engine's calculated probability of success. This is not a guarantee, but a data-driven confidence score.
Dotted Gray Line: The signal's Entry Price.
Dashed Green Lines: The calculated Take Profit Targets.
Dashed Red Line: The calculated Stop Loss level.
PART IV: THE DASHBOARD - YOUR STRATEGIC COMMAND CENTER
The dashboard is your real-time intelligence briefing. It synthesizes all the engine's analysis into a clear, concise, and constantly updating summary.
--- CURRENT SESSION ---
POC, VAH, VAL: The live values for the core structure.
Profile Shape: Is the current auction top-heavy (b-shaped), bottom-heavy (P-shaped), or balanced (D-shaped)?
VA Width: Is the value area expanding (trending) or contracting (balancing)?
Day Type: The engine's judgment on the day's personality. Use this to select the right strategy.
IB Range & POC Trend: Key metrics for understanding the opening sentiment and its evolution.
--- CVD ANALYSIS ---
Session CVD: The raw order flow. Is there more net buying or selling pressure in this session?
CVD Trend & DIVERGENCE: This is your order flow intelligence. Is the order flow confirming the price action? If "DIVERGENCE" flashes, it is a critical, high-alert warning of a potential reversal.
--- MARKET METRICS ---
Volume, ATR, RSI: Your standard contextual metrics, providing a quick read on activity, volatility, and momentum.
Regime: The engine's assessment of the broad market environment: High Volatility (favor breakouts), Low Volatility (favor mean reversion), or Normal.
--- PROFILE STATS, COMPOSITE, & STRUCTURE ---
These sections give you a quick quantitative summary of the profile structure, the major long-term Composite levels, and any active Poor Structures.
--- SIGNAL TYPES & ACTIVE SIGNAL ---
A permanent key to the signal colors and their meanings, along with the full details of the most recent active signal: its Type, Probability, Entry, Stop, and Target.
PART V: THE INPUTS MENU - CALIBRATING YOUR LENS
This engine is designed to be calibrated to your specific needs as a trader. Every input is a lever. This is not a "one size fits all" tool. The extensive tooltips are your built-in user manual, but here are the key areas of focus:
--- MARKET PROFILE ENGINE ---
Profile Mode: This is the most fundamental choice. Volume is the standard for price-based support and resistance. TPO is for analyzing time-based acceptance. Hybrid is the professional's choice, fusing both for a complete picture.
Profile Resolution: This is your zoom lens. Lower values for scalping and intraday precision. Higher values for a cleaner, big-picture view suitable for swing trading.
Composite Sessions: Your timeframe for macro analysis. 5-10 sessions for a weekly view; 20-30 sessions for a monthly, structural view.
--- SESSION & VALUE AREA ---
These settings must be configured correctly for your specific asset. The Session times are critical. The Initial Balance should reflect the key opening period for your market (60 minutes is standard for equities).
--- SIGNAL ENGINE & RISK MANAGEMENT ---
Signal Mode: THIS IS YOUR PERSONAL RISK PROFILE. Set it to Conservative to see only the absolute best A+ setups. Use Elite or Balanced for a standard approach. Use Aggressive only if you are an experienced scalper comfortable with managing more frequent, lower-probability setups.
ATR Multipliers: This suite gives you full, dynamic control over your risk/reward parameters. You can precisely define your initial stop loss distance and profit targets based on the market's current volatility.
A FINAL WORD FROM THE ARCHITECT
The creation of this engine was a journey into the very heart of market dynamics. It was born from a frustrating truth: that the most profound market theories were often confined to books and expensive institutional platforms, inaccessible to the modern retail trader. The goal was to bridge that gap.
The challenge was monumental. Making each discrete system—the volume profile, the TPO counter, the composite engine, the CVD tracker, the signal generator, the dynamic dashboard—work was a task in itself. But the true struggle, the frustrating, painstaking process that consumed countless hours, was making them work in unison. It was about ensuring the CVD analysis could intelligently inform the signal engine, that the day type classification could adjust the probability scores, and that the composite levels could provide context to the intraday structure, all in a seamless, real-time dance of data.
This engine is the result of that relentless pursuit of integration. It is built on the belief that a trader's greatest asset is not a signal, but clarity. It was designed to clear the noise, to organize the chaos, and to present the elegant, underlying logic of the market auction so that you can make better, more informed, and more confident decisions.
It is now in your hands. Use it not as a crutch, but as a lens. See the market for what it truly is.
"The market can remain irrational longer than you can remain solvent."
- John Maynard Keynes
DISCLAIMER
This script is an advanced analytical tool provided for informational and educational purposes only. It is not financial advice. All trading involves substantial risk, and past performance is not indicative of future results. The signals, probabilities, and metrics generated by this indicator do not constitute a recommendation to buy or sell any financial instrument. You, the user, are solely responsible for all trading decisions, risk management, and outcomes. Use this tool to supplement your own analysis and trading strategy.
PUBLISHING CATEGORIES
Volume Profile
Market Profile
Order Flow
This is not an indicator. It is a lens through which to see the true nature of the market.
Welcome to the definitive application of Auction Market Theory. What you have before you is the culmination of decades of market theory, fused with state-of-the-art data analysis and visual engineering. It is an institutional-grade intelligence engine designed for the serious trader who seeks to move beyond simplistic indicators and understand the fundamental forces that drive price.
This guide is your complete reference. Read it. Study it. Internalize it. The market is a complex story, and this tool is the language with which to read it.
PART I: THE GRAND THEORY - A UNIVERSE IN AN AUCTION
To understand the market, you must first understand its purpose. The market is a mechanism of discovery, organized by a continuous, two-way auction.
This foundational concept was pioneered by the legendary trader J. Peter Steidlmayer at the Chicago Board of Trade in the 1980s. He observed that beneath the chaotic facade of ticking prices lies a beautifully organized structure. The market's primary function is not to go up or down, but to facilitate trade by seeking a price level that encourages the maximum amount of interaction between buyers and sellers. This price is "value."
The Organizing Principle: The Normal Distribution
Over any given period, the market's activity will naturally form a bell curve (a normal distribution) turned on its side. This is the blueprint of the auction.
The Point of Control (POC): This is the peak of the bell curve—the single price level where the most trade occurred. It represents the point of maximum consensus, the "fairest price" as determined by the market participants. It is the gravitational center of the session.
The Value Area (VA): This is the heart of the bell curve, typically containing 70% of the session's activity (one standard deviation). This is the zone of "accepted value." Prices within this area are considered fair and are where the market is most comfortable conducting business.
The Extremes: The thin areas at the top and bottom of the curve are the "unfair" prices. These are levels where one side of the auction (buyers at the top, sellers at the bottom) was shut off, and trade was quickly rejected. These are areas of emotional trading and excess.
The Narrative of the Day: Balance vs. Imbalance
Every trading session is a story of the market's search for value.
Balance: When the market rotates and builds a symmetrical, bell-shaped profile, it is in a state of balance. Buyers and sellers are in agreement, and the market is range-bound.
Imbalance: When the market moves decisively away from a balanced area, it is in a state of imbalance. This is a trend. The market is actively seeking new information and a new area of value because the old one was rejected.
Your Purpose as a Trader
Your job is to read this story in real-time. Are we in balance or imbalance? Is the auction succeeding or failing at these new prices? The Advanced Market Theory engine is your Rosetta Stone to translate this complex narrative into actionable intelligence.
PART II: THE AMT ENGINE - AN EVOLUTION IN MARKET VISION
A standard market profile tool shows you a picture. The AMT Engine gives you the architect's full schematics, the engineer's stress tests, and the psychologist's behavioral analysis, all at once.
This is what makes it the Advanced Market Theory. We have fused the timeless principles with layers of modern intelligence:
TRINITY ANALYSIS: You can view the market through three distinct lenses. A Volume Profile shows where the money traded. A TPO (Time) Profile shows where the market spent its time. The revolutionary Hybrid Profile fuses both, giving you a complete picture of market conviction—marrying volume with duration.
AUTOMATED STRUCTURAL DECODING: The engine acts as your automated analyst, identifying critical structural phenomena in real-time:
Poor Highs/Lows: Weak auction points that signal a high probability of reversal.
Single Prints & Ledges: Footprints of rapid, aggressive market moves and areas of strong institutional acceptance.
Day Type Classification: The engine analyzes the session's personality as it develops ("Trend Day," "Normal Day," etc.), allowing you to adapt your strategy to the market's current character.
MACRO & MICRO FUSION: Via the Composite Profile, the engine merges weeks of data to reveal the major institutional battlegrounds that govern long-term price action. You can see the daily skirmish and the multi-month war on a single chart.
ORDER FLOW INTELLIGENCE: The ultimate advancement is the integrated Cumulative Volume Delta (CVD) engine. This moves beyond structure to analyze the raw aggression of buyers versus sellers. It is your window into the market's soul, automatically detecting critical Divergences that often precede major trend shifts.
ADAPTIVE SIGNALING: The engine's signal generation is not static; it is a thinking system. It evaluates setups based on a multi-factor Confluence Score, understands the market Regime (e.g., High Volatility), and adjusts its own confidence (Probability %) based on the complete context.
This is not a tool that gives you signals. This is a tool that gives you understanding.
PART III: THE VISUAL KEY - A LEXICON OF MARKET STRUCTURE
Every element on your chart is a piece of information. This is your guide to reading it fluently.
--- THE CORE ARCHITECTURE ---
The Profile Histogram: The primary visual on the left of each session. Its shape is the story. A thin profile is a trend; a fat, symmetrical profile is balance.
Blue Box [Value Area]: The zone of accepted, "fair" value. The heart of the session's business.
Bright Orange Line & Label [POC]: The Point of Control. The gravitational center. The price of maximum consensus. The most significant intraday level.
Dashed Blue Lines & Labels [VAH/VAL]: The boundaries of value. Critical inflection points where the market decides to either remain in balance or seek value elsewhere.
Dashed Cyan Lines & Labels [Composite Levels]: The major, long-term structural levels derived from weeks of data. These are institutional reference points and carry immense weight. Treat them as primary support and resistance.
Dashed Orange Lines & Labels [Poor High/Low]: Marks a Poor or Unfinished Auction. These represent emotional, weak extremes and are high-probability targets for future price action.
Diamond Markers [◆ SP]: Mark Single Prints, which are footprints of aggressive, one-sided moves that left a "liquidity vacuum." Price is often drawn back to these levels to "repair" the poor structure.
Arrow Markers [◄ LDG]: Mark Ledges, which are areas of strong horizontal acceptance. They often act as powerful support/resistance in the future.
Dotted Gray Lines & Labels [IB Projections]: The projected daily range based on multiples of the Initial Balance. Use them to set realistic profit targets and gauge the day's potential.
--- THE SIGNAL SUITE ---
Colored Triangles [▲ ▼]: These are your high-probability entry signals. The color is a strategic playbook:
Gold Triangle [🔶]: ELITE Signal. An A+ setup with overwhelming confluence. This is the highest quality signal the engine can produce.
Yellow Triangle [🟡]: FADE Signal. A counter-trend setup against an exhausted move at a structural extreme.
Cyan Triangle [💧]: BREAKOUT Signal. A momentum setup attempting to capitalize on a breakout from the value area.
Purple Triangle [🟣]: ROTATION Signal. A mean-reversion setup within the value area, typically from one edge towards the POC.
Magenta Triangle [💓]: LIQUIDITY Signal. A sophisticated setup that identifies a "stop run" or liquidity sweep.
Percentage [%] Number: The engine's calculated probability of success. This is not a guarantee, but a data-driven confidence score.
Dotted Gray Line: The signal's Entry Price.
Dashed Green Lines: The calculated Take Profit Targets.
Dashed Red Line: The calculated Stop Loss level.
PART IV: THE DASHBOARD - YOUR STRATEGIC COMMAND CENTER
The dashboard is your real-time intelligence briefing. It synthesizes all the engine's analysis into a clear, concise, and constantly updating summary.
--- CURRENT SESSION ---
POC, VAH, VAL: The live values for the core structure.
Profile Shape: Is the current auction top-heavy (b-shaped), bottom-heavy (P-shaped), or balanced (D-shaped)?
VA Width: Is the value area expanding (trending) or contracting (balancing)?
Day Type: The engine's judgment on the day's personality. Use this to select the right strategy.
IB Range & POC Trend: Key metrics for understanding the opening sentiment and its evolution.
--- CVD ANALYSIS ---
Session CVD: The raw order flow. Is there more net buying or selling pressure in this session?
CVD Trend & DIVERGENCE: This is your order flow intelligence. Is the order flow confirming the price action? If "DIVERGENCE" flashes, it is a critical, high-alert warning of a potential reversal.
--- MARKET METRICS ---
Volume, ATR, RSI: Your standard contextual metrics, providing a quick read on activity, volatility, and momentum.
Regime: The engine's assessment of the broad market environment: High Volatility (favor breakouts), Low Volatility (favor mean reversion), or Normal.
--- PROFILE STATS, COMPOSITE, & STRUCTURE ---
These sections give you a quick quantitative summary of the profile structure, the major long-term Composite levels, and any active Poor Structures.
--- SIGNAL TYPES & ACTIVE SIGNAL ---
A permanent key to the signal colors and their meanings, along with the full details of the most recent active signal: its Type, Probability, Entry, Stop, and Target.
PART V: THE INPUTS MENU - CALIBRATING YOUR LENS
This engine is designed to be calibrated to your specific needs as a trader. Every input is a lever. This is not a "one size fits all" tool. The extensive tooltips are your built-in user manual, but here are the key areas of focus:
--- MARKET PROFILE ENGINE ---
Profile Mode: This is the most fundamental choice. Volume is the standard for price-based support and resistance. TPO is for analyzing time-based acceptance. Hybrid is the professional's choice, fusing both for a complete picture.
Profile Resolution: This is your zoom lens. Lower values for scalping and intraday precision. Higher values for a cleaner, big-picture view suitable for swing trading.
Composite Sessions: Your timeframe for macro analysis. 5-10 sessions for a weekly view; 20-30 sessions for a monthly, structural view.
--- SESSION & VALUE AREA ---
These settings must be configured correctly for your specific asset. The Session times are critical. The Initial Balance should reflect the key opening period for your market (60 minutes is standard for equities).
--- SIGNAL ENGINE & RISK MANAGEMENT ---
Signal Mode: THIS IS YOUR PERSONAL RISK PROFILE. Set it to Conservative to see only the absolute best A+ setups. Use Elite or Balanced for a standard approach. Use Aggressive only if you are an experienced scalper comfortable with managing more frequent, lower-probability setups.
ATR Multipliers: This suite gives you full, dynamic control over your risk/reward parameters. You can precisely define your initial stop loss distance and profit targets based on the market's current volatility.
A FINAL WORD FROM THE ARCHITECT
The creation of this engine was a journey into the very heart of market dynamics. It was born from a frustrating truth: that the most profound market theories were often confined to books and expensive institutional platforms, inaccessible to the modern retail trader. The goal was to bridge that gap.
The challenge was monumental. Making each discrete system—the volume profile, the TPO counter, the composite engine, the CVD tracker, the signal generator, the dynamic dashboard—work was a task in itself. But the true struggle, the frustrating, painstaking process that consumed countless hours, was making them work in unison. It was about ensuring the CVD analysis could intelligently inform the signal engine, that the day type classification could adjust the probability scores, and that the composite levels could provide context to the intraday structure, all in a seamless, real-time dance of data.
This engine is the result of that relentless pursuit of integration. It is built on the belief that a trader's greatest asset is not a signal, but clarity. It was designed to clear the noise, to organize the chaos, and to present the elegant, underlying logic of the market auction so that you can make better, more informed, and more confident decisions.
It is now in your hands. Use it not as a crutch, but as a lens. See the market for what it truly is.
"The market can remain irrational longer than you can remain solvent."
- John Maynard Keynes
DISCLAIMER
This script is an advanced analytical tool provided for informational and educational purposes only. It is not financial advice. All trading involves substantial risk, and past performance is not indicative of future results. The signals, probabilities, and metrics generated by this indicator do not constitute a recommendation to buy or sell any financial instrument. You, the user, are solely responsible for all trading decisions, risk management, and outcomes. Use this tool to supplement your own analysis and trading strategy.
PUBLISHING CATEGORIES
Volume Profile
Market Profile
Order Flow
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
Empowering everyday traders and DAFE Trading Systems
DAFETradingSystems.com
DAFETradingSystems.com
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
Empowering everyday traders and DAFE Trading Systems
DAFETradingSystems.com
DAFETradingSystems.com
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。