Moving average
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.
Inputs and outputs
Section titled “Inputs and outputs”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 |
Settings
Section titled “Settings”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 | – |
Example
Section titled “Example”Notifies you when the price crosses above the EMA 200.
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.
{ "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" } ]}Good to know
Section titled “Good to know”- 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.
Technical details
Section titled “Technical details”- Type in the chain:
core.ma· Version 1.0.0 · Category keyind - Reference tests in the manifest: 5 (with fixed price data
binance-btcusdt-1h-500) - How a node is built