Are you searching a fast way to programming your custom indicator in EasyLanguage and PowerLanguage? These quick tutorials are designed to make the task of learning to code more accessible.

Generally, the programming tutorials start from the coding theory. It’s complicated and boring for a newbie. Conversely, we begin with a real case and with practice.

Traders don’t need to understand everything about programming; many times, they need only a simple indicator that they can’t find in their trading platform.

The language is called “EasyLanguage” because it must be simple!

If you follow this interactive tutorial, you will be able to realize your project.

We start from many fundamental indicators, and we show you how to add many interesting features that help you in your trading activity.

Let’s start!

Create an indicator: EasyLanguage and PowerLanguage Tutorial


TradeStation:

Click on “Apps” and choose “EasyLanguage”; TradeStation will open a new window with the Editor.

Create an indicator with TradeStation Apps

In the Editor window, click on “New” bottom, choose “Indicator” and write the name of your new indicator.


MultiCharts:

Click on “File”, “New” and choose “PowerLanguage Editor” and MultiCharts will open a new window with the Editor.

How to create a new indicator in MultiCharts

In the Editor window, click on “New” bottom or click Ctrl+N, choose “Indicator” and write the name of your new indicator.

Create new Indicator in MultiCharts

Let’s start to code your indicator with EasyLanguage and PowerLanguage!

How to create a Moving Average

Easy Mode:

1. Insert all Inputs

You can assign a default value to the inputs. In Easy Mode, you have to decide only the Period of your moving average.

Input can be:

input easylanguage moving average period

If you want to learn more: EasyLanguage Tutorial – The Inputs

2. Declare all Variables

The variables holds all values; for example, you will declare the “MA” or “MA_Value” variable to store all Moving Average values.

There are three types of variables:

variable easylanguage moving average period

There are three Numeric Variable types:

You can choose any name for your Inputs and Variables, except for some special characters ($ % & / ).

ADVICE: you must always choose a name that has meaning. After some months, you have to open the code and immediately understand what a variable refers to.

Finally there are many pre-declared variables, you can use them like other variables but they don’t need to be declared. You can use this to test a draft program.

Variables can reference previous bar value on any historical bar. To do this, you can use the square-bracket:

Close[3] –> the Closed Priced of 3 bars ago

Value1[10]

3. The calculations

EasyLanguage and PowerLanguage calculate only in Bars. Everytime you use an indicator, you have to choose the number of bars to be analyzed.

If you want to learn more, read this:

We are here to calculate a moving average. TradeStation and MultiCharts are straightforward and have many pre-built functions. You don’t have to write extended code, because you can use a pre-built function like AverageFC() that calculate your moving average.

AverageFC() function will use the Close price and your MA_Period input to calculate the MA.

EasyLanguage PowerLanguage AverageFC function 3

4. Draw the indicator

The last step is to draw your indicator in a chart. To do this, you can use another pre-built function: Plot1().

With Plot Function you can draw many indicators in the same chart, you only have to add many functions changing the number: Plot1()  Plot2()  Plot3 (), etc.

plot function EasyLanguage PowerLanguage 2

5. Compile the program

The last step is to click on “compile” and verify in the output window if the code is correct. If you find an error, you must fix it before using the indicator.

compiler for tradestation and multicharts

That’s all! The first part of our EasyLanguage and PoweLanguage Tutorial is finished.

draw moving average multicharts powerlanguage

Advanced Mode:

In this part of the tutorial, we add many user-friendly features. With the basic Moving Average, you can’t choose the color, the width, and the price. You can only select the MA Period and add another moving average.

1. User-friendly Inputs

Add all the inputs you need. When you add the indicator to the chart, you’ll choose the color, the width, and the price to use to calculate the Moving Average (Close, High, Low, Open).

Remember to separate the Inputs with a comma and to use a semicolon after the last input.

advanced mode easylanguage powerlanguage coding moving average

Add the correct inputs to the AverageFC() function.

calculation function powerlanguage easylanguage

2. Change the Plot1() function. Here you have two streets:

Simple: add your input directly in the Plot function.

plot function simple powerlanguage

Advanced: add another two functions to set the color and the width. You can use the Set

plot advance functions easylanguage

That’s all! Now your menu is complete and user-friendly.

custom indicator inputs multicharts tradestation

 

Editors’ Recommendations:

 

 

 

EasyLanguage References.

Leave a Reply