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

  1. Go to Stash-Magic Indicators and sign in.
  2. Copy the text under Type this into the box and click Create.
  3. 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.
  4. 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.

Type this: 50 day SMA
Formula: sma(close, 50)
You see: Line on the candles
Type this: 20 day and 200 day SMA
Formula: sma(close, 20)
sma(close, 200)
You see: 2 lines on the candles

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.

Type this: 21 EMA
Formula: ema(close, 21)
You see: Line on the candles
Type this: 8 EMA and 21 EMA
Formula: ema(close, 8)
ema(close, 21)
You see: 2 lines on the candles

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.

Type this: 20 WMA
Formula: wma(close, 20)
You see: Line on the candles

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.

Type this: Hull moving average 20
Formula: hma(close, 20)
You see: Line on the candles
Type this: HMA 55
Formula: hma(close, 55)
You see: Line on the candles
Type this: mark when price crosses above the 21 Hull
Formula: crossover(close, hma(close, 21))
You see: Triangles under matching bars
Type this: paint bars green when the 20 HMA is rising and red when falling
Formula: hma(close, 20) > lag(hma(close, 20), 1)
You see: Candles painted green and red

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.

Type this: volume weighted moving average 50
Formula: sum(close * volume, 50) / sum(volume, 50)
You see: Line on the candles

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.

Type this: Efficiency weighted Hull
Formula: wma(wma(close, 17) + abs(close - lag(close, 20)) / sum(abs(close - lag(close, 1)), 20) * (wma(close, 17) - wma(close, 34)), 6)
You see: Line on the candles

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.

Type this: Bollinger bands
Formula: sma(close, 20)
sma(close, 20) + 2 * stdev(close, 20)

sma(close, 20) - 2 * stdev(close, 20)
You see: 3 lines on the candles
Type this: flag closes below the lower bollinger band
Formula: close < sma(close, 20) - 2 * stdev(close, 20)
You see: Triangles under matching bars

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.

Type this: Bollinger band width
Formula: (sma(close, 20) + 2 * stdev(close, 20) - (sma(close, 20) - 2 * stdev(close, 20))) / sma(close, 20) * 100
You see: Histogram in its own pane
Type this: Bollinger band width as a line
Formula: sma(close, 20) + 2 * stdev(close, 20) - (sma(close, 20) - 2 * stdev(close, 20))
You see: Line in its own pane

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.

Type this: Keltner channels
Formula: ema(close, 20)
ema(close, 20) + 2 * atr(10)

ema(close, 20) - 2 * atr(10)
You see: 3 lines on the candles

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.

Type this: Donchian channels
Formula: highest(high, 20)
lowest(low, 20)
You see: 2 lines on the candles
Type this: Donchian channel 55
Formula: highest(high, 55)
lowest(low, 55)
You see: 2 lines on the candles

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.

Type this: Supertrend
Formula: supertrend(10, 3)
You see: Line on the candles
Type this: Supertrend 7 2.5
Formula: supertrend(7, 2.5)
You see: Line on the candles
Type this: paint bars green above the Supertrend and red below
Formula: close > supertrend(10, 3)
You see: Candles painted green and red
Type this: mark bullish Supertrend flips
Formula: crossover(close, supertrend(10, 3))
You see: Triangles under matching bars

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.

Type this: Parabolic SAR
Formula: psar(0.02, 0.2)
You see: Line on the candles
Type this: Parabolic SAR with step 0.01 and maximum 0.1
Formula: psar(0.01, 0.1)
You see: Line on the candles
Type this: mark when price crosses above the Parabolic SAR
Formula: crossover(close, psar(0.02, 0.2))
You see: Triangles under matching bars

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.

Type this: ADX 14
Formula: adx(14)
You see: Line in its own pane, with lines at 20 and 25
Type this: ADX with +DI and -DI
Formula: adx(14)
plus_di(14)

minus_di(14)
You see: 3 lines in its own pane, with lines at 20 and 25
Type this: DMI
Formula: adx(14)
plus_di(14)

minus_di(14)
You see: 3 lines in its own pane, with lines at 20 and 25
Type this: mark when +DI crosses above -DI
Formula: crossover(plus_di(14), minus_di(14))
You see: Triangles under matching bars

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.

Type this: Ichimoku cloud
Formula: (highest(high, 9) + lowest(low, 9)) / 2
(highest(high, 26) + lowest(low, 26)) / 2

lag(((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)
You see: 4 lines on the candles

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.

Type this: Aroon
Formula: aroon_up(25)
aroon_down(25)
You see: 2 lines in its own pane
Type this: Aroon oscillator 14
Formula: aroon_up(14) - aroon_down(14)
You see: Histogram in its own pane

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.

Type this: Vortex indicator
Formula: vortex_plus(14)
vortex_minus(14)
You see: 2 lines in its own pane, with lines at 1

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.

Type this: Choppiness index
Formula: chop(14)
You see: Line in its own pane, with lines at 61.8 and 38.2

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.

Type this: paint candles by Heikin Ashi direction
Formula: ha_close > ha_open
You see: Candles painted green and red
Type this: Heikin Ashi close line
Formula: ha_close
You see: Line on the candles

Note: 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.

Type this: RSI 14
Formula: rsi(close, 14)
You see: Line in its own pane
Type this: RSI 2
Formula: rsi(close, 2)
You see: Line in its own pane
Type this: flag when RSI is below 30
Formula: rsi(close, 14) < 30
You see: Triangles under matching bars
Type this: RSI minus its 20-day average
Formula: rsi(close, 14) - sma(rsi(close, 14), 20)
You see: Histogram in its own pane

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.

Type this: MACD line and signal line
Formula: macd(close, 12, 26)
macd_signal(close, 12, 26, 9)
You see: 2 lines in its own pane
Type this: MACD histogram
Formula: macd(close, 12, 26) - macd_signal(close, 12, 26, 9)
You see: Histogram in its own pane

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.

Type this: 10 day rate of change
Formula: roc(close, 10)
You see: Line in its own pane

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.

Type this: stochastic oscillator
Formula: 100 * (close - lowest(low, 14)) / (highest(high, 14) - lowest(low, 14))
sma(100 * (close - lowest(low, 14)) / (highest(high, 14) - lowest(low, 14)), 3)
You see: 2 lines in its own pane, with lines at 80 and 20
Type this: stochastic 5, 3
Formula: 100 * (close - lowest(low, 5)) / (highest(high, 5) - lowest(low, 5))
sma(100 * (close - lowest(low, 5)) / (highest(high, 5) - lowest(low, 5)), 3)
You see: 2 lines in its own pane, with lines at 80 and 20

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.

Type this: Williams %R
Formula: -100 * (highest(high, 14) - close) / (highest(high, 14) - lowest(low, 14))
You see: Line in its own pane, with lines at -20 and -80
Type this: Williams %R 10
Formula: -100 * (highest(high, 10) - close) / (highest(high, 10) - lowest(low, 10))
You see: Line in its own pane, with lines at -20 and -80

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.

Type this: CCI 20
Formula: cci(hlc3, 20)
You see: Line in its own pane, with lines at 100 and -100
Type this: commodity channel index 14
Formula: cci(hlc3, 14)
You see: Line in its own pane, with lines at 100 and -100
Type this: flag when CCI 20 goes above 100
Formula: cci(hlc3, 20) > 100
You see: Triangles under matching bars

Volume 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.

Type this: Volume weighted CCI
Formula: vwcci(hlc3, 20)
You see: Line in its own pane, with lines at 100 and -100
Type this: Volume weighted CCI, length 10
Formula: vwcci(hlc3, 10)
You see: Line in its own pane, with lines at 100 and -100

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.

Type this: WaveTrend oscillator
Formula: 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)
You see: 2 lines in its own pane, with lines at 60 and -60
Type this: WaveTrend with channel length 9 and average length 12
Formula: 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)
You see: 2 lines in its own pane, with lines at 60 and -60
Type this: mark WaveTrend bullish crosses
Formula: 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))
You see: Triangles under matching bars
Type this: mark WaveTrend bearish crosses
Formula: 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))
You see: Triangles under matching bars

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.

Type this: Chande momentum oscillator
Formula: cmo(9)
You see: Line in its own pane, with lines at 50 and -50
Type this: CMO 14
Formula: cmo(14)
You see: Line in its own pane, with lines at 50 and -50

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.

Type this: Connors RSI
Formula: crsi(3, 2, 100)
You see: Line in its own pane, with lines at 90 and 10

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.

Type this: Schaff trend cycle
Formula: stc(23, 50, 10)
You see: Line in its own pane, with lines at 75 and 25

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.

Type this: Fisher transform
Formula: fisher(9)
lag(fisher(9), 1)
You see: 2 lines in its own pane

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.

Type this: Know Sure Thing
Formula: 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)
You see: 2 lines in its own pane, with lines at 0

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.

Type this: Kaufman efficiency ratio over 10 bars
Formula: abs(close - lag(close, 10)) / sum(abs(close - lag(close, 1)), 10)
You see: Line in its own pane

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.

Type this: ATR 14
Formula: atr(14)
You see: Line in its own pane
Type this: 14 day ATR as a percent of price, as a line
Formula: atr(14) / close * 100
You see: Line in its own pane

TTM 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.

Type this: TTM Squeeze
Formula: ttm_momentum(20)
You see: Histogram in its own pane
Type this: Squeeze momentum indicator
Formula: ttm_momentum(20)
You see: Histogram in its own pane
Type this: mark when the TTM squeeze is on
Formula: ttm_squeeze(20)
You see: Triangles under matching bars

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.

Type this: percent above the 200 day
Formula: (close - sma(close, 200)) / sma(close, 200) * 100
You see: Histogram in its own pane
Type this: percent above the 200 day as a line
Formula: (close - sma(close, 200)) / sma(close, 200) * 100
You see: Line in its own pane
Type this: distance from the 20 day moving average measured in ATRs
Formula: (close - sma(close, 20)) / atr(14)
You see: Histogram in its own pane

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.

Type this: On balance volume
Formula: obv
You see: Line in its own pane

Note: 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.

Type this: Money flow index
Formula: mfi(14)
You see: Line in its own pane, with lines at 80 and 20
Type this: MFI 10
Formula: mfi(10)
You see: Line in its own pane, with lines at 80 and 20
Type this: flag when MFI is below 20
Formula: mfi(14) < 20
You see: Triangles under matching bars

Note: 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.

Type this: mark days with volume over twice normal
Formula: volume > 2 * sma(volume, 20)
You see: Triangles under matching bars
Type this: volume as a ratio to its 50 day average
Formula: volume / sma(volume, 50)
You see: Histogram in its own pane

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.

Type this: mark golden crosses
Formula: crossover(sma(close, 50), sma(close, 200))
You see: Triangles under matching bars
Type this: mark when the 50 day SMA crosses below the 200 day SMA
Formula: crossunder(sma(close, 50), sma(close, 200))
You see: Triangles under matching bars
Type this: mark when the 8 EMA crosses above the 21 EMA
Formula: crossover(ema(close, 8), ema(close, 21))
You see: Triangles under matching bars

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.

Type this: mark when the close breaks above the prior 20 bar high
Formula: close > lag(highest(high, 20), 1)
You see: Triangles under matching bars
Type this: mark when the close breaks below the prior 20 bar low
Formula: close < lag(lowest(low, 20), 1)
You see: Triangles under matching bars

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.

Type this: last swing high and swing low on the chart
Formula: swinghigh(5)
swinglow(5)
You see: 2 lines on the candles
Type this: swing high and swing low with a length of 10
Formula: swinghigh(10)
swinglow(10)
You see: 2 lines on the candles

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.

Type this: flag sweeps of the swing low
Formula: sweeplow(5)
You see: Triangles under matching bars
Type this: flag sweeps of the swing high
Formula: sweephigh(5)
You see: Triangles under matching bars

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.

Type this: mark bullish break of structure
Formula: crossover(close, swinghigh(5))
You see: Triangles under matching bars
Type this: mark bearish break of structure
Formula: crossunder(close, swinglow(5))
You see: Triangles under matching bars

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.

Type this: mark bullish fair value gaps
Formula: low > lag(high, 2)
You see: Triangles under matching bars
Type this: mark bearish fair value gaps
Formula: high < lag(low, 2)
You see: Triangles under matching bars

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.

Type this: Mark bars where close crosses above the prior 5 bar high within 10 bars of a sweep of the swing low
Formula: crossover(close, lag(highest(high, 5), 1)) and barssince(sweeplow(5)) <= 10
You see: Triangles under matching bars

Candle 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.

Type this: mark inside days
Formula: high < lag(high, 1) and low > lag(low, 1)
You see: Triangles under matching bars
Type this: mark outside days
Formula: high > lag(high, 1) and low < lag(low, 1)
You see: Triangles under matching bars

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.

Type this: mark days that open above the previous high
Formula: open > lag(high, 1)
You see: Triangles under matching bars
Type this: mark days that open below the previous low
Formula: open < lag(low, 1)
You see: Triangles under matching bars

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.

Type this: Paint bars green when the 8 EMA is above the 21 EMA and red when below
Formula: ema(close, 8) > ema(close, 21)
You see: Candles painted green and red
Type this: paint the candles green above the 200 day average and red below
Formula: close > sma(close, 200)
You see: Candles painted green and red
Type this: Color the candles by whether RSI is above 50
Formula: rsi(close, 14) > 50
You see: Candles painted green and red

Not 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.