Indicators
138 entries. What each one takes, what it returns, and a working example.
Series: the AC value (the difference between AO and the signal SMA of AO). Insufficient early bars are None.
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.
Accumulation/Distribution line (CUMULATIVE). Bar contribution = ((close-low)-(high-close))/(high-low) x volume; zero contribution when high==low.
Computed from the chart OHLCV; takes no arguments. accdist is CUMULATIVE (a line) while iii/wvad are per-bar values - do not confuse them.
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.
A series that measures trend strength between 0 and 100.
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.
An adx > 25 filter screens out misleading signals in a sideways market.
plot(adx(14), "ADX")
Plots the 14-bar trend strength; above 25 is considered a strong trend.
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).
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.
The result is None for the first length-1 bars; if there is a None value in the window, that bar returns None.
A series giving the Awesome Oscillator value; the first slow-1 bars are None due to insufficient data.
The calculation is done over the (high+low)/2 average price; positive values show upward momentum and negative values downward momentum.
A single series containing the EMA(fast) − EMA(slow) difference; the first (slow−1) bars are None.
The EMA is computed with the SMA-seeded Wilder convention; the first valid value appears on the bar where the slow period completes.
Returns a record: .up (upward strength 0-100), .down (downward strength 0-100), .osc (up - down, -100..100).
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.
The cumulative Accumulation Swing Index series. The first bar is None.
Uses Wilder's K/R/SI formula; requires O/H/L/C. The first bar returns None because there is no prev close.
An Average True Range series that measures volatility in price units.
It uses high, low and close; it does not take a separate source argument. Commonly used to set stop distances.
close ± multiplier*atr(14) is a common pattern for stop distance.
plot(atr(14), "ATR")
Plots the 14-bar average true range (volatility).
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).
A common expectation is that price recovers as it approaches the lower band and pulls back as it approaches the upper band.
Increasing stddev widens the bands and makes touches rarer.
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.
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).
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).
Series: a Balance of Power value for each bar (between -1 and +1); 0 if the range (high-low) is 0.
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.
A series that measures the deviation of price from its average.
The ±100 bands are common thresholds; above +100 signals strong upward pressure and below −100 strong downward pressure. Uses H/L/C.
Above +100 signals strong upward and below −100 strong downward pressure.
plot(cci(20), "CCI")
Plots the 20-bar commodity channel index; read against the ±100 bands.
c = cci(20) plotshape(crossover(c, -100), "Dipten dönüş")
Marks bars where CCI crosses above −100 (a possible bottom recovery).
The Chaikin Oscillator series values (the difference of the fast EMA and slow EMA of ADL).
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.
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.
A Choppiness Index value between 0 and 100 for each bar; the first (length-1) bars are None.
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.
Positive = buying pressure (close in the upper half of the bar + volume), negative = selling. Uses H/L/C/V.
A momentum series between -100 and +100.
The first length bars return None; if all movement within the window is zero, it returns 0.
The center-of-gravity oscillator value (single series).
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.
A rise above zero is interpreted as a long-term buy signal.
A rolling Pearson correlation series between −1 and 1.
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.
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).
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.
A single series: a correlation value between -1 and 1 (the first length-1 bars are None).
The time axis is fixed at 0..length-1 within the window; if the denominator is zero (constant price), it returns 0.0.
A cumulative series holding the highest value seen from the start of the chart up to each bar (it never falls).
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.
plot(cumMax(close), "Tüm-zaman zirvesi")
Plots the highest close seen since the start of the chart.
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.
A cumulative series holding the lowest value seen from the start of the chart up to each bar (it never rises).
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.
plot(cumMin(close), "Tüm-zaman dibi")
Plots the lowest close seen since the start of the chart.
plot(cumMin(low), "En düşük seviye")
Plots the lowest price (low) seen since the start of the chart.
A cycle value series oscillating around zero; the first 6 bars are None for warmup.
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.
A bar-by-bar Decycler series; the first 2 bars are None (high-pass initialization).
decycler = source - highpass(source, length); it preserves the low-frequency trend and removes cycles shorter than length.
A double exponential moving average series.
Because two nested EMAs are used, roughly the first 2*length-1 bars return None.
A mean absolute deviation series for each bar; the first (length-1) bars are None.
basis = sma(source, length), dev = mean(|source - basis|) within the window.
A single series: the percentage distance of the close from its SMA (%) for each bar.
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.
A three-field record: .plus (+DI), .minus (−DI), .adx (0–100 trend strength).
Direction: if +DI > −DI the uptrend dominates. Strength: adx > 20–25 means a meaningful trend. Fields are accessed with a dot.
A three-field record: .upper (highest high), .middle, .lower (lowest low).
Common in breakout strategies: enter when price passes .upper, exit when it breaks .lower.
A Detrended Price Oscillator series; a detrended value that oscillates around zero.
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.
Record: .bull (the bull power series) and .bear (the bear power series).
The EMA is computed over the close price; the first (length-1) bars are empty due to insufficient data.
An exponential moving average series that gives more weight to recent bars.
Catches price reversals earlier than sma; in return it may produce more misleading signals during sudden moves.
Crossing two EMAs (e.g. 9 and 21) is a common fast trend filter.
plot(ema(close, 21), "EMA21")
Plots the 21-bar exponential average; reflects price turns earlier than SMA.
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.
An Ease of Movement value for each bar (a series); the first length bars are None.
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.
Record: .fisher (the Fisher oscillator) and .trigger (the fisher value of the previous bar).
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).
The Force Index series smoothed with an exponential moving average.
Above the zero line indicates buying pressure, below it indicates selling pressure; the distance measures the strength of the move.
An oscillator series in percentage terms; it oscillates around the zero line. Positive = price is above the forecast line, negative = below it.
The first length-1 bars are empty due to warmup (None). It is plotted together with the zero line.
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.
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).
A FRAMA value for each bar (the first length-1 bars are None).
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).
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).
A Hull moving average series.
Gives a smooth curve with low lag; shows reversals earlier than classic moving averages.
A historical volatility series annualized, expressed as a percentage.
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.
Intraday Intensity Index - per-bar value (NOT cumulative): (2*close - high - low) / ((high-low) * volume). Empty when the denominator is 0.
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.
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.
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.
A three-field record: .upper, .middle, .lower.
Middle = ema(close, length); band = middle ± mult·atr(length). Similar to Bollinger but the band is scaled by ATR.
A series giving the Keltner channel width relative to the middle line (upper minus lower divided by the middle band).
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).
plot(kcw(close, 20, 1.5), "Kanal genişliği")
Plots the Keltner channel width; low values indicate a squeeze.
squeeze = kcw(close, 20, 1.5) < 0.03 bgcolor(squeeze ? "#ffee5833" : na)
Tints the background yellow when width drops below 3% (a squeeze).
Record: .k (the %K line), .d (the %D line), .j (3K−2D). The first length+m1+m2−2 bars are None.
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).
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).
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.
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).
Fields are accessed with a dot. First assign it to a variable: m = macd(close), then use m.macd and m.signal.
Access fields with a dot: first m = macd(close), then use m.macd, m.signal and m.histogram.
m = macd(close) plot(m.macd, "MACD") plot(m.signal, "Sinyal")
Plots the MACD main line together with the signal line; watch their crossovers.
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.
Computed over the source (H+L)/2 (hl2). mama crossing fama upward is interpreted as a buy signal, crossing downward as a sell signal.
A bar-by-bar Mass Index series; insufficient early bars are None.
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.
A series containing a McGinley Dynamic value for each bar.
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.
The first length-1 bars return None due to insufficient data. Unlike the average, the median is robust to outliers (extreme values).
A money flow index series between 0 and 100.
It is like an rsi that also takes volume into account; below 20 and above 80 are the extreme zones.
A series holding the most frequently repeated value in the window; on a tie the smallest value is chosen.
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.
plot(mode(close, 20), "En sık değer")
Plots the most frequent close value over the last 20 bars.
plot(mode(round(close), 30), "Mod")
Plots the most frequent value of the rounded close over the last 30 bars.
A series of the difference between source and source length bars ago.
The result is empty (None) on the first length bars because there is not enough data.
Negative Volume Index - accumulates price change on bars where volume DROPS, carries otherwise. Seed value 1.0 matching the reference definition.
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".
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.
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.
plot(percentileLinear(close, 50, 75), "P75")
Plots the interpolated 75th percentile of the last 50 closes.
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).
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.
plot(percentileNearestRank(close, 50, 25), "P25")
Plots the actual value at the 25th percentile of the last 50 closes.
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.
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.
plot(percentile_linear_interpolation(close, 50, 90), "P90")
Plots the interpolated 90th percentile of the last 50 closes.
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).
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.
plot(percentile_nearest_rank(close, 50, 90), "P90")
Plots the actual value at the 90th percentile of the last 50 closes.
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.
The ratio of values within the last length bars that are less than or equal to the current value is computed as a percentage.
A single series: (close - sma(close,length)) / ema(atr(length),length). The first ~2*length-1 bars are None.
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.
It is aligned to the intraday bar; used as a support/resistance reference.
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).
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.
Index the array: lv = pivotLevels(...), then lv[0] is Pivot, lv[1] R1, lv[2] S1.
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.
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.
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.
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.
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.
For accessing the previous day's close on an intraday chart.
Positive Volume Index - accumulates price change on bars where volume RISES, carries otherwise. Seed value 1.0 matching the reference definition.
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.
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).
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.
A single series: a PZO value for each bar (the first length-1 bars are None).
ema_series starts with an SMA (Wilder), so the first valid value is on the length-1 bar.
The simple moving average of the close − open difference over a length window (a single series).
A positive value indicates buyer dominance, a negative value indicates seller dominance; the first length-1 bars are None.
A series giving the difference between the highest and lowest value in the last length bars (the range width).
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.
plot(range(close, 20), "20-bar aralık")
Plots the gap between the highest and lowest close over the last 20 bars.
plot(range(close, 10) / close * 100, "Aralık %")
Plots the 10-bar range relative to price as percentage volatility.
A series of RCI values between -100 and 100; the first length-1 bars are None.
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)
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.
A Wilder RMA series.
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.
The first valid value appears on the momentum + length - 1 bar (bar 17 with the defaults).
A percent change (Rate of Change) series.
Measures momentum; a positive value shows the speed of a rise and a negative value the speed of a fall.
A filtered oscillator series oscillating around zero; the first 2 bars are empty due to warmup.
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.
A relative strength series that oscillates between 0 and 100.
Above 70 is considered overbought and below 30 oversold. It is more reliable evaluated together with the trend direction rather than on its own.
Lowering the length (e.g. 7) makes it more jittery, raising it makes it smoother.
plot(rsi(close, 14), "RSI")
Plots the 14-bar relative strength index in the 0–100 range.
r = rsi(close, 14) bgcolor(r > 70 ? "#ef535026" : na)
Tints the background light red while RSI is above 70 (overbought warning).
Record: .rvi (the main line) and .signal (the swma signal of rvi).
SWMA has a fixed length of 4; it returns None on the first bars and when the denominator is zero.
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.
The first length bars return None. atr(k) is computed with Wilder ATR; the existing atr_series helper is called directly.
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.
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.
A series holding, for each bar, the arithmetic mean of the last length bars.
The result is empty (na) on the first length-1 bars because there is not enough data.
The larger the length, the smoother the line but the greater the lag.
plot(sma(close, 20), "SMA20")
Plots the 20-bar simple average on the price panel.
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).
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
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.
A rolling standard deviation (volatility) series.
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.
Below 20 is considered oversold and above 80 overbought. Uses high/low/close.
It returns a two-field record: s = stoch(14,3,3), then use s.k and s.d.
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.
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.
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.
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.
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.
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).
When .direction changes sign, the trend reverses. .line sits below price in an uptrend and above price in a downtrend.
A symmetrically weighted moving average series.
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).
Because of the chain of six consecutive EMAs, roughly the first 6*(length-1) bars produce no value.
A triple exponential moving average series (a value for each bar; the first 3·(length−1) bars are empty).
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.
A single series in the 0-100 range; the first (majorLen-1 + minorLen-1) bars are None due to insufficient data.
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.
max(H−L, |H−prev C|, |L−prev C|); no smoothing. It is the unsmoothed form of ATR.
A series containing the triangular moving average value for each bar; the first (length-1) bars are None due to insufficient data.
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.
The TRIX value for each bar (insufficient first bars are None).
Due to the triple EMA, roughly the first 3*(length-1)+1 bars return None; division by zero is guarded.
A one-bar-ahead linear regression forecast for each bar; the first length-1 bars are None.
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.
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).
.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.
An Ulcer Index value for each bar (≥ 0); the first length-1 bars are None.
Penalizes only declines (drawdowns); unlike standard deviation, upward movement does not increase risk. A higher value = a deeper/longer decline.
A single series in the 0-100 range (the Ultimate Oscillator value); the first `slow` bars are None.
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).
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).
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.
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.
A population variance series of the source over the last length bars.
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.
A VHF value for each bar (trend strength; high = trending, low = ranging).
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.
The smoothing coefficient k = (2/(length+1)) * |CMO|; CMO approaches 0 in a ranging market and locks onto the average source.
The volume oscillator series (percentage); the first (slow-1) bars are None.
The source volume is the chart's volume; it does not take a separate source. Positive = volume is above the slow average.
A two-field record: .plus (VI+, upward strength) and .minus (VI-, downward strength).
Crossovers of VI+ and VI- are read as trend-reversal signals; both typically oscillate around 1.0.
A reference level commonly used in intraday trading; whether price is above or below the VWAP gives a directional cue.
Price crossing above the VWAP reads as intraday strength, below it as weakness.
plot(vwap(), "VWAP")
Plots the volume-weighted average price as a reference line.
plotshape(crossover(close, vwap()), "VWAP üstü")
Marks bars where the close crosses above the VWAP.
A volume-weighted average series.
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.
The first length-1 bars return None due to warmup. If the EMA volume is zero, that bar is None (division-by-zero protection).
Does not use volume; it computes cumulative accumulation/distribution using only H/L/C. The first bar starts at 0 as the cumulative base.
Record: .wt1 (the main WaveTrend line) and .wt2 (the 4-period simple moving average of wt1)
Crossovers of wt1 and wt2 are used as signals; the extreme zones indicate overbought/oversold
A single series: a Williams Vix Fix value for each bar (percentage).
Uses the chart's H/L/C data; the first (length-1) bars return None due to insufficient data.
A Williams %R series that oscillates between −100 and 0.
Above −20 is interpreted as overbought and below −80 as oversold.
A weighted moving average series.
The most recent bar is given the highest weight; weights increase from 1 up to length.
A Williams %R series that oscillates between −100 and 0.
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.
plot(wpr(14), "Williams %R")
Plots the 14-bar Williams %R in the −100…0 range.
w = wpr(14) plotshape(crossover(w, -80), "Dipten dönüş")
Marks bars where the indicator crosses above −80 (a possible bottom recovery).
Williams Variable Accumulation/Distribution - per-bar value: (close-open)/(high-low) * volume. Empty when high==low.
Computed from the chart OHLCV; takes no arguments. accdist is CUMULATIVE (a line) while iii/wvad are per-bar values - do not confuse them.
A series of Zero-Lag EMA values; the first (lag + length - 1) bars are None.
lag = floor((length-1)/2). A lag-compensation term is added to the source (src + (src - src[lag])), then the EMA is applied.
A z-score series for each bar; the first length-1 bars are None.
The standard deviation is population (biased) based. If the standard deviation in the window is zero, the value returns 0.0.