> For the complete documentation index, see [llms.txt](https://docs.proliquid.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.proliquid.xyz/terminal-sections/auto-close.md).

# Auto Close

Account-wide Stop Loss and Take Profit protection in Proliquid Terminal

Auto Close is an account-wide protection control in Terminal. It can close all open positions and cancel open orders when your account unrealized PNL reaches a configured Stop Loss or Take Profit threshold.

Use it when you want an account-level exit rule instead of managing each position one by one.

Auto Close uses local Terminal unrealized PNL for the active trading account. Keep Proliquid open while it is enabled.

## What it does

When Auto Close triggers, Proliquid:

* Turns Auto Close off immediately.
* Sends reduce-only market close requests for current open positions.
* Uses aggressive close slippage so the close attempt prioritizes execution.
* Cancels current open orders.
* Retries canceling remaining open orders for a short period.

Auto Close can only run while a supported trading account is connected and Terminal is not in [Spectate mode](/terminal-sections/spectate-mode.md).

## Stop Loss and Take Profit

Auto Close has two independent thresholds:

<table><thead><tr><th width="174">Side</th><th>Trigger rule</th></tr></thead><tbody><tr><td>Stop Loss</td><td>Closes when account unrealized PNL goes below or equal to the Stop Loss value.</td></tr><tr><td>Take Profit</td><td>Closes when account unrealized PNL goes above or equal to the Take Profit value.</td></tr></tbody></table>

You can configure only Stop Loss, only Take Profit, or both at the same time.

The values are signed USDC PNL thresholds. They are not prices, position sizes, or percentages.

## Positive and negative values

Use the sign that matches the account-level PNL you want Auto Close to react to.

### Standard loss protection

Your account is near flat or slightly profitable, and you want everything closed if losses reach `-1,000 USDC`.

Set:

* Stop Loss: `-1000`
* Take Profit: empty, or any profit target you also want active

Auto Close triggers when account unrealized PNL is `-1,000 USDC` or lower.

### Standard profit target

You want to close the account when unrealized profit reaches `+2,000 USDC`.

Set:

* Stop Loss: empty, or any loss limit you also want active
* Take Profit: `2000`

Auto Close triggers when account unrealized PNL is `+2,000 USDC` or higher.

### Protecting existing profit

Your account is currently up `+5,000 USDC`. You want to protect most of the move, but still allow the trade to breathe. If unrealized PNL falls back to `+2,500 USDC`, you want everything closed.

Set:

* Stop Loss: `2500`
* Take Profit: empty, or a higher target such as `8000`

Auto Close triggers when account unrealized PNL goes down to `+2,500 USDC` or lower.

This is a positive Stop Loss because the stop is still in profit.

### Recovering from an existing loss

Your account is currently down `-5,000 USDC`. You do not want to close immediately, but if the account recovers to `-2,500 USDC`, you want to close and reduce risk.

Set:

* Stop Loss: empty, or a lower emergency loss limit such as `-7000`
* Take Profit: `-2500`

Auto Close triggers when account unrealized PNL goes up to `-2,500 USDC` or higher.

This is a negative Take Profit because the target is still a loss, but it is better than the current unrealized PNL.

## Warnings and activation guards

Auto Close validates each side after you leave the input.

If the current unrealized PNL is already past a configured threshold, Auto Close cannot be enabled. This prevents positions and orders from closing immediately just because you turned the switch on.

If the current unrealized PNL is close to a configured threshold, Terminal shows a warning with the distance. The warning uses the remaining PNL gap relative to account value.

Example: if account value is `10,000 USDC`, Stop Loss is `-1,000 USDC`, and current unrealized PNL is `-800 USDC`, the gap is `200 USDC`, or `2%` of account value.

## Runtime behavior

The saved Stop Loss and Take Profit values stay in your Terminal settings.

The ON / OFF state does not persist. Auto Close always starts OFF when the app starts. This avoids an old protection setting unexpectedly closing positions after you reopen Terminal.

If Auto Close is ON and you switch to [Spectate mode](/terminal-sections/spectate-mode.md) or disconnect your wallet, Terminal asks you to confirm because that pauses Auto Close.

If Auto Close is already executing, spectating and wallet disconnect are blocked until execution finishes.

## When to use it

Use Auto Close when you want a simple account-wide guardrail:

* During fast news or macro events.
* When managing several correlated positions.
* When protecting an open profit across multiple markets.
* When waiting for a partial loss recovery before stepping away from risk.

Auto Close is not a replacement for exchange-side risk management. It depends on Proliquid being open, live market/account data being available, and order execution being supported by the active exchange.

Related pages: [Account](/terminal-sections/account.md), [Positions](/terminal-sections/positions.md), [Open orders](/terminal-sections/open-orders.md), [Market orders](/order-types/market-orders.md), [Spectate mode](/terminal-sections/spectate-mode.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.proliquid.xyz/terminal-sections/auto-close.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
