OPEN-SOURCE SCRIPT
DeMarker (DeM)

The DeMarker (DeM) indicator is a momentum oscillator designed to identify overbought and oversold conditions by comparing the most recent price extremes (highs and lows) to those of the previous candle. It moves between 0 and 1 and is especially useful for spotting potential trend reversals, exhaustion, and better-timed entries within larger trends.
How the DeMarker works
The DeMarker focuses on the relationship between today’s highs and lows and those of the previous bar:
• When price is pushing to new highs but not making significantly lower lows, DeM tends to rise toward 1, reflecting buying pressure and potential overbought conditions.
• When price is making lower lows but not significantly higher highs, DeM falls toward 0, reflecting selling pressure and potential oversold conditions.
Internally, the indicator measures the positive difference between the current high and the previous high (up-move strength) and the positive difference between the previous low and the current low (down-move strength). These values are smoothed over a user-defined period and combined into a ratio that keeps the output bounded between 0 and 1, making it easy to interpret visually.
Default settings and parameters
Typical default settings are aimed at providing a balance between responsiveness and noise reduction:
• Length: 14
• Overbought level: 0.7
• Oversold level: 0.3
With these settings, readings above 0.7 suggest that the market may be overheated to the upside, while readings below 0.3 suggest potential exhaustion on the downside. Traders can adjust these parameters depending on their style and the volatility of the asset.
Example configurations
Here are a few practical configurations that can be suggested to users:
• Swing trading setup:
• Length: 14–21
• Overbought: 0.7–0.75
• Oversold: 0.25–0.3 This works well on 4H and daily charts for spotting potential swing highs and lows.
• Short-term intraday setup:
• Length: 7–10
• Overbought: 0.8
• Oversold: 0.2 A shorter length increases sensitivity, better for 5–15 minute charts, but also increases the number of signals.
• Trend-following filter:
• Length: 20–30
• Overbought: 0.65–0.7
• Oversold: 0.3–0.35 This smoother configuration can be used together with moving averages to filter trades in the direction of the main trend.
Basic trading usage
Traders commonly use DeMarker in three main ways:
• Mean-reversion entries:
• Look for DeM below the oversold level (for example, 0.3 or 0.25) while price is approaching a support zone.
• Consider long entries when DeM turns back up and crosses above the oversold level, ideally confirmed by a bullish candle pattern or break of minor resistance.
• Taking profits or trimming positions:
• When DeM moves above the overbought level (for example, 0.7–0.8) near a known resistance level, traders may choose to take partial profits or tighten stops.
• A downward turn from overbought after a strong rally often signals momentum exhaustion.
• Divergence signals:
• Bullish divergence: price makes a lower low while DeM makes a higher low. This can hint at weakening downside momentum and a possible reversal upward.
• Bearish divergence: price makes a higher high while DeM makes a lower high. This can warn of weakening upside momentum before a pullback.
Combining with other tools
DeMarker often performs best as part of a confluence-based approach rather than as a standalone signal generator:
• Combine with trend filters:
• Use a moving average (for example, 50 or 200 EMA) to define trend direction and take DeM oversold entries only in uptrends, or overbought entries only in downtrends.
• Use with support/resistance and price action:
• Prioritize DeM signals that occur near well-defined horizontal levels, trendlines, or supply/demand zones.
• Add volume or volatility tools:
• Strong signals tend to appear when DeM reverses from extreme zones in sync with a volume spike or volatility contraction/expansion.
How the DeMarker works
The DeMarker focuses on the relationship between today’s highs and lows and those of the previous bar:
• When price is pushing to new highs but not making significantly lower lows, DeM tends to rise toward 1, reflecting buying pressure and potential overbought conditions.
• When price is making lower lows but not significantly higher highs, DeM falls toward 0, reflecting selling pressure and potential oversold conditions.
Internally, the indicator measures the positive difference between the current high and the previous high (up-move strength) and the positive difference between the previous low and the current low (down-move strength). These values are smoothed over a user-defined period and combined into a ratio that keeps the output bounded between 0 and 1, making it easy to interpret visually.
Default settings and parameters
Typical default settings are aimed at providing a balance between responsiveness and noise reduction:
• Length: 14
• Overbought level: 0.7
• Oversold level: 0.3
With these settings, readings above 0.7 suggest that the market may be overheated to the upside, while readings below 0.3 suggest potential exhaustion on the downside. Traders can adjust these parameters depending on their style and the volatility of the asset.
Example configurations
Here are a few practical configurations that can be suggested to users:
• Swing trading setup:
• Length: 14–21
• Overbought: 0.7–0.75
• Oversold: 0.25–0.3 This works well on 4H and daily charts for spotting potential swing highs and lows.
• Short-term intraday setup:
• Length: 7–10
• Overbought: 0.8
• Oversold: 0.2 A shorter length increases sensitivity, better for 5–15 minute charts, but also increases the number of signals.
• Trend-following filter:
• Length: 20–30
• Overbought: 0.65–0.7
• Oversold: 0.3–0.35 This smoother configuration can be used together with moving averages to filter trades in the direction of the main trend.
Basic trading usage
Traders commonly use DeMarker in three main ways:
• Mean-reversion entries:
• Look for DeM below the oversold level (for example, 0.3 or 0.25) while price is approaching a support zone.
• Consider long entries when DeM turns back up and crosses above the oversold level, ideally confirmed by a bullish candle pattern or break of minor resistance.
• Taking profits or trimming positions:
• When DeM moves above the overbought level (for example, 0.7–0.8) near a known resistance level, traders may choose to take partial profits or tighten stops.
• A downward turn from overbought after a strong rally often signals momentum exhaustion.
• Divergence signals:
• Bullish divergence: price makes a lower low while DeM makes a higher low. This can hint at weakening downside momentum and a possible reversal upward.
• Bearish divergence: price makes a higher high while DeM makes a lower high. This can warn of weakening upside momentum before a pullback.
Combining with other tools
DeMarker often performs best as part of a confluence-based approach rather than as a standalone signal generator:
• Combine with trend filters:
• Use a moving average (for example, 50 or 200 EMA) to define trend direction and take DeM oversold entries only in uptrends, or overbought entries only in downtrends.
• Use with support/resistance and price action:
• Prioritize DeM signals that occur near well-defined horizontal levels, trendlines, or supply/demand zones.
• Add volume or volatility tools:
• Strong signals tend to appear when DeM reverses from extreme zones in sync with a volume spike or volatility contraction/expansion.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.