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

# Take profit and stop loss

> Close a position at a trigger price.

```ts theme={null}
const tp = await zeus.orders.takeProfit({ market: 'ETH/USD', side: 'long', triggerPrice: 2600 })
const sl = await zeus.orders.stopLoss({ market: 'ETH/USD', side: 'long', triggerPrice: 2250, size: 500 })
```

Without `size` the order closes the whole position. The SDK places them the way the ZEUS app does, as orders attached to the position, so they are cleared together with it.

| Order | A Long triggers | A Short triggers |
| - | - | - |
| Take profit | at or above the price | at or below the price |
| Stop loss | at or below the price | at or above the price |

Take profit and stop loss are `decrease` orders:

```ts theme={null}
await zeus.orders.update({ kind: 'decrease', orderIndex: tp.orderIndex, triggerPrice: 2650 })
await zeus.orders.cancel({ kind: 'decrease', orderIndex: sl.orderIndex })
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.