Skip to content

Crosses Above

Signals · Crossovers

Crosses Above node on the canvas

True on the bar where a crosses from <= b to > b.

CrossesAbove is the classic crossover trigger: it fires exactly once, on the single bar where series A pushes up through series B. Not "A is above B" (that's true for many bars in a row) — but the precise moment the relationship flips. It's the building block behind golden crosses, RSI-out-of-oversold triggers, price-breaks-the-band entries, and a hundred other "something just changed" signals. If you want an entry that fires on the event, not the ongoing state, this is the block you reach for.

How it works

The logic is deliberately simple and lookahead-free. The block aligns A and B onto a shared timeline, then computes their difference diff = A − B. It looks back one bar with diff.shift(1). The signal is True only when the previous bar's diff was ≤ 0 and the current bar's diff is > 0 — i.e. A was at-or-below B last bar and is strictly above it now. On every other bar it's False, including the very first bar (no prior value to compare against, so it can never fire there). There are no parameters to tune — the behaviour is fully determined by what you wire into A and B.

When to use it

Reach for it whenever your entry or exit logic is event-shaped: a fast MA crossing a slow MA, RSI crossing back above 30, price crossing its VWAP, MACD crossing its signal line. It shines as a clean entry pulse you can feed straight into a Tester. Where it struggles: choppy, ranging markets where A and B hug each other will produce a burst of whipsaw crosses. In those conditions, gate it with a trend or volatility filter rather than trusting raw crosses.

Example

A trend-following long entry: wire an EMA(20) into A and an EMA(50) into B, send CrossesAbove's output into an And block alongside a higher-timeframe trend filter, then into the entry socket of the Tester. You now go long only on the golden cross and when the bigger trend agrees.

Tips & gotchas

  • It fires once per crossing, not continuously — perfect for entries, wrong if you need "is A currently above B" (use GreaterThan for the persistent state).
  • Order matters: A is the line doing the crossing, B is the reference. Swapping them gives you the opposite event.
  • For a threshold trigger (e.g. RSI > 30), wire a constant into B rather than another indicator.
  • In ranging markets, expect clusters of false crosses — combine with a filter instead of trading every signal.
  • It's strict (> 0), so an exact touch where A equals B does not count as a cross above.

Inputs

Socket Type What to wire in
A series Left-hand series — the one DOING the crossing. In an MA crossover this is the FAST line (e.g. EMA-20). In an RSI trigger this is the RSI line itself.
B series Right-hand series — the REFERENCE being crossed. In an MA crossover this is the SLOW line (e.g. EMA-50). In an RSI trigger this is the threshold (e.g. constant 30).

Outputs

Output Type Plots as Description
Cross ↑ signal Signal arrows Bar where a crosses up through b

Reference auto-generated from the block catalog · category Signals.