# Can I calculate Sharpe ratio by running over many samples?

I have an algorithm that I am backtesting 200 times. It trades over 200 trading days per iteration.

My sharpe ratio is calculated as follows:

sharpe_ratio = (results['Reward'].mean() - 3) / results['Reward'].std()


Where 3 is my risk free rate of return. Is it valid to calculate the returns this way and use them to calculate my sharpe ratio?

• Assuming you are trying to determine your max Sharpe ratio for a portfolio of assets, 200 iterations is way too small. I don't think I ever use less than 100k iterations when doing any optimization whether it be a mean-variance optimization or something more robust. Without any more information, there is no way to tell if your returns are correct or not. Annualizing Sharpe is customary. Being that you are taking the mean of what looks to be a pandas dataframe series, I assume it has not been annualized...you need to use annualized returns and annualized volatility. Apr 12, 2019 at 13:38