System builder
Indicators
Indicators are arithmetic on past prices or volume. They can summarize. They cannot know the next trade. Learn the formula well enough to say what the number is not.
On this page
The lab under this introduction uses a constructed series. It is labeled as such so nobody can mistake it for a chart to trade. Choose MACD, RSI, or another tool and the panel for that tool opens in place. Each section below then shows the same kind of figure, and a way to use the number without pretending the number is an order.
Indicator lab
Try the arithmetic, then read the number
These prices were generated. They are not a market, not a quote, and not a trade. Choose an indicator. Its panel opens here, with the latest reading written underneath.
The slider moves only the averages and the bands. RSI, MACD, ATR, stochastic, and ADX keep their usual lengths.
Oscillator
RSI
RSI (14) is 73. That is the balance of average gains and average losses. A print near 70 or 30 is Wilder's convention, not an order. It does not follow the length slider.
Read the RSI sectionThe last close is above the 20-period simple average. Recent closes were strong enough to sit over their own average. The average is late by design. Band width is 4.6 percent of the middle average. Narrow width means recent closes clustered. Clustering does not choose a direction.
Section 01
Moving averages
Close, simple average, exponential average
- Close
- SMA 20
- EMA 20
The last close on this drawing is 116.71, above the simple average. The 20-period simple average is 114.15. The exponential average is 114.09. The exponential line hugs the latest closes more tightly because newer prices carry more weight. Both lines arrive late at the turn. That lag is the average, not a drawing error.
Use it
- Write the length down before the session. Shortening it after a missed turn only adds noise.
- A close above a rising average describes that window. It is not an instruction to buy.
- If you use a crossover, write the fast length, the slow length, and the exit. Then size the stop on the desk.
A simple moving average is the sum of the last N closes divided by N. Each close counts the same. An exponential moving average gives more weight to the newer close. Its usual multiplier is 2 divided by N plus 1, and it needs a seed, often a simple average of the first N closes. Both follow price. Both are late at turns, because a turn is new and the average still contains the old path.
A price above a rising average describes strength in that window. It is not an instruction to buy. Crossovers of a fast and a slow average are a trend rule with a famous lag. They work when a move is large enough to pay for the lag and the false crosses. They bleed in ranges. Shortening N to "make it faster" also makes it noisier. You have not removed the tradeoff. You have moved it.
Section 02
RSI
RSI, length 14
- RSI
- 30 and 70
The last RSI on this drawing is 73, at or above 70. The number is the balance of smoothed average gains and average losses. Wilder's 70 and 30 lines are a convention. A high reading can persist while price keeps rising.
Use it
- Freeze the length, usually 14, before you look at the chart.
- Read the number as gains versus losses. Do not read it as an order.
- If you use 70 and 30, write the action in advance. Shorting only because the line is above 70 fights many trends.
- A divergence counts only if you defined the comparison before the bar printed.
J. Welles Wilder published the relative strength index in New Concepts in Technical Trading Systems. The usual length is 14. Relative strength here means average gain versus average loss over the window. It has nothing to do with comparing one stock's strength to another, which is a different use of the same English words.
Wilder's RSI
RSI = 100 − 100 ÷ (1 + average gain ÷ average loss)
Gains and losses are taken as positive numbers. After a first simple average, Wilder smooths them with a factor of 1 divided by N. That is not the 2 divided by N plus 1 multiplier of a standard exponential average. If you code the wrong smoother, you have drawn a cousin of RSI and should not quote Wilder's levels. The index runs from 0 to 100. If there is no loss in the window it sits at 100.
Wilder discussed 70 and 30 as conventional bands. In a strong trend, RSI can live above 70 while price keeps rising. Calling that "overbought, time to short" is how people fight a trend with a slogan. A more careful use is to describe momentum, or to notice a divergence you defined in advance: price makes a new high, and RSI, under your frozen settings, does not. Divergence is a prompt to look. It is not a filled order.
Section 03
MACD
MACD, 12, 26, and 9
- MACD line
- Signal
- Histogram up
- Histogram down
The last MACD line on this drawing is 1.62. The signal is 1.59. The histogram is 0.03. The line is above zero, so the 12-period average is above the 26-period average. The histogram is positive, so the MACD line is above its signal. Early bars are omitted because the averages are still warming up.
Use it
- Keep 12, 26, and 9 unless a test gives you a reason to change them. Changing them after one loss is fitting.
- Above zero means the faster average is above the slower average. That is the whole meaning of the zero line.
- A signal cross is that spread changing, lagged again. Write whether you require the cross, the zero line, or both, and where the stop is.
- Do not trade the warmup. The first values on a fresh chart are unstable.
The moving average convergence divergence line, associated with Gerald Appel, is usually the 12-period exponential average minus the 26-period exponential average of price. The signal line is a 9-period exponential average of that difference. The histogram is the MACD line minus the signal line. Those three lengths are a convention. They are not a discovered constant of markets.
When the MACD line is above zero, the fast average is above the slow average. That is all the zero line means. A cross of the signal line is a change in the spread between those averages, smoothed again. It lags. Early values on a fresh chart are unstable because the averages are still warming up. Do not trade the warmup.
Section 04
Bollinger Bands
Bollinger Bands, 20 and 2
- Close
- Middle average
- Bands
The bands use a 20-period simple average and two population standard deviations, the division by N that Bollinger specified. Band width on the last bar is 4.6 percent of the middle average. The last close is 116.71. A tag of the upper band is not a sell. In a trend, price can walk a band. Narrow bands mean recent closes clustered. They do not choose a direction.
Use it
- Treat a band touch as a location, not a signal.
- If you trade a squeeze, you still need a separate entry, a stop, and a size.
- Put the stop distance into the position-size tool. The bands do not size the trade.
John Bollinger's bands put a simple average in the middle, usually 20 closes, and draw lines a number of standard deviations away, usually two. He uses the population standard deviation, dividing by N, not by N minus 1. The bands measure how widely recent closes are scattered. They are not a ceiling the market respects.
A tag of the upper band is not a sell signal. In a trend, price can walk the band. Narrow bands mean the recent closes clustered. Clustering often comes before a larger move, in either direction. Bollinger's %b says where price sits between the bands. Bandwidth says how wide the bands are relative to the middle. Both are descriptions. Pair them with a separate rule if you want a system.
Section 05
Average true range
Average true range, length 14
- ATR
ATR is a width. It has no up or down. On the last bar of this drawing it is 1.32. A stop two ATRs away would sit 2.63 from the entry you choose. That multiple is your choice. A wider stop means fewer units if the cash at risk stays fixed.
Use it
- Measure the stop in ATR, or in price, and write the number down before you size.
- Type that distance, and the cash you can lose, into the position-size tool.
- Remember the optimistic case: a gap can make the real loss larger than ATR suggested.
True range is the greatest of three distances: today's high minus today's low, the absolute distance from today's high to yesterday's close, and the absolute distance from today's low to yesterday's close. The third and second terms exist so a gap is counted. Average true range is Wilder's smooth of that true range, usually over 14 periods.
ATR is a width, not a direction. A common stop places the exit a multiple of ATR away from entry or from a recent swing, so the stop sits outside ordinary noise. The multiple is a choice. A wider stop means a smaller position if you keep the cash at risk fixed. That tradeoff is the point. ATR does not know where the news will open.
Section 06
ADX and directional movement
ADX with plus DI and minus DI
- ADX
- Plus DI
- Minus DI
The last ADX on this drawing is 47. Plus DI is 29 and minus DI is 9. Plus DI is above minus DI, so the recent directional movement leaned up. ADX itself does not say which way. A reading near 25 is a folk label for a directional window, not a permit to enter. The line starts late because each smooth needs a warmup.
Use it
- Use plus DI and minus DI for direction. Use ADX only to describe how directional the window has been.
- A high ADX does not promise that the trend will continue.
- If you require a threshold, write the number in the rule before the session. Do not invent it after the bar.
Wilder's average directional index is built from smoothed plus and minus directional movement. Plus DI and minus DI carry the direction. ADX itself does not. A high ADX says the market has been trending. It does not say which way, and it does not say the trend will continue. A reading above 25 is a folk threshold taken from that work. It is a label for "this window was directional," not a permit to enter.
Section 07
Stochastic
Stochastic, 14 and 3
- %K
- %D
The last %K is 91 and the last %D is 93. %K says where the close sits inside the recent high-low range. A high number means the close is near the top of that box. In a trend, closes can stay there. The 20 and 80 lines are a habit, not a contract.
Use it
- Write the lookback and the %D length before you use a cross.
- Do not fade a trend only because %K is high. The range is a box the trend is trying to leave.
- If a cross is your trigger, the stop is still a separate rule. Put that distance on the desk.
George Lane's stochastic compares the close to the high-low range of the last N bars, often 14. The raw percent K is 100 times (close minus the lowest low) divided by (highest high minus lowest low). Percent D is a short average of K. A close near the top of the recent range prints a high number. In a trend, closes can hug that edge. The same warning as RSI applies, and it applies harder, because the lookback high and low are a box the trend is trying to leave.
Section 08
VWAP and volume tools
Session VWAP, reset every 40 bars
- Close
- VWAP
Volume here is constructed so the formula can be seen. It is not a market's volume. Typical price is the high, the low, and the close, divided by three. The running sums reset on the marked bars, the way a real VWAP resets with the session. A line that never resets is a different object. Do not call it VWAP. On spot foreign exchange, confirm whether your platform's volume is real volume or a tick count.
Use it
- Use VWAP as a benchmark for the session, not as a magnet price owes you.
- Reset it when the session resets.
- If you fade an extension from VWAP, write the invalidation first, then size it. Adding to a loser because it is far from VWAP is how mean-reversion accounts die.
The session volume-weighted average price is the running sum of typical price times volume, divided by the running sum of volume. Typical price is usually high plus low plus close, divided by three. It resets when the session resets. It is a benchmark for the session, used heavily in intraday equity trade. Bands around it are a platform extra, not part of the definition. On a chart with no true session, a never-reset VWAP is a different object. Do not call it the same name.
On-balance volume (OBV), from Joseph Granville, adds the bar's volume when the close is up and subtracts it when the close is down. The level is arbitrary because it is a running total. People watch the slope, and they watch disagreements with price. Volume itself is the number of shares or contracts traded. In spot foreign exchange, the number on a retail platform is often a tick count from that provider. Say which one you mean.
Section 09
Fibonacci retracements
A swing, then the usual ratios
- Swing
- Retracement
The lines measure the pullback from the swing high at 40 toward the swing low at 20. 38.2 percent and 61.8 percent are the rounded Fibonacci ratios traders draw. 50 percent is not a Fibonacci ratio. It stayed in the habit from older chart practice. A different swing, even one bar earlier, moves every line. Nothing here requires price to stop.
Use it
- Mark the swing high and the swing low before you draw anything. Write which bars you used.
- Treat the levels as candidate areas inside a system that already has a trend, a trigger, and a stop.
- Do not use the ratio as the system. If price stalls nearby, that is a description of where orders clustered, not a floor.
Traders draw the ratios 38.2 percent and 61.8 percent, and also 50 percent, between a swing low and a swing high. Fifty percent is not a Fibonacci ratio. It entered the habit from older chart practice. The start and end of the swing are a choice, and a different choice moves every level. There is no law that price must stop on a ratio. The levels are popular, so orders sometimes cluster near them. A cluster is not a floor. If you use them, use them as candidate areas inside a system that already has a trend, a trigger, and a stop. Do not use them as the system.
Section 10
Stacking indicators
Three momentum tools, one window
- RSI
- Stochastic %K
- MACD histogram
RSI and stochastic %K share the 0 to 100 scale in the top panel. The MACD histogram is a different unit, so it sits in its own panel. The shapes often lean together because each one is mostly a view of recent momentum. Waiting for all three to agree feels like confirmation. It is often one clock, read three times.
Use it
- Pair tools that measure different things: a slow trend filter, a faster trigger, and a volatility measure for the stop.
- Then stop adding. Every extra rule is another chance to fit the past.
- Write the trio in one sentence before the next session. If you cannot write it, you do not have a system yet. The journal is where you find out whether you followed it.
RSI, stochastic, and a fast MACD mostly describe the same recent momentum. Waiting until all three agree feels like confirmation and is often one clock read three times. Pair tools that measure different things if you pair any: a trend filter that is slow, and a timing tool that is fast, and a volatility measure for the stop. Then stop adding. Every extra rule is a chance to fit the past.
Check yourself
RSI has been above 70 for many bars while price rises. What does that mean?