> For the complete documentation index, see [llms.txt](https://docs.tradefi.bot/whitepaper/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tradefi.bot/whitepaper/decentralized-ai-trading-bots/backtesting-interpreting-bot-performance-metrics.md).

# Backtesting - Interpreting Bot Performance Metrics

Interpreting backtesting results is essential for evaluating the performance and potential of your trading bots. Below is a detailed explanation of each variable displayed in the backtesting results to help you make informed decisions.

<figure><img src="/files/CCaMiwiEw6Y8NP88RSfr" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/v8wMr6jyr8POigvwAifL" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/366KErijh3EZQ7ixE1Lb" alt=""><figcaption></figcaption></figure>

### -Net Profit

**Net Profit**: This represents the total profit or loss generated by the bot after accounting for all trades and fees. It's a key indicator of the bot's overall performance.

### -Gross Profit

**Gross Profit**: The total profit generated from winning trades before deducting any losses.

### -Gross Loss

**Gross Loss**: The total loss incurred from losing trades.

### -Max Run-up

**Max Run-up**: The maximum gain experienced during the trading period. It indicates the highest profit level reached before a subsequent decline.

### -Max Drawdown

**Max Drawdown**: The maximum decline from the peak equity value during the trading period. It helps assess the risk level and volatility of the trading strategy.

### -Buy & Hold Return

**Buy & Hold Return**: The return if the asset was simply bought and held without any trading activity. This benchmark helps compare the bot's performance against a passive investment strategy.

### -Sharpe Ratio

**Sharpe Ratio**: This measures the risk-adjusted return of the bot. A higher Sharpe ratio indicates better risk-adjusted performance.

### -Sortino Ratio

**Sortino Ratio**: Similar to the Sharpe ratio but only considers downside risk, providing a more accurate measure of risk-adjusted return in volatile markets.

### -Profit Factor

**Profit Factor**: The ratio of gross profit to gross loss. A value greater than 1 indicates a profitable strategy.

### -Max Contracts Held

**Max Contracts Held**: The highest number of contracts held during any point in the trading period.

### -Open PL

**Open PL**: The current unrealized profit or loss of open positions.

### -Commission Paid

**Commission Paid**: The total fees paid for executing trades. This is important for evaluating the net profitability after accounting for transaction costs.

### -Total Closed Trades

**Total Closed Trades**: The total number of trades that were opened and closed during the backtesting period.

### -Total Open Trades

**Total Open Trades**: The number of trades that are still open.

### -Number Winning Trades

**Number Winning Trades**: The total number of trades that resulted in a profit.

### -Number Losing Trades

**Number Losing Trades**: The total number of trades that resulted in a loss.

### -Percent Profitable

**Percent Profitable**: The percentage of total trades that were profitable.

### -Avg Trade

**Avg Trade**: The average profit or loss per trade. This gives an indication of the typical trade performance.

### -Avg Winning Trade

**Avg Winning Trade**: The average profit of winning trades.

### -Avg Losing Trade

**Avg Losing Trade**: The average loss of losing trades.

### -Ratio Avg Win / Avg Loss

**Ratio Avg Win / Avg Loss**: This ratio compares the average profit of winning trades to the average loss of losing trades. A higher ratio indicates a more favorable risk/reward profile.

### -Largest Winning Trade

**Largest Winning Trade**: The largest single trade profit during the backtesting period.

### -Largest Losing Trade

**Largest Losing Trade**: The largest single trade loss during the backtesting period.

### -Avg # Bars in Trades

**Avg # Bars in Trades**: The average number of bars (time intervals) that trades remain open. This helps understand the average holding period of trades.

### -Margin Calls

**Margin Calls**: The number of times the account received a margin call due to insufficient funds.

<figure><img src="/files/S8D4E4uoZVvMvxCmO4jA" alt=""><figcaption></figcaption></figure>

By understanding these variables, you can better assess the performance and risk associated with your trading bots. This detailed analysis will enable you to optimize your trading strategies and achieve more consistent and profitable outcomes.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.tradefi.bot/whitepaper/decentralized-ai-trading-bots/backtesting-interpreting-bot-performance-metrics.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
