Skip to content

Moving average

Indicators core.ma Version 1.0.0

SMA, EMA, WMA or HMA over N periods. Calculates like TradingView: ta.sma, ta.ema (seeded with the SMA of the first N values), ta.wma and ta.hma. The EMA 200 is a classic trend filter.

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 in Number series required
Output Average out Number series in the unit of the input

The settings appear on the right under “Properties” once the node is selected on the board. Those marked “More” appear after clicking “More”.

Setting Default Allowed Meaning
Type kind EMA · exponential (ema) SMA · simple · EMA · exponential · WMA · weighted · HMA · Hull –
Periods length 20 from 2 to 500, whole number –

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 · Binance · 1hMoving averageEMA 200Compare A/BPrice crosses above EMA 200Pushat most every 4 h

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" }
]
}
  • 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.
  • Type in the chain: core.ma · Version 1.0.0 · Category key ind
  • Reference tests in the manifest: 5 (with fixed price data binance-btcusdt-1h-500)
  • How a node is built