For a pair the spread is typically A - h x B, where h is the hedge-ratio. Its level in dollars is arbitrary, so traders normally track its z-score and enter when it is stretched, exiting near zero.
The two choices that decide everything are h and the lookback used for the mean and standard deviation. Both should be checked for parameter-sensitivity, and both should be estimated only on data available at the time, or you have invented a beautiful look-ahead-bias.
Worked example: A at 52.00, B at 39.00, h = 1.25. Spread = 52.00 - 1.25 x 39.00 = 3.25. If the 60-day mean is 2.10 with a standard deviation of 0.46, the z-score is 2.5, a typical entry threshold for a short-A long-B position.
Related: cointegration, hedge-ratio, z-score, mean-reversion