I have coded a strategy that works 5m time frame. I know you multiply it by 252 but i am using 5m or sometimes 1h time frame. Which number do i have to chose to multiply? There are 72576 five minutes in a year. Do i have to chose this number? Here how i calculate sharpe ratio

daily = sm['cash'].pct_change()
sharpe_ratio = daily.mean() / daily.std()
a_sharpe_ratio = (252 ** 0.5) * sharpe_ratio
entire_sharpe_ratio = (total_bars ** 0.5) * sharpe_ratio
  • $\begingroup$ I mean, using monthly data to approximate the yearly SR is still not ideal so let alone doing that on 5-min data (i.e. don't do it:)) $\endgroup$ – sen_saven Nov 1 '19 at 13:56
  • $\begingroup$ my algo works in smaller time frames :) scalper $\endgroup$ – Don Coder Nov 1 '19 at 15:29
  • 1
    $\begingroup$ Sure, that's great. But at the end of each day compute a P&L. And from these daily P&Ls compute an annualized Sharpe ratio $\endgroup$ – Alex C Nov 1 '19 at 16:15
  • $\begingroup$ @AlexC is there a way to do that? Or do i have to calculate P&L day by day? Because my current SR is calculated like 20+ which doesn't make sense :) $\endgroup$ – Don Coder Nov 2 '19 at 4:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.