Sharpe Ratio
Nobel Laureate, William Sharpe, introduced the Sharpe Ratio in 1966 under the name “reward-to-variability ratio”. The Sharpe Ratio is widely used by portfolio managers and individual traders to show how much risk was taken to achieve specific returns.
The formula for the Sharpe ratio is:

Where:
MR: Average return for a monthly trading period.
RFR: Risk-free rate of return (by default, 2% annually. Can be changed with the "risk_free_rate" parameter of the "strategy()" function).
SD: Standard deviation of returns (includes both upside and downside volatility).

(where Xi is the i-th return, MR is the average return of returns, and N is the total number of returns).
Thus, this formula yields a value that could be loosely defined as return per unit risked if we accept the premise that variability is risk. The higher Sharpe ratio, the smoother the equity curve. Having a smooth equity curve is an important objective for many traders.
Example of Xi calculation:
January 1, 2026: Account equity = 100
February 1, 2026: Account equity = 110
January return (X1): (110 - 100) / 100 = 10%