EasyLanguage & PowerLanguage Tutorials – Lesson 02: Coding A Moving Average

EasyLanguage & PowerLanguage Tutorial - Lesson 02: Coding A Moving Average Creating the first real indicator and expanding the basics After you familiarized yourself with the PowerLanguage Editor in the previous PowerLanguage tutorial - lesson 01 we will now build up on this foundation. In case you haven't read the last lesson, I would suggest doing that first as it can help you with understanding this lesson, too. Let's start with today's lesson now. Open the PowerLanguage Editor and create a new Indicator study. I will name mine ABC_PowerLanguage Lesson 02 - Moving Average so I can find it easily within my editor later. The name is totally up to you of course and you could even change it later. As the last part of the indicator name suggests, we will create and plot a moving average today. You have probably seen a moving average on a chart before or remember the term average from math. The main use for averages is as a filter to smooth the data you input. The image displays a 200 period simple moving average that gives a very smooth outcome. The downside to this smoothness is that you introduce more lag. This means the average becomes less responsive to changes in price. If you take a look at the next image you will see how different the behavior of a 200 period simple moving average is when you compare it to the green 10 period average. The latter is much quicker in responding to price changes, but in turn there is a lot more "noise" in the average. There are many different types of averages that mainly vary in the impact each data point has [...]