In stock backtesting, the measurement of risk involves evaluating the volatility and potential losses of a particular investment strategy. This can be done by calculating various risk metrics such as standard deviation, beta, Sharpe ratio, maximum drawdown, and value at risk. These metrics help to quantify the level of risk associated with a strategy and determine the likelihood of incurring losses.