EasyLanguage Object Reference
Using Forms Classes
The EasyLanguage forms classes allow you to create free-standing windows
as part of an analysis technique or strategy. There are two categories
of form objects: Containers and Controls. Containers (such as forms, groups,
or panels) are used to group and display Controls (such as buttons, text
areas, count up/count down spinners, combo boxes, and more). The properties
for each container and control object are accessed through Easy Language.
- Button - A push button
that responds to a user's click by sending an event to the
calling analysis technique.
- Checkbox - A small box
that can be checked or unchecked by the user. They send
an event when clicked allowing the analysis technique to review
the checked or unchecked state.
- ComboBox - Presents a
list of items to a user from a drop-down list and sends
an event when a selection is made.
- Label - Displays non-editable
text on form. They can be used to provide descriptions or
identify surrounding controls.
- ListView - Displays a
collection of text items in a multi-column format. They send
an event when a selection is made.
- NumericUpDown -
Displays a numeric value that users can quickly increment
or decrement at a predefined step value using up-down arrows.
- Radio Button - Typically
placed in groups of two or more, allows users to select from
a group of mutually exclusive options. Radio buttons can send
an event when clicked, and their state can be queried at runtime.
- TextBox - Displays a string
of characters that can be edited by a user.
- A window in which to place the form's related controls and
- Panel - An area to visually
place a form's related controls.
- GroupBox - An area used
to visually group a form's related controls.
To use EasyLanguage form controls and containers,
you must have the following elements:
- Declare a variable for each container or control to be
used. The class type of each variable must be appropriate
for the object it will reference. Remember to include the
identifier "elsystem.windows.forms" in front of
the specific class type unless you have previously added a
for the forms namespace. In this example, "form1"
and "button1" are the names of the variables being
elsystem.windows.forms.Form form1(Null ), //declare
form1 as a Form type variable
button1(Null); //declare button1 as a Button type variable
- Create an instance of each container and control object
by assigning it to the object variable created above.
= form.create("Form Heading", 100, 100); //create
a form container object and assign it to form1
button1 = button.create("MY BUTTON", 40, 30 ); //create
a button control object and assign it to button1
- Add control objects (eg. buttons) to a container object
- Set the location property to specify the relative placement
of a control within a container.
50, 50 );
- Add an event handler (a method to call when a control event
occurs, such as when a button is clicked).
button1.Click += OnButton1Click;
- Finally, write the method(s) to be called when an event
void OnButton1Click( elsystem.Object sender, elsystem.EventArgs
The following example
shows how to create a windows form with a button and a text box.
on the Import Example link to import the example into TradeStation.
to the TradeStation platform and create a chart window. Use
the Insert - Indicator menu sequence and Add !ex_WinForm to the window.
- To review
or modify the example code, go to the TS Development Environment
and open indicator !ex_WinForm in the