I tried to backtest a simple strategy on TradingView, it made 6 trades with these results:
Now I want to calculate Sharpe ratio using definition provided by TradingView.
So, my daily returns(profit_by_days
) equals:
2020-11-07 0.45
2020-11-08 0.00
2020-11-09 -0.14
2020-11-10 -0.05
2020-11-11 0.00
2020-11-12 0.00
2020-11-13 0.24
2020-11-14 -0.08
Using this Pandas code:
sharpe = (profit_by_days.mean() - (2/365))/profit_by_days.std(ddof=0)
I get 0.257
Sharpe ratio, while TradingView shows 0.205
.
Why did I get a different result?
(absolute_profit_of_trade * 100) / capital
. What do you mean byamd
andbp
? $\endgroup$