# Trend test on historical stock prices, where to start?

I am a beginner on statistic but come across an urgent situation that I have to work with statistics of stock prices data.

I have learned that ones can do a hypothesis test that rejects the Random Walk hypothesis in order to show that the data have trends. I have tried to understand it but that seems impossible for me as a completely beginner. (beside simple concepts like probability and linear regression, I have just learned about the hypothesis test along the way!)

I have tried finding if there are easier alternative ways that I can understand but am feeling lost as there are too many terms that I don't know such as parametric-nonparametric thing, t-statistics, residuals etc.. Not to mention that I can't randomly pick a test strategy to do the work, could I?

In fact, I am not doing any deep analysis at all. All I want to do is to prove that a subset of my data is statistically increasing or not (in fact it is, visually), as follows.

I have a time series of historical prices, $\{p_0, p_1, p_2,...,p_n\}$. And I have an algorithm to pick 2 points $p_{t1}$ and $p_{t2}$ (with ${t2} > {t1}$) such that $p_{t1} < p_{t2}$. Then I want to show that the prices between $p_{t1}$ and $p_{t2}$ is statistically increasing. Please guide me to do that or advise a learning path that leads straight to the topic. Thank you.

The picture below shows examples of the case where the prices between the two points are increasing and the case where not.

My algorithm involves the use of MACD and fuzzy logic but it's just a trial-and-error thing and may looks basically like nothing more than asking a person to pick two points as mentioned. My intention is that the algorithm chooses $p_{t2}>p_{t1}$ due to that the data have the increasing trend from $t1$ to $t2$, not by chance

• Please explain what you mean by "statistically increasing." After all, because $p_{t1}\lt p_{t2},$ by definition the prices have increased from $t1$ to $t2$. You probably will need to describe your algorithm in order to get useful responses. – whuber Jan 21 '14 at 16:25
• My algorithm involves the use of MACD and fuzzy logic but it's just a trial-and-error thing and may looks basically like nothing more than asking a person to pick two points as mentioned. My intention is that the algorithm chooses $p_{t2}>p_{t1}$ due to that the data have the increasing trend from $t1$ to $t2$, not by chance. By increasing trend, I don't know how to define it but there might be a case that the data go up and down randomly but the algorithm still is able to choose the points. – asinkxcoswt Jan 21 '14 at 16:41
• Well, let's try this: how would you characterize the times $t1$ and $t2$ that your algorithm finds? Examples of characterizations would be "times at which the maximum and minimum prices are observed" or "times between which the slope in price is maximized" or "times bracketing the longest period in which the price never dropped." – whuber Jan 21 '14 at 17:10
• Sorry, but I am completely lost in what you asked. T_T. – asinkxcoswt Jan 21 '14 at 17:20
• You don't have an understandable or answerable question until you can describe, in sufficient detail, what you are doing and what you wish to accomplish. It's not even clear from the image you have posted what you mean by "trend": after all, in both cases there are increases in prices between the two times. – whuber Jan 21 '14 at 17:36

The equation would be $Y=\beta t + \epsilon$ where $t$ is the trend and $\epsilon$ is the residual. Use the t-value to see if the trend is significant, and look at the coefficient to determine the direction and slope.