OPEN-SOURCE SCRIPT

Sharpe Ratio BTC vs Gold

109
It calculates the Sharpe Ratio for Bitcoin (BTCUSDT) and Gold (XAUUSD).
Uses log returns to compute risk-adjusted returns.
Takes a 30-day lookback period by default.
Risk-free rate is set at 3% annualized, converted to daily.
Plots both Sharpe Ratios on the same chart: Bitcoin (Blue line), Gold (Red line)

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.