OPEN-SOURCE SCRIPT
업데이트됨

Stochastic Momentum Index - SMI | TR

974
🎯 Overview
Stochastic Momentum Index - SMI | TR is a refined momentum oscillator that measures the position of the closing price relative to the midpoint of the recent high-low range. Developed by Tiagorocha1989, this enhanced version of William Blau's Stochastic Momentum Index offers dual-mode operation with moving average customization and comprehensive visual features, helping traders identify momentum shifts, overbought and oversold conditions, and potential reversal points with greater precision than traditional stochastic oscillators.

🔧 How It Works
The Stochastic Momentum Index (SMI) is an evolution of the traditional stochastic oscillator. While standard stochastic measures where price closes within the recent high-low range, the SMI measures where price closes relative to the midpoint of that range, providing a more balanced view of momentum.

Core Calculation Logic:
The indicator calculates the SMI using the standard stochastic formula:

Stochastic = (Current Close - Lowest Low) / (Highest High - Lowest Low) × 100

Where the highest high and lowest low are determined over the specified Length SMI period

The resulting oscillator oscillates between 0 and 100, with:

Readings above 50 indicating price is closing in the upper half of the recent range (bullish momentum)

Readings below 50 indicating price is closing in the lower half of the recent range (bearish momentum)

Readings above 80 suggesting overbought conditions

Readings below 20 suggesting oversold conditions

The indicator compares SMI to a reference line that can be either:

The traditional 50 level (centerline)

A user-defined moving average of the SMI itself (SMI MA mode)

✨ Key Features
🔹 Dual Operating Modes
50 Level Mode: Classic SMI implementation where signals occur when the SMI crosses above or below the 50 centerline, indicating momentum shifts

SMI MA Mode: Enhanced version where signals occur when SMI crosses its own moving average, providing smoother, filtered entries

🔹 Flexible Moving Average Selection
Choose from six MA types for the SMI MA mode:

EMA (Exponential Moving Average) for responsive signals

SMA (Simple Moving Average) for smoother readings

RMA (Rolling Moving Average) for weighted recent data

WMA (Weighted Moving Average) for customizable weighting

VWMA (Volume-Weighted Moving Average) incorporating volume

HMA (Hull Moving Average) for reduced lag

🔹 Customizable SMI Parameters
Length SMI: Lookback period for SMI calculation (default 101)

Source SMI: Price source for calculations (default Close)

🔹 Extended Lookback Period
The default length of 101 makes this version particularly suitable for longer-term trend identification and filtering out short-term market noise.

🔹 Customizable Color Themes
Eight distinct color schemes to match your charting preferences:

Classic – Green for bullish, Red for bearish

Modern – White for bullish, Purple for bearish

Robust – Amber for bullish, Maroon for bearish

Accented – Violet for bullish, Pink for bearish

Monochrome – Light gray for bullish, Dark gray for bearish

Moderate – Green for bullish, Red for bearish

Aqua – Blue for bullish, Orange for bearish

Cosmic – Pink for bullish, Purple for bearish

🔹 Comprehensive Visual Feedback
Colored SMI Line: Changes color based on position relative to the reference line

Signal Line: Yellow line showing 50 or MA reference

Gradient Fill Zones: Clear visualization of overbought (above 80) and oversold (below 20) conditions

Dynamic Zone Fills: Semi-transparent fills showing when SMI is above or below the reference line

Color-Coded Candles: Bars reflect current SMI bias (above or below reference)

Signal Markers: Triangle up/down symbols at crossover points

Live Value Display: Current SMI value shown in a floating label

Trend Table: Bullish/Bearish status displayed on the chart

🔹 Ready-to-Use Alerts
Built-in alert conditions trigger LONG signals on bullish crossovers and SHORT signals on bearish crossunders across both operating modes.

⚙️ Settings Summary
Color Choice: Select from eight visual themes (Default: Classic)

Length SMI: Lookback period for SMI calculation (Default: 101)

Source SMI: Price source for calculations (Default: Close)

Entry/Exit Signal: Choose between 50 level or SMI MA mode (Default: 50)

Length MA: Moving average period for SMI MA mode (Default: 365)

SMI MA Type: Moving average method for signal line (Default: EMA)

📈 Practical Applications
🔹 Overbought/Oversold Detection
Traditional SMI usage identifies extreme conditions:

Readings above 80 suggest overbought conditions and potential reversal down

Readings below 20 suggest oversold conditions and potential reversal up

The indicator provides gradient fills in these zones for visual clarity

The long default period (101) makes these signals more significant and less frequent

🔹 Centerline Crossovers
In 50 Level mode, crossovers provide momentum signals:

Crossover above 50 → Bullish momentum strengthening

Crossunder below 50 → Bearish momentum strengthening

These signals often confirm trend direction changes

🔹 Signal Line Crossovers
In SMI MA mode, crossovers between SMI and its moving average provide filtered signals that reduce whipsaws in ranging markets while maintaining sensitivity in trends.

🔹 Divergence Trading
SMI is excellent for spotting divergences:

Bullish Divergence: Price makes lower low, SMI makes higher low → Potential upside reversal

Bearish Divergence: Price makes higher high, SMI makes lower high → Potential downside reversal

Divergences are most significant when occurring at extreme levels (above 80 or below 20)

🔹 Trend Confirmation
The position of SMI relative to 50 confirms trend direction:

SMI consistently above 50 confirms uptrend

SMI consistently below 50 confirms downtrend

The extended 101-period length ensures these signals reflect meaningful trends

🔹 Momentum Reversal Signals
Watch for SMI turning up from oversold levels or turning down from overbought levels:

Turn up from below 20 → Potential bullish reversal

Turn down from above 80 → Potential bearish reversal

🔹 Multiple Timeframe Analysis
Compare SMI readings across different timeframes:

Higher timeframe SMI confirms primary trend direction

Lower timeframe SMI identifies entry timing and short-term momentum

🎯 Ideal For
✅ Long-Term Traders seeking to identify major trend shifts with reduced noise

✅ Swing Traders wanting to capture medium to long-term momentum shifts

✅ Divergence Traders looking for reliable reversal signals

✅ Position Traders needing confirmation of trend strength and direction

✅ System Developers needing robust, smoothed momentum signals

✅ Trend Followers wanting to avoid false signals in choppy markets

📌 Key Takeaways
Extended Lookback Period: The default length of 101 makes this indicator particularly effective for filtering out short-term noise and identifying significant trend movements

Midpoint Focus: By measuring price relative to the midpoint of the range (rather than just the range extremes), SMI provides a more balanced view of momentum than traditional stochastic

Dual-Mode Flexibility: Choose between classic 50-level crossovers for traditional signals or MA-smoothed signals for filtered entries

Comprehensive Visualization: Color themes, gradient fills for overbought/oversold zones, candles, and labels provide immediate market awareness

Divergence Capability: Excellent for spotting both regular and hidden divergences that signal trend reversals or continuations

Alert-Ready: Built-in alerts for both LONG and SHORT signals across both operating modes

⚠️ Important Notes
The long default length (101) makes this SMI variant much smoother than traditional stochastic settings (typically 14). This reduces false signals but also makes the indicator slower to react to short-term price changes. The 365-day MA default in SMI MA mode is designed for longer-term trend context on daily charts. Readings above 80 and below 20 are significant but may persist during strong trends; consider combining with trend filters. Divergences are most reliable when they occur at extreme readings. Always combine with proper risk management and additional confirmation for best results.

Disclaimer: This indicator is provided for educational and informational purposes only. Past performance is not indicative of future results. Always conduct thorough testing and align with your risk management strategy before live deployment.
릴리즈 노트
Resolution Previous Problem
릴리즈 노트
Resolution Previous Problem
릴리즈 노트
Color Mode – Added 'Heat' option ([#ff0000, #87cefb]).

Dynamic Fill Transparency – Calculates Momentum and Norm_Momentum to set a variable transparency (Fill_Transp) for the overbought/oversold fills, replacing the fixed 0/100 values.

Gradient Candle Colors – Computes a normalized and uses color.from_gradient() to color candles with a smooth transition between down and up colors.

Persistent Trend State – Introduces Trend_ (1 for bull, -1 for bear) that holds the trend direction, used in:

The third fill() (now based on Trend_ instead of a direct.

bgcolor() (now uses Trend_ instead of isBull_/isBear_).

The table and label (display and color based on Trend_).

Label Color – Simplified to use Trend_ colors without transparency.
릴리즈 노트
.

면책사항

해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.