Is there a formula of calculating the significance of an increase of a value relative to its size?

27 Views Asked by At

This is an idea I had about volume in stock trading (amount of shares traded over a given time interval)

If a stock volume at some point is 5 and the next time unit it's 10, that represents a 100% increase in volume but it only increased by 5, so it's not that significant.

On the other hand, if you had a volume of 10,000 at some point and it went to 11,000 the next time unit, it's only 10% but that's far more significant given the volume's magnitude.

I'm trying to make a program that alerts me based on an increase in volume of a stock, but I wonder if there's a formula that will give me alerts that are actually significant. As the volume goes higher, the increase threshold could be lower for the alert to still make sense (like example above), and vise versa.

Does anybody know of a formula that can determine how much the volume of a stock needs to increase with respect to its initial volume to be "noteworthy" of attention?

Thanks

1

There are 1 best solutions below

0
On

In order to calculate the significance (usually represented through a "$p$-value") there are two different approaches you can take:

  1. Parametric Approach:

We can assume an underlying distribution of the changes, normally supported by empirical evidence. For example, if you assume that the returns of stock prices, i.e., $(S(t+1)-S(t))/S(t)$, are Normal$(0,\sigma^2)$, and you estimate $\sigma^2$ using past data, then you can calculate a probability of having a move that extreme using the normal distribution. These $p$-values are readily calculated in R, Python, etc., using built in functions. Note that by dividing by $S(t)$ in the above returns we control for the effect of higher priced stocks moving more - the same reasoning also holds for stock volume.

With regards to financial data, the normal distribution is usually not appropriate as financial data often exhibit heavy tails. Instead, you can use the $t$-distribution, or some other heavy-tailed distribution.

  1. Non-parametric Approach

For this approach, we don't assume an underlying distribution but instead use the previously observed stock volume. For example, let $v_1, v_2, \dots, v_n$ be the daily volumes of a certain stock $i$ over the past $n$ days. Suppose we observe $v_{n+1}$, the volume of current day, and we want to calculate how "significant" the daily volume is. Then we can do this by using the previous days $v_1, v_2, \dots, v_n$. Specifically, calculate the proportion of days with volume larger than the current day, and take this as your $p$-value:

$$\hat{p} = \frac{1}{n}\sum_{i=1}^n \mathbb{1}(v_i > v_{n+1})$$

where $\mathbb{1}(v_i > v_{n+1})$ is the indicator function that is $1$ or $0$ depending on whether the enclosed statement is true or false, respectively. If $\hat{p}$ is small, then the empirical probability of such volume occurring is small, meaning the volume is significant. Conversely, if $\hat{p}$ is large, then such volume occurs frequently, and so it is not significant.

In the above approach we normally use a moving window (using the past $n$ days instead of all previously observed days) since the behavior of financial securities tends to change over time.