# Conditional Order

### **Overview**

A **Conditional Order**—also known as a **Trigger Order**—is an order that only becomes active once the **market reaches a specified trigger price**. Until the condition is met, the order remains inactive and does **not require any margin**.

> ⚠️ If there is **insufficient margin** in your account when the trigger condition is met, the order will **fail to execute**.

### **How It Works**

* **Trigger Price**: The price at which the order becomes active.
* **Trigger Mechanism**: The system currently uses the **latest traded price** as the condition to trigger the order.
* Once triggered, the order is **submitted** as either a **limit** or **market** order based on your selected type.

### **Types of Conditional Orders**

#### **1. Conditional Limit Order**

* Once triggered, the order is placed at your specified **limit price**.
* The order enters the order book and follows the regular behavior of limit orders.

#### **2. Conditional Market Order**

* Once triggered, the system immediately executes the order at the **best available market price**.
* Designed for speed and certainty of execution.

### **Common Use Cases**

Conditional orders are useful in various trading strategies, especially when traders want to automate actions based on specific market movements:

#### **Chase Up (Breakout Buying)**

* **Goal**: Open a position only if the price breaks above a certain resistance level.
* **Setup**: Set the **trigger price above** the current level and select **either 'Buy at market' or 'Limit'**.

#### **Close Down (Breakout Selling)**

* **Goal**: Open a short position if the price falls below a support level.
* **Setup**: Set the **trigger price below** the current level and select **Sell**.

#### **Take Profit**

* **Goal**: Automatically close a profitable position at your target price.
* **Setup**: Set the trigger price at the **Take Profit level** and configure a sell or buy order based on position direction.

#### **Stop Loss**

* **Goal**: Limit losses by closing a position if the price moves against you.
* **Setup**: Set the trigger price at the **Stop Loss level** and configure an opposite-side order to exit the position.

### **Example: Chase Up Scenario**

**Context**:\
In November 2020, BTC was trading at $19,500. You predict that if BTC breaks $20,000, it may rapidly rise to $50,000. You want to enter the market only if that breakout occurs, but you don't want to monitor the market constantly.

**Solution**: Set a **Conditional Market Order** as follows:

* **Trigger Price**: 20,000
* **Direction**: Buy
* **Order Type**: Market
* **Quantity**: 1 BTC

#### **Execution Logic**:

Once the system detects a **latest traded price of 20,000 USD**, it **automatically submits** a **market buy order for 1 BTC**. Your position is opened almost instantly near that price, just as you planned.

This is an example of using a conditional order for **breakout entry, also known as "chasing up."** The same logic applies in reverse for **"close down"** scenarios.

### **Summary**

| Feature               | Description                                        |
| --------------------- | -------------------------------------------------- |
| **Trigger Type**      | Latest traded price                                |
| **Order Types**       | Limit or Market                                    |
| **Margin Required**   | None until triggered                               |
| **Failure Condition** | Fails if insufficient margin at trigger time       |
| **Common Uses**       | Breakout trades, Take Profit, Stop Loss automation |


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.coinlocally.com/perpetual-contracts/functions/conditional-order.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
