In this lecture, we're going to discuss one very popular application of the simple moving average.
While it might seem surprising that the absolute simplest concepts from this section can be applied
to algorithmic trading.
It's true, although algorithmic trading won't be taught in this course.
I think it's a fun application and you'll see that this technique actually appears to make a lot of
sense.
So the key idea with this method is to have two simple moving averages.
We call one the fastest in and one the slow Esmay.
The algorithm works like this whenever the fastest time crosses, the slowest to move from above.
We use that as a signal to take a short position or to sell in the case where you don't allow short
selling whenever the fastest time crosses, the slowest come from below.
We use that as a signal to take a long position or to buy.
So let's take a look at a stock price time series, along with the fast and slow Assam's to make sure
that this method actually makes sense.
OK, so in this graphic, the fastest form is denoted by Orange and the slow Assamese denoted by green,
the original close price is blue.
So we see that in the first part when Orange Cross is green from above.
This is when the stock price falls.
So it makes sense to sell at this point.
In the second part, when orange crosses green from below.
This is when the stock price rises.
So it makes sense to buy at this point.
Here's another example of a sell signal.
Note that this can perform poorly because the estimate lags the true price.
It's also important to optimize your window sizes, which I haven't done in any case.
Here's another example of a busy signal.
So generally we see that this strategy makes sense.
So when things are going down and buy, when things are going up, not bad for the simplest technique
from the section.