# Backtest from Telegram

> Describe a strategy in plain English to the TextToQuant bot in Telegram and get the backtest result back in the chat.

Source: https://docs.texttoquant.com/guides/telegram

---

The TextToQuant bot runs the same backtest as the terminal, from a Telegram chat. You write the
strategy in plain English after `/backtest`, and the result comes back in the chat with a link to the
full report in the app.

## 1. Link your account

The bot runs backtests as you, on your plan, so it needs to know who you are.

1. Open **[Account → Notifications](/account/notifications)** and press **Connect Telegram**.
2. Telegram opens a chat with **[@ttq_notifications_bot](https://t.me/ttq_notifications_bot)**. Press **Start**.
3. The bot answers that your account is connected.

The same link also sends your backtest and screener alerts to Telegram. To unlink, send `/stop` to
the bot or press **Disconnect** on the Notifications page.

## 2. Run a backtest

Send `/backtest` followed by the strategy, written the way you would type it in the terminal:

```text
/backtest buy BTC on the 4h when RSI 14 crosses above 30, stop loss 2%
```

```text
/backtest Buy ETHUSDT on the 1d when the close crosses above the 50 day SMA, sell when it crosses below, last 3 years
```

If you give no dates, the bot uses a default window and says so: the last 2 years on most timeframes,
1 year on the 15m and 30m, and 3 months on shorter ones.

The bot first shows how it read the strategy (market, timeframe, window, entry and exit), so you
can check it understood you. Then it posts the result with its chart: return, largest drop, win
rate, number of trades, how many backtests your plan has left, and buttons to open the full report
or share it. Most runs take a few seconds.

Under a result, **Try another** runs the same strategy with one change, one tap each: another
timeframe, another coin (BTC or ETH), or the last 5 years. Each is a normal run on your plan.

Anything the terminal understands works here: the market, timeframe, entry, exit, stop and the date
range. If something is missing or unclear, the bot says what to add, the same way the terminal asks.
See [phrasings](/docs/reference/phrasings) for what you can write.

### Use your own indicators

Saved custom indicators work here too. Send `/indicators` to see their names, then write one with
`@` in front of its name:

```text
/backtest buy BTC on the 4h when @my_trend crosses above 0
```

## 3. Share a result

Results in your chat with the bot are private. Press **Share a public link** under a result, or send
`/share` for your last run, to get a public report link with its chart card. Anyone with the link can see the report, and you can turn the link off at any
time from the share menu in the app. See [Share, fork & the gallery](/docs/guides/share-and-fork).

## Market checks and alerts

- `/scan` lists the biggest crypto movers of the last 24 hours, both ways, with a chart.
- `/regime` says whether the crypto market is trending (risk on) or weak (risk off) on each
  timeframe. It describes the market; it is not a signal to trade.
- `/alert` sets an alert in plain words and messages you when it matches:

```text
/alert BTC rsi below 30
/alert SOL rsi above 70 on 4h
/alert any coin up 15%
/alert any coin volume above 500M
```

`/alerts` lists your alerts with a button to turn each one off. Alerts count toward the active
alerts your plan allows.

## Commands

| Command | What it does |
| --- | --- |
| `/backtest <strategy>` | Runs a backtest of the strategy you describe |
| `/share` | Makes a public report link for your last run from this chat |
| `/indicators` | Lists your saved custom indicators |
| `/scan` | The biggest crypto movers of the last 24 hours |
| `/regime` | Whether the crypto market is risk on or risk off, per timeframe |
| `/alert <condition>` | Sets an alert; `/alerts` lists them |
| `/help` | Shows how to use the bot, with an example |
| `/start` | Shows the welcome message and whether your account is linked |
| `/stop` | Unlinks this Telegram chat from your account |

## Plans, credits and limits

- A run from Telegram is a normal run: it uses your plan, its limits and its credits, exactly as a
  run in the app does, and it appears in your History.
- Each person can run a limited number of backtests from Telegram per hour. Past that, the bot asks
  you to try again later or use the app.
- Add the bot to a group and anyone there with a linked account can use `/backtest`, `/scan` and
  `/regime`; results are posted to the group with a public report link. Group admins can send
  `/backtest_off` to stop it. Your alerts, saved indicators and plan details stay in your direct chat.
- A run is charged to the person who sent it, so the bot cannot run anything for an admin posting
  anonymously in a group. Turn off **Remain anonymous** in your admin rights, or use a direct chat.
