Hello,
I’m new to P123, so please be gentle.
I’ve spent (wasted) a fair amount of time trying to figure this issue out today. Given that this thread is “only” 8 years old, odds are that this has been addressed elsewhere already, but I’m tired of hunting.
So I’d like to try to answer this to see if I’ve got this right, and also to close with a question.
The only conclusion that I can see is that neither function (PctDev or PctAvg) is meant to give a true Standard Deviation of the price itself.
Other than having the average of this type of price change, I can’t see much use for it, in and of itself, since averages can hide all manner of sins.
But PctDev could be useful as a measure of how volatile prices (measured as price changes) are over any given time period of “m” moves of “n” bars (where “bar” is a day). So, in the PctDev(5,2) example given here…
https://www.portfolio123.com/doc/doc_detail.jsp?factor=PctDev&popUpFullDesc=1
We see the example of five 2-day moves, which yielded these percent changes from the price of the day that occurred 2 days earlier…
0.67, 1.64, 0.94, -2.53, -1.55
The 0.67, for example, is derived from (75.99-75.48)/75.48, which equals 0.67%. Same thing for the rest of the sequence – it’s the pct change from 2 days earlier, over a total of five 2-day “moves.” That gives us…
0.67,1.64,0.94,-2.53,-1.55
And that averages out to -0.165, as we see in the same example where PctAvg(5,2) is used, too…
https://www.portfolio123.com/doc/doc_detail.jsp?factor=PctAvg&popUpFullDesc=1
I actually get that to be -0.166, so I’ll use that number, instead, for the rest of this.
So we get the difference between the above 5 numbers and -0.166 (the mean of the 2-day price changes)…
0.836 1.806 1.106 -2.364 -1.384
And summing up their squares…
0.698896 + 3.261636 + 1.223236 + 5.588496 + 1.915456
= 12.68772
The sum of the squares is, finally, divided by n-1 (using Excel’s formula STDEV.S which assumes that this is a sample of the population).
So 12.68772/4 = 3.17193
And phew! The square root of that is 1.78%.
This gives us an indication of how volatile prices are from day to day, or 2 day period to 2 days, or week to week, or whatever.
So it does have some usefulness.
–
But, and this is my question, what would have been wrong to also have a function that gave us the Standard Deviation of, say the last 10 numbers (+ the 11th), which would be the equivalent (using the same example) of this function in Excel…
stdev(75.99,74.86,75.48,76.07,74.26,73.70,73.57,74.24,75.48,76.47)
That gives us a Standard Deviation of 1.03% for the last 10 daily numbers, where the SD of the prices from the mean are more directly tied to the price itself.
This could be a stupid question, but then again, I gave the newbie warning up top.
But isn’t this latter the convention? I mean, if you want to talk to others in the literature (I don’t, but I’m just saying), which is conventional?
All the best,
Ken