OPEN-SOURCE SCRIPT
Market State Momentum Oscillator

Market State Momentum Oscillator (MSMO)
Overview
The MSMO combines three elements in one panel:
Momentum oscillator (gray/blue area with aqua signal line)
Market State filter (green/red background area)
Money Flow Index (orange line)
Works on all markets and all timeframes. Non-repainting at bar close.
Colors and meaning
Gray area: Momentum above 0 (bullish bias)
Blue area: Momentum below 0 (bearish bias)
Aqua line: Signal line smoothing the oscillator
Green background: Market state bullish (price above moving average)
Red background: Market state bearish (price below moving average)
Orange line: Money Flow Index (volume-weighted momentum)
How to use
Always wait for confirmation of the green or red market state before acting.
Trend alignment: Watch the slope of the Weekly and Daily 200 MA and Weekly and Daily 50 MA to understand higher-timeframe trend direction. Trade only in alignment with the broader trend.
Entries:
Long: Green state + gray histogram rising + MFI trending up
Short: Red state + blue histogram falling + MFI trending down
Exits: Histogram crossing back through 0, or state background flips against the position.
Users can add chart alerts on plot crossings if needed.
Inputs
Lengths for oscillator pivot, signal smoothing, state moving average, trend weight, return %, and Money Flow Index. Defaults work for most charts.
Note
Educational use only. Not financial advice.
Tags
trend, oscillator, market state, momentum, money flow, crypto, forex, stocks, indices, futures
Overview
The MSMO combines three elements in one panel:
Momentum oscillator (gray/blue area with aqua signal line)
Market State filter (green/red background area)
Money Flow Index (orange line)
Works on all markets and all timeframes. Non-repainting at bar close.
Colors and meaning
Gray area: Momentum above 0 (bullish bias)
Blue area: Momentum below 0 (bearish bias)
Aqua line: Signal line smoothing the oscillator
Green background: Market state bullish (price above moving average)
Red background: Market state bearish (price below moving average)
Orange line: Money Flow Index (volume-weighted momentum)
How to use
Always wait for confirmation of the green or red market state before acting.
Trend alignment: Watch the slope of the Weekly and Daily 200 MA and Weekly and Daily 50 MA to understand higher-timeframe trend direction. Trade only in alignment with the broader trend.
Entries:
Long: Green state + gray histogram rising + MFI trending up
Short: Red state + blue histogram falling + MFI trending down
Exits: Histogram crossing back through 0, or state background flips against the position.
Users can add chart alerts on plot crossings if needed.
Inputs
Lengths for oscillator pivot, signal smoothing, state moving average, trend weight, return %, and Money Flow Index. Defaults work for most charts.
Note
Educational use only. Not financial advice.
Tags
trend, oscillator, market state, momentum, money flow, crypto, forex, stocks, indices, futures
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
CJ
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
CJ
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。