# Trade management commands reference

> All 4 trade management commands in AlgoBarsX, each with its parameters, defaults, ranges and an example: partial, breakeven, trail, exit.

Source: https://algobarsx.com/docs/ref-cmd-management/

### `partial <amount> [options]`

Close part of the trade at a level.

#### Arguments

| Name | Type | Default | What it is |
| --- | --- | --- | --- |
| `amount` | percent | required | Share of the trade to close. |

#### Options

| Name | Type | Default | What it is |
| --- | --- | --- | --- |
| `at` | price \| distance | required | Level, such as 1.5R. |

**Where it goes** Inside the management block of a buy or sell.

```algobarsx
partial 50% at: 2R
```

Works in: strategy. Since 1.0.

### `breakeven [options]`

Move the stop to the entry price at a level.

#### Options

| Name | Type | Default | What it is |
| --- | --- | --- | --- |
| `at` | price \| distance | required | Level, such as 1R. |
| `offset` | distance | `0 pips` | Distance beyond entry. |

**Where it goes** Inside the management block of a buy or sell.

```algobarsx
breakeven at: 1R, offset: 2 pips
```

Works in: strategy. Since 1.0.

### `trail [options]`

Trail the stop behind price.

#### Options

| Name | Type | Default | What it is |
| --- | --- | --- | --- |
| `by` | distance | required | Trailing distance. |
| `after` | price \| distance | `0R` | Start trailing once this level is reached. |

**Where it goes** Inside the management block of a buy or sell.

```algobarsx
trail by: atr(14), after: 2R
```

Works in: strategy. Since 1.0.

### `exit [options]`

Close the trade after a time or when a condition becomes true.

#### Options

| Name | Type | Default | What it is |
| --- | --- | --- | --- |
| `after` | bars \| duration | `none` | Close after this long. |
| `when` | bool | `false` | Close when true. |

**Where it goes** Inside the management block of a buy or sell.

```algobarsx
exit after: 48 bars
```

Works in: strategy. Since 1.0.
