The 20 EMA moving above the 50. RSI climbing back over 30. Price taking out yesterday's high. Each of these is a moment, not a condition that sits true for hours, and the Crossover node is how you catch the moment. It fires on the one bar where A crosses B, and it keeps count of how long ago that was.
- Takes
- Two numbers: A, the value that moves, and B, the line it crosses
- Gives
- True on the crossing bar only, plus the bars since the last cross
- Reach for it
- The moment one line crosses another
How it works
Wire the value that moves into A, the line into B, and pick a direction: Above, Below or Either. A cross above is a bar where A is above B when, on the bar before, it was below B or exactly on it. That last part matters more than it sounds. Price that closes right at a level and then closes through it is a cross, because touching counts as the other side.
The output, Crossed, is an event. It's true on the crossing bar and false again on the next one, which is exactly what an entry trigger wants and exactly what a filter doesn't. "While the 20 is above the 50" is a state, and that's a Comparison.
On the default Bar close clock, the cross is judged when a bar closes, and your rules can act on it throughout the next bar. If a value the rule needs is missing (an indicator still warming up, say), there's no cross. The node never invents one.
Only after n bars on the other side
Moving averages that braid through each other in a range cross constantly, and most of those crosses mean nothing. Prior bars on the other side sets how many bars before the cross get checked, and At least the share of them that must have been on the other side. The node shows the result in words:
| Prior bars | At least | The node reads |
|---|---|---|
| 1 | 100% | the classic cross |
| 3 | 100% | after 3 bars below |
| 10 | 70% | after at least 7 of the last 10 bars below |
Whatever you set, the bar right before the cross still has to be on the other side. The share is rounded up, so 80% of 4 bars means all 4.
Bars since
The second output counts clock bars since the most recent cross: 0 on the crossing bar, then 1, 2, 3. Before the first cross it's unknown, and a Comparison against an unknown reads false, so nothing downstream fires early.
The intrabar clock
Intrabar stops waiting for the close. It watches every trade and fires on the first one that takes price through the line, and an entry on it fills on that same trade. The bar can still close back on the wrong side: that break counted anyway. On the chart its marker starts hollow and fills in at the close if the bar held.
For that to mean anything, B has to stand still. Inside a bar, the line is B's value at the last completed bar's close, so it never shifts under you. That sets the rules:
- A is Current Price on the instrument you trade. Two indicators only change when a bar closes, so they can only ever cross at a close, and the node greys Intrabar out and tells you why.
- B holds still until the bar closes: an indicator, a Price History level or a price-action line on the crossover's series or a slower one whose bars line up with its closes, a constant, or math over those. Put any offset on B ("price breaks above EMA(200) + 2"), never on A.
- Refused by name: VWAP and anything else that updates on every trade, the live price as the line, a series finer than the one being counted (or one whose bars don't line up with it), and another intrabar crossover.
Under Intrabar the persistence setting counts prior closes on the other side, and Bars since is 0 from the break until that bar closes. The swap button between A and B trades the wires and flips the direction with them, so the rule stays the same.
What it can read
A and B take market data and arithmetic on it: indicators, prices, Price History, Pivot Levels, modifiers, a constant on one side, Math over those, the numbers a Since or Capture keeps, and another crossover's Bars since. Not a true/false value, not a value that only exists inside a trade (trade and user variables, Conditional Value, a Tally score, the time nodes), and not an external data source.
Five price-action nodes are refused too: Swing Points, Market Structure, Order Block, Fair Value Gap and Multi-Bar Formation. The engine runs a backtest in monthly pieces, and those five carry their own memory from month to month, so a crossover can't see their true history.
Why not Bars Ago and two Comparisons
The old way was a Bars Ago Modifier on each line, a Comparison for "below a bar ago", another for "above now", and an AND. It misses a touch followed by a break, it reads in the trade panel and Explain a trade as two unrelated rules, and "7 of the last 10 bars below" can't be built that way at all. With the node, the engine records each cross, the chart marks it, and every explanation reads it as one sentence.
Example: a cross that has to mean it
Say you trade NQ 15m with a 20/50 EMA crossover, and it bleeds in ranges where the two lines weave around each other. Wire EMA(20) into A and EMA(50) into B, keep Direction on Above and the clock on Bar close, then set Prior bars on the other side to 10 and At least to 80%. The node now reads "at least 8 of the last 10 bars below, then above". Wire Crossed into a long Entry.
A cross that comes three bars after a cross the other way no longer qualifies, because only three of the last ten bars were below. The clean turns still do.
Settings
Outputs
Use something else when
When it doesn't behave
Intrabar is greyed out
Intrabar needs Current Price on A. If both inputs are indicators, there's nothing to fix: they only change at bar closes, so they can only cross at one. If B holds the price, press the swap button. Don't swap an indicator for price only to unlock Intrabar, though. That's a different signal, and it'll trade differently.
My intrabar entry missed a break I can see on the chart
An intrabar cross lasts one trade. If the strategy couldn't act on that trade (already in a position, cooling down, another condition false), the event is gone. For "any time during this bar", use Bars since Less Than 1 instead of Crossed: it stays at 0 from the break to the close.
My exit fires the bar after I enter
That's NOT of a crossover in an exit. The cross is true for one bar, so its NOT is true almost all the time, and the exit trips on the next bar. To exit when the cross reverses, use the opposite crossover, or a Comparison of the two lines (fast below slow). The builder warns about this one.
The builder says my cross of the 20-bar high can never fire
On the Bar close clock, a Price History with Skip 0 already includes the bar being judged, and no bar closes above its own high. Set Skip to 1 (the error offers it in one click) for a close above the 20 bars before it, or use Intrabar with Current Price on A for the moment price trades through.
Going further
Only Prior bars and At least can be swept. Direction and the clock change what the strategy is, so they never become sweep rows. Treat the window like any other filter: if you're trying 7 of 10, then 8 of 10, then 8 of 12, the backtest is choosing for you.
One quirk of the classic one-bar cross: if A sits above B, touches it for a bar, then lifts off, that counts as a cross above, because the touching bar was "the other side". Two or more prior bars, all required, filter it out. And to switch a regime on a cross, compare Bars since against a number. Crossed wired straight into Activate Regime would flip it on and off every time it fired, so the builder refuses it.