OPEN-SOURCE SCRIPT
MomentumIndex (Oscillator)

The "MomentumIndex" is an oscillator designed to measure the market's internal energy (supply-demand imbalance) and visually capture the moment when the consensus among market participants reaches a state of "extreme fear."
By combining it with the "MarketGoingIndex"—which forecasts the broader market phase—it helps identify high-precision entry points. The logic behind the indicator and specific methods for its use are explained below.
**Core Logic of MomentumIndex**
Rather than tracking individual stock prices, this indicator measures the "pace of the overall market," helping you grasp the true market environment while filtering out false signals (whipsaws).
**Base Data: A/D Difference (Advance-Decline Difference)**
It calculates the difference between the number of advancing stocks and declining stocks across the entire NYSE market (USI:ADD). This allows you to detect "illusory bull markets"—where the index is propped up by only a handful of large-cap stocks—and instead capture the actual underlying flow of capital into and out of the market.
**Calculation Method: 3-Week Simple Moving Average (SMA)**
To smooth out daily noise (such as volatility caused by sudden news events), a 3-period moving average based on weekly data is used. This clarifies the direction of the medium-term trend and indicates whether the market is overheating.
**Anti-Repaint Processing**
Strict "look-ahead prevention" (lookahead_off) is applied to ensure that signals are not retroactively rewritten during historical data analysis (backtesting).
**Signal Interpretation and Visual Alerts**
When the indicator crosses one of the two preset threshold lines, the chart background changes color to signal that it is time to prepare for a potential entry.
・**Light Green Illumination (Threshold: -1000 or lower)**
**Meaning:** Indicates that the entire market is under broad selling pressure and has entered a "caution zone" suggesting it is "Oversold."
**Action:** This does not constitute an immediate buy signal. Rather than jumping in right away, treat this as a preparation phase to look for buy signals in stocks identified as potential candidates. Light Pink Indicator (Threshold: -1500 or lower)
Meaning: This indicator is set to signal a state of "extreme pessimism" (selling climax)—a point where market participants are in a panic and panic selling has reached its peak.
Action: This light pink signal is designed to help you identify the "Buying Juncture"—the optimal moment offering the lowest risk and the greatest potential for a subsequent rebound.
Practical Application (In conjunction with the MarketGoingIndex)
While it functions as an oscillator on its own, its true power is realized when used alongside macro indicators.
Waiting for Timing Alignment
Look for a period where the "MarketGoingIndex" (orange line) overlaid on the main chart forms a trough and begins to turn upward (signaling an improvement in the macro environment).
Alert for Finding Entry Points
The moment the market plunges and the MomentumIndex lights up in light pink (-1500 or lower)—while the aforementioned macro turnaround signal is active—marks the time when the system's high-probability entry conditions are met. Once you identify this point where "macro tailwinds" converge with "micro-level oversold conditions," you can look for a buy signal (such as Vstop) and consider entering a long position.
By combining it with the "MarketGoingIndex"—which forecasts the broader market phase—it helps identify high-precision entry points. The logic behind the indicator and specific methods for its use are explained below.
**Core Logic of MomentumIndex**
Rather than tracking individual stock prices, this indicator measures the "pace of the overall market," helping you grasp the true market environment while filtering out false signals (whipsaws).
**Base Data: A/D Difference (Advance-Decline Difference)**
It calculates the difference between the number of advancing stocks and declining stocks across the entire NYSE market (USI:ADD). This allows you to detect "illusory bull markets"—where the index is propped up by only a handful of large-cap stocks—and instead capture the actual underlying flow of capital into and out of the market.
**Calculation Method: 3-Week Simple Moving Average (SMA)**
To smooth out daily noise (such as volatility caused by sudden news events), a 3-period moving average based on weekly data is used. This clarifies the direction of the medium-term trend and indicates whether the market is overheating.
**Anti-Repaint Processing**
Strict "look-ahead prevention" (lookahead_off) is applied to ensure that signals are not retroactively rewritten during historical data analysis (backtesting).
**Signal Interpretation and Visual Alerts**
When the indicator crosses one of the two preset threshold lines, the chart background changes color to signal that it is time to prepare for a potential entry.
・**Light Green Illumination (Threshold: -1000 or lower)**
**Meaning:** Indicates that the entire market is under broad selling pressure and has entered a "caution zone" suggesting it is "Oversold."
**Action:** This does not constitute an immediate buy signal. Rather than jumping in right away, treat this as a preparation phase to look for buy signals in stocks identified as potential candidates. Light Pink Indicator (Threshold: -1500 or lower)
Meaning: This indicator is set to signal a state of "extreme pessimism" (selling climax)—a point where market participants are in a panic and panic selling has reached its peak.
Action: This light pink signal is designed to help you identify the "Buying Juncture"—the optimal moment offering the lowest risk and the greatest potential for a subsequent rebound.
Practical Application (In conjunction with the MarketGoingIndex)
While it functions as an oscillator on its own, its true power is realized when used alongside macro indicators.
Waiting for Timing Alignment
Look for a period where the "MarketGoingIndex" (orange line) overlaid on the main chart forms a trough and begins to turn upward (signaling an improvement in the macro environment).
Alert for Finding Entry Points
The moment the market plunges and the MomentumIndex lights up in light pink (-1500 or lower)—while the aforementioned macro turnaround signal is active—marks the time when the system's high-probability entry conditions are met. Once you identify this point where "macro tailwinds" converge with "micro-level oversold conditions," you can look for a buy signal (such as Vstop) and consider entering a long position.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。