Skip to content

Then

Logic & timing

  • First A
  • Then B
Then

below 30, then Compare A/B within 6 candles

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

First A, then B within candles. Waits for an order of events: first signal A must become true, then signal B within the set number of candles. The node is true on the candle where B follows A. That is how you build patterns like a breakout and pullback. Example: A is RSI below 30, B is price crosses above EMA 20, with 6 candles the alert fires when the price recovers within 6 hours after a sell-off.

Then with 3 candlesB only counts if A was true in the three candles before.First A: RSI below 30Then B: price crosses EMA 20B after A · 3 candles
  • input true
  • output true
  • false
Each box is one candle. The first B comes two candles after A and counts. The second B comes six candles after A, too late for 3 candles. After the next A two Bs follow within three candles; both count.

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: 6 · from 1 to 500, whole number

Within how many candles after A signal B must follow. With 1-hour candles, 6 candles are six hours, 24 a day.

Recovery after a sell-off: first the RSI drops below 30, then within 6 candles the price crosses above the EMA 20.

Example chain: Candle, RSI, Compare, Moving average, Compare A/B, Then, TelegramConnections: Candle → RSI, RSI → Compare, Candle → Moving average, Candle → Compare A/B, Moving average → Compare A/B, Compare → Then, Compare A/B → Then, Then → Telegram.CandleBTC/USDT · 1hRSI14 candlesCompareRSI 14 below 30Moving averageEMA 20Compare A/BPrice crosses above EMA 20Thenbelow 30, then Compare A/Bwithin 6 candlesTelegramlinked chat · at most every4 h

How to connect the nodes:

  1. Candle (Price) → RSI (Value)
  2. RSI (RSI) → Compare (Value)
  3. Candle (Price) → Moving average (Value)
  4. Candle (Price) → Compare A/B (A)
  5. Moving average (Average) → Compare A/B (B)
  6. Compare (true/false) → Then (First A)
  7. Compare A/B (true/false) → Then (Then B)
  8. Then (B after A) → Telegram (Trigger)

On the board it reads: below 30, then Compare A/B within 6 candles

Chain as JSON

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

sequence.json
{
"name": "Example: Then",
"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": "e1", "type": "core.ma", "position": { "x": 260, "y": 170 }, "settings": { "kind": "ema", "length": 20 } },
{ "id": "k2", "type": "core.compare-ab", "position": { "x": 480, "y": 170 }, "settings": { "operator": "crossesAbove" } },
{ "id": "s2", "type": "core.sequence", "position": { "x": 700, "y": 40 }, "settings": { "bars": 6 } },
{ "id": "t1", "type": "core.telegram", "position": { "x": 920, "y": 40 }, "settings": {} }
],
"edges": [
{ "from": "c1.close", "to": "r1.in" },
{ "from": "r1.out", "to": "k1.in" },
{ "from": "c1.close", "to": "e1.in" },
{ "from": "c1.close", "to": "k2.a" },
{ "from": "e1.out", "to": "k2.b" },
{ "from": "k1.out", "to": "s2.first" },
{ "from": "k2.out", "to": "s2.then" },
{ "from": "s2.out", "to": "t1.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 First A Signal (true/false) required
Input Then B Signal (true/false) required
Output B after A Signal (true/false) –
  • Warm-up with the default settings: 6 candles (this many extra candles are loaded by the replay before the value is reliable).
  • Search also finds it under: order, then, sequence, retest, first then, pattern.

True on candle i when B is true on i and A on at least one of the candles i − N to i − 1; A on the same candle does not count.

  • Type in the chain: core.sequence · Version 1.0.0 · Category key logic
  • Settings in the chain: bars (Within (candles))
  • Pins in the chain: Input first, then · Output out
  • How a node is built

Version 2026.10.21.23 · Changelog