# Backtest Your AI Trading Agent

<figure><img src="/files/wHPSUgktOQV6P27Rn6Iz" alt="" width="375"><figcaption></figcaption></figure>

After copying or creating an agent through Agent Builder, you should be automatically redirected to the backtesting view. If you don't see the backtesting modal, you can open it by clicking the "Run Backtesting" button on your agent's dashboard.

### Backtesting – What It Is and Its Limitations

Backtesting simulates how your agent would have performed using historical blockchain data. NOKS runs your agent periodically over a selected past period and executes the trading logic as if it were live.

**Limitations of backtesting:**

* **No slippage included** – assumes perfect execution with no price deviation.
* **No price impact simulation** – doesn’t account for large trades moving the market.
* **No gas fees or DEX fees included** – returns are calculated without subtracting transaction costs.
* **No MEV or front-running risk simulated** – assumes fair and uninterrupted execution.
* **Liquidity is checked** – the agent verifies whether there was enough liquidity in the pool at the time of execution.
* **Backtesting ≠ real performance** – even if a strategy performs well in backtest, it doesn't guarantee the same result in live conditions.

### How to Test Your Agent with Historical Data

1. **Choose the Backtest Period:** Select a historical range from 1 to 30 days. Longer periods offer more reliable results.
2. **Set Portfolio Size:** Define your starting wallet balance to ensure your strategy executes properly.
3. **Add ERC-20 Tokens (Optional):** Add tokens to simulate real trades if you want to test with your current holdings.
4. **Run the Backtest:** Click "Run" to simulate your agent’s trades during the selected period.

### **Next Step:**

Once you're satisfied with the backtesting results, you can proceed to the next step. For detailed instructions on creating and assigning a wallet to your agent, see the [Create & Assign Wallet](/noks/how-to-build-ai-trading-agent/assign-wallet-and-deposit-funds.md) section.


---

# 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://noks.gitbook.io/noks/how-to-build-ai-trading-agent/interactive-blocks.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.
