All TermsConcept

Crossover

A crossover occurs on the bar where one series moves from below another to above it. The reverse — moving from above to below — is a "crossunder". Crossovers are the building blocks of trend-following strategies.

In Pine Script

pinescript
if ta.crossover(fast, slow)
    strategy.entry("Long", strategy.long)
if ta.crossunder(fast, slow)
    strategy.close("Long")

ta.crossover(a, b) returns true only on the single bar where the cross happens — not while a > b continues to hold.

Signal quality

Crossovers fire late by design. A crossover happens after the relationship has already changed — that latency is the cost you pay for filtering whipsaws. Tighter MAs (e.g. 3/8) react faster but generate more false signals.

Strategies that use Crossover

Related Terms

Stop Reading. Start Trading.

PineForge backtests every concept on this site against real market data.

Try It Free

We use cookies for analytics and ads measurement. See our privacy policy.