OPEN-SOURCE SCRIPT
Aggiornato

Impulse Candle Detector with MA Ribbon

185
Indicator Overview

The Impulse Candle Detector with MA Ribbon highlights “impulsive” candles—those with unusually large range, volume and body proportion—by coloring them blue (bullish) or orange (bearish) and firing an alert when they complete. In addition, it plots up to four moving averages on any chosen timeframe, with full control over type, length, source and color.

What It Does

Impulse Candle Detection
A candle is marked impulsive only when all three conditions are met:
  • Range exceeds the n-bar SMA of true-range multiplied by a size factor.
  • Volume exceeds the n-bar SMA of volume multiplied by a volume factor.
  • Body size (|close – open|) is at least a specified fraction of the candle’s total high-low range.

MA Ribbon
Four independent moving averages can be plotted, each optionally fetched from a different timeframe. You choose the MA type (SMA, EMA, SMMA/RMA, WMA or VWMA), the calculation source (open, high, low, close or custom), the length in periods, and the line color.

Typical Use Cases

Traders can use the impulse candle signal to spot strong momentum surges or reversal traps. Overlaying these signals on an MA ribbon gives trend context: impulsive candles aligned with the ribbon direction suggest continuation, while impulsive candles against the ribbon warn of counter-trend exhaustion. Alerts automate detection so you never miss a key move.

Inputs and Defaults

Impulse Candles Group
You’ll find four inputs under “Impulse Candles.”
  • Length for Average Calculation (integer, default 10): bars used to compute the SMA of true-range and volume.
  • Size Multiplier (float, default 1.5): threshold factor for range vs. average range.
  • Volume Multiplier (float, default 1.5): threshold factor for volume vs. average volume.
  • Body-to-Wick Ratio (float, default 0.7): minimum candle-body fraction of total range.

Moving Averages Group
There is one timeframe input and then settings for MA #1 through MA #4. Each MA has five properties.
  • Set MA Timeframe (timeframe, default blank): timeframe to fetch the MAs; leave blank to use the chart’s timeframe.
  • For each MA #X: Show (true/false), Type (SMA, EMA, SMMA/RMA, WMA, VWMA), Source (price series), Length (integer ≥ 1)
  • Color (hex code)


Alert Configuration

When all three impulsive-candle conditions are true on the prior bar, an alert named “Impulsive Candle” fires with the message “Impulsive candle detected.”

How to Use

  1. Copy the script into TradingView’s Pine Editor, save and add it to your chart.
  2. Under Impulse Candles, adjust length and multipliers to match your asset’s volatility.
  3. Under Moving Averages, set your desired timeframe (if different), then toggle and customize each MA line.
  4. Create an alert on the indicator, selecting the built-in Impulsive Candle condition to get notified whenever a qualifying candle closes.


Disclaimer

This indicator is provided for educational purposes only and does not constitute financial advice or a guaranteed strategy. Trading involves substantial risk and may result in significant losses; past performance does not guarantee future results. Always conduct your own research and consider seeking advice from a qualified financial professional before making any trading decisions.
Note di rilascio
Updating chart image to showcase full functionality.

Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.