Using Statistics to Trade Stocks
In my last article, I discussed the role of variability, variance, and standard deviation for traders. I received some questions about the actual calculations required, so this post is my attempt to show you what goes on behind the curtain.
In statistics and finance, calculating 2 standard deviations of the mean helps identify data points that deviate significantly from the average. This measure is especially useful in fields like trading, where understanding volatility can inform investment decisions. Here’s how to calculate it:
Step 1: Calculate the Mean
The mean is simply the average of a set of numbers. To find it, add up all the values in your data set and divide by the total number of values.
Example:
Suppose we have daily price returns: 4, 6, 7, 8, and 10.
- Mean = (4 + 6 + 7 + 8 + 10) / 5 = 35 / 5 = 7
Step 2: Find Each Value’s Deviation from the Mean
Next, subtract the mean from each data point to find the deviation of each value from the mean.
Example:
- Deviations from the mean (7):
- (4 – 7) = -3
- (6 – 7) = -1
- (7 – 7) = 0
- (8 – 7) = 1
- (10 – 7) = 3
Step 3: Square Each Deviation
Square each deviation to avoid negative values canceling out positive ones.
Example:
- Squared deviations:
- (-3)^2 = 9
- (-1)^2 = 1
- (0)^2 = 0
- (1)^2 = 1
- (3)^2 = 9
Step 4: Calculate the Variance
The variance is the average of these squared deviations. Sum up the squared deviations and divide by the number of values (for population standard deviation) or by one less than the number of values (for sample standard deviation).
Example (assuming sample standard deviation):
- Variance = (9 + 1 + 0 + 1 + 9) / (5 – 1) = 20 / 4 = 5
Step 5: Calculate the Standard Deviation
The standard deviation is the square root of the variance.
Example:
- Standard Deviation = √5 ≈ 2.24
Step 6: Multiply by 2 for 2 Standard Deviations
To find 2 standard deviations, multiply the standard deviation by 2.
Example:
- 2 Standard Deviations = 2.24 * 2 = 4.48
Interpreting the Result
When working with data following a normal distribution, about 95% of values will fall within 2 standard deviations of the mean. This measurement helps identify values that significantly deviate from the average and can signal unusual or volatile conditions.
In trading, this metric is frequently applied to determine if a price movement is substantial enough to indicate a potential reversal or trend continuation, helping traders make more informed decisions based on statistical probability.
If you’re interested in using statistical software to analyze big datasets, Julie and I have used SPSS since we were undergrads. You can find it here https://www.ibm.com/spss.
Good Trading,
Adrian Manz