> For the complete documentation index, see [llms.txt](https://docs.surgecardano.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.surgecardano.com/tutorials/10.-rule-based-strategy.md).

# 10. Rule-Based strategy

Draw buy and sell levels on the chart, and Surge trades them at your prices around the clock.

{% embed url="<https://drive.google.com/file/d/1X7e4KqXObeo_WB0gyFN86JUgVe-fV5P-/preview>" %}

You already know where you'd buy the dip and where you'd take profit. The hard part is being awake when the price gets there. With Rule-Based, each level is a standing instruction: when the price reaches this line, trade this much, this many times.

### What you'll learn

* Placing buy and sell levels directly on the chart
* Setting size, max executions and cooldown for each level
* Reading plan metrics and the price guarantee
* Tracking fills and editing levels while the strategy runs

### Create a Rule-Based strategy

1. Click **New Strategy** and choose **Rule-Based**.
2. Pick your pair and the DEXes to monitor. A level fires on whichever selected DEX reaches its price first.
3. Click **Add Level**, then click the chart where you want the level. Buy levels go below the price and sell levels above it.
4. Drag a level's tag to adjust its price.
5. Set each level's details in the **Levels** table.
6. Review **Plan Metrics**, then deploy.

### Level settings

| Setting        | What it does                           |
| -------------- | -------------------------------------- |
| Side           | Buy or sell                            |
| Price          | The price that triggers the level      |
| Size           | Buys are sized in ADA, sells in tokens |
| Max executions | How many times the level can fire      |
| Cooldown       | The minimum time between fills         |

**Example:** scale in with three buys at 0.039, 0.037 and 0.034 ADA, and take profit with two sells above the current price.

### Plan metrics and the guarantee

* **Plan metrics:** your total buys, sells, fees and net token change if every level fills
* **The guarantee:** every trade carries an on-chain price floor. A fill can come in better than your line, but never worse.

### While it runs

* **Current P\&L:** profit and loss from filled executions
* **Executions used:** how many fills have happened so far
* **Fees paid:** the running total
* **Executions tab:** every fill, with its DEX and price
* **Edit any time:** add, edit or remove levels. Changes apply from the next attempt.

### Good to know

* **Fund both sides.** Buy levels need ADA in the wallet and sell levels need the token.
* **Use cooldowns on levels that fire more than once.** They stop a level from filling over and over while the price hovers around it.
* **Keep the Surge tab open.** Trades are signed in your browser. Turn on Keep display awake in Settings.

### Next

[11. Managing strategies, alerts and settings](/tutorials/11.-managing-strategies-alerts-and-settings.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.surgecardano.com/tutorials/10.-rule-based-strategy.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.
