Pular para o conteúdo

Compare A/B

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

ConditionsIn Free

  • A
  • B
Compare A/B

Volume above avg volume 20 × 1.8

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

Like a balance with two pans: Compare A/B checks at every candle which of two values weighs more, say price or average, and notices when the balance tips.

Compares two values, e.g. price and EMA. Compares two values on every candle, such as the price (A) with a moving average (B). The factor multiplies B by a number. Example: volume (A) above average (B) with factor 1.8 is true when the volume is more than 1.8 times its average.

BTC/USDT price (A) and EMA 20 (B)Below it two strips: when “Price above EMA 20” is true and when “Price crosses above EMA 20” is.Price BTC/USDT81,00082,00083,00084,000Price above EMA 20Price crosses above EMA 20Oct 8Oct 9Oct 10Oct 11Oct 12
  • A: Price
  • B: EMA 20
  • true as long as
  • true on exactly one candle
Price (A) and EMA 20 (B) on 1-hour candles. “above” is true as long as the price is over the EMA (bars). “crosses above” is only true on the candle where it breaks through from below (dots).

Properties of the Compare A/B node: the chart with the price of the last 150 candles, the EMA 200 line and the area 2% below it, dots where the price is below it, a handle at the right edge, below it the Factor for B field with 0.98 and −2% next to it.

In the properties, a chart shows the last 150 candles of A with line B and the area up to B × factor. Next to the factor you see the distance in percent, such as “+2%” for 1.02, and the sentence on the board reads the same way. Drag the edge of the area or move it in small steps with the arrow keys; dots mark where the condition would be met.

More under Chart above the price.

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: above

When the comparison is true. “above” and “below” hold as long as A stays there. “crosses” only holds on the one candle where A breaks through B.

  • above (default): True while A is greater than B.
  • below: True while A is less than B.
  • at least: Like “above”, but also true when A exactly reaches line B.
  • at most: Like “below”, but also true when A exactly reaches line B.
  • crosses above: Only true on the candle where A rises from below to above B.
  • crosses below: Only true on the candle where A falls from above to below B.
  • crosses: Only true on the candle where A crosses line B in either direction.

Default: 1 · from 0 to 1,000

B is multiplied by this number before comparing. 1 leaves B unchanged. 1.02 puts B 2% higher, 0.98 puts it 2% lower, 2 doubles it. In the chart above you drag the area above or below B and see the distance in percent.

Compares two values and notifies you when the volume is above 1.8 times its average.

Example chain: Candle, Volume, Compare A/B, TelegramConnections: Candle → Volume, Candle → Compare A/B, Volume → Compare A/B, Compare A/B → Telegram.CandleSOL/USDT · 1hVolume20-candle averageCompare A/BVolume above avg volume 20× 1.8Telegramlinked chat · at most every4 h

How to connect the nodes:

  1. Candle (Volume) → Volume (Volume)
  2. Candle (Volume) → Compare A/B (A)
  3. Volume (Average) → Compare A/B (B)
  4. Compare A/B (true/false) → Telegram (Trigger)

On the board it reads: Volume above avg volume 20 × 1.8

Chain as JSON

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

compare-ab.json
{
"name": "Example: Compare A/B",
"version": 1,
"nodes": [
{ "id": "c1", "type": "core.candle", "position": { "x": 40, "y": 40 }, "settings": { "pair": "SOL/USDT", "timeframe": "1h" } },
{ "id": "v1", "type": "core.volume", "position": { "x": 260, "y": 40 }, "settings": {} },
{ "id": "k1", "type": "core.compare-ab", "position": { "x": 480, "y": 40 }, "settings": { "operator": "above", "factor": 1.8 } },
{ "id": "t1", "type": "core.telegram", "position": { "x": 700, "y": 40 }, "settings": {} }
],
"edges": [
{ "from": "c1.volume", "to": "v1.in" },
{ "from": "c1.volume", "to": "k1.a" },
{ "from": "v1.average", "to": "k1.b" },
{ "from": "k1.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 A Number series required
Input B Number series required
Output true/false Signal (true/false) –
  • Search also finds it under: crosses, cross, ema, price, above, below, factor.

“crosses above” is true when A is now above B times the factor and was at most on it one candle before, “crosses below” the other way round; the same rule as ta.crossover and ta.crossunder in TradingView.

  • Type in the chain: core.compare-ab · Version 1.0.0 · Category key cond
  • Settings in the chain: operator (Condition), factor (Factor for B)
  • Pins in the chain: Input a, b · Output out
  • Reference tests in the manifest: 1 (with fixed price data: 500 candles of 1h)
  • How a node is built

Versão 2026.11.29.15 · Changelog