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?

Thanks,

Oscar

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?

Thanks,

Oscar

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:

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

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