# Exit rules

## Introduction

What applies to entry rules also applies to exit rules.

{% content-ref url="entry-rules" %}
[entry-rules](https://docs.obside.com/algo-strategies/create-a-trading-algo/rules/entry-rules)
{% endcontent-ref %}

The **exit rules** determine **when to close a position**, whether for a buy (Long) or a sell (Short).

{% hint style="info" %}
**Note:**

* In **trading**a strategy must include both **entry and exit rules** to actively manage positions.
* In **investment**Alternatively, you can define entry rules only if you intend to accumulate assets without planning systematic selling. In other words, **it is possible to have no exit rules**.
  {% endhint %}

Your exit rules and conditions can of course be based on technical indicators, patterns, units of measurement or any other **condition already used in the entry rules**.

You can also use a **stop-loss** as well as **take-profits**.\
\
It is also possible to perform **partial exits** of your positions, thereby allowing you to lock in gains or reduce losses before fully closing a position.

### Using a stop-loss

To limit the loss on a trade, a stop-loss can be specified in your exit rules. The stop-loss can be expressed as a percentage, in price, in price change, in ticks, in pips, in points, in changes in indicator values or in multiples of the ATR.

You can also place your stop-loss at a technical level, such as the high or low point of the last X days.

The stop-loss can be fixed, trailing and moved to breakeven if needed. Simply specify what you want in your exit rules. The possibilities are numerous.

{% hint style="success" %}
Our artificial intelligence knows that for a buy trade the stop-loss is placed below the entry price, and that for a sell trade it is placed above the entry price.
{% endhint %}

You can, however, separate buy and sell trades by assigning, if needed, one stop-loss for buy trades and a different stop-loss for sell trades.

{% hint style="info" %}
**Examples:**

“Place a stop-loss at 2 ATR below the low or high of the last 5 days.”

“Close the trade if the price moves 4% against us.”

“Close the trade if the price moves 4% against us.”

“Trailing stop-loss at 1%, which is moved to breakeven when 1.5% profit is reached.”

“SL at the low of the last 10 candles for a buy trade. SL at the high of the last 10 candles for a sell trade.”
{% endhint %}

### Using a take-profit

As the name implies, the "take-profit" serves to “take your profits”, that is to close your trade to secure your gains.

It can also be expressed as a percentage, in price, in price change, in ticks, in pips, in points, in changes in indicator values or in multiples of the ATR.

Another notable unit of measure for take-profit is "R." This is the risk/reward ratio. In other words, it is the distance between the entry price and the stop-loss on your trade. By expressing the stop-loss in multiples of R (e.g.: 1 R, 2 R, 2.5 R, etc.), your trade closes when the specified risk/reward ratio is reached.

The take-profit can be full or partial, depending on whether you want to secure all or part of the gains on each trade.

As with the stop-loss, the take-profit can also be trailing.

{% hint style="info" %}
E**xamples:**

“Take-profit at 2R.”

“Partial TP of 50% when the price has moved up 10 pips, and 50% when it has moved up 20 pips.”

“Set a take-profit at 5% from our entry price.”

“TP at 1R with a trailing of 0.25R.”

“We take profits at +2 ATR.”
{% endhint %}
