Chain format
Este conteúdo não está disponível em sua língua ainda.
Every chain is JSON. That’s exactly the JSON you get when you Export, and it’s how the templates are stored in the repository. The format is described as a JSON schema (draft 2020-12): download chain-1.json.
An example
Section titled “An example”The RSI alert from First alert in three minutes:
{ "$schema": "https://bellchain.app/schema/chain-1.json", "name": "BTC RSI below 30", "version": 1, "nodes": [ { "id": "c1", "type": "core.candle", "position": { "x": 40, "y": 40 }, "settings": { "pair": "BTC/USDT", "timeframe": "1h" } }, { "id": "r1", "type": "core.rsi", "position": { "x": 260, "y": 40 }, "settings": { "length": 14 } }, { "id": "k1", "type": "core.compare", "position": { "x": 480, "y": 40 }, "settings": { "operator": "below", "value": 30 } }, { "id": "t1", "type": "core.telegram", "position": { "x": 700, "y": 40 }, "settings": {} } ], "edges": [ { "from": "c1.close", "to": "r1.in" }, { "from": "r1.out", "to": "k1.in" }, { "from": "k1.out", "to": "t1.in" } ]}The fields
Section titled “The fields”| Field | Required | Content |
|---|---|---|
$schema |
reference to the schema, for editors with autocompletion | |
name |
yes | name of the chain, 1 to 120 characters; appears in messages as {{chain}} |
version |
yes | version of the chain format, currently always 1 |
description |
free text, up to 2,000 characters | |
meta |
details for the template gallery and the chain’s TP and SL (meta.trade), see Templates |
|
pauseAfterAlert |
true: one-off, the chain pauses after its first alert, see Price alert |
|
scanner |
{ "node": "c1", "pairs": ["BTC/USDT", "ETH/USDT"] }: the candle node runs as a scanner for each pair of the list separately, 1 to 100 pairs, each only once. Instead of pairs, "top": { "count": 25, "quote": "USDT" } gives top N by volume, count 1 to 100; the pairs are then renewed every day. Never both. The candle’s own pair then doesn’t count. |
|
nodes |
yes | the nodes, at most 200 |
edges |
yes | the connections, at most 1,000 |
customNodes |
the custom nodes the chain uses, as JSON, at most 20; nodes refer to them with custom.… |
An entry in nodes:
| Field | Content |
|---|---|
id |
unique within the chain, starts with a letter, no dot, up to 32 characters, such as c1 |
type |
node type with namespace, such as core.rsi; the types are listed in the node reference under “Technical details” |
position |
x and y on the board |
settings |
settings as number, text or boolean; Bellchain fills in missing ones with the default. Secret fields such as the Webhook and Discord URLs are empty in an export ("") |
A connection in edges leads from an output to an input, both as node.pin: "from": "c1.close", "to": "r1.in". Growing inputs such as on AND are called in0, in1 and so on.
Pinning versions
Section titled “Pinning versions”core.rsi always takes the latest version of a node. If a chain should never change unnoticed, pin the version: core.rsi@1 takes the latest 1.x, core.rsi@1.0.0 exactly this one. If a node’s result changes, its major version goes up.
Templates
Section titled “Templates”The templates are chains with additional details in meta. Whoever uses a template gets their own chain with notes and messages in the language of the interface; what only belongs to the gallery is dropped.
Field in meta |
Content |
|---|---|
title, description |
name and one sentence for the card, per language (de, en) |
tags |
tags such as einsteiger, dip or trend; the gallery filters by them |
author, source |
who wrote the template and where the idea comes from |
notes |
text of the notes per language, by note id; ends up in settings.text |
messages |
message per language, by id: for an action in settings.message, for a message template in settings.text |
tips |
tips for adapting the template, per language |
test |
result of a replay with the sample prices: alerts alerts in days days up to until (date in UTC); the gallery shows it as “In the test”, with trade also trades (hit TP, hit SL, open, sum after fees) |
trade |
Take-profit and stop-loss, also in your own chains: side (long or short), takeProfit and stopLoss in percent or with "unit": "atr" as a multiple of the ATR, fee per side, sides as the direction per action, stages with up to two more TP stages, trailing and breakEven (true), maxBars for the exit after N candles and positions (one: one trade at a time, flip: an opposite signal flips it; without it every signal is a trade). For money in the replay capital (starting capital, 1,000 if absent), sizing (fixed, share or risk), stake (an amount or a percentage depending on sizing) and leverage (1 to 125). The replay, the chart and the “Alerts” page score with it |
settings holds the German version, so the chain is complete even without meta.
How Bellchain checks a chain
Section titled “How Bellchain checks a chain”When loading, importing and testing, Bellchain checks in this order:
- structure against the JSON schema
- unique ids and known nodes
- settings against each node’s description; missing ones are filled in
- connections: node and pin exist, types match, every input has at most one connection, no node connected to itself
- no loops, the same timeframe for all candles
- open required inputs and empty required fields
Point 6 is a note in a draft and an error when you activate. Every message names the location in the JSON, such as /nodes/2/settings/length, in German and English.
| Code | Means |
|---|---|
schema |
structure doesn’t match the schema |
duplicate-node |
two nodes with the same id |
unknown-type |
unknown node or version not available |
unknown-setting, invalid-setting |
setting doesn’t exist or value is invalid |
required-setting |
required field empty, such as a webhook’s URL |
unknown-node, unknown-pin |
connection points nowhere |
type-mismatch |
pin types don’t match |
input-taken |
input already has a connection |
self-loop, cycle |
node connected to itself, or a loop |
required-input, too-few-inputs |
required input open or too few growing inputs connected |
timeframe-mismatch |
candles with different timeframes |
custom-node |
a custom node is invalid, for example a formula with an error; the location points to the field, such as /customNodes/0/outputs/0/formula |
Importing always creates a copy. Errors block the import, notes don’t. That way unfinished chains can be shared too.
Versão 2026.11.29.15 · Changelog