Adding the choice of which Moving Average to Plot on the Price Chart.
In the previous lesson we added a moving average to the chart. In lesson 3 we will provide the user of the indicator the choice of which moving average type plot in the user dialog box. This selected moving average will be plotted on the Price chart. We will learn about the enum C# function and switch statement ( which is a C# case statement). Finally, we will spend more time on the PLOT statement.
Just a note on the enum function used in NinjaScript Indicators. It is a great feature to allow the user to select from a list but internally there is a fair but going on, which will be explained in detail. If you have ever tried to save an indicator which has an enum as another name, on compilation you will get errors relating to a duplicate name. In this lesson, we will show you how to get around this problem.