GemHunter is a free Pine Script indicator for TradingView that helps you visually and systematically identify bullish, bearish, and neutral market conditions. It combines EMA alignment, MACD momentum, and RSI strength with optional higher timeframe confirmation to filter out noise and highlight actionable trends.
- Dynamically tints your chart background:
- Green: Confirmed bullish trend.
- Red: Confirmed bearish trend.
- Gray: Sideways / neutral zone.
- Displays trend tables showing:
- Short-term vs. long-term trend status.
- Average length of up and down trends.
- Current regime (uptrend/downtrend/neutral) and bar count.
- Uses multi-timeframe (MTF) logic so you can confirm shorter-term setups against higher timeframe trends.
- Provides noise filters (EMA slope, ATR separation, hysteresis) to reduce false flips in choppy markets.
Follow these steps to add GemHunter and configure it correctly:
- Open TradingView.
- Choose the asset and timeframe you want to analyze.
- Open the Pine Editor at the bottom panel.
- Paste the GemHunter script code into the editor.
- Click Add to Chart.
- Save it to your TradingView account for easy reuse.
Open the Settings (⚙) on the GemHunter indicator and review the inputs:
- EMA Settings:
- EMA Fast: Default 50-period (adjust for asset volatility).
- EMA Slow: Default 200-period (adjust for longer-term bias).
- RSI Settings:
- RSI length (default 14).
- Bull & Bear thresholds (default 55/45).
- MACD Settings:
- Fast EMA: 12, Slow EMA: 26, Signal: 9 (classic MACD).
- Noise Filters:
- ATR separation multiplier (how far apart EMAs must be to confirm a trend).
- EMA slope lookback & minimum ROC (filters sideways chop).
- RSI hysteresis & MACD strength multiplier (filters weak signals).
- Higher Timeframe (HTF) Options:
- Enable/disable HTF confirmation.
- Choose HTF timeframe (e.g., if you trade 1H charts, select 4H).
- Mode:
- Display Only: Show HTF status but don’t filter LTF signals.
- Filter: Block LTF bullish if HTF bearish (and vice versa).
- Strict: Require full alignment between LTF and HTF.
- Background & Visuals:
- Choose background source (LTF, HTF, or gated combo).
- Enable/disable EMAs and MACD dots.
- For crypto / volatile assets: Consider slightly shorter EMAs and wider ATR separation to avoid false flips.
- For stocks / forex: Default 50/200 EMAs and 14-RSI often work well.
- Backtest and optimize parameters for your asset and timeframe.
- In TradingView, go to Alerts → Create Alert.
- Select the GemHunter indicator and choose conditions like:
- Trend regime flips (Uptrend → Downtrend).
- Background color changes.
- This allows you to be notified instantly when trend conditions shift.
Once set up, follow this process:
- Green: Trend bias is bullish. Favor long setups.
- Red: Trend bias is bearish. Favor shorts or hedging.
- Gray: No clear bias. Stay cautious or wait for confirmation.
- Top-right table: Shows short-term vs. long-term trend strength.
- Bottom-left: Average up/down trend durations over recent history (helps estimate how long trends might last).
- Bottom-right: Current regime & number of bars since it began.
- If using HTF confirmation:
- Only trade when both LTF & HTF agree (e.g., 1H background green + 4H bullish status).
- Strict mode helps avoid false counter-trend trades.
GemHunter gives trend context, but entries/exits are stronger with confluence:
- Look for support/resistance breaks.
- Confirm with candlestick patterns or volume.
- Manage trades based on average trend durations.
- If you see too many flips in sideways markets, increase:
- Confirm Bars.
- ATR separation multiplier.
- Minimum Hold Bars.
GemHunter already uses MACD internally, but for deeper analysis you can pair it with the MACD Integration script.
- TEMA-smoothed MACD: Triple EMA smoothing for cleaner crossovers.
- Volume-weighted MACD (optional): Filters low-volume moves.
- Multi-timeframe MACD display: View higher timeframe MACD on your current chart.
- Divergence detection: Automatic bullish/bearish divergence markers.
- Visual customization: Histogram, zero-line, crossover dots.
- Trend status label: Instant "Uptrend/Downtrend/Neutral" tag.
- Add MACD Integration alongside GemHunter.
- Match MACD parameters with GemHunter’s settings for consistency.
- Watch for:
- MACD crossover confirming GemHunter’s background flips.
- Divergence warnings before trend reversals.
- Combine volume-weighted MACD for stronger conviction.
- Use multi-timeframe MACD to spot larger trend context while trading lower timeframes.
- Set alerts for MACD crossover with MTF confirmation (built into the script).
Pro Tip:
Strongest setups often occur when:
- GemHunter background is green/red.
- MACD Integration crossover aligns in the same direction.
- No opposing divergence is present.
GemHunter and MACD Integration are educational tools, not financial advice.
Trading and investing involve risk. You are responsible for your decisions.
Backtest and adjust settings for your strategy. Seek professional advice if needed.
GemHunter provides clarity and context for market trends.
Use the background tint + trend tables for bias, confirm with price action, and optionally enhance with MACD Integration for momentum and divergence insights.