//@version=4
study("Bar States", overlay = true)
first = barstate.isfirst
last = barstate.islast
hist = barstate.ishistory
rt = barstate.isrealtime
new = barstate.isnew
conf = barstate.isconfirmed
t = new ? "new" : conf ? "conf" : "intra-bar"
t := t + (hist ? "\nhist" : rt ? "\nrt" : "")
t := t + (first ? "\nfirst" : last ? "\nlast" : "")
label.new(bar_index, na, yloc=yloc.abovebar, text=t,
color=hist ? color.green : color.red)
Overview
Bar States checks whether each candle is historical or real-time, new or confirmed, and whether it represents the first or last bar. For each bar, it renders a text label directly above the price candle displaying these state flags, styling historical bars in green and real-time bars in red. The script includes no trading signals or configurable inputs.
Bar state built-in variable inspection
Above-bar diagnostic text labels
Color distinction for historical and real-time bars
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.
The Adaptive Laguerre Filter calculates a smoothed, dynamically adjusted trendline plotted directly on the main price chart. It dynamically adjusts its damping factor (alpha) based on recent price range variations and median percentile calculations over a spec
The indicator plots ICT displacement candles on the price chart and can switch to retracement scanning. Displacement requires a move larger than a set share of the 14-bar average high-low range, lasting at least a chosen number of bars, with optional close, pr
This indicator classifies each bar as bull, bear, or sideways from a rolling log return compared with adjustable percentage thresholds. It paints a regime ribbon on the price chart, shows a current-regime banner, and labels state changes after a minimum hold.
This script plots three moving averages on the price chart: a fast EMA or SMA with 10 periods, a slow EMA or SMA with 20 periods, and a trend EMA or SMA with 100 periods. It signals trend changes by drawing a white cross when the fast moving average crosses ab
This indicator calculates an ATR trailing stop line derived from the highest high minus an average true range multiple over a specified lookback period. It plots the trailing stop line directly on the price chart and colors price bars based on whether the clos
1833 Tracker is an overlay indicator that visualizes historical buy and sell transactions executed by ARK Invest ETFs for the stock on the main price chart. It displays trade dates using green buy and red sell labels positioned relative to price bars, indicati