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.
Value areas from a function - Lesson 07 Display value areas from a multiple output function In the last lesson you learned how to create, call and operate functions. Let's put this knowledge to use today by taking a look at how to use the function that is part of our free Value Area toolset. If you don't have a copy installed already, I would suggest to do that now. We need the function that provides the value areas in this lesson. What are Value Areas? Value Areas give you the areas where a defined amount of volume was traded or where price stayed in for a certain amount of time. A volume value area is the area where a certain percentage of the daily volume was traded in. While TPO (short for Time Price Opportunity) value areas are the areas where price spent a defined amount of time. You would usually look for areas with a width of about 70% of the total volume or total time (roughly one standard deviation). In case you want to learn more about value areas, this link is a good start. A brief function description In the last session we learned that there is no need to know how a function works internally. As long as you know how to call it, you can use it. We will make use of this, while we learn how to work with the "ABC_ValueAreas" function. This is a multiple output function and therefore it can return more than one value. As you learned in lesson six, this is done via reference inputs. We also learned that a function should have a return value, even [...]
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. If [...]
Recommended Futures Broker for MultiCharts Over the last couple of month I have been in contact with Matt Zimberg of Optimus Futures and had a chance to get to know the company a bit better. I must admit that I am really impressed by the way they are dedicated to helping and supporting their clients. Therefore I can can confidently recommend them as broker to use with Multicharts (or in general) and you should definitely check them out: Optimus Futures has an excellent reputation in terms of supporting its customers, providing good connectivity via their data feed and its low commissions. Above all, they have a good understanding of the platform they offer. You can see the series of Videos they did about MultiCharts here: MultiCharts Video If you wish to ask technical questions, you may do so on their forum here: MultiCharts Forum If you wish to get a demo of MultiCharts with Optimus, please go here: http://optimusfutures.com/multicharts-platform.html You can contact my broker Matt Zimberg Matt (AT) OptimusFutures.com 800 771 6748 or local at 561 367 8686 He can answer all your questions directly and please make sure to mention you are coming from ABC Trading Group Just to make it clear I don't receive a financial compensation for referring you to them. There is a substantial risk of loss in futures trading and it’s not suitable for all investors.
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 [...]
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 [...]
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 [...]
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 [...]
EasyLanguage & PowerLanguage Tutorial - Lesson 01 The first steps towards Easylanguage & PowerLanguage proficiency Great, you are taking the first step towards learning to program in Multicharts and Tradestation. I am happy for you as this will be an interesting journey. This will bring up a new window. Set the study type to Indicator and click “OK”. Give the study a name of your choice. The only limitation is that the name can't be already in use by a different study. For example I will use ABC_PowerLanguage Lesson 01 as name and then click OK again. The name will be what you use later to add the study to the chart, so it helps when it displays the purpose of the study. I like using the ABC_ prefix to label the studies that I have worked on for myself or the website for example. For other work I will use different labels. This makes it easier to find something when I have to look up a study. Every study can have inputs that you can assign a default value to. For example you can use an input for the length of a moving average. The inputs for indicators and signals can be changed when you load the study on a chart. So it makes sense to have some inputs to allow a more user friendly study. When you declare an input by giving it a name and initialize it by assigning a default value, you also define the type of the input. There can be three different types: a Numeric input a String input a Boolean input i.e. a true/false input To declare [...]
EasyLanguage Tutorial - Lesson 0 Learning EasyLanguage as easy as ABC A new school year starts after the summer holidays here. This seems to be the perfect time to finally start something I had in mind for a long time. I wanted to create a set of Easylanguage tutorials that help users with starting to learn how to program in Multicharts and Tradestation. At least help them in understanding basic coding principles. If you already have coding experience in either of the programs these EasyLanguage tutorials will probably not be for you. The lessons will be geared towards Multicharts, as the build in PowerLanguage is more powerful than Tradestation’s EasyLanguage. At the same time what works within EasyLanguage will usually work within PowerLanguage, too. I will highlight differences in the two languages, thus making sure you can use the lessons for Tradestation, too. Tradestation and Multicharts have expanded the programming capabilities of their software a lot over the last years. Tradestation has extended EasyLanguage with object oriented components. It’s called OOEL (object oriented EasyLanguage) which allows for more complex programming. Multicharts.NET even takes it one step further as you can program in C# or VB.NET. This offers great possibilities for experienced programmers. If you have some experience in either of the languages you could take a look at the free MC.NET SE (Starter Edition). As the EasyLanguage tutorials focus on the basics (and Multicharts.NET doesn’t use EasyLanguage or Powerlanguage anyway) I will concentrate on EasyLanguage and PowerLanguage first. My goal is to create one lesson per week and I will try to have a couple of lessons ready for publishing in advance. So in case there will be little [...]