- [Instructor] What we've got here again, is data that we've seen previously. We've got data on any particular day, for the open price, the high price, the low price, and the adjusted close. Now, one trading strategy we might want to pursue involves trying to understand whether any of these prices seem artificially high or low, over a particular period of time. Maybe the stock, as an example, seems to have an artificial level of exuberance around it. People have been very excited about it, and buying pressures have pushed the prices up a little too much.
Or maybe people are a little too down on the stock, and prices have pushed down too low. A simple way to communicate that type of idea is through what we call the moving average. We might want to go through and develop a moving average that sort of smooths out some of the inter-day fluctuations in the stock, and gives us a better idea of where the trend is over time, and potentially allows us to develop some sort of a trading strategy around that. To do this, we'll need to put together a moving average for the stock in question.
Now, what kind of moving average might we want here? Well the answer is that we're probably looking for something that is going to help us to smooth out the data, but at the same time, capture what's really going on with the stock. Reasonable minds could differ on what type of moving average that might be. In our case, let's just say that we're going to use a moving average over the last two weeks. So, what we need to do then is go out two weeks, and then go back and average the prices from the previous two weeks.
Now, since there's five trading days in a week, that means that we're going to have a total of 10 prices for our moving average. So the moving average on January 16th will incorporate the average price from January 2nd through January 15th. Of course we don't know what the closing price is on the 16th itself. So to do this, to construct our simple moving average, I'm just going to go through and use the prices from the last two weeks, and then, that'll spit out our moving average.
I'm now going to drag and drop that all the way to the bottom of the column, and I'll format our cells so that we can read it more easily. Now when we get done, we should have a nice clean moving average over time, that's going to smooth out those data points for us. Let's see if this worked. Let's go ahead and graph our moving average against our other prices over time, just to see what that looks like, shall we? So I'm going to insert a line chart now, that'll show us what those prices look like over time.
And what we observe here is we've got five different points in our chart. And this is for what we call the VIX, again, which is the market's fear gauge, and this of course runs from the period 1990 through 2017, and so we have a lot of data here. But as you see, the dark blue line is the moving average. And it looks like the moving average kind of smooths out over time, exactly what we wanted it to do. It removes some of the high fluctuations, like we observe here in 2009, where the VIX shot up a lot, and it also takes out some of the low points.
So that adjusted close price, the yellow, and certainly the orange and the gray are a lot more volatile than the blue. For that reason, then, we might be able to develop a trading strategy based on smoothing out this data over time, and trying to sell the stock when it's artificially high, or buy it when it's artificially low. Or in this case, the security. And that's going to be the goal that we're going to establish in some of the algorithms moving forward.
Released
3/14/2018Professor Michael McDonald provides a brief primer on securities markets. He explains how data helps investors forecast performance and automate trading. Then he moves into the practical steps: coming up with algorithmic trading rules and developing and testing an algorithm. Finally, he shows how the algorithm can be applied and eventually expanded to other securities. Anyone working in financial services, or interested in investing in the stock market, will be able to use these tutorials to understand and develop simple trading algorithms of their own.
- Define what a share of stock is.
- Classify the type of trading that attempts to capitalize on the bid-ask spread.
- Name the rule that can be used as a metric for Fed interference in the market.
- State the first step in a data analysis project.
- Identify the type of characteristic algorithmic trading relies on.
- Break down how VAR is used to manage risk.
Share this video
Embed this video
Video: Stationarity and the VIX