A trading indicator is a calculation on price, and sometimes volume, that turns raw candles into a number that is easier to act on. Most of the common ones answer one of five questions: which way is the trend (Moving Average, Parabolic SAR, Ichimoku, Alligator), how strong is it (ADX), how stretched is the move (RSI, Stochastic, Williams %R, CCI, DeMarker, Money Flow Index), is momentum changing (MACD, Momentum, Awesome Oscillator, Bulls and Bears Power), and how much is price moving (ATR, Standard Deviation, Bollinger Bands, Envelopes). No indicator predicts the market: each one describes what has already happened, and levels such as "RSI below 30" are conventions, not rules that work by themselves. An indicator becomes useful when it is part of a precise, testable condition, such as "RSI(14) crosses above 30 on the closed bar". This reference covers the 19 indicators available as blocks in AlgoPuzzle, which match the standard MetaTrader calculations, with the formula and a worked example for each, the usual levels, the differences between look-alike indicators, and how to build them into conditions you can backtest.
All 19 indicators at a glance
Each indicator answers one question, so the fastest way to choose is to start from the question. The defaults below are the ones AlgoPuzzle starts with; every setting can be changed.
| Indicator | Question it answers | Range | Default settings |
|---|---|---|---|
| Moving Average | Which way is the trend? | Price | 14, Simple, Close |
| RSI | How stretched is the move? | 0 to 100 | 14 |
| MACD | Is momentum shifting? | Around 0 | 12, 26, 9 |
| Bollinger Bands | Is price far from its average, given recent volatility? | Price | 20, 2.0 |
| ATR | How large are candles right now? | Price distance | 14 |
| Stochastic | Where is the close inside the recent range? | 0 to 100 | 5, 3, 3 |
| ADX, +DI, -DI | How strong is the trend, and who leads? | 0 to 100 | 14 |
| Parabolic SAR | Where would a trailing stop sit, and has the trend flipped? | Price | 0.02, 0.2 |
| Ichimoku | Is price above or below the cloud? | Price | 9, 26, 52 |
| Envelopes | Is price a fixed percentage away from its average? | Price | 14, 0.1% |
| Alligator | Are the three averages stacked in trend order? | Price | 13, 8, 5 (shifted 8, 5, 3) |
| CCI | How far is price from its average, in typical deviations? | Around 0, no fixed limit | 20 |
| Williams %R | Where is the close inside the recent range? | -100 to 0 | 14 |
| Momentum | Is price higher than N candles ago? | Around 100 | 14 |
| DeMarker | Are highs and lows expanding up or down? | 0 to 1 | 14 |
| Bulls / Bears Power | How far do highs and lows reach from the average? | Around 0 | 13 |
| Awesome / Accelerator Oscillator | Is short-term momentum beating longer-term momentum? | Around 0 | Fixed (5 and 34) |
| Standard Deviation | How widely is price spread around its average? | Price distance | 20 |
| Money Flow Index | How stretched is the move, weighted by tick volume? | 0 to 100 | 14 |
Trend indicators: formulas and worked examples
Trend indicators smooth or track price so that direction is easier to see, which also means they react after the move has started. All the examples use made-up round numbers so you can check the arithmetic.
| Indicator | Formula | Worked example |
|---|---|---|
| Simple Moving Average | Sum of the last N closes / N | Closes 1.10, 1.20, 1.30: SMA(3) = 3.60 / 3 = 1.20 |
| Exponential Moving Average | Previous EMA + k x (close - previous EMA), where k = 2 / (N + 1) | N = 14: k = 0.1333. Previous EMA 1.1000, close 1.1030: 1.1000 + 0.1333 x 0.0030 = 1.1004 |
| MACD | Main = EMA(12) - EMA(26). Signal = average of Main over 9. Histogram = Main - Signal | EMA(12) 1.1040, EMA(26) 1.1020: Main 0.0020. Signal 0.0015: Histogram 0.0005 |
| ADX | DX = |+DI - -DI| / (+DI + -DI) x 100. ADX = smoothed average of DX | +DI 30, -DI 10: DX = 20 / 40 x 100 = 50 |
| Parabolic SAR | Next SAR = SAR + AF x (EP - SAR). EP is the extreme price of the trend, AF starts at the step and grows up to the max | SAR 1.1000, EP 1.1100, AF 0.02: 1.1000 + 0.02 x 0.0100 = 1.1002 |
| Ichimoku | Tenkan = (highest high + lowest low of 9) / 2. Kijun = same over 26. Senkou A = (Tenkan + Kijun) / 2. Senkou B = (highest high + lowest low of 52) / 2. A and B are drawn 26 candles ahead | Tenkan 1.1050, Kijun 1.1030: Senkou A = 2.2080 / 2 = 1.1040 |
| Alligator | Three smoothed averages of the median price: Jaw (13, shifted 8), Teeth (8, shifted 5), Lips (5, shifted 3) | Lips above Teeth above Jaw is the classic uptrend reading |
The difference between moving average types is how much weight recent candles get: an EMA reacts faster than an SMA of the same period, and a Smoothed average slower. RSI, MACD & Moving Averages, Quickly is a shorter introduction to the three most common indicators.
Oscillators: formulas, worked examples and usual levels
Oscillators measure how stretched or how fast a move is on a fixed or centred scale, which is why they have conventional "overbought" and "oversold" levels. In a strong trend an oscillator can stay at its extreme for a long time, so a high reading is not a sell signal by itself.
| Indicator | Formula | Worked example | Usual levels |
|---|---|---|---|
| RSI | 100 - 100 / (1 + RS), where RS = average gain / average loss | Average gain 1.0, average loss 0.5: RS = 2, RSI = 66.67 | 70 overbought, 30 oversold |
| Stochastic | %K = (close - lowest low) / (highest high - lowest low) x 100, smoothed by Slowing. %D = average of %K | Close 1.1080, range 1.1000 to 1.1100: %K = 80 (before smoothing) | 80 and 20 |
| Williams %R | (highest high - close) / (highest high - lowest low) x -100 | Same candle: -20 | -20 and -80 |
| CCI | (typical price - its average) / (0.015 x mean deviation) | Typical price 1.1060, average 1.1000, mean deviation 0.0040: 0.0060 / 0.00006 = 100 | +100 and -100 |
| Momentum | Price now / price N candles ago x 100 | 1.1110 / 1.1000 x 100 = 101 | Crossing 100 |
| DeMarker | Average of DeMax / (average of DeMax + average of DeMin), from how far highs rose and lows fell | 0.0060 / (0.0060 + 0.0020) = 0.75 | 0.7 and 0.3 |
| Money Flow Index | 100 - 100 / (1 + positive money flow / negative money flow), using typical price x tick volume | Flows 3 and 1: 100 - 100 / 4 = 75 | 80 and 20 |
| Bulls / Bears Power | Bulls = high - EMA(13). Bears = low - EMA(13) | High 1.1050, low 1.1010, EMA 1.1020: Bulls 0.0030, Bears -0.0010 | Crossing 0 |
| Awesome / Accelerator | AO = SMA(5) - SMA(34) of the median price. AC = AO - SMA(5) of AO | SMA(5) 1.1040, SMA(34) 1.1025: AO = 0.0015 | Crossing 0 |
Volatility indicators: formulas and worked examples
Volatility indicators say how much price is moving, not which way, so they are mainly used for sizing stops and filtering quiet markets. ATR and Standard Deviation are distances in price units, so they are compared with a pip distance or with each other, not with a price.
| Indicator | Formula | Worked example |
|---|---|---|
| ATR | True range = the largest of high - low, |high - previous close|, |low - previous close|. ATR = its smoothed average | High 1.1050, low 1.1010, previous close 1.1000: true range = 0.0050 |
| Standard Deviation | Square root of the average squared distance from the moving average | Values 1, 2, 3, 4, 5 around an average of 3: 1.41 |
| Bollinger Bands | Middle = SMA(20). Upper and lower = middle +/- 2 x standard deviation | Middle 1.1000, deviation 0.0020: 1.1040 and 1.0960 |
| Envelopes | Moving average x (1 +/- deviation / 100) | 1.1000 with 0.1%: 1.1011 and 1.0989 |
The most common use of ATR is a stop that adapts to the market, such as 2 x ATR; ATR-Based Stop Loss Sizing covers it in detail, and Position Sizing shows how to size the lot from that stop.
Look-alike indicators: what is actually different
Several indicators look interchangeable but measure different things, and some are nearly the same calculation. Using two from the same row adds little new information to a strategy.
| Pair | The difference | Practical consequence |
|---|---|---|
| RSI vs Stochastic | RSI compares the size of gains and losses; Stochastic locates the close inside the range | Stochastic reaches its extremes more often, so it fires more signals |
| Stochastic vs Williams %R | The same raw calculation on a different scale: %R = raw %K - 100 | Close at 80 on %K before smoothing is -20 on %R, so using both is redundant |
| RSI vs Money Flow Index | MFI uses typical price and weighs it by tick volume | On forex, volume means tick volume, the number of price changes, not traded size |
| SMA vs EMA | An EMA weights recent candles more heavily | An EMA turns sooner and also gets whipsawed more often |
| Bollinger Bands vs Envelopes | Bollinger width follows volatility; Envelopes stay a fixed percentage from the average | Bollinger Bands widen in fast markets; Envelopes do not |
| ATR vs Standard Deviation | ATR uses each candle's range and gaps; Standard Deviation uses the spread of prices around their average | ATR is the usual choice for stop distance |
| ADX vs Moving Average | ADX measures strength without direction; a moving average shows direction without strength | They complement each other: one is often used as a filter for the other |
How to turn an indicator into a trading condition
An indicator does nothing until it is part of a true-or-false question about the market. In AlgoPuzzle that question is a condition block in a rule's IF slot, and each type of condition suits a different kind of signal. All the blocks are described in Conditions and Indicators and values.
| Condition | True when | Example | Typical use |
|---|---|---|---|
| Comparison | One value is above or below another | RSI(14) < 30 | A state: "is it oversold now?" |
| crosses above / below | One value moves to the other side on this bar only | MACD Main crosses above MACD Signal | An event: fires once, not on every bar |
| is rising / falling for N bars | The value moved the same way on each of the last N bars | Moving Average(50) is rising for 3 bars | A direction filter |
| is between | The value is inside a range | RSI(14) is between 40 and 60 | Excluding extremes |
| Candle pattern | A completed candle has a given shape | Bullish engulfing on the bar 1 bars ago | Price-action confirmation |
| AND / OR / NOT | Conditions combine | Close above MA(200) AND RSI crosses above 30 | A trend filter plus an entry trigger |
A state and an event behave very differently. "RSI below 30" stays true for as long as RSI stays there, while "RSI crosses above 30" is true on a single bar. A rule that uses a state can keep firing, so limit it with the rule's Positions setting. Algo Trading Strategies for Beginners shows how these combine into five common rule types.
Live bar or closed bar: the setting that changes results
A rule is checked once, right after a new candle opens, so the choice of candle decides what the indicator value means. Reading the candle that has just opened uses a value based on its first price, which is not the value you see on a chart later.
| Choice | What it reads | Same as a finished chart? | How to set it in AlgoPuzzle |
|---|---|---|---|
| On the closed bar | The last completed candle | Yes | Set the comparison or crosses block to "on the closed bar", or wrap the value in "as of 1 bars ago" |
| On the live bar | The candle that has just opened | No, the value keeps changing until the candle closes | The default of a comparison taken from the drawer; crosses and rising / falling start on the closed bar |
If a backtest and a chart seem to disagree about a signal, check this setting first. It is also a good reason to read how the backtest trades before trusting a result.
Which indicators can be compared with each other
A comparison only makes sense between values in the same unit: RSI is a 0 to 100 score, ATR is a price distance and a moving average is a price. AlgoPuzzle checks this as you build, so a block of the wrong kind will not snap into place.
| Kind | Indicators | Compare with |
|---|---|---|
| Price | Moving Average, Bollinger Bands, Parabolic SAR, Ichimoku, Envelopes, Alligator, candle prices | Another price, or a price level such as 1.1000 |
| Oscillator (0 to 100) | RSI, Stochastic, Money Flow Index | Each other, or a number |
| Volatility | ATR, Standard Deviation | Each other, or a number or pip distance |
| MACD | Main, Signal, Histogram | Another MACD line, or a number such as 0 |
| ADX / DI | ADX, +DI, -DI | Another ADX line, or a number such as 25 |
| Own scale | CCI, Williams %R, Momentum, DeMarker, Bulls / Bears Power, Awesome / Accelerator | The same indicator, or a number |
Example rules built from these indicators
These rules show how the pieces fit together. They are examples for learning the structure, not recommendations, and none of them is claimed to be profitable: backtest any idea before relying on it.
| Idea | IF condition | Stop and target | Indicators used for |
|---|---|---|---|
| Trend pullback | Previous Close above Moving Average(200) AND RSI(14) crosses above 40 | 2 x ATR(14), 4 x ATR(14) | Direction, timing, stop size |
| Moving average crossover | EMA(20) crosses above EMA(50) AND ADX(14) > 25 | 2 x ATR(14), 3 x ATR(14) | Timing, strength filter, stop size |
| Mean reversion in a quiet market | Previous Close below lower Bollinger Band AND ADX(14) < 20 | Stop 1.5 x ATR(14), CLOSE IF Previous Close above middle band | Stretch, regime filter, exit |
| Breakout | Current Price above Highest High of the last 20 closed bars AND ATR(14) is rising for 2 bars | 2 x ATR(14), 4 x ATR(14) | Trigger, volatility filter, stop size |
| Higher-timeframe filter | RSI(14) on 4 Hours > 50 AND MACD Main crosses above Signal, on a 1 Hour rule | 2 x ATR(14), 4 x ATR(14) | Bigger-picture direction, timing |
A filter such as "Current Spread (pips) < 2" can be added to any of them with AND, so the rule skips entries while spreads are wide (why spread matters). After a backtest, read the result with profit factor, drawdown and expectancy.
Common indicator mistakes
| Mistake | Why it hurts | Fix |
|---|---|---|
| Treating "overbought" as a sell signal | In a strong trend, RSI can stay above 70 for a long time | Add a trend filter, or wait for a cross back through the level |
| Stacking similar oscillators | RSI, Stochastic and CCI ask nearly the same question | Use one indicator per question |
| Comparing ATR with a price | ATR is a distance, a moving average is a price | Compare ATR with pips, or use price minus average |
| Using = with an indicator | Values are rarely exactly equal to a number | Use >, < or crosses above |
| Assuming every platform has the same defaults | Stochastic and MACD settings differ between charts and tools; the MACD signal line is a simple average in MetaTrader and exponential in cTrader | Set the periods yourself, and expect small differences across platforms |
| Tuning periods until the backtest looks perfect | The settings fit past noise, not a repeatable effect | Read What Is Curve Fitting? |
| Backtesting without costs | Frequent signals can vanish after spread and slippage | Set a realistic spread; see slippage |
How to test an indicator idea without coding, step by step
The quickest way to find out what an indicator does on your market is to build the rule and test it. In AlgoPuzzle the steps are:
- Open the builder. Go to the AlgoPuzzle builder in your browser. Building needs no account.
- Set the asset and timeframe. Each rule names its own market and timeframe; see Strategy rules.
- Build the condition. Drag a condition into IF and drop the indicator into its slots. Type "bollinger" or "atr" in Search blocks to find a block quickly.
- Add the trade. Open BUY or Open SELL with a lot size, stop loss and take profit; see Trades, stops and lot size.
- Backtest it. Switch to Backtest and run it (a free account loads the data). The trade chart shows every entry, so you can see whether the indicator fired when you expected. See Reading backtest results.
- Export and confirm. Export to MT5, MT4 or cTrader, then check it in the MT5 Strategy Tester and on a demo account (why both).
Where to go next
| You want to | Read |
|---|---|
| Understand what an EA does with these conditions | What Is an Expert Advisor (EA)? |
| Build a first complete strategy | How to Build Your First Algorithmic Trading Strategy |
| Use trailing stops once the trade is open | Trailing Stop Loss Explained |
| See every block and setting | Indicators and values (documentation) |
| Build indicators into a gold strategy | How to Build a Gold (XAUUSD) EA Without Coding |
| Compare no-code builders | fxDreema vs EA Builder vs MQL5 Wizard vs AlgoPuzzle |
Common questions
What are the most common trading indicators?
The most widely used are the Moving Average, RSI, MACD, Bollinger Bands, ATR and Stochastic. They answer different questions: moving averages show trend direction, RSI and Stochastic show how stretched a move is, MACD shows momentum, Bollinger Bands show price against its recent volatility, and ATR shows how large candles are.
Which indicator is best for identifying a trend?
No single indicator is best, because direction and strength are separate questions. A moving average shows direction: price above a rising average suggests an uptrend. ADX shows strength regardless of direction: readings above 25 are conventionally read as a trending market. +DI above -DI, or Parabolic SAR below price, also point to an uptrend.
What is the difference between RSI and Stochastic?
RSI compares the size of recent gains with the size of recent losses. Stochastic measures where the close sits inside the recent high-low range. Both run from 0 to 100, but Stochastic usually reacts faster and reaches its extremes more often. Their usual overbought and oversold levels are 70 and 30 for RSI, and 80 and 20 for Stochastic.
What does ADX above 25 mean?
By convention, ADX above 25 suggests the market is trending and below 20 suggests it is not. ADX measures strength only, not direction: it rises in strong downtrends as well as strong uptrends. To see the direction, compare its two companion lines: +DI above -DI favours buyers, and -DI above +DI favours sellers.
What is the difference between ATR and standard deviation?
Both measure volatility in price units. ATR averages the true range of each candle, so it includes gaps and intrabar highs and lows. Standard deviation measures how widely closing prices are spread around their average. ATR is the more common choice for sizing a stop loss, such as 2 x ATR.
Should an indicator condition use the live bar or the closed bar?
Most traders use the closed bar, because that is the value a chart shows once the candle has finished. A rule is checked right after a new candle opens, so the live bar has barely started and its indicator value rests on that first price. In AlgoPuzzle, set the block to on the closed bar or wrap the value in as of 1 bars ago.
How many indicators should a trading strategy use?
There is no correct number, but each indicator should answer a different question. RSI, Stochastic and CCI all measure how stretched price is, so using all three adds little new information. A moving average for direction, an oscillator for timing and ATR for the stop cover three separate questions.
Can I use indicators in an Expert Advisor without coding?
Yes. In a no-code builder such as AlgoPuzzle you drag an indicator into a condition, for example RSI(14) crosses above 30, add the trade and stops, backtest it in the browser and export it as a MetaTrader 5 or MetaTrader 4 Expert Advisor or a cTrader cBot.