Stash-Magic Indicator Reference
What each indicator measures, exactly what to type to add it, and how it's traditionally read.
How to add any of these
- Go to Stash-Magic Indicators and sign in.
- Copy the text under Type this into the box and click Create.
- Compare the formula you get with the one shown here. The AI can word it differently, but check that the numbers and functions make sense.
- Check the test chart, then click Save to My Indicators or Add to my charts.
To change a setting, change the number in your request, for example HMA 55, or edit the number in the formula box. To choose how something in its own pane looks, add as a line or as a histogram. New to Stash-Magic? Start with the guide.
Moving averages
Averages smooth price and sit on the candles. They differ in how much weight recent bars get, which changes how quickly they respond.
Simple moving average (SMA)
What it is: The plain average of the last N closes. Every bar counts equally.
How it's read: Often used to judge trend direction, or as a reference level. Longer periods react more slowly. If you say "average" or "moving average" without naming a type, you get an SMA.
sma(close, 50)sma(close, 20)sma(close, 200)Exponential moving average (EMA)
What it is: An average that gives recent bars more weight, so it turns sooner than an SMA of the same length.
How it's read: Often used for shorter-term trend. The gap between a fast and a slow EMA is a common way to see momentum.
ema(close, 21)ema(close, 8)ema(close, 21)Weighted moving average (WMA)
What it is: An average where weights fall in a straight line: the newest bar counts most and the oldest least.
How it's read: Usually sits between an SMA and an EMA in responsiveness. It is also the building block of the Hull moving average.
wma(close, 20)Hull moving average (HMA)
What it is: A fast, smooth average built from weighted averages: twice the half-length WMA minus the full-length WMA, smoothed again over the square root of the length.
How it's read: Designed to reduce lag, so it turns early. Its direction is often read as the short-term trend. Because it reacts quickly, it can also overshoot price.
hma(close, 20)hma(close, 55)crossover(close, hma(close, 21))hma(close, 20) > lag(hma(close, 20), 1)Volume weighted moving average (VWMA)
What it is: An average of closes where each bar counts in proportion to its volume.
How it's read: Bars with heavy volume pull the line harder. Comparing it with an SMA of the same length shows whether volume has favored higher or lower prices.
sum(close * volume, 50) / sum(volume, 50)Note: This is a rolling average, not session or anchored VWAP. Those aren’t available in Stash-Magic.
Efficiency weighted Hull
What it is: A Hull-style average that applies its speed-up only as far as price is moving cleanly. It scales the fast-minus-slow step by the 20-bar efficiency ratio, then smooths the result.
How it's read: In a clean trend it behaves like a regular Hull. In choppy markets the speed-up fades, so it follows more slowly and flips less often.
wma(wma(close, 17) + abs(close - lag(close, 20)) / sum(abs(close - lag(close, 1)), 20) * (wma(close, 17) - wma(close, 34)), 6)Note: Only the default lengths are available (Hull 34, efficiency 20). Asking for another length gets a refusal. You can edit the numbers in the formula yourself.
Bands and channels
Bands and channels draw an envelope around price. They differ in what sets the width.
Bollinger bands
What it is: A 20-bar SMA with bands two standard deviations above and below it.
How it's read: The bands widen when price is volatile and narrow when it is quiet. A close outside a band means an unusually large move for the recent past. It does not by itself mean a reversal or a continuation.
sma(close, 20)sma(close, 20) + 2 * stdev(close, 20)sma(close, 20) - 2 * stdev(close, 20)close < sma(close, 20) - 2 * stdev(close, 20)Bollinger band width
What it is: The distance between the upper and lower bands, as a percent of the middle line or in price.
How it's read: Low readings mean the bands are tight, which many traders call a squeeze. It shows how quiet the market is, not which way it will move next. Using a percent lets you compare stocks at different prices.
(sma(close, 20) + 2 * stdev(close, 20) - (sma(close, 20) - 2 * stdev(close, 20))) / sma(close, 20) * 100sma(close, 20) + 2 * stdev(close, 20) - (sma(close, 20) - 2 * stdev(close, 20))Note: Check the formula to see which you got. If it ends with / sma(close, 20) * 100, it’s a percent. Otherwise it’s in price.
Keltner channels
What it is: A 20-bar EMA with lines two 10-bar ATRs above and below it.
How it's read: Similar in purpose to Bollinger bands, but the width comes from average true range, so the channel usually changes width more smoothly.
ema(close, 20)ema(close, 20) + 2 * atr(10)ema(close, 20) - 2 * atr(10)Note: To use other settings, ask for the channel and then change the numbers in the formula box.
Donchian channels
What it is: The highest high and the lowest low of the last N bars.
How it's read: Each line shows the extreme of the lookback window. Because the current bar is included, a bar that makes a new high is the channel’s upper line on that bar.
highest(high, 20)lowest(low, 20)highest(high, 55)lowest(low, 55)Trend indicators
These try to show which way the market is trending, or whether it is trending at all.
Supertrend
What it is: A trailing line set a multiple of ATR away from the bar’s midpoint. It sits below price in an uptrend and above it in a downtrend, and switches sides when the close goes through it.
How it's read: Which side of the line price is on is usually read as the trend. Flips can come often in sideways markets. A higher multiplier flips less often.
supertrend(10, 3)supertrend(7, 2.5)close > supertrend(10, 3)crossover(close, supertrend(10, 3))Note: It draws as one line that jumps at each flip, not in two colors. To see the trend as color, use the paint bars request.
Parabolic SAR
What it is: A trailing level that speeds up toward price as a trend extends, then flips to the other side when price reaches it. It starts at a step of 0.02 and is capped at 0.2.
How it's read: Below price is usually read as an uptrend and above as a downtrend. It suits trending markets and flips often in sideways ones.
psar(0.02, 0.2)psar(0.01, 0.1)crossover(close, psar(0.02, 0.2))Note: It draws as a line rather than dots, so you’ll see a jump at each flip.
ADX and DMI
What it is: ADX measures how strong a trend is, whichever way it is going, from 0 to 100. +DI and -DI measure upward and downward movement. The default is 14 bars, using Wilder smoothing.
How it's read: ADX above about 20 to 25 is commonly read as a trending market. +DI above -DI means upward movement is stronger. ADX falling means the trend is weakening, not that it has reversed.
adx(14)adx(14)plus_di(14)minus_di(14)adx(14)plus_di(14)minus_di(14)crossover(plus_di(14), minus_di(14))Note: Also available as ADX with +DI / -DI in + Add indicator, with the same numbers. Asking for ADX alone occasionally adds the +DI and -DI lines too.
Ichimoku
What it is: Four lines built from high-low midpoints: Tenkan (9 bars), Kijun (26 bars), and Span A and Span B, which form the edges of the cloud (Span B uses 52 bars).
How it's read: Price above both spans is usually read as bullish, and below both as bearish. Tenkan crossing Kijun is a commonly watched event.
(highest(high, 9) + lowest(low, 9)) / 2(highest(high, 26) + lowest(low, 26)) / 2lag(((highest(high, 9) + lowest(low, 9)) / 2 + (highest(high, 26) + lowest(low, 26)) / 2) / 2, 26)lag((highest(high, 52) + lowest(low, 52)) / 2, 26)Note: This is a partial Ichimoku. The space between the spans isn’t shaded, the cloud doesn’t extend 26 bars into the future, and there’s no lagging span, because formulas can’t look ahead or draw past the last bar.
Aroon
What it is: How recently the highest high and lowest low of the last N bars happened, from 0 to 100. Aroon up is 100 on a new high. The default here is 25 bars. The oscillator is up minus down.
How it's read: Up near 100 with down near 0 is usually read as an uptrend. The two lines close together suggest no clear trend.
aroon_up(25)aroon_down(25)aroon_up(14) - aroon_down(14)Note: Also available as Aroon (25) and Aroon Oscillator (25) in + Add indicator.
Vortex
What it is: Compares upward and downward price movement across bars, each divided by true range, over 14 bars by default.
How it's read: VI+ above VI- is usually read as an uptrend. The lines cross often in sideways markets.
vortex_plus(14)vortex_minus(14)Note: Also available as Vortex Indicator (14) in + Add indicator.
Choppiness index
What it is: Compares the total distance traveled over N bars with the overall range, on a scale from 0 to 100. The default is 14 bars.
How it's read: High readings, commonly above 61.8, suggest a sideways market. Low readings, commonly below 38.2, suggest a trend. It does not show direction.
chop(14)Heikin Ashi values
What it is: Heikin Ashi averages each bar with the one before it. The close is the average of open, high, low and close. The open is the midpoint of the previous Heikin Ashi open and close.
How it's read: When the Heikin Ashi close is above its open, the smoothed bar is up. Runs of one color are usually read as a steady trend.
ha_close > ha_openha_closeNote: To draw Heikin Ashi candles, use the chart type menu on the chart. These requests use the values in an indicator while the chart keeps real prices.
Momentum oscillators
Oscillators draw in their own pane and measure how strong or stretched the recent move is. The overbought and oversold levels below are traditional labels. In a strong trend, an oscillator can stay at an extreme for a long time.
Relative Strength Index (RSI)
What it is: Compares recent gains with recent losses on a scale from 0 to 100, using Wilder smoothing. The default is 14 bars.
How it's read: Traditionally, above 70 is called overbought and below 30 oversold. Short periods such as RSI 2 move between extremes much more often.
rsi(close, 14)rsi(close, 2)rsi(close, 14) < 30rsi(close, 14) - sma(rsi(close, 14), 20)MACD
What it is: The 12-bar EMA minus the 26-bar EMA, with a 9-bar EMA of that line as its signal line. The histogram is the gap between the two lines.
How it's read: Above zero, the fast average is over the slow one. The histogram shrinking shows the gap between the lines closing.
macd(close, 12, 26)macd_signal(close, 12, 26, 9)macd(close, 12, 26) - macd_signal(close, 12, 26, 9)Rate of change (ROC)
What it is: The percent change in close over N bars.
How it's read: Above zero, price is higher than it was N bars ago. The value is already a percent.
roc(close, 10)Stochastic oscillator
What it is: Shows where the close sits within the high-low range of the last 14 bars, from 0 to 100 (%K), with a 3-bar average of that as %D.
How it's read: Traditionally, above 80 is called overbought and below 20 oversold. %K crossing %D is a commonly watched event.
100 * (close - lowest(low, 14)) / (highest(high, 14) - lowest(low, 14))sma(100 * (close - lowest(low, 14)) / (highest(high, 14) - lowest(low, 14)), 3)100 * (close - lowest(low, 5)) / (highest(high, 5) - lowest(low, 5))sma(100 * (close - lowest(low, 5)) / (highest(high, 5) - lowest(low, 5)), 3)Williams %R
What it is: The same idea as the stochastic, measured down from the top of the range, from 0 to -100.
How it's read: Traditionally, above -20 is called overbought and below -80 oversold.
-100 * (highest(high, 14) - close) / (highest(high, 14) - lowest(low, 14))-100 * (highest(high, 10) - close) / (highest(high, 10) - lowest(low, 10))Commodity Channel Index (CCI)
What it is: How far typical price (the average of high, low and close) is from its average, compared with its usual distance. The constant 0.015 is meant to keep most readings between +100 and -100.
How it's read: Readings beyond +100 or -100 are unusually far from the average. CCI has no fixed limits and can go well past 200.
cci(hlc3, 20)cci(hlc3, 14)cci(hlc3, 20) > 100Volume weighted CCI
What it is: CCI with its average and its deviation both weighted by each bar’s volume, so bars with heavy volume count more.
How it's read: Read it like CCI. Differences from regular CCI come from where the heavy volume traded.
vwcci(hlc3, 20)vwcci(hlc3, 10)Note: If a symbol has no volume data, this gives the same result as regular CCI.
WaveTrend
What it is: Measures typical price’s distance from its 10-bar EMA, scales that by the average size of the distance, then smooths it with a 21-bar EMA (WT). The signal line is a 4-bar average of WT.
How it's read: Commonly, levels of +60 and -60 mark stretched readings, and WT crossing its signal line is the event people watch. Crosses happen often, so many traders only pay attention to those near the levels.
ema((hlc3 - ema(hlc3, 10)) / (0.015 * ema(abs(hlc3 - ema(hlc3, 10)), 10)), 21)sma(ema((hlc3 - ema(hlc3, 10)) / (0.015 * ema(abs(hlc3 - ema(hlc3, 10)), 10)), 21), 4)ema((hlc3 - ema(hlc3, 9)) / (0.015 * ema(abs(hlc3 - ema(hlc3, 9)), 9)), 12)sma(ema((hlc3 - ema(hlc3, 9)) / (0.015 * ema(abs(hlc3 - ema(hlc3, 9)), 9)), 12), 4)crossover(ema((hlc3 - ema(hlc3, 10)) / (0.015 * ema(abs(hlc3 - ema(hlc3, 10)), 10)), 21), sma(ema((hlc3 - ema(hlc3, 10)) / (0.015 * ema(abs(hlc3 - ema(hlc3, 10)), 10)), 21), 4))crossunder(ema((hlc3 - ema(hlc3, 10)) / (0.015 * ema(abs(hlc3 - ema(hlc3, 10)), 10)), 21), sma(ema((hlc3 - ema(hlc3, 10)) / (0.015 * ema(abs(hlc3 - ema(hlc3, 10)), 10)), 21), 4))Chande momentum oscillator (CMO)
What it is: Up moves minus down moves, divided by the two added together, over N bars, on a scale from -100 to +100. The default is 9 bars.
How it's read: Above +50 and below -50 are commonly read as strong momentum up and down.
cmo(9)cmo(14)Note: Also available as Chande Momentum Osc (9) in + Add indicator.
Connors RSI
What it is: The average of three things: a 3-bar RSI, a 2-bar RSI of the current up or down streak, and the percent rank of today’s change over the last 100 bars.
How it's read: Above 90 is commonly called overbought and below 10 oversold. It reaches those extremes much more often than a 14-bar RSI.
crsi(3, 2, 100)Schaff trend cycle
What it is: A stochastic of a stochastic of the MACD line, on a scale from 0 to 100. The defaults are 23, 50 and a cycle of 10.
How it's read: It tends to move quickly between low and high and stay there. Levels of 25 and 75 are commonly watched.
stc(23, 50, 10)Fisher transform
What it is: Rescales where the bar’s midpoint sits within its recent range so that extremes stand out. The trigger line is the same value one bar earlier. The default is 9 bars.
How it's read: Sharp turns and crosses of the trigger line are the events people watch. It has no fixed limits.
fisher(9)lag(fisher(9), 1)Know Sure Thing (KST)
What it is: A weighted sum of four smoothed rates of change (10, 15, 20 and 30 bars), with longer ones counting more. The signal line is its 9-bar average.
How it's read: Above zero means the combined momentum is positive. KST crossing its signal line is the commonly watched event.
sma(roc(close, 10), 10) + 2 * sma(roc(close, 15), 10) + 3 * sma(roc(close, 20), 10) + 4 * sma(roc(close, 30), 15)sma(sma(roc(close, 10), 10) + 2 * sma(roc(close, 15), 10) + 3 * sma(roc(close, 20), 10) + 4 * sma(roc(close, 30), 15), 9)Note: Also available as Pring’s Know Sure Thing in + Add indicator.
Efficiency ratio (Kaufman)
What it is: The net move over N bars divided by the total distance traveled bar by bar. It runs from 0 to 1.
How it's read: Near 1, price moved almost in a straight line. Near 0, it covered a lot of ground without getting anywhere. It does not show direction.
abs(close - lag(close, 10)) / sum(abs(close - lag(close, 1)), 10)Volatility and distance
These show how much price is moving, whether volatility has contracted, and how far price is from a reference level.
Average True Range (ATR)
What it is: The average size of each bar’s range, including any gap from the previous close. The default is 14 bars.
How it's read: Higher means bigger moves per bar, in price units. Dividing by price lets you compare stocks at different prices. ATR does not show direction.
atr(14)atr(14) / close * 100TTM Squeeze and squeeze momentum
What it is: The squeeze is on when Bollinger bands (2 standard deviations) fit inside Keltner channels (1.5 ATR). Momentum is a 20-bar linear regression of price’s distance from its recent midpoint.
How it's read: A squeeze shows that volatility has contracted, not which way price will break. The momentum histogram shows the direction of the recent push.
ttm_momentum(20)ttm_momentum(20)ttm_squeeze(20)Note: Also available as TTM Squeeze in + Add indicator. Platforms differ in how they calculate this one, so values may not match exactly elsewhere.
Distance from an average
What it is: How far price is from a moving average, in percent or in ATRs.
How it's read: Larger readings mean price is more stretched from the average. Measuring in ATRs takes the stock’s usual volatility into account.
(close - sma(close, 200)) / sma(close, 200) * 100(close - sma(close, 200)) / sma(close, 200) * 100(close - sma(close, 20)) / atr(14)Volume
These use volume to show participation, or compare it with what is normal for the stock.
On balance volume (OBV)
What it is: A running total that adds the day’s volume on up closes and subtracts it on down closes.
How it's read: Traders look at its direction, and at whether it confirms price. The number itself means little, because it starts from zero on the first bar loaded.
obvNote: Also available as On Balance Volume in + Add indicator.
Money flow index (MFI)
What it is: An RSI-style reading that uses typical price and volume together, from 0 to 100. The default is 14 bars.
How it's read: Above 80 is traditionally called overbought and below 20 oversold.
mfi(14)mfi(10)mfi(14) < 20Note: Also available as Money Flow Index (14) in + Add indicator.
Volume spikes
What it is: Marks bars where volume is well above its recent average, or shows volume as a ratio to that average.
How it's read: A spike shows unusual activity, not whether it was buying or selling. A ratio of 2 means twice the average.
volume > 2 * sma(volume, 20)volume / sma(volume, 50)Crosses and breakouts
These mark the bars where something happens. Say "mark" or "flag" to get a triangle under the bar.
Moving average crosses
What it is: Marks the one bar where a faster average crosses a slower one. A golden cross is the 50-day SMA crossing above the 200-day. A death cross is the reverse.
How it's read: Crosses of long averages are rare and happen well after a move has started.
crossover(sma(close, 50), sma(close, 200))crossunder(sma(close, 50), sma(close, 200))crossover(ema(close, 8), ema(close, 21))Note: Name the averages for the most reliable result. Asking for "death crosses" alone sometimes used EMAs in our tests, so check the formula.
New highs and breakouts
What it is: Marks closes above the highest high of the prior N bars.
How it's read: This uses the prior bars on purpose. A close can never be above a high that includes its own bar, so a formula like close > highest(high, 20) would almost never fire.
close > lag(highest(high, 20), 1)close < lag(lowest(low, 20), 1)Market structure
These work from swing highs and lows. A swing needs 5 bars on each side by default, so it only appears 5 bars after it prints. This delay is what stops the level from changing later.
Swing highs and lows
What it is: The most recent confirmed swing high and swing low, held as a stepped line until a newer swing is confirmed.
How it's read: These are the levels many traders treat as support and resistance, and they are the base for sweeps and structure breaks below.
swinghigh(5)swinglow(5)swinghigh(10)swinglow(10)Liquidity sweeps
What it is: A bar that wicks through the latest swing level but closes back inside it.
How it's read: Traders read this as price running the stops beyond a swing and failing to hold there. Sweeps are frequent, and many are followed by continuation.
sweeplow(5)sweephigh(5)Note: Stash-Magic marks the sweep bar only. It can’t add an entry, stop or targets. A request for those is refused.
Break of structure
What it is: The bar where the close crosses through the latest swing high or swing low.
How it's read: An upward break closes above the last swing high, and a downward break closes below the last swing low.
crossover(close, swinghigh(5))crossunder(close, swinglow(5))Note: Stash-Magic doesn’t separate a break of structure from a change of character (CHoCH), because that requires remembering the previous break.
Fair value gaps
What it is: A three-bar gap: the current low is above the high from two bars ago (bullish), or the current high is below the low from two bars ago (bearish).
How it's read: It marks a fast move that left a price area untraded. Stash-Magic marks the bar where the gap forms. It can’t draw the gap as a box or track when it fills.
low > lag(high, 2)high < lag(low, 2)A sweep followed by a break
What it is: A custom example showing how to spell out a two-step idea: mark a break above the prior 5-bar high within 10 bars of a sweep of the swing low.
How it's read: It marks the event only. It doesn’t track a stop, or cancel the setup if the swing high is swept first.
crossover(close, lag(highest(high, 5), 1)) and barssince(sweeplow(5)) <= 10Candle patterns
Simple patterns comparing a bar with the one before it.
Inside and outside days
What it is: An inside day’s range sits within the previous bar’s range. An outside day’s range goes beyond it on both sides.
How it's read: Inside days show the range tightening, and outside days show it expanding. The same formulas apply to weekly bars on a weekly chart.
high < lag(high, 1) and low > lag(low, 1)high > lag(high, 1) and low < lag(low, 1)Gaps
What it is: A bar that opens above the previous high or close (gap up), or below the previous low or close (gap down).
How it's read: Check the formula to see which definition you got. Opening above the prior close happens far more often than opening above the prior high.
open > lag(high, 1)open < lag(low, 1)Paint bars
Paint bars recolor every candle: green where the condition is true and red where it is false. Say "paint" or "color the candles".
Painting candles by a condition
What it is: Any condition that lasts over a stretch of bars can paint the chart.
How it's read: The colors show which state applies to each bar. They don’t mean the candle closed up or down. If you ask to paint on a cross, you get the state after the cross.
ema(close, 8) > ema(close, 21)close > sma(close, 200)rsi(close, 14) > 50Not available yet
Stash-Magic refuses these rather than draw something else under the same name:
- Order blocks: They need boxes that stay on the chart until price uses them up. Indicators can’t draw boxes yet.
- Wyckoff: It’s a sequence of phases that depends on judgment, not one calculation per bar.
- Elliott wave: Wave counts depend on judgment, and they can change as new bars print.
- Volume profile: It’s a sideways histogram of volume at each price, and that needs data from inside each bar.
- Renko: It’s a different kind of chart built from price moves rather than time, so it can’t sit on top of normal bars.
Indicators not on this page may also get a refusal, even when + Add indicator on the chart has them. That menu includes others such as Coppock Curve, TRIX, True Strength Index, Ultimate Oscillator, PPO and Mass Index.
If you can describe the calculation in steps using price, volume and averages, spell it out in your request of 13 words or more and Stash-Magic will try to build it. Check that formula carefully, because the result is less reliable than the indicators on this page.