Pular para o conteúdo

Moving average

Este conteúdo não está disponível em sua língua ainda.

IndicatorsIn Free

  • Value
Moving average

EMA 200

  • Average
This is how the node looks on the board: inputs on the left, outputs on the right.

Like the view from a plane: from up high the single bends of the road disappear and you see where it leads overall. That is how the average smooths the ups and downs into a trend.

Smooths the price into a trend line. Averages the last candles. Short spikes drop out and the trend remains: when the price is above the average, the trend tends to point up, below it down. Example: the EMA 200 is a common line for the long-term trend. When the price crosses above it, many see the start of an uptrend.

BTC/USDT price with EMA 20 and SMA 20Both averages smooth the price; the EMA follows it more closely.Price BTC/USDT81,00082,00083,00084,000Oct 8Oct 9Oct 10Oct 11Oct 12
  • Price (close of each candle)
  • EMA 20
  • SMA 20
BTC/USDT on 1-hour candles over four days. Both averages smooth out the spikes; the EMA follows the price more closely because it weights recent candles more.

The settings appear on the right under “Properties” once you click the node on the board. Below each field you find the same explanation as here.

Default: EMA · recent candles count more

How much weight recent candles get. If unsure, use EMA.

  • SMA · every candle counts equally: Simple average: every candle counts the same. Calm, but slow to react to turns. Common as SMA 50 or SMA 200.
  • EMA · recent candles count more (default): Exponential average: recent candles count more than old ones. Reacts faster than the SMA and is the usual choice, for example as EMA 20 or EMA 200.
  • WMA · weight drops evenly: Weighted average: the newest candle counts most, each older one evenly less. Follows the price more closely than the SMA.
  • HMA · fast, little lag: Hull average: follows the price with very little lag and still stays smooth. At turns it sometimes overshoots a little.

Default: 20 · from 2 to 500, whole number

How many candles the average covers. Common are 20 for the short-term, 50 for the medium-term and 200 for the long-term trend. More candles make the line calmer but slower.

Notifies you when the price crosses above the EMA 200.

Example chain: Candle, Moving average, Compare A/B, PushConnections: Candle → Moving average, Candle → Compare A/B, Moving average → Compare A/B, Compare A/B → Push.CandleBTC/USDT · 1hMoving averageEMA 200Compare A/BPrice crosses above EMA 200Pushat most every 4 h

How to connect the nodes:

  1. Candle (Price) → Moving average (Value)
  2. Candle (Price) → Compare A/B (A)
  3. Moving average (Average) → Compare A/B (B)
  4. Compare A/B (true/false) → Push (Trigger)

On the board it reads: EMA 200

Chain as JSON

To try it, copy it and paste it in the editor under “Import”. Importing creates a new chain.

ma.json
{
"name": "Example: Moving average",
"version": 1,
"nodes": [
{ "id": "c1", "type": "core.candle", "position": { "x": 40, "y": 40 }, "settings": { "pair": "BTC/USDT", "timeframe": "1h" } },
{ "id": "e1", "type": "core.ma", "position": { "x": 260, "y": 40 }, "settings": { "kind": "ema", "length": 200 } },
{ "id": "k1", "type": "core.compare-ab", "position": { "x": 480, "y": 40 }, "settings": { "operator": "crossesAbove" } },
{ "id": "p1", "type": "core.push", "position": { "x": 700, "y": 40 }, "settings": {} }
],
"edges": [
{ "from": "c1.close", "to": "e1.in" },
{ "from": "c1.close", "to": "k1.a" },
{ "from": "e1.out", "to": "k1.b" },
{ "from": "k1.out", "to": "p1.in" }
]
}

Only matching types connect: number series to number series (round pin), signal to signal (square), message to message (diamond).

Direction Pin Type Note
Input Value Number series required
Output Average Number series in the unit of the input
  • In messages the value is called “EMA 20”.
  • Warm-up with the default settings: 100 candles (this many extra candles are loaded by the replay before the value is reliable).
  • Search also finds it under: moving average, trend, sma, ema, wma, hma, hull.
  • More on this, with ready-made templates and their test results: Golden cross alerts.

Simple, exponential (seeded with the SMA of the first values), linearly weighted and Hull average; the same formulas as ta.sma, ta.ema, ta.wma and ta.hma in TradingView.

  • Type in the chain: core.ma · Version 1.0.0 · Category key ind
  • Settings in the chain: kind (Type), length (Candles)
  • Pins in the chain: Input in · Output out
  • Reference tests in the manifest: 5 (with fixed price data: 500 candles of 1h)
  • How a node is built

Versão 2026.11.29.15 · Changelog