The EasyLanguage ABC's: First Steps in Mastering TradeStation Programming On Tuesday, May 23rd @ 4:30PM Eastern US we held a webinar with futures.io, the largest Futures trading community. The webinar was recorded and a link to the recording and webinar thread on futures.io is below. The webinar deals with "The EasyLanguage ABC's:" and explains the "First Steps in Mastering TradeStation Programming". It covers a lot of helpful information that can really simplify your programming life. Some bullet points are: What is EasyLanguage and where can I use it? The EasyLanguage ABC - a foundation of the basics Good coding habits Working with the Tradestation Development Environment Tips and Tricks for finding code errors Make sure to check the webinar thread on futures.io, where you can find the links for the useful resources, codes and some of the slides that I used during the webinar. You can also ask questions there.
Working with Multicharts and Tradestation - Lesson 06: Functions Learn how to create and use functions in Multicharts and Tradestation Let’s take a look at what functions are and how they are used. We can use this as foundation for another lesson when we take a look at how to operate the function that comes with our free Value Area Indicator. In previous lessons we have looked at Moving Averages in various forms. The studies we wrote had all calculations within the main code block. This is fine to demonstrate things or when you only work with a few lines of code. However handling ten different moving averages within your code would require you to add the same code ten times. This would make your code much harder to read and the code maintenance would become harder, too. Think about a logic error you want to fix or a change in the average formula that you want to make. A mistake in the average logic is likely included in all ten code blocks. The change to the formula would have to be made at ten locations within the code. What are functions? Functions can be of help here. As the developer you can keep your code at one location, within a function. You can use this function now to provide the results of the computation to any other code. In case of a logic error in the code this can be a huge help. The error has to be corrected at one place only. At the same time this correction will effect all other codes that call your function. It doesn't even have to be as serious as an error. [...]
Learning EasyLanguage & PowerLanguage - Lesson 05: Text and Trendlines Tracking daily extremes with an indicator The goal for this lesson is to do some more programming and create a study that tracks the daily extremes of a symbol. If you haven't read the previous lessons, I suggest you start at the beginning with lesson 01, as this lesson will use basics covered in earlier sessions. As I wrote the goal is a study that is able to track the daily extremes and to display them on the chart. We want to be able to see the current extremes for the day and also show yesterday's extremes on today's data. Let's take a moment to consider what we need for this study and how we want to handle the objectives best: we need to be able to find the highest high and lowest low for each day the study should use trendlines to display yesterday's extremes we want to be able to change the appearance on the chart via inputs the study should display text on the chart that labels the lines This already gives you an idea about what we have to look at today. Besides being a useful study or framework for future modifications, drawing text and trendlines and updating them will be the focal point of this study. Multicharts and Tradestation provide functions that return the daily high and low, but for various reasons this is not what we want to use here. Instead we'll create two tracking variables that store the current highest high and lowest low. On a new day these variables need to be reset and their value will be stored in a second set of variables. [...]
Multicharts Tutorial - Lesson 04: If statements and conditional branching Learn how to execute code expressions based on conditions In today's lesson you will learn how to control your program flow and make it execute parts only when certain conditions are met. This is where if statements are used. You can find them in basically every high level programming language and they are the engine that drives each program. If statements can for example be used in coloring a moving average differently based on its relation to the close of a bar. If you want to close all open positions after a certain time, an if statement will come into play. In case you want to trigger an alert when a predefined condition is met, you will also use an if statement for that. This list could go on for quite some time, but I think you already understand that if statements are not only very useful, but also very important. No programming tutorial could be complete without going over them and a good understanding is essential before we can move to more complex things. if...then... The "if...then..." statement is the simplest form of a conditional statement. The condition is tested and if it's true the following code statement will be executed. If the test is false nothing will be done as the following code statement will not be executed. When I say the test is true, don't get confused and think you are limited to testing conditions that include "true" only. In case "ii" is a numeric variable and "MyCondition1" and "MyCondition2" are boolean variables these are three valid "if...then..." statements. In case of the first statement the code checks for [...]
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