Community scripts built for Indian markets. Add any of them to your chart in one click.
Trending Scripts
SuperTrend Strategy
A simple trend-following strategy built on the SuperTrend line. It goes long when SuperTrend flips up and short when it flips down, and each flip also closes the opposite trade. Works best on trending markets and daily or hourly charts.
How to use: add it to a chart and open Backtest. Inputs are the ATR length (10) and multiplier (3.0), a switch to allow or block shorts, and an optional intraday square-off time for intraday testing. The green and red lines on the chart show the current trend.
Backtest note: on RELIANCE daily it returned +2.73% over 139 trades (profit factor 1.04, max drawdown 14.5%) with 0.03% commission and 1 tick slippage. Trend systems give back some profit in sideways markets, and past results do not guarantee future returns, so test it on your own symbols.
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.
A trend-following strategy built on AlphaTrend, a line that follows an ATR-based band and switches between support and resistance depending on money flow (MFI). It goes long when AlphaTrend crosses above its own line from two bars back and short when it crosses below, and each flip closes the opposite trade.
How to use: add it to a chart and open Backtest. Inputs are the ATR multiplier (1.0), the common period (14) used for both ATR and MFI, a switch to allow or block shorts, and an optional intraday square-off time for intraday testing. A higher multiplier gives a wider, slower line with fewer trades. It suits trending stocks and indexes and can whipsaw in sideways markets.
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.