B&H Sharpe Ratio

When I apply a B&H system to a portfolio or a symbol (Buy=1; Sell=0;) the Sharpe Ratio shows as N/A in the Backtester Report, is their a way to calculate the SR in this case?



AmiBroker calculates the sharpe ratio of trades. It is not meaningful when there is only one trade. Instead, you could calculate the sharpe ratio of your equity curve. To compute a sharpe ratio:

  1. Write custom backtest code
  2. Choose a sampling interval (daily, weekly, monthly, yearly)
  3. Compute the array of sampled returns of your equity array
  4. Compute the average and standard deviation of the sampled returns
  5. Compute the ratio of the (average return - riskfree return) / stddev
  6. Add a custom metric with your newly calculated sharpe ratio

For simplicity, you could assume the risk free rate of return is zero.