Community scripts built for Indian markets. Add any of them to your chart in one click.
Trending Scripts
Volatility Regime Meter
This indicator shows how volatile a stock is right now compared with its own recent history. It ranks ATR as a percentage of price on a 0–100 scale over the last 120 bars. Each bar is labelled Compressed (20 or below), Normal, or Expanded (80 or above). When a compression of at least 5 bars ends, it prints a triangle: green if price is above EMA 20, red if below. A small table shows the current regime, ATR % and percentile. It has alerts for the release signals and for expansion. It does not predict direction on its own, so pair it with a trend or breakout tool.
Simple price-statistics helpers for trend, volatility and position in range. Each function works on every bar and returns one number.
normalize(src, len): where src sits in its len-bar low-high range, scaled 0 to 100.
atrPct(len): ATR as a percentage of close, so volatility can be compared across stocks.
trendEfficiency(src, len): net move divided by total path travelled, from 0 (choppy) to 1 (clean trend).
rangePos(len): where the close sits inside the len-bar high-low range, 0 to 100.
How to use:
import g_T9PHE3Z1/PriceStats/2 as ps
eff = ps.trendEfficiency(close, 20)
vol = ps.atrPct(14)
pos = ps.rangePos(50)
Call each function once per bar at the top level of your script (not inside if or for). Values were checked against hand-written versions of the same formulas.