# Query shape

> The anatomy of a strategy sentence: direction, asset, conditions, exits, timeframe, window.

Source: https://docs.texttoquant.com/start/query-shape

---

You compose a strategy in plain words. The parser reads a handful of *slots* out of your sentence;
fill the ones you care about and it will make reasonable assumptions for the rest (and show you what
it assumed, so you can change it).

## The slots

| Slot | What it sets | Example |
| --- | --- | --- |
| Direction | Long or short | `buy`, `short` |
| Asset | The symbol(s) to test | `BTC`, `ETH` |
| Entry | The condition that opens a trade | `when RSI crosses above 50` |
| Exit | Conditions, stops and targets that close it | `exit below 50`, `SL 2%`, `TP 3RR` |
| Timeframe | The bar size | `1h`, `4h`, `1d` |
| Window | The date range to test | `last 90 days`, `from 1/1/2024 to 3/31/2024` |

## A worked example

Take this sentence:

```text
Buy BTC when RSI(14) crosses above 30, exit at 3R or a 2% stop, on the 4h for the last 90 days
```

The parser reads it as:

| Slot | Value |
| --- | --- |
| Direction | Long (`Buy`) |
| Asset | `BTCUSDT` |
| Entry | `RSI(14) crosses above 30` |
| Exit | Take profit at `3R`, stop loss at `2%` |
| Timeframe | `4h` |
| Window | Last 90 days |

<RunInTerminal query="Buy BTC when RSI(14) crosses above 30, exit at 3R or 2% stop, on the 4h for the last 90 days" />

<Callout variant="warning" title="Amber = assumed">
  Anything the parser filled in for you is marked with a dashed amber chip. Click it to confirm or
  change the value before you spend a run.
</Callout>

To go deeper, see the full [query syntax](/docs/reference/query-syntax), the
[indicator library](/docs/reference/indicators), and the [operators](/docs/reference/operators)
you can compare with.
