> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trinigence.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Crossovers & Trend Changes

> How crossover events and trend state changes work in Trinigence strategies.

## Events vs states

One of the most common sources of confusion in strategy logic is the difference between:

* **events** (something happens now)
* **states** (something is true over time)

Crossovers and trend changes are **events**.

They trigger at a specific moment - not continuously.

***

## What a crossover is

A **crossover** occurs when one value moves from one side of another value to the other.

Examples:

```text theme={null}
EMA(20) crosses above EMA(50)
MACD line crosses below signal
RSI(14) crosses above 50
```

A crossover:

* triggers on the candle where the crossing happens
* is true for one evaluation only
* becomes false again on the next candle

***

## Crossovers vs comparisons

Compare:

**Crossover**

```text theme={null}
EMA(20) crosses above EMA(50)
```

Triggers once.

**Comparison**

```text theme={null}
EMA(20) > EMA(50)
```

Remains true as long as the condition holds.

<Info>
  Most entries should be based on crossovers, not comparisons.
</Info>

***

## What a trend change is

A **trend change** is a transition from one directional state to another.

Examples:

```text theme={null}
Trend changes to bullish
Supertrend flips to buy
Trend direction switches to down
```

Trend changes:

* are event-based
* usually derived from trend indicators
* often abstract multiple internal calculations

***

## Trend state vs trend change

**Trend state**

```text theme={null}
Trend is bullish
```

**Trend change**

```text theme={null}
Trend changes to bullish
```

Trend states persist.\
Trend changes trigger once.

***

## Common uses

### Entries

Crossovers and trend changes are most commonly used for:

* trade entries
* initial position opening
* momentum confirmation

Example:

```text theme={null}
Go long when EMA(20) crosses above EMA(50).
```

***

### Exits

They can also be used for exits.

Example:

```text theme={null}
Exit long when trend changes to bearish.
```

***

## Evaluation timing

Crossovers and trend changes are evaluated:

* on candle close
* on the strategy timeframe
* once per candle

If the cross happens intrabar but is gone at close, it does not trigger.

<Warning>
  There is no intrabar crossover detection by default.
</Warning>

***

## Direction-specific behavior

Crossovers may be defined per direction.

Example:

```text theme={null}
Go long when EMA(20) crosses above EMA(50).
Go short when EMA(20) crosses below EMA(50).
```

Each event is evaluated independently.

***

## Defaults and assumptions

If a crossover or trend change is:

* clearly stated → used exactly
* implied → ATI infers conservatively
* ambiguous → ATI requests clarification

<Card title="What Trinigence fills automatically" icon="robot" href="/writing-ideas/what-trinigence-fills-automatically" horizontal>
  See how event logic is inferred.
</Card>

***

## Common mistakes

<AccordionGroup>
  <Accordion title="Using crossovers as filters">
    Crossovers are events, not states. Use comparisons for filters.
  </Accordion>

  <Accordion title="Expecting repeated signals">
    A crossover fires once, not continuously.
  </Accordion>

  <Accordion title="Confusing trend change with trend state">
    Trend changes are moments. Trend states persist.
  </Accordion>
</AccordionGroup>

***

## Best practices

* Use crossovers for entries
* Use states for filters
* Do not chain multiple crossovers unnecessarily
* Validate trigger points visually

<Card title="Operators & conditions" icon="code-branch" href="/indicators-logic/operators-and-conditions" horizontal>
  Learn how crossovers fit into logic.
</Card>

***

## What to read next

<CardGroup cols={2}>
  <Card title="Indicator categories" icon="layer-group" href="/indicators-logic/categories">
    Trend, momentum, volatility indicators.
  </Card>

  <Card title="Entry logic" icon="arrow-right-to-bracket" href="/strategy-structure/entry-logic">
    How events open trades.
  </Card>

  <Card title="Exit logic" icon="arrow-right-from-bracket" href="/strategy-structure/exit-logic">
    How events close trades.
  </Card>

  <Card title="Indicators overview" icon="wave-square" href="/indicators-logic/overview">
    Return to the big picture.
  </Card>
</CardGroup>

<Note>
  Events trigger action.\
  States define context.
</Note>
