This function calculates the average up and down returns from a series of returns.
pt.udrtn(r)
r
:a vector of periodic returns
r <- runif(100,-1,1) # generate random number to simulate returns pt.udrtn(r)