//@version=6
indicator("Zen Consecutive Bar Streak v1.0", shorttitle="Zen CBS v1.0", overlay=true)
// --- Bar Direction ---
barDir = close > open ? 1 : close < open ? -1 : 0
// --- Streak Count ---
var int streak = 0
if barDir == 1
streak := streak > 0 ? streak + 1 : 1
else if barDir == -1
streak := streak < 0 ? streak - 1 : -1
else
streak := 0
// --- Bar Colour (only colour when streak >= 2 or <= -2) ---
barcolor(streak >= 2 ? color.green : streak <= -2 ? color.red : na)
// --- Data Window Plots ---
plot(barDir, title="Bar Direction", display=display.data_window)
plot(streak, title="Streak", display=display.data_window)
Overview
Zen Consecutive Bar Streak determines whether each bar is bullish, bearish, or neutral based on its close relative to its open. When two or more consecutive bars close in the same direction, the indicator colors the chart bars green for bullish streaks or red for bearish streaks. Neutral doji candles reset the streak counter to zero. Additionally, it outputs the raw bar direction and streak values to the TradingView data window.
Consecutive directional candle tracking
Streak-based chart bar coloring
Automatic streak reset on neutral bars
Data window outputs for streak count and direction
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.
All Candlestick Patterns detects and highlights a wide range of bullish, bearish, and neutral candlestick patterns directly on the price chart. It features optional trend filtering using either a 50-period simple moving average or a combination of 50-period an
This indicator detects a large set of classic candlestick patterns and plots colored labels on the price chart. Trend context uses a 50-period simple moving average, or the 50 and 200 averages stacked together, and can be switched off. Users filter bullish, be
Five-in-one Strategy combines five analytical tools into a single price chart overlay: the Dual Thrust Trading Algorithm (DTTA), Semafore, HalfTrend, Nick Rypock Trailing Reverse, and Tweezer or Kangaroo Tail candlestick patterns. It generates trade signals us
This indicator calculates and plots Heikin-Ashi smoothed candlesticks directly on the price chart. It derives the smoothed close from standard price averages and recursively computes the open, high, and low values. The script does not issue trade signals or al
This indicator overlays on the price chart and provides trend and momentum analysis. It calculates and plots three exponential moving averages with fixed periods of 20, 50, and 200 using yellow, orange, and blue colors respectively. The script also computes th
The Confluence Suite indicator draws multiple trading signals and tools directly on the price chart. It generates entry and exit signals based on selected modes and filters, with an AI signal classifier rating quality from 1-4. Additional features include smar