Multicharts PowerLanguage Tutorial – Lesson 03: The while loop

EasyLanguage & PowerLanguage Tutorial - Lesson 03: The while loop Learn how to properly use the while loop in your programming Welcome back for the next lesson in our way to become fluent in Multicharts, Easylanguage and PowerLanguage. If you haven't read the previous lessons yet, I would suggest to start here. A new lesson will build up on the previous lessons and starting at the beginning will ensure you have a solid foundation. Lesson 02 showed how you can easily calculate a simple moving average and plot it on the chart. We used a "for loop" to sum the values over the previous bars that should compose the average. Today you will learn another type of loop and how to use the editor to print information to the output bar. In the first lesson we took a look at the main window within the PowerLanguage editor. When you open the editor it will probably show three different parts. If it looks very different on your end chances are that you changed the appearance under "View". Make sure that the "Output Bar" is checked as we will use this during the current lesson. Switch to the "Output" tab in the bottom window. This is where the PL editor will display information coming from print statements within your code. We will take a look at how this works now. Create a new indicator with a name of your choice. Again I am using a name that is easy for me to find within the editor and that displays the purpose of the indicator. We want the print statement only to appear one time in this demonstration. Easylanguage offers a convenient reserved word for [...]