> For the complete documentation index, see [llms.txt](https://docs.tradingalert.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tradingalert.net/indicator-alert-feature/how-cross-over-cross-under-over-under-work.md).

# How cross over,cross under,over,under work ?

![](https://1752735084-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLEg9b9dcLWBfThsXevkl%2Fuploads%2F7q12dqIOTmLNLsBvwJ7L%2Funder-over.jpg?alt=media\&token=bc5c00d1-1ee4-4ad4-85e0-8c652ed00853)

{% hint style="info" %}
Checking cross over, cross under at candle <mark style="color:yellow;">**x**</mark>:

* Take two points at candle <mark style="color:yellow;">**x**</mark> and <mark style="color:yellow;">previous 1 candle of x</mark> on the <mark style="color:blue;">blue line</mark> (**b\[x-1],b\[x]**) and two points on the <mark style="color:red;">red line</mark> (**r\[x-1],r\[x]**)
* If **b\[x-1] < r\[x-1]** and **b\[x] > r\[x]** => <mark style="color:blue;">blue line</mark> cross over <mark style="color:red;">red line</mark>.
* If **b\[x-1] > r\[x-1]** and **b\[x] < r\[x]** => <mark style="color:blue;">blue line</mark> cross under <mark style="color:red;">red line</mark>.
* A cross must really **change side**. If the two lines are **equal** on either candle, it is not a cross — touching is not crossing.

**Note**: in case the condition is <mark style="color:red;">Price cross over/cross under....</mark> if you select price to check:

* **C-C**: take the two points <mark style="color:red;">close</mark> of the previous candle of <mark style="color:yellow;">x</mark> and <mark style="color:red;">close</mark> of candle <mark style="color:yellow;">x</mark> **(c\[x-1],c\[x])**
* **O-C**: take the two points <mark style="color:red;">open and close</mark> of candle <mark style="color:yellow;">x</mark> **(o\[x],c\[x])**
* **H-L**: take the two points <mark style="color:red;">high and low</mark> of candle <mark style="color:yellow;">x</mark>, **in the direction the candle moved**: a <mark style="color:green;">green</mark> candle (close above open) is read **low → high** **(l\[x],h\[x])**, a <mark style="color:red;">red</mark> candle is read **high → low** **(h\[x],l\[x])**. This is what lets a single candle's wick cross a line up or down.
  {% endhint %}

{% hint style="info" %}
Checking over, under at candle <mark style="color:yellow;">**x**</mark>:

* Take one point at candle <mark style="color:yellow;">**x**</mark> on the <mark style="color:blue;">blue line</mark> (**b\[x]**) and one point on the <mark style="color:red;">red line</mark> (**r\[x]**)
* If **b\[x] >= r\[x]** => <mark style="color:blue;">blue line</mark> over <mark style="color:red;">red line</mark>.
* If **b\[x] <= r\[x]** => <mark style="color:blue;">blue line</mark> under <mark style="color:red;">red line</mark>.
* Equal values count as **both** over and under, because only one candle is read and there is no direction to decide.
  {% endhint %}

![](https://1752735084-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLEg9b9dcLWBfThsXevkl%2Fuploads%2FuXgt7cYywDYJJ74VsYCU%2Fprice.jpg?alt=media\&token=a8c2fa73-d68e-4e0a-80b0-9b895881d724)

{% hint style="success" %}
**Which candle is "x" ?** The one you pick in **Candle To Check** — see How "candle to check" work ?. Remember that **cross over / cross under also read the candle before x**, so a cross is never decided by one candle alone.

**Want the same thing to happen more than once ?** See How "Multi-Candle" work ? — the check above is then repeated on every candle of the window.

**Want to filter how far apart the two lines are ?** See How "Distance limit" work ? — the distance is an extra filter on top: the condition above must be true **and** the distance must match.
{% endhint %}

&#x20;[![](https://tracking.avapartner.com/imp/?affid=214848\&bannerid=35546\&adTheme=768\&campaign=221449\&campaignName=Default%20Campaign\&tag=214848\&source=general_setting)](https://tracking.avapartner.com/click/?affid=214848\&bannerid=35546\&adTheme=768\&campaign=221449\&campaignName=Default%20Campaign\&tag=214848\&source=about_indi_alert)[![](https://d3dpet1g0ty5ed.cloudfront.net/EN_Spreads_Pay_less_keep_more_2-4_Google_300x250.jpg)](https://one.exnessonelink.com/intl/en/a/t7p3v7p3)
