Cross Any (Crossany): Complete Guide for Algorithmic Trading

The Cross Any block (crossany) is a signal detection tool in Arrow Algo that fires whenever one value crosses another — in either direction. Whether the crossing goes upward or downward, Cross Any captures it and outputs a signal, making it one of the most versatile trigger blocks for building condition-based strategies without writing a single line of code.

What Is the Cross Any Block?

Cross Any is a binary signal block. It outputs 1 when two input series change their relative position — that is, when one series moves from above to below the other, or from below to above. On all other candles, it outputs 0.

This makes Cross Any distinct from the Crossover block, which only detects upward crosses (when Series A moves from below Series B to above it). Cross Any catches crosses in both directions simultaneously, making it ideal for strategies that need to respond to any shift in the relationship between two series — not just one side of the move.

Think of Crossover as a one-way gate and Cross Any as a two-way detector. If you are building a strategy that should trigger every time two moving averages change their relative position — whether the fast line crosses up or down — Cross Any is the block to reach for.

How Does Cross Any Work?

The block takes two inputs: a primary series (Input A) and a reference series (Input B). On each new candle, it checks whether the relative position of A compared to B has changed from the previous candle.

If A was above B and is now below B — the block outputs 1.

If A was below B and is now above B — the block outputs 1.

If the relative position has not changed — the block outputs 0.

Detection is based entirely on position change, not magnitude. A small cross and a large cross produce the same output: 1. This keeps the block clean and easy to chain into downstream logic blocks on the canvas.

Because the output is binary, Cross Any connects naturally into AND and OR gates on your visual strategy canvas. Layer in trend filters, volatility conditions, or volume checks to control when the cross signal actually triggers an entry or exit action.

How to Read Cross Any Signals

A Cross Any signal carries no directional information. It tells you that a crossing occurred — not which direction it went. This is simultaneously its strength and its limitation.

Strength: For symmetric strategies — those that enter on any EMA cross rather than only bullish or bearish ones — Cross Any reduces your logic to a single block. You do not need to combine two separate Crossover blocks through an OR gate.

Limitation: If direction matters to your strategy, Cross Any is not the right choice. Use the Crossover block for upward crosses, and configure a second Crossover with reversed inputs for downward crosses.

In practice, Cross Any is most useful in three contexts:

  • Symmetric mean reversion strategies that trade both sides of a crossing event
  • Exit triggers — close a position whenever a key indicator crosses a threshold in either direction
  • Regime change detection — flag that a relationship has shifted without needing to specify which way

What Are the Best Cross Any Trading Strategies?

1. Symmetric Moving Average Entry

Connect a fast EMA (e.g. period 9) and a slow EMA (e.g. period 21) into a Cross Any block. Every time these lines change their relative position — whether the fast EMA crosses up or down — the block fires. Pair it with a position sizing block to open a trade on each signal. This approach works well in oscillating markets where both directions offer comparable statistical opportunity.

2. RSI Level Exit

Feed the RSI output and a fixed value of 50 into a Cross Any block. Whenever RSI crosses 50 in either direction, trigger an exit from the current position. This builds a clean “close when momentum shifts” rule without two separate crossing conditions cluttering your canvas.

3. Volatility Regime Reset

Use Cross Any to detect when ATR crosses its own moving average — upward or downward. Route this signal into an AND gate alongside your main entry condition. Entries only fire when volatility is in a stable phase rather than spiking or collapsing, giving your strategy a volatility-aware filter without adding significant complexity.

What Are Common Cross Any Mistakes to Avoid?

Not filtering for trend in choppy markets: In sideways, low-volatility conditions, two series can cross many times per session. Cross Any fires on every one of those events. Combine it with an ADX or Aroon block to verify that sufficient trend strength exists before acting on a cross.

Treating it as directional: Cross Any does not tell you whether a cross went up or down. If your entry logic distinguishes between a bullish and a bearish cross, use the Crossover block instead — it is explicitly directional.

Skipping the confirmation candle: Signals that fire on the crossing candle itself can be based on intracandle moves that reverse before the candle closes. Route the Cross Any output through a Lag block to confirm the cross held at close before triggering an action.

Overlapping inputs across multiple Cross Any blocks: If your strategy uses several Cross Any blocks, ensure each is connected to a clearly distinct input pair. Overlapping inputs can cause duplicate signals to fire on the same candle across different logic branches.

How to Build Cross Any Strategies in Arrow Algo

Arrow Algo’s visual block builder makes the Cross Any block straightforward to configure. No code is needed — drag the blocks onto the canvas, connect them, and run a backtest.

A typical setup looks like this:

  1. Add an EMA block and set your fast period (e.g. 9). Place it on the canvas.
  2. Add a second EMA block for your slow period (e.g. 21).
  3. Drag a Cross Any block onto the canvas. Connect the fast EMA output to Input A and the slow EMA output to Input B.
  4. Connect the Cross Any output to your entry or exit logic — an AND gate, a position block, or a profit target trigger.
  5. Run a backtest to see how often the cross fires across different market conditions. Add filters as needed to reduce noise in choppy periods.

The same setup works with any two numeric series — not just moving averages. Cross RSI against a fixed level, MACD against its signal line, or Bollinger Band width against a threshold value. Switching inputs is a matter of reconnecting blocks on the canvas — no code changes required.

For a directional crossing block, read our guide on the Cross Over (Crossover) indicator. Explore all available signal blocks in the Arrow Algo indicator block documentation.

What Are the Key Takeaways?

  • Cross Any fires a 1 whenever two input series change their relative position — in either direction
  • It is direction-agnostic: use it when the fact of a crossing matters more than which way it crossed
  • For directional strategies, the Crossover block is the more appropriate choice
  • Pair Cross Any with a trend or volatility filter to avoid false signals in choppy, low-momentum conditions
  • A Lag block after Cross Any can confirm that the cross held at candle close before an action fires
  • In Arrow Algo, it connects to any two numeric outputs — indicators, fixed values, or other calculated series — with no code required

Disclaimer: This content is for educational purposes only and does not constitute financial advice. Trading involves significant risk and you should only trade with capital you can afford to lose. Past performance is not indicative of future results. Always conduct your own research before making any trading decisions.

Ready to build your own automated trading strategies without writing a single line of code? Start for free at Arrow Algo and join thousands of traders who’ve made the switch to systematic trading.

About the Author

Author Bio