OPEN-SOURCE SCRIPT

Consecutive Candle Counter

412
Consecutive Condition Counter is a versatile indicator that tracks and visualizes consecutive candles based on user-defined market conditions. It helps traders quickly identify streaks of bullish or bearish signals by counting how many bars in a row satisfy the selected condition.

🔍 Features:

Three selectable conditions via a dropdown:

Up & Down Days: Counts consecutive up or down candles. Each up candle adds +1, each down candle subtracts -1. The counter resets when direction changes.

RSI Signal: Counts how many consecutive bars RSI remains above 70 (+1 per bar) or below 30 (-1 per bar). Resets when RSI moves back to the neutral zone.

SMA Positioning: Counts consecutive bars where price stays above (+1) or below (-1) a Simple Moving Average (SMA). SMA period is user-defined.

📊 Visualization:

Positive streaks are shown in green, negative streaks in red, and neutral values in gray.

Displayed as a histogram below the chart for quick pattern recognition.

⚙️ Inputs:

Choose condition logic from the dropdown.

Configure the RSI period and SMA period as needed.

This tool can be helpful for identifying momentum streaks, overbought/oversold trends, or trend-following behavior in a visually intuitive way.

Clause de non-responsabilité

Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.