---
description: >-
  Backtesting is a critical step in evaluating the performance of your AI
  Trading Agent. It allows you to test your strategy using historical market
  data to see how it would have performed in the past.
---

# Backtest Your AI Trading Agent

<figure><img src="https://content.gitbook.com/content/O5WhSde5bNcimZ1K95En/blobs/1ZS8letqT0DSFoTc3Sn0/Screenshot%20from%202025-03-27%2012-00-31.png" 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](assign-wallet-and-deposit-funds) section.
