From the course: Getting Started with Python for Finance
Unlock the full course today
Join today to access over 24,700 courses taught by industry experts.
Solution: Exponential moving average - Python Tutorial
From the course: Getting Started with Python for Finance
Solution: Exponential moving average
(upbeat music) - [Instructor] Let's look at the solution to this challenge. I'm going to build this up from scratch. Remember, I said check out the EWM documentation here. Let's just do that really quickly. So here's AAPL and I'm just going to say EWM and put a question mark after that to pull up the documentation. You can see that one of the parameters there is alpha. We can come down here and it says that alpha is this smoothing factor. So I'm providing you the smoothing factor of 0.03 and 0.009. We can scroll down a little bit more and there should be some examples of using this. And so, you can see that just like rolling, we say EWM and provide one of the parameters. In our case, we'll provide alpha and then we're going to provide an aggregation. Looks like this is doing mean and we're going to want to do mean as well. Okay, so that should give us some hints on how to use that. Again, leverage that documentation inside…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.