# The importance of Backtesting

## **What is Backtesting?**

Backtesting allows users to simulate their agent’s trading strategy using historical data to evaluate its performance before deploying it live. This feature is a powerful tool for users to **reduce risk, improve decision-making, and optimize strategies**. By analyzing how their strategy would have performed in the past, users gain valuable insights into potential future performance.

Backtesting is an **add-on feature** available for users who want to take their agents to the next level. The results will be accessible in a detailed, interactive format powered by **COMET**, enabling users to explore performance metrics and refine their strategies.

***

### **Why Add Backtesting to Your Agent?**

1. **Validate Your Strategy**
   * Backtesting provides immediate feedback on whether your agent’s strategy is likely to be profitable.
   * Spot flaws in the strategy before committing real funds.
2. **Performance Metrics at Your Fingertips**\
   Users will receive detailed analytics such as:
   * **Sharpe Ratio** – Measure of risk-adjusted return.
   * **Max Drawdown** – The largest peak-to-trough decline in capital.
   * **Win/Loss Ratio** – Percentage of successful trades vs. losses.
   * **Profit and Loss (PnL) Graphs** – Visualize daily, weekly, and monthly performance.
3. **Optimize and Improve**
   * Test multiple scenarios to fine-tune your agent’s parameters.
   * Adjust settings to minimize risk and maximize returns based on historical data.
4. **Reduce Risk**
   * Identify periods of high volatility or potential losses in advance.
   * Develop strategies with a stronger understanding of how they behave under different market conditions.

***

### **How Backtesting Results Are Displayed**

Once the backtesting add-on is purchased, users will have access to **interactive, easy-to-read reports** powered by COMET.

**Key Elements of the Report:**

* **Performance Summary:** Includes cumulative returns, total trades executed, and profitability trends.
* **Visual Analytics:** Detailed graphs for performance over time, volatility, and drawdowns.
* **Trade Logs:** A complete breakdown of all trades during the backtest with timestamps, entry/exit prices, and profit per trade.

> **Example View:**\
> Here’s what a typical backtesting report will look like:

<figure><img src="https://3787740934-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7nvVUIZMUI3YoBF76RvY%2Fuploads%2Fn8c7lkSV7S8rMA2SU7zj%2Fimage.png?alt=media&#x26;token=b6ebdd2d-4938-43fa-9b3f-e1a1f1ebcf5e" alt=""><figcaption></figcaption></figure>

***

### **How to Enable Backtesting**

Users can activate backtesting for their agent through the **"My Agents"** section by selecting the agent and purchasing the add-on. Once activated:

1. The system will run the backtest using relevant historical data.
2. Results will be displayed in an interactive dashboard.
3. Users can review and download the results as a PDF or CSV for further analysis.

***

### **Important Note & Disclaimer**

*   1️⃣ The selected strategy likely has existing open trades within our AI system. Users will receive a list of active trades aligned with their strategy, including the date each trade was opened. It is entirely up to the user to decide whether to enter these trades, considering they were initiated in the past.

    2️⃣ Backtesting generates a portfolio of up to 15 tokens. If the agent creator selects a group with more than 15 tokens, our algorithm will automatically prioritize tokens with the highest volatility targets and trading volume.

    3️⃣ Users can choose to enter existing open trades or wait for new ones. If there are already many active trades when receiving the COMET, our AI technology may not send new trades daily. This is because we operate on a daily timeframe with an expiration mechanism for trades.

    4️⃣ Our average trade holding period is typically weekly, and in some cases, even monthly. Users are responsible for monitoring, reviewing, and executing trades based on their personal preferences and risk tolerance.

***

### **Conclusion**

Backtesting is a must-have feature for serious users who want to refine and enhance their agent’s performance. By leveraging historical data and detailed analytics, users can confidently deploy agents that are fine-tuned for success.

