The Ultimate Guide to Understanding Algo Trading Metrics

The Ultimate Guide to Understanding Algo Trading Metrics

2 weeks agoTutorials By Saleh Mir

When it comes to algo-trading, having a well-performing strategy is key. But how can you tell if your strategy is actually performing well? Of course, by backtesting it and then reading the performance metrics. However, some of those metrics can be daunting to some. So, I decided to write this article and walk you through an example, describing every single metric.

In fact, I will go through every single metric that you get to see after finishing a backtest with the Jesse framework. I believe the best way to learn about something is by looking at an example. So here's an example result that I've been getting for a strategy. I've been backtesting for the period of 5 months for BTC-USD, using the 4h timeframe:

Metric Value
Total Closed Trades 8
Total Net Profit 4441.42 (44.41%)
Starting => Finishing Balance 10000 => 14432.12
Open Trades 1
Total Paid Fees 426.39
Max Drawdown -16.01%
Annual Return 118.82%
Expectancy 555.18 (5.55%)
Avg Win 1026.77
Avg Loss 230.8
Ratio Avg Win / Avg Loss 4.45
Win-rate 62.5%
Longs 100%
Shorts 0%
Avg Holding Time 273h 30m 0s
Winning Trades Avg Holding Time 332h 48m 0s
Losing Trades Avg Holding Time 174h 40m 0s
Sharpe Ratio 1.87
Calmar Ratio 7.42
Sortino Ratio 3.3
Omega Ratio 1.45
Winning Streak 3
Losing Streak 2
Largest Winning Trade 1820.69
Largest Losing Trade -453.39
Total Winning Trades 5
Total Losing Trades 3

Breaking Down the Metrics

  • Total Closed Trades: This metric shows the total number of trades that have been closed during the backtest period. In this example, 8 trades have been closed.
  • Total Net Profit: This metric shows the total profit or loss generated by the strategy, expressed as a dollar amount and as a percentage of the starting balance. In this example, the total net profit is $4441.42, or 44.41%. This means that the portfolio has grown from a starting balance of $10,000 to a balance of $14,432.12 at the end of the backtest period.
  • Starting => Finishing Balance: This metric shows the starting balance of the portfolio and the balance at the end of the backtest period. In this example, the starting balance was $10,000 and the finishing balance was $14,432.12.
  • Open Trades: This metric shows the number of trades that are currently open. In this example, there is 1 open trade.
  • Total Paid Fees: This metric shows the total amount of fees paid during the backtest period. In this example, the total fees paid are $426.39.
  • Max Drawdown: This metric shows the maximum peak-to-trough decline in the value of the portfolio during the backtest period, expressed as a percentage. In this example, the maximum drawdown was -16.01%. This means that the portfolio value declined by 16.01% at its lowest point during the backtest period.
  • Annual Return: This metric shows the annualized return of the strategy, expressed as a percentage. In this example, the annual return is 118.82%. This means that the portfolio would have grown by 118.82% if the backtest period were one year.
  • Expectancy: This metric shows the expected value of a single trade, expressed as a dollar amount and as a percentage. In this example, the expectancy is $555.18, or 5.55%. This means that, on average, each trade is expected to generate a profit of $555.18, or 5.55% of the starting balance.
  • Avg Win | Avg Loss: These metrics show the average profit or loss per trade, expressed as a dollar amount. In this example, the average profit per trade is $1026.77, and the average loss per trade is $230.8.
  • Ratio Avg Win / Avg Loss: This metric shows the ratio of the average profit per trade to the average loss per trade. In this example, the ratio is 4.45. This means that, on average, each profitable trade generates more than four times the profit of each unprofitable trade.
  • Win-rate: This metric shows the percentage of trades that are profitable. In this example, the win-rate is 62.5%. This means that 62.5% of the trades generated a profit, and 37.5% of the trades generated a loss.
  • Longs | Shorts: These metrics show the percentage of trades that are long positions (i.e., buying an asset in the expectation that its price will increase) and short positions (i.e., selling an asset in the expectation that its price will decrease). In this example, 100% of the trades are long positions, and 0% are short positions.
  • Avg Holding Time: This metric shows the average length of time that a position is held open, expressed as hours, minutes, and seconds. In this example, the average holding time is 273 hours, 30 minutes, 0 seconds.
  • Winning Trades Avg Holding Time: This metric shows the average length of time that a winning trade is held open, expressed as hours, minutes, and seconds. In this example, the average holding time for a winning trade is 332 hours, 48 minutes, 0 seconds.
  • Losing Trades Avg Holding Time: This metric shows the average length of time that a losing trade is held open, expressed as hours, minutes, and seconds. In this example, the average holding time for a losing trade is 174 hours, 40 minutes, 0 seconds.
  • Sharpe Ratio: This metric shows the Sharpe Ratio of the strategy, which is a measure of risk-adjusted return. It is calculated by dividing the annualized return of the strategy by the standard deviation of the daily returns. A higher Sharpe Ratio indicates that the strategy is generating a higher return for each unit of risk taken. In this example, the Sharpe Ratio is 1.87.
  • Calmar Ratio: This metric shows the Calmar Ratio of the strategy, which is a measure of risk-adjusted return that takes into account both the Sharpe Ratio and the maximum drawdown. It is calculated by dividing the annualized return of the strategy by the maximum drawdown. A higher Calmar Ratio indicates that the strategy is generating a higher return for each unit of risk taken, and is able to recover from drawdowns more quickly. In this example, the Calmar Ratio is 7.42.
  • Sortino Ratio: This metric shows the Sortino Ratio of the strategy, which is a measure of risk-adjusted return that takes into account the downside deviation of the returns (i.e., the volatility of negative returns) instead of the standard deviation of the returns. It is calculated by dividing the annualized return of the strategy by the downside deviation. A higher Sortino Ratio indicates that the strategy is generating a higher return for each unit of downside risk taken. In this example, the Sortino Ratio is 3.3.
  • Omega Ratio: This metric shows the Omega Ratio of the strategy, which is a measure of risk-adjusted return that compares the probability of achieving a certain level of return (e.g., the expected return) to the probability of not achieving that level of return. It is calculated by dividing the probability of achieving the expected return by the probability of not achieving it. A higher Omega Ratio indicates that the strategy is more likely to achieve the expected return. In this example, the Omega Ratio is 1.45.
  • Winning Streak: This metric shows the longest sequence of consecutive winning trades. In this example, the longest winning streak was 3 trades.
  • Losing Streak: This metric shows the longest sequence of consecutive losing trades. In this example, the longest losing streak was 2 trades.
  • Largest Winning Trade: This metric shows the trade with the highest profit. In this example, the largest winning trade was $1820.69.
  • Largest Losing Trade: This metric shows the trade with the highest loss. In this example, the largest losing trade was -$453.39.
  • Total Winning Trades: This metric shows the number of trades that generated a profit. In this example, there were 5 profitable trades.
  • Total Losing Trades: This metric shows the number of trades that generated a loss. In this example, there were 3 unprofitable trades.

Mistakes to avoid

It's vital to know how to read and interpret cryptocurrency trading strategy performance metrics. However, it's equally important to be aware of the common mistakes. Here are some to avoid:

  1. Putting all the emphasis on profit: Profit is important, but it's not the only metric that matters. Traders who focus solely on profit may overlook crucial risk metrics such as drawdowns, Sharpe ratio, and losing streaks.
  2. Neglecting the timeframe: Consider the timeframe over which the performance metrics were calculated. A strategy that performs well over a short timeframe may not perform as well over a longer timeframe, and vice versa.
  3. Comparing apples to oranges: Compare strategies that are similar in terms of risk profile, timeframe, and asset class. Comparing a high-risk strategy to a low-risk strategy, or a short-term strategy to a long-term strategy, can lead to incorrect conclusions.
  4. Disregarding the impact of fees: Trading fees can significantly affect the profitability of a strategy. Take into account the fees that would be incurred in a live trading environment.For example, it makes sense to trade perpetual futures for a short-term strategy to save on trading fees. However, for a long-term strategy, spot trading might be a smarter choice.
  5. Overfitting: Overfitting occurs when a strategy is optimized to perform well on historical data, but fails to perform well in live trading. Read my previous article on how to avoid overfitting for more information.
  6. Ignoring the win-rate: While the average profit per trade is important, the win-rate is also crucial. A strategy with a high average profit per trade but a low win-rate may not be as reliable as a strategy with a lower average profit per trade but a higher win-rate.
  7. Failing to analyze the holding time: The average holding time, as well as the average holding time for winning and losing trades, can provide valuable insights into a strategy's performance. Strategies with excessively long holding times may not be practical for live trading perpetual futures.

By avoiding these common mistakes, you can ensure that you are making informed decisions about your trading strategies.

Conclusion

Of course, you don't have to read all of these metrics every single time. So, for example, if your goal is to make the most amount of profit, you can begin by looking at the PNL number and then at your risk metric, whichever you're more comfortable with. Or you could just combine it and merely look at Calmar or Sharpe ratios, which will give you good numbers for both the profit considering the risk.

There you go. Now you know how to read the performance metrics of a backtested strategy. If you have any questions or need further clarification, feel free to reach out in my Discord server and ask me questions.

❤️ Like Jesse?

If you like this project, please consider supporting me for free by using my referral links.

It's a win-win, you get free discounts and bonuses, and it helps me to develop more features and content:


Thank you 🙏