CODESCRIPT

Indicators

138 entries. What each one takes, what it returns, and a working example.

ac(fast=5, slow=34, signal=5)

Series: the AC value (the difference between AO and the signal SMA of AO). Insufficient early bars are None.

fast
int
AO fast SMA period (default 5).
slow
int
AO slow SMA period (default 34).
signal
int
Signal SMA period applied to the AO (default 5).
NOTE

Above/below the zero line and the color change (rising/falling bar) indicate the acceleration direction; unlike AO, it measures whether momentum is accelerating or decelerating.

accdist()

Accumulation/Distribution line (CUMULATIVE). Bar contribution = ((close-low)-(high-close))/(high-low) x volume; zero contribution when high==low.

NOTE

Computed from the chart OHLCV; takes no arguments. accdist is CUMULATIVE (a line) while iii/wvad are per-bar values - do not confuse them.

adl()

A series containing the cumulative Accumulation/Distribution value.

NOTE

Takes no parameters; it uses the bars' H/L/C/V values directly. On bars where (H-L)=0, that bar's contribution is taken as zero.

adx(length)

A series that measures trend strength between 0 and 100.

length
number
Calculation period; a common value is 14.
NOTE

Uses high/low/close. It measures the strength of the trend, not its direction; above 25 is considered a strong trend, and a separate filter is needed for direction.

TIP

An adx > 25 filter screens out misleading signals in a sideways market.

CODESCRIPT
plot(adx(14), "ADX")

Plots the 14-bar trend strength; above 25 is considered a strong trend.

CODESCRIPT
strong = adx(14) > 25
bgcolor(strong ? "#26a69a26" : na)

Tints the background light green while the trend is strong (adx>25).

alligator(jaw_len=13, teeth_len=8, lips_len=5)

Record: .jaw, .teeth, .lips series (each a forward-shifted SMMA; insufficient early bars are None).

jaw_len
int
Jaw SMMA length (default 13).
teeth_len
int
Teeth SMMA length (default 8).
lips_len
int
Lips SMMA length (default 5).
NOTE

SMMA = rma. Shifts: jaw 8, teeth 5, lips 3 bars forward. Due to the shift, the first valid values start on the 20th/12th/7th bar respectively.

alma(source, length, offset=0.85, sigma=6)

An Arnaud Legoux Moving Average series.

source
series
Source series the calculation runs on (e.g. close).
length
number
Window length (number of bars).
offset
number
Gaussian peak position 0..1; a higher value increases responsiveness, a lower value increases smoothness (default 0.85).
sigma
number
Width of the Gaussian bell; a larger value spreads the weights, a smaller value sharpens them (default 6).
NOTE

The result is None for the first length-1 bars; if there is a None value in the window, that bar returns None.

ao(fast=5, slow=34)

A series giving the Awesome Oscillator value; the first slow-1 bars are None due to insufficient data.

fast
number
Short simple moving-average period (default 5).
slow
number
Long simple moving-average period (default 34).
NOTE

The calculation is done over the (high+low)/2 average price; positive values show upward momentum and negative values downward momentum.

apo(source, fast=12, slow=26)

A single series containing the EMA(fast) − EMA(slow) difference; the first (slow−1) bars are None.

source
series
Source series the calculation is applied to (e.g. close).
fast
int
Fast EMA period (default 12).
slow
int
Slow EMA period (default 26).
NOTE

The EMA is computed with the SMA-seeded Wilder convention; the first valid value appears on the bar where the slow period completes.

aroon(length=14)

Returns a record: .up (upward strength 0-100), .down (downward strength 0-100), .osc (up - down, -100..100).

length
number
Lookback period (default 14).
NOTE

The window covers the last length+1 bars including this bar. up=100 indicates that a new highest peak occurred on this bar, down=100 indicates that a new lowest bottom occurred on this bar. The first length bars are None.

asi(limit=300)

The cumulative Accumulation Swing Index series. The first bar is None.

limit
number
Scale factor (default 300). Used in Swing Index normalization.
NOTE

Uses Wilder's K/R/SI formula; requires O/H/L/C. The first bar returns None because there is no prev close.

atr(length)

An Average True Range series that measures volatility in price units.

length
number
Number of bars to average over; a common value is 14.
NOTE

It uses high, low and close; it does not take a separate source argument. Commonly used to set stop distances.

TIP

close ± multiplier*atr(14) is a common pattern for stop distance.

CODESCRIPT
plot(atr(14), "ATR")

Plots the 14-bar average true range (volatility).

CODESCRIPT
stop = close - 2 * atr(14)
plot(stop, "Zarar-kes")

Plots a volatility-adaptive stop-loss level 2 ATR below the close.

bb(source, length=20, stddev=2)

A three-field record: .upper (upper band), .middle (middle band), .lower (lower band).

source
series
The series fed into the calculation; usually close.
length
number
Moving-average period of the middle band (default 20).
stddev
number
How many standard deviations the bands sit from the middle band (default 2).
NOTE

A common expectation is that price recovers as it approaches the lower band and pulls back as it approaches the upper band.

TIP

Increasing stddev widens the bands and makes touches rarer.

CODESCRIPT
b = bb(close, 20, 2)
plot(b.upper)
plot(b.middle)
plot(b.lower)

Plots the three bands (upper/middle/lower); the middle band is the 20-bar average.

CODESCRIPT
b = bb(close, 20, 2.5)
plotshape(close > b.upper, "Üst kırılım")

Marks bars where the close pushes above the upper band.

bbw(source, length=20, stddev=2)

The band width ratio for each bar (None for the first N insufficient bars).

source
series
Calculation source (default close).
length
number
Period (default 20).
stddev
number
Standard-deviation multiplier (default 2).
NOTE

The middle band is found with the SMA and the upper/lower bands with ±stddev standard deviation; the result is the (upper-lower)/middle ratio. It shares the same math as Bollinger Bands (bb).

bop()

Series: a Balance of Power value for each bar (between -1 and +1); 0 if the range (high-low) is 0.

NOTE

There is no smoothing; you can smooth the output with sma/ema to reduce noise. On bars containing missing (None) values, the result is None.

cci(length=20)

A series that measures the deviation of price from its average.

length
number
Calculation period (default 20).
NOTE

The ±100 bands are common thresholds; above +100 signals strong upward pressure and below −100 strong downward pressure. Uses H/L/C.

TIP

Above +100 signals strong upward and below −100 strong downward pressure.

CODESCRIPT
plot(cci(20), "CCI")

Plots the 20-bar commodity channel index; read against the ±100 bands.

CODESCRIPT
c = cci(20)
plotshape(crossover(c, -100), "Dipten dönüş")

Marks bars where CCI crosses above −100 (a possible bottom recovery).

chaikinosc(fast=3, slow=10)

The Chaikin Oscillator series values (the difference of the fast EMA and slow EMA of ADL).

fast
int
Fast EMA period (default 3).
slow
int
Slow EMA period (default 10).
NOTE

The first slow-1 bars return None due to insufficient data. chaikinosc_series computes ADL internally.

chandeKrollStop(p=10, x=1, q=9)

Record: .long (the long trailing-stop level) and .short (the short trailing-stop level) series.

p
int
ATR and initial high/low window period (default 10).
x
float
ATR multiplier; sets the stop distance from price (default 1).
q
int
Highest/lowest window that smooths the initial stops (default 9).
NOTE

The first valid value appears (p-1)+(q-1) bars later (in practice p+q-1 bars, since the ATR helper requires p bars). It returns None on insufficient bars.

chop(length=14)

A Choppiness Index value between 0 and 100 for each bar; the first (length-1) bars are None.

length
number
Number of lookback bars (default 14).
NOTE

High values (typically >61.8) indicate a ranging/consolidating market, low values (typically <38.2) indicate a strong trend; it measures only trend strength/absence, not direction.

cmf(length=20)

A Chaikin Money Flow series between −1 and 1.

length
number
Window length (default 20).
NOTE

Positive = buying pressure (close in the upper half of the bar + volume), negative = selling. Uses H/L/C/V.

cmo(length=9, source=close)

A momentum series between -100 and +100.

length
number
Sum window (default 9).
source
series
Source series (default close).
NOTE

The first length bars return None; if all movement within the window is zero, it returns 0.

cog(source, length=10)

The center-of-gravity oscillator value (single series).

source
series
Source series to compute on (default close).
length
number
Window length (default 10).
NOTE

No value is produced on bars where the window sum is zero and on the first length-1 bars (None).

coppock(source, long=14, short=11, wmaLen=10)

The Coppock Curve values (a single series). The first bars are None when there is insufficient data.

source
series
Calculation source (usually close).
long
int
Long-term ROC period (default 14).
short
int
Short-term ROC period (default 11).
wmaLen
int
Weighted moving average length (default 10).
NOTE

A rise above zero is interpreted as a long-term buy signal.

correlation(a, b, length)

A rolling Pearson correlation series between −1 and 1.

a
series
First series.
b
series
Second series (e.g. the close of another symbol).
length
number
Number of bars over which the correlation is computed.
NOTE

A value near 1 means moving together and a value near −1 means moving inversely; used in pair selection.

covariance(a, b, length, biased?)

Rolling covariance series; the first length-1 bars and bars with missing values in the window are empty.

a
series
First series.
b
series
Second series.
length
number
Window length (constant number, >=2).
biased
bool
Optional. true (default) → population (÷length); false → sample (÷length-1). Same convention as arrayVariance/arrayStdev.
NOTE

Unlike correlation, covariance is UNSCALED (depends on the series units) and is not normalized to -1..1. Use correlation for a comparable measure.

crsi(rsiLen=3, streakLen=2, rankLen=100)

A single series in the 0-100 range (the Connors RSI value).

rsiLen
int
Close RSI period (default 3).
streakLen
int
Streak RSI period (default 2).
rankLen
int
Percentrank window (default 100).
NOTE

It is the average of three components: the RSI of close, the RSI of the consecutive up/down streak series, and the percent rank of the 1-bar change. The first valid value is produced after the rankLen bar.

cti(source, length=20)

A single series: a correlation value between -1 and 1 (the first length-1 bars are None).

source
series
Source series (e.g. close).
length
int
Correlation window (default 20).
NOTE

The time axis is fixed at 0..length-1 within the window; if the denominator is zero (constant price), it returns 0.0.

cumMax(kaynak)

A cumulative series holding the highest value seen from the start of the chart up to each bar (it never falls).

source
series
The series to track; usually close.
NOTE

Each bar is the maximum of all values so far; the value only rises when a new peak appears and never falls. Gap (na) values are skipped.

CODESCRIPT
plot(cumMax(close), "Tüm-zaman zirvesi")

Plots the highest close seen since the start of the chart.

CODESCRIPT
dd = (cumMax(close) - close) / cumMax(close) * 100
plot(dd, "Zirveden düşüş %")

Plots how far, in percent, price has pulled back from its all-time high.

cumMin(kaynak)

A cumulative series holding the lowest value seen from the start of the chart up to each bar (it never rises).

source
series
The series to track; usually close.
NOTE

Each bar is the minimum of all values so far; the value only falls when a new bottom appears and never rises. Gap (na) values are skipped.

CODESCRIPT
plot(cumMin(close), "Tüm-zaman dibi")

Plots the lowest close seen since the start of the chart.

CODESCRIPT
plot(cumMin(low), "En düşük seviye")

Plots the lowest price (low) seen since the start of the chart.

cybercycle(source, length=20)

A cycle value series oscillating around zero; the first 6 bars are None for warmup.

source
series
Source series (e.g. close).
length
int
Cycle length (alpha = 2/(length+1)), default 20.
NOTE

Supports None-safe chaining: warmup Nones in the source series are preserved, and computation is done over the valid tail then mapped back to the original indices.

decycler(source, length=60)

A bar-by-bar Decycler series; the first 2 bars are None (high-pass initialization).

source
series
Source series (e.g. close).
length
int
Cycle cutoff length; cycles shorter than this are suppressed (default 60).
NOTE

decycler = source - highpass(source, length); it preserves the low-frequency trend and removes cycles shorter than length.

dema(source, length)

A double exponential moving average series.

source
series
Source series to compute on (default: close).
length
number
EMA period.
NOTE

Because two nested EMAs are used, roughly the first 2*length-1 bars return None.

dev(source=close, length=10)

A mean absolute deviation series for each bar; the first (length-1) bars are None.

source
series
Source series to compute on (default close).
length
number
Window length (default 10).
NOTE

basis = sma(source, length), dev = mean(|source - basis|) within the window.

disparity(length=14)

A single series: the percentage distance of the close from its SMA (%) for each bar.

length
int
Moving average period (default 14).
NOTE

Oscillates around the zero line; extreme positive/negative values can point to overbought/oversold zones. The first (length−1) bars are empty due to warmup.

dmi(length=14, adxLength=14)

A three-field record: .plus (+DI), .minus (−DI), .adx (0–100 trend strength).

length
number
Wilder period for +DI/-DI (default 14).
adxLength
number
ADX smoothing period (defaults to length).
NOTE

Direction: if +DI > −DI the uptrend dominates. Strength: adx > 20–25 means a meaningful trend. Fields are accessed with a dot.

donchian(length=20)

A three-field record: .upper (highest high), .middle, .lower (lowest low).

length
number
Window length (default 20).
NOTE

Common in breakout strategies: enter when price passes .upper, exit when it breaks .lower.

dpo(source, length=21)

A Detrended Price Oscillator series; a detrended value that oscillates around zero.

source
series
Source series to compute on (default close).
length
number
Moving-average and back-shift window (default 21).
NOTE

The shift is length/2+1 bars; the first length-1 bars return None. It does not follow the trend, but emphasizes short-term cycle peaks/troughs.

elderray(length=13)

Record: .bull (the bull power series) and .bear (the bear power series).

length
int
EMA period (default 13).
NOTE

The EMA is computed over the close price; the first (length-1) bars are empty due to insufficient data.

ema(source, length)

An exponential moving average series that gives more weight to recent bars.

source
series
The series to average; usually close.
length
number
Window length; a smaller value reacts faster to price.
NOTE

Catches price reversals earlier than sma; in return it may produce more misleading signals during sudden moves.

TIP

Crossing two EMAs (e.g. 9 and 21) is a common fast trend filter.

CODESCRIPT
plot(ema(close, 21), "EMA21")

Plots the 21-bar exponential average; reflects price turns earlier than SMA.

CODESCRIPT
f = ema(close, 9)
s = ema(close, 21)
plotshape(crossover(f, s), "AL sinyali")

Places a mark when the fast EMA crosses above the slow one.

eom(length=14)

An Ease of Movement value for each bar (a series); the first length bars are None.

length
number
Moving-average period (default 14).
NOTE

Positive values indicate that price moves upward easily, negative values indicate easy downward movement, and values near zero indicate little price movement despite high volume.

fisher(length=9)

Record: .fisher (the Fisher oscillator) and .trigger (the fisher value of the previous bar).

length
number
Normalization and min/max window length (default 9).
NOTE

No dependency beyond the math.log standard library. hl2 = (high+low)/2 is normalized over the last `length` bars; the value is clamped to ±0.999, and the fisher and normalized value are smoothed with the 0.5/0.66/0.67 coefficients (Ehlers convention).

forceindex(length=13)

The Force Index series smoothed with an exponential moving average.

length
number
EMA smoothing period (default 13).
NOTE

Above the zero line indicates buying pressure, below it indicates selling pressure; the distance measures the strength of the move.

fosc(length=14)

An oscillator series in percentage terms; it oscillates around the zero line. Positive = price is above the forecast line, negative = below it.

source
Series
Source series (default close).
length
int
Regression period (default 14).
NOTE

The first length-1 bars are empty due to warmup (None). It is plotted together with the zero line.

fractal() -> record(up, down)

Record: .up (up fractal, a bool series) and .down (down fractal, a bool series). The mark is placed on the middle bar and is delayed by 2 bars.

NOTE

Uses a 5-bar window; the first and last two bars cannot be computed (None). The comparison is a strict inequality (equality does not count as a fractal).

frama(length=16)

A FRAMA value for each bar (the first length-1 bars are None).

length
int
Window length (must be even; if odd, +1 is applied). Default 16.
NOTE

Uses the chart's high/low/close series. Based on the fractal dimension, it reacts quickly in a trend and slowly in a range.

gator(jaw_len=13, jaw_shift=8, teeth_len=8, teeth_shift=5, lips_len=5, lips_shift=3)

Record: .upper (the absolute jaw-teeth difference, ≥0) and .lower (the negative of the absolute teeth-lips difference, ≤0).

jaw_len
int
Jaw SMMA period (default 13).
jaw_shift
int
Jaw forward shift (default 8).
teeth_len
int
Teeth SMMA period (default 8).
teeth_shift
int
Teeth forward shift (default 5).
lips_len
int
Lips SMMA period (default 5).
lips_shift
int
Lips forward shift (default 3).
NOTE

Derived from the Alligator; computed with an SMMA (Wilder RMA) over the median price (H+L)/2 and shifted into the future. The value is empty on the first bars (equal to the shift + the period).

hma(source, length)

A Hull moving average series.

source
series
The series to average.
length
number
Window length.
NOTE

Gives a smooth curve with low lag; shows reversals earlier than classic moving averages.

hv(length=10)

A historical volatility series annualized, expressed as a percentage.

length
number
Log-return window length over which volatility is computed (default 10).
NOTE

It is computed over closing prices; the sample (N-1) standard deviation of the ln(close/close[1]) log returns is annualized with sqrt(365) and multiplied by 100. The first 'length' bars (while there are not enough returns) produce no value.

iii()

Intraday Intensity Index - per-bar value (NOT cumulative): (2*close - high - low) / ((high-low) * volume). Empty when the denominator is 0.

NOTE

Computed from the chart OHLCV; takes no arguments. accdist is CUMULATIVE (a line) while iii/wvad are per-bar values - do not confuse them.

inertia(length=20, rviLength=14)

The Inertia series (a single value); the first (length-1)+(rviLength-1)+3 bars are None.

length
int
Linear regression smoothing length (default 20).
rviLength
int
RVI sum window length (default 14).
NOTE

RVI is computed with the swma method; when the denominator is zero, that bar returns None. Inertia > 0 indicates a bullish, < 0 a bearish bias.

kama(source, length=10, fast=2, slow=30)

A Series containing the KAMA values; the first length bars are None.

source
Series
Source series (usually close).
length
int
Efficiency ratio window length (default 10).
fast
int
Fastest EMA period (default 2).
slow
int
Slowest EMA period (default 30).
NOTE

Efficiency ratio = |change over length bars| / |sum of the bar-by-bar changes|. A high ER means a trend, and KAMA approaches the fast coefficient; a low ER means a ranging market, and it approaches the slow coefficient.

kc(length=20, mult=2)

A three-field record: .upper, .middle, .lower.

length
number
Period of the middle line (ema) and ATR (default 20).
mult
number
Band-width multiplier (default 2).
NOTE

Middle = ema(close, length); band = middle ± mult·atr(length). Similar to Bollinger but the band is scaled by ATR.

kcw(source, length, mult)

A series giving the Keltner channel width relative to the middle line (upper minus lower divided by the middle band).

source
series
The series the middle line is computed from; usually close.
length
number
Period of the middle line and true range (default 20).
mult
number
Band-distance multiplier (default 1).
NOTE

The middle line is ema(source, length) and the band distance is mult*atr(length); the result is 2*mult*atr/middle. A smaller value means a narrowing channel (squeeze), a larger one a widening channel (volatility). It uses high/low/close (for atr).

CODESCRIPT
plot(kcw(close, 20, 1.5), "Kanal genişliği")

Plots the Keltner channel width; low values indicate a squeeze.

CODESCRIPT
squeeze = kcw(close, 20, 1.5) < 0.03
bgcolor(squeeze ? "#ffee5833" : na)

Tints the background yellow when width drops below 3% (a squeeze).

kdj(length=9, m1=3, m2=3)

Record: .k (the %K line), .d (the %D line), .j (3K−2D). The first length+m1+m2−2 bars are None.

length
int
RSV (stochastic) lookback period (default 9).
m1
int
%K smoothing period — SMA(rsv, m1) (default 3).
m2
int
%D smoothing period — SMA(K, m2) (default 3).
NOTE

The J line can exceed the 0..100 range (intentional; an early overbought/oversold signal). If the Highest-Lowest range is zero, that bar is None.

kst(source?, r1=10, r2=15, r3=20, r4=30, s1=10, s2=10, s3=10, s4=15, signal=9) -> .kst, .signal

Record: .kst (the main line) and .signal (the signal line).

source
series
Source series (default close).
r1, r2, r3, r4
int
ROC periods (default 10/15/20/30).
s1, s2, s3, s4
int
SMA smoothing period for each ROC (default 10/10/10/15).
signal
int
Signal-line SMA period (default 9).
NOTE

KST above/below the zero line indicates the long-term momentum direction, while KST crossing the signal indicates reversal signals.

kvo(fast=34, slow=55, signal=13)

Record: .kvo (the oscillator line) and .signal (the signal line).

fast
number
Fast EMA period (default 34).
slow
number
Slow EMA period (default 55).
signal
number
Signal EMA period (default 13).
NOTE

Volume force is computed from the trend determined by the direction of the intraday (H+L+C) value and the ratio of the high-low range to the cumulative measure. The first value appears on the slow bar.

linreg(source, length, offset=0)

The value of the least-squares line at the last bar.

source
series
The series fed into the calculation.
length
number
Number of bars over which the regression is computed.
offset
number
Optional. Backward shift (default 0).
NOTE

Used to track the direction and slope of the trend in a smooth way.

macd(source, fast=12, slow=26, signal=9)

A three-field record: .macd (main line), .signal (signal line), .histogram (the difference of the two).

source
series
The series fed into the calculation; usually close.
fast
number
Fast EMA period (default 12).
slow
number
Slow EMA period (default 26).
signal
number
EMA period of the signal line (default 9).
NOTE

Fields are accessed with a dot. First assign it to a variable: m = macd(close), then use m.macd and m.signal.

TIP

Access fields with a dot: first m = macd(close), then use m.macd, m.signal and m.histogram.

CODESCRIPT
m = macd(close)
plot(m.macd, "MACD")
plot(m.signal, "Sinyal")

Plots the MACD main line together with the signal line; watch their crossovers.

CODESCRIPT
m = macd(close, 12, 26, 9)
plot(m.histogram, "Histogram", style="histogram")

Plots the difference of the two lines (histogram) as bars; the zero crossing marks a momentum turn.

mama(fastLimit=0.5, slowLimit=0.05)

Record: .mama (the fast adaptive MA) and .fama (the slow following MA). The first 6 bars are None due to warmup.

fastLimit
float
Upper adaptation speed limit (alpha ceiling). Default 0.5.
slowLimit
float
Lower adaptation speed limit (alpha floor). Default 0.05.
NOTE

Computed over the source (H+L)/2 (hl2). mama crossing fama upward is interpreted as a buy signal, crossing downward as a sell signal.

massindex(length=25)

A bar-by-bar Mass Index series; insufficient early bars are None.

length
int
Window length for the ratio sum (default 25).
NOTE

The inner EMAs have a fixed 9-period length (classic definition). A rise above 27 followed by a return below 26.5 (reversal bulge) signals a possible trend reversal.

mcginley(source, length=14)

A series containing a McGinley Dynamic value for each bar.

source
series
Calculation source series (e.g. close).
length
int
Period length; larger values are slower/smoother (default 14).
NOTE

k=0.6 is fixed. The first bar is seeded with the raw source, so there is no insufficient-data period (it produces no None).

median(source=close, length=20)

A series holding, for each bar, the median value of the last length bars.

source
series
Source series to take the median of (default: close).
length
number
Sliding-window length (number of bars, default 20).
NOTE

The first length-1 bars return None due to insufficient data. Unlike the average, the median is robust to outliers (extreme values).

mfi(length=14)

A money flow index series between 0 and 100.

length
number
Calculation period (default 14).
NOTE

It is like an rsi that also takes volume into account; below 20 and above 80 are the extreme zones.

mode(source, length)

A series holding the most frequently repeated value in the window; on a tie the smallest value is chosen.

source
series
The series to inspect; usually close (default close).
length
number
Window length over which frequency is measured (default 14).
NOTE

It looks at the frequency of values in the last length bars; if several values share the top frequency it returns the smallest. The result is empty (na) on the first length-1 bars.

CODESCRIPT
plot(mode(close, 20), "En sık değer")

Plots the most frequent close value over the last 20 bars.

CODESCRIPT
plot(mode(round(close), 30), "Mod")

Plots the most frequent value of the rounded close over the last 30 bars.

mom(source, length)

A series of the difference between source and source length bars ago.

source
series
Source series used in the calculation (default close).
length
number
How many bars back the value is compared against.
NOTE

The result is empty (None) on the first length bars because there is not enough data.

nvi()

Negative Volume Index - accumulates price change on bars where volume DROPS, carries otherwise. Seed value 1.0 matching the reference definition.

NOTE

A cumulative/multiplicative index seeded at 1.0, so values stay around 1.0 (e.g. 0.78-1.25). Do NOT confuse it with the classic 1000-based variant - this matches referans dil ta.nvi/ta.pvi. NVI is read as "smart money", PVI as "the crowd".

obv()

A cumulative On-Balance Volume series.

NOTE

It adds volume when the close rises and subtracts it when it falls; shows the direction of volume flow.

percentileLinear(source, length, percent)

A series giving the linearly interpolated percentile of the values in the last length bars.

source
series
The series to take the percentile of; usually close.
length
number
Window length (14 if omitted).
pct
number
The requested percentile 0–100 (50 if omitted).
NOTE

This is the short-name form of the exact same computation as percentile_linear_interpolation: the window is sorted and the percentile is interpolated between two neighboring values. The result is empty on the first length-1 bars.

CODESCRIPT
plot(percentileLinear(close, 50, 75), "P75")

Plots the interpolated 75th percentile of the last 50 closes.

CODESCRIPT
plot(percentileLinear(close, 30, 50), "Ortanca")

pct=50 gives the median; plots the middle value of the last 30 bars.

percentileNearestRank(source, length, percent)

A series giving the nearest-rank percentile from the values in the last length bars (always an actual observation).

source
series
The series to take the percentile of; usually close.
length
number
Window length (14 if omitted).
pct
number
The requested percentile 0–100 (50 if omitted).
NOTE

This is the short-name form of the exact same computation as percentile_nearest_rank: the window is sorted and the actual value at the matching rank is returned (no interpolation). The result is empty on the first length-1 bars.

CODESCRIPT
plot(percentileNearestRank(close, 50, 25), "P25")

Plots the actual value at the 25th percentile of the last 50 closes.

CODESCRIPT
plot(percentileNearestRank(high, 50, 95), "P95")

Plots the 95th percentile of the last 50 highs as an upper band.

percentile_linear_interpolation(source, length, percent)

A series giving the requested percentile of the values in the last length bars, computed with linear interpolation.

source
series
The series to take the percentile of; usually close.
length
number
Window length (14 if omitted).
pct
number
The requested percentile 0–100; e.g. 90 = the 90th percentile (50 if omitted).
NOTE

The window is sorted and the percentile is found by a weighted transition (interpolation) between two neighboring values; the result need not equal an actual value in the window. pct 50 gives the median. The result is empty on the first length-1 bars.

CODESCRIPT
plot(percentile_linear_interpolation(close, 50, 90), "P90")

Plots the interpolated 90th percentile of the last 50 closes.

CODESCRIPT
hi = percentile_linear_interpolation(high, 50, 95)
plot(hi, "Üst %95 bant")

Plots the 95th percentile of the last 50 highs as an adaptive upper band.

percentile_nearest_rank(source, length, percent)

A series giving the percentile selected by the nearest-rank method from the values in the last length bars (always an actual value in the window).

source
series
The series to take the percentile of; usually close.
length
number
Window length (14 if omitted).
pct
number
The requested percentile 0–100; e.g. 90 = the 90th percentile (50 if omitted).
NOTE

The window is sorted and the actual value at the rank matching the percentile is returned; no interpolation is done, so the result is always one of the window's observations. The result is empty on the first length-1 bars.

CODESCRIPT
plot(percentile_nearest_rank(close, 50, 90), "P90")

Plots the actual value at the 90th percentile of the last 50 closes.

CODESCRIPT
lo = percentile_nearest_rank(low, 50, 10)
plot(lo, "Alt %10 bant")

Plots the 10th percentile of the last 50 lows as a lower band.

percentrank(source=close, length=20)

A percentile rank series between 0 and 100; the first length bars are None.

source
series
Source series (default close).
length
number
Number of bars to look back over (default 20).
NOTE

The ratio of values within the last length bars that are less than or equal to the current value is computed as a percentage.

pgo(length=14)

A single series: (close - sma(close,length)) / ema(atr(length),length). The first ~2*length-1 bars are None.

length
int
Calculation period (sma and atr/ema length).
NOTE

Since atr_series contains a None-warmup, it is not passed directly to ema; the valid tail is taken, ema is computed, and mapped back to the original indices. Because close is raw OHLC, no extra precaution is needed for sma. If the denominator is zero, that bar is None.

pivot()

The classic daily pivot level (from the previous day's H/L/C).

NOTE

It is aligned to the intraday bar; used as a support/resistance reference.

pivotLevels(tip, anchor)

An 11-element array: [Pivot, R1, S1, R2, S2, R3, S3, R4, S4, R5, S5]; indexed with brackets (lv[0]=Pivot). Depending on the method the upper levels can be empty (na).

type
string
Pivot calculation method: "Traditional", "Fibonacci", "Woodie", "Classic", "Camarilla" or "DM".
anchor
series
A boolean series marking new period starts; levels are computed from the completed period between two trues.
NOTE

Levels are computed from the high/low/close of the last COMPLETED period (the bars between the two starts marked by anchor). If type is omitted "Traditional" is used. Woodie and DM also account for the open; DM produces only Pivot, R1 and S1, with the rest empty.

TIP

Index the array: lv = pivotLevels(...), then lv[0] is Pivot, lv[1] R1, lv[2] S1.

CODESCRIPT
lv = pivotLevels("Traditional", barIndex % 50 == 0)
plot(lv[0], "Pivot")
plot(lv[1], "R1")
plot(lv[2], "S1")

Treating every 50th bar as a period start, plots the Pivot, R1 and S1 levels.

CODESCRIPT
lv = pivotLevels("Fibonacci", barIndex % 100 == 0)
plot(lv[0], "P")
plot(lv[3], "R2")
plot(lv[4], "S2")

Plots Pivot, R2 and S2 with the Fibonacci method over 100-bar periods.

pivothigh(leftbars=2, rightbars=2)

A series of pivot-high peak values; None on non-pivot bars. The value fills in with a rightbars-bar delay due to right-side confirmation.

leftbars
int
Number of bars to the left (default 2) — there must be this many lower highs to the left of the pivot.
rightbars
int
Number of bars to the right (default 2) — there must be this many lower highs to the right of the pivot; the value is confirmed this many bars later.
NOTE

A pivot must be strictly greater than all of the leftbars bars to its left and the rightbars bars to its right (equality does not count as a pivot). Because right-side confirmation is required, the value appears rightbars bars after the pivot bar.

pivotlow(leftbars=2, rightbars=2)

The pivot-low price on the confirmation bar; empty (na) on non-pivot bars.

leftbars
int
Number of bars to the left (default 2).
rightbars
int
Number of bars to the right (default 2).
NOTE

The center bar must make a lower low than all of the leftbars bars to its left and the rightbars bars to its right. The value is written to the bar where the pivot is confirmed (center + rightbars); therefore there is no look-ahead. It is the low counterpart of the Pivot High indicator.

ppo(source, fast=12, slow=26, signal=9)

Record: .ppo (the oscillator %), .signal (the signal line), .hist (histogram = ppo - signal). The first slow-1 bars are None, while the signal/histogram start after the slow+signal-2 bar.

source
series
Calculation source (usually close).
fast
int
Fast EMA period (default 12).
slow
int
Slow EMA period (default 26).
signal
int
Signal EMA period (default 9).
NOTE

Same logic as MACD but uses a percentage relative to the slow EMA instead of an absolute difference; this brings symbols at different price levels to a comparable scale.

prevClose()

The close of the previous full day (aligned to the intraday bar).

NOTE

For accessing the previous day's close on an intraday chart.

prevHigh()

The high of the previous full day (aligned to the intraday bar).

prevLow()

The low of the previous full day (aligned to the intraday bar).

pvi()

Positive Volume Index - accumulates price change on bars where volume RISES, carries otherwise. Seed value 1.0 matching the reference definition.

NOTE

A cumulative/multiplicative index seeded at 1.0, so values stay around 1.0 (e.g. 0.78-1.25). Do NOT confuse it with the classic 1000-based variant - this matches referans dil ta.nvi/ta.pvi. NVI is read as "smart money", PVI as "the crowd".

pvo(fast=12, slow=26, signal=9)

Record: .pvo (the oscillator value), .signal (the signal line), .hist (histogram = pvo - signal). The first N bars are None when data is insufficient.

fast
int
Fast volume EMA period (default 12).
slow
int
Slow volume EMA period (default 26).
signal
int
Signal EMA period (default 9).
NOTE

Same calculation logic as PPO, applied to volume instead of close. A positive PVO indicates that the fast volume average is above the slow one (increasing volume interest).

pvt()

The cumulative Price Volume Trend series (a single series).

NOTE

Standard cumulative PVT math is used. The first bar starts from 0; if the prev close is 0, that bar's contribution is skipped to avoid division by zero. Similar to OBV, but it weights by the percentage price change rather than the full volume.

pzo(length=14)

A single series: a PZO value for each bar (the first length-1 bars are None).

length
int
Exponential average period (default 14).
NOTE

ema_series starts with an SMA (Wilder), so the first valid value is on the length-1 bar.

qstick(length=10)

The simple moving average of the close − open difference over a length window (a single series).

length
int
Moving average length (default 10).
NOTE

A positive value indicates buyer dominance, a negative value indicates seller dominance; the first length-1 bars are None.

r1()

The classic pivot R1 resistance level.

r2()

The classic pivot R2 resistance level.

range(source, length)

A series giving the difference between the highest and lowest value in the last length bars (the range width).

source
series
The series whose range is measured; usually close (default close).
length
number
Window length (default 14).
NOTE

It is computed as highest(source, length) − lowest(source, length); a volatility/range measure in price units. The result is empty on the first length-1 bars.

CODESCRIPT
plot(range(close, 20), "20-bar aralık")

Plots the gap between the highest and lowest close over the last 20 bars.

CODESCRIPT
plot(range(close, 10) / close * 100, "Aralık %")

Plots the 10-bar range relative to price as percentage volatility.

rci(source=close, length=9)

A series of RCI values between -100 and 100; the first length-1 bars are None.

source
series
Calculation source series (default close).
length
number
Window length (default 9).
NOTE

A value near +100 indicates a strong uptrend, a value near -100 indicates a strong downtrend. For equal prices the average rank is used.

relvol(length=14, stdevLen=10)

A single series oscillating between 0 and 100 (the RVI value)

length
int
RMA smoothing period (default 14).
stdevLen
int
Standard deviation window (default 10).
NOTE

The stdev of close is population based (divided by N). The up and down standard deviations are smoothed separately with Wilder RMA; therefore the first stdevLen-1 + length bars return None.

rma(source, length)

A Wilder RMA series.

source
series
The series to average (usually close).
length
number
Period (number of bars).
NOTE

The smoothing used inside rsi and atr. At the same period it reacts more slowly than ema.

rmi(source, length=14, momentum=4)

An RMI series in the 0–100 range; the warmup bars are None.

source
series
Calculation series (e.g. close).
length
int
rma smoothing length (default 14).
momentum
int
Momentum lookback in bars (default 4).
NOTE

The first valid value appears on the momentum + length - 1 bar (bar 17 with the defaults).

roc(source, n=1)

A percent change (Rate of Change) series.

source
series
The series fed into the calculation.
n
number
How many bars back the change is measured against (default 1).
NOTE

Measures momentum; a positive value shows the speed of a rise and a negative value the speed of a fall.

roofing(source, hp=48, lp=10)

A filtered oscillator series oscillating around zero; the first 2 bars are empty due to warmup.

source
series
Source series to filter (usually close).
hp
int
High-pass period; filters out cycles longer than this (trend/DC) (default 48).
lp
int
Low-pass (Super Smoother) period; filters out cycles shorter than this (noise) (default 10).
NOTE

It is a two-stage band-pass filter: first a 2-pole high-pass with period hp filters the trend/DC component, then a Super Smoother with period lp filters the high-frequency noise. It is recursive; on a constant input the output falls to zero.

rsi(source, length)

A relative strength series that oscillates between 0 and 100.

source
series
The series fed into the calculation; usually close.
length
number
Calculation period; the most common value is 14.
NOTE

Above 70 is considered overbought and below 30 oversold. It is more reliable evaluated together with the trend direction rather than on its own.

TIP

Lowering the length (e.g. 7) makes it more jittery, raising it makes it smoother.

CODESCRIPT
plot(rsi(close, 14), "RSI")

Plots the 14-bar relative strength index in the 0–100 range.

CODESCRIPT
r = rsi(close, 14)
bgcolor(r > 70 ? "#ef535026" : na)

Tints the background light red while RSI is above 70 (overbought warning).

rvi(length=10)

Record: .rvi (the main line) and .signal (the swma signal of rvi).

length
int
Number of bars over which the numerator and denominator swma values are summed (default 10).
NOTE

SWMA has a fixed length of 4; it returns None on the first bars and when the denominator is zero.

rwi(length=14)

Record: .high (uptrend strength) and .low (downtrend strength). Above 1 is considered a sign of a trend, below 1 a sign of random/sideways movement.

length
int
Maximum lookback period (scanned across k=2..length). Default 14.
NOTE

The first length bars return None. atr(k) is computed with Wilder ATR; the existing atr_series helper is called directly.

s1()

The classic pivot S1 support level.

s2()

The classic pivot S2 support level.

sar(start=0.02, inc=0.02, max=0.2)

The Parabolic SAR values (a single series); it produces dots below price in an uptrend and above price in a downtrend.

start
number
Initial acceleration factor (AF), default 0.02.
inc
number
AF increment step at each new extreme point, default 0.02.
max
number
Upper limit of the AF, default 0.2.
NOTE

The first bar is None; the trend starts from the second bar. AF increases by inc at each new extreme point, is capped by max, and resets to the start value on a trend reversal.

sma(source, length)

A series holding, for each bar, the arithmetic mean of the last length bars.

source
series
The price series to average; usually close.
length
number
How many bars the averaging window spans.
NOTE

The result is empty (na) on the first length-1 bars because there is not enough data.

TIP

The larger the length, the smoother the line but the greater the lag.

CODESCRIPT
plot(sma(close, 20), "SMA20")

Plots the 20-bar simple average on the price panel.

CODESCRIPT
fast = sma(close, 10)
slow = sma(close, 50)
plot(fast, "Hızlı")
plot(slow, "Yavaş")

A fast and a slow average; their crossovers read as trend turns.

smi(length=10, smooth1=3, smooth2=3)

Record: .smi (Stochastic Momentum Index, -100..+100) and .signal (the smooth2 EMA of SMI).

length
int
HH/LL window length (default 10).
smooth1
int
First EMA smoothing length (default 3).
smooth2
int
Second EMA smoothing and signal length (default 3).
NOTE

Uses the chart's H/L/C series. It returns None for the first length-1 bars plus the double-EMA lag. On bars where den=0, smi is None.

stc(source?, fast=23, slow=50, cycle=10)

A single series oscillating between 0 and 100; used for trend direction and reversal points

source
series
Source series (default close).
fast
int
Fast EMA length (default 23).
slow
int
Slow EMA length (default 50).
cycle
int
Stochastic cycle window (default 10).
NOTE

The first bars are empty until the slow EMA is ready (warmup equal to the slow length). The values come from MACD's double-stage stochastic cycle; they saturate at 0 or 100 in strong trends.

stdev(source, length)

A rolling standard deviation (volatility) series.

source
series
The series fed into the calculation.
length
number
Window length.
NOTE

Commonly used for the Z-score: (close − sma(close,n)) / stdev(close,n).

stoch(length=14, smoothK=1, smoothD=3, source?, highSrc?, lowSrc?)

A two-field record: .k (fast line) and .d (signal line); between 0 and 100.

length
number
Number of bars looked back over (default 14).
smoothK
number
Smoothing of the %K line (default 1).
smoothD
number
Smoothing of the %D signal line (default 3).
NOTE

Below 20 is considered oversold and above 80 overbought. Uses high/low/close.

TIP

It returns a two-field record: s = stoch(14,3,3), then use s.k and s.d.

CODESCRIPT
s = stoch(14, 3, 3)
plot(s.k, "%K")
plot(s.d, "%D")

Plots the %K and %D lines together; read against the 20/80 bands.

CODESCRIPT
s = stoch(14, 1, 3)
plotshape(crossover(s.k, s.d), "K, D üstü")

Marks bars where %K crosses above %D (momentum turns up).

stochRsi(rsiSource=close, rsiLen=14, stochLen=14, smoothK=3, smoothD=3)

A two-field record:.k (fast line) and.d (signal line); between 0 and 100.

rsiSource
series
Optional. The series RSI is computed on (default close).
rsiLen
number
RSI length (default 14).
stochLen
number
Stochastic length over the RSI (default 14).
smoothK
number
Smoothing of the %K line (default 3).
smoothD
number
Smoothing of the %D signal line (default 3).
NOTE

First RSI is computed, then a stochastic is applied to the RSI; identical to stoch(stochLen, smoothK, smoothD, rsi, rsi, rsi). It is more sensitive than plain RSI because it measures RSI's position within its own range.

CODESCRIPT
s = stochRsi(close, 14, 14, 3, 3)
plot(s.k, "%K")
plot(s.d, "%D")

Plots %K and %D over the RSI; read against the 20/80 bands.

CODESCRIPT
s = stochRsi(close, 14, 14, 3, 3)
plotshape(crossover(s.k, s.d), "K, D üstü")

Marks bars where %K crosses above %D (RSI momentum turns up).

supersmoother(source, length=10)

A smoothed value series; the first 2 bars are None.

source
Series
Source series to smooth (usually close).
length
int
Filter period (default 10).
NOTE

A 2-pole Butterworth Super Smoother; the coefficient sum is 1 (DC gain 1), and it converges to the same constant on a constant input.

supertrend(factor=3, atrPeriod=10)

A two-field record: .line (trailing line), .direction (+1 up, −1 down).

factor
number
ATR multiplier (default 3); a larger value means fewer but later signals.
atrPeriod
number
ATR period (default 10).
NOTE

When .direction changes sign, the trend reverses. .line sits below price in an uptrend and above price in a downtrend.

swma(source)

A symmetrically weighted moving average series.

source
series
Source series to compute on (default: close). A fixed 4-bar window is used.
NOTE

The length is fixed (4) and the weights are [1,2,2,1]/6; therefore it does not take a length parameter. The first 3 bars return None due to warmup.

t3(source, length=8, vfactor=0.7)

A Tillson T3 moving average series (the first bars are empty due to insufficient data).

source
series
Source series the calculation is applied to (default close).
length
number
Period of each EMA step (default 8).
vfactor
number
Volume factor a; balances curve smoothness against responsiveness (0-1, default 0.7).
NOTE

Because of the chain of six consecutive EMAs, roughly the first 6*(length-1) bars produce no value.

tema(length=9, source=close)

A triple exponential moving average series (a value for each bar; the first 3·(length−1) bars are empty).

length
number
EMA period (default 9).
source
series
Source series to compute on (default close).
NOTE

TEMA compensates in a compound manner for the lag created by applying the EMA three times; it reacts faster to price reversals than the classic EMA.

tii(majorLen=60, minorLen=30)

A single series in the 0-100 range; the first (majorLen-1 + minorLen-1) bars are None due to insufficient data.

majorLen
int
Period of the moving average against which deviations are measured (default 60).
minorLen
int
Length of the rolling window over which deviations are summed (default 30).
NOTE

The 50 reference line separates direction: when the value is above 50, upward pressure dominates; when below, downward pressure dominates. If all deviations are zero, the result is taken as 50.

tr()

A True Range series.

NOTE

max(H−L, |H−prev C|, |L−prev C|); no smoothing. It is the unsmoothed form of ATR.

trima(source, length=20)

A series containing the triangular moving average value for each bar; the first (length-1) bars are None due to insufficient data.

source
series
Source series the calculation is applied to (e.g. close).
length
int
Total window length (default 20). The inner SMA windows are derived from this.
NOTE

Computed with two nested SMAs: first an SMA with a ceil((n+1)/2) window, then an SMA with a floor(n/2)+1 window. The total warmup time is length-1 bars.

trix(source, length=18)

The TRIX value for each bar (insufficient first bars are None).

source
series
Calculation source (default close).
length
number
EMA period (default 18).
NOTE

Due to the triple EMA, roughly the first 3*(length-1)+1 bars return None; division by zero is guarded.

tsf(source, length=14)

A one-bar-ahead linear regression forecast for each bar; the first length-1 bars are None.

source
series
Source series the forecast is applied to (e.g. close).
length
int
Regression window length (default 14).
NOTE

Identical to linreg(source, length, offset=-1); offset=-1 projects the line onto the next bar (x=length).

tsi(source, long=25, short=13)

A TSI momentum series that oscillates between -100 and +100.

source
series
Calculation source (default close).
long
number
First (long) EMA period, default 25.
short
number
Second (short) EMA period, default 13.
NOTE

Momentum is the difference of the source from the previous bar; because of the double EMA smoothing, roughly the first long+short+1 bars return None.

ttmsqueeze(length=20, bbMult=2, kcMult=1.5)

Record: .on (bool — is the squeeze on) and .mom (float — the linear-regression momentum).

length
int
BB/KC/momentum window length (default 20).
bbMult
float
Bollinger Band standard deviation multiplier (default 2).
kcMult
float
Keltner Channel ATR multiplier (default 1.5).
NOTE

.on is None for the first length+1 bars due to ATR warmup; .mom returns None for the first ~2*length-2 bars, since linreg warmup is added on top of the source warmup. The BB standard deviation is population (biased) based, consistent with the bbands convention.

ulcerindex(length=14)

An Ulcer Index value for each bar (≥ 0); the first length-1 bars are None.

length
int
Rolling window length (default 14).
NOTE

Penalizes only declines (drawdowns); unlike standard deviation, upward movement does not increase risk. A higher value = a deeper/longer decline.

uo(fast=7, mid=14, slow=28)

A single series in the 0-100 range (the Ultimate Oscillator value); the first `slow` bars are None.

fast
number
Fast period (default 7) — highest weight (x4).
mid
number
Middle period (default 14) — medium weight (x2).
slow
number
Slow period (default 28) — lowest weight (x1).
NOTE

Buying pressure BP = close - min(low, prev close); true range TR = max(high, prev close) - min(low, prev close). For each period the average = Σ(BP)/Σ(TR); UO = 100*(4*fast + 2*mid + slow)/7. Standard Williams math is applied.

valueWhen(condition, source, occurrence=0)

A series carrying, from that bar onward, the source value at the bar where the condition was last true (going n occurrences back).

condition
bool
The condition series to search; bars where it is true are captured.
source
series
The value series read when the condition occurs.
n
number
Optional. Which past occurrence: 0 = the most recent, 1 = the one before (default 0).
NOTE

When the condition is true the source value is captured and held on later bars; n=0 gives the most recent occurrence, n=1 the previous one. If the condition has never occurred yet the result is empty (na).

CODESCRIPT
vw = valueWhen(crossover(close, sma(close,20)), close)
plot(vw, "Son kesişim fiyatı")

Plots a line holding the close at the bar where price last crossed above SMA20.

CODESCRIPT
hi = valueWhen(high == cumMax(high), high)
plot(hi, "Son zirve fiyatı")

Remembers and plots the high at the bar where the most recent new peak was made.

variance(source, length=20)

A population variance series of the source over the last length bars.

source
series
Source series to compute the variance of (default: close).
length
number
Number of lookback bars (window length, default 20).
NOTE

Variance is the average of the squared deviations from the mean (moving average); it equals the square of the standard deviation (stdev) and measures the dispersion of the series.

vhf(length=28)

A VHF value for each bar (trend strength; high = trending, low = ranging).

length
int
Window length (default 28).
NOTE

The first length-1 bars are None; if the window's sum of absolute changes is zero, that bar is None.

vidya(source, length=14, cmoLen=9)

A VIDYA value series for each bar; the first cmoLen bars are None.

source
series
Calculation source (usually close).
length
int
VIDYA smoothing length (default 14).
cmoLen
int
CMO momentum period (default 9).
NOTE

The smoothing coefficient k = (2/(length+1)) * |CMO|; CMO approaches 0 in a ranging market and locks onto the average source.

vo(fast=5, slow=10)

The volume oscillator series (percentage); the first (slow-1) bars are None.

fast
int
Fast EMA period (default 5).
slow
int
Slow EMA period (default 10).
NOTE

The source volume is the chart's volume; it does not take a separate source. Positive = volume is above the slow average.

vortex(length=14)

A two-field record: .plus (VI+, upward strength) and .minus (VI-, downward strength).

length
number
Summation-window length (default 14).
NOTE

Crossovers of VI+ and VI- are read as trend-reversal signals; both typically oscillate around 1.0.

vwap()

A cumulative volume-weighted average price series.

NOTE

A reference level commonly used in intraday trading; whether price is above or below the VWAP gives a directional cue.

TIP

Price crossing above the VWAP reads as intraday strength, below it as weakness.

CODESCRIPT
plot(vwap(), "VWAP")

Plots the volume-weighted average price as a reference line.

CODESCRIPT
plotshape(crossover(close, vwap()), "VWAP üstü")

Marks bars where the close crosses above the VWAP.

vwma(source, length)

A volume-weighted average series.

source
series
The series to average.
length
number
Period (number of bars).
NOTE

Weight = bar volume; low-volume bars affect the average less.

vzo(source, volume, length=14)

The Volume Zone Oscillator series (approximately between -100 and +100); a positive value indicates that directional volume is buyer-dominant, a negative value indicates it is seller-dominant.

close
series
Close series.
volume
series
Volume series.
length
int
EMA period (default 14).
NOTE

The first length-1 bars return None due to warmup. If the EMA volume is zero, that bar is None (division-by-zero protection).

wad()

The cumulative Williams A/D line (a single series).

NOTE

Does not use volume; it computes cumulative accumulation/distribution using only H/L/C. The first bar starts at 0 as the cumulative base.

wavetrend(n1=10, n2=21)

Record: .wt1 (the main WaveTrend line) and .wt2 (the 4-period simple moving average of wt1)

n1
int
Channel length (base EMA period), default 10.
n2
int
Average length (tci EMA period), default 21.
NOTE

Crossovers of wt1 and wt2 are used as signals; the extreme zones indicate overbought/oversold

williamsvixfix(length=22)

A single series: a Williams Vix Fix value for each bar (percentage).

length
int
Lookback period (default 22).
NOTE

Uses the chart's H/L/C data; the first (length-1) bars return None due to insufficient data.

willr(length=14)

A Williams %R series that oscillates between −100 and 0.

length
number
Calculation period (default 14).
NOTE

Above −20 is interpreted as overbought and below −80 as oversold.

wma(source, length)

A weighted moving average series.

source
series
The series to average; usually close.
length
number
Window length.
NOTE

The most recent bar is given the highest weight; weights increase from 1 up to length.

wpr(length)

A Williams %R series that oscillates between −100 and 0.

length
number
Number of bars looked back over; a common value is 14.
NOTE

It uses high/low/close. The scale is inverted: values near 0 mark the top (overbought) and values near −100 the bottom (oversold); above −20 is overbought and below −80 oversold.

CODESCRIPT
plot(wpr(14), "Williams %R")

Plots the 14-bar Williams %R in the −100…0 range.

CODESCRIPT
w = wpr(14)
plotshape(crossover(w, -80), "Dipten dönüş")

Marks bars where the indicator crosses above −80 (a possible bottom recovery).

wvad()

Williams Variable Accumulation/Distribution - per-bar value: (close-open)/(high-low) * volume. Empty when high==low.

NOTE

Computed from the chart OHLCV; takes no arguments. accdist is CUMULATIVE (a line) while iii/wvad are per-bar values - do not confuse them.

zlema(source, length=20)

A series of Zero-Lag EMA values; the first (lag + length - 1) bars are None.

source
series
Source series used in the calculation (e.g. close).
length
int
Average period (default 20).
NOTE

lag = floor((length-1)/2). A lag-compensation term is added to the source (src + (src - src[lag])), then the EMA is applied.

zscore(source?, length=20)

A z-score series for each bar; the first length-1 bars are None.

source
series
Source series (default close).
length
number
Window length (default 20).
NOTE

The standard deviation is population (biased) based. If the standard deviation in the window is zero, the value returns 0.0.