TradeStation Development Environment

About Component Objects in EasyLanguage

To make it easier to add and use objects with EasyLanguage, some object classes are designed as components so that you can simply drag and drop them into your EasyLanguage document and use a special editor to modify their properties without writing any code. Components automatically produce hidden designer generated code that is associated with your document.  You may view designer code but you can't directly edit the code.

 

Once component objects are added to your EasyLanguage document, you use the Properties editor to configure them for use.  Then you simply write your own EasyLanguage statements that access each object's properties and methods much like you would refer to reserved words and functions.

 

[ Expand All ]

Inserting a Component Object

 

  1. From the TradeStation Development Environment (TDE), Open or create a New document (analysis technique, strategy, function) in the EasyLanguage editor.
  2. Open the Toolbox panel by clicking the Toolbox tab on the left side of the TDE window.  Highlight the component you want to add and click on it to add it to the current EasyLanguage document.
  3. Once inserted, the component's icon appears in the component tray beneath the editor window (you may need to re-size the component tray to see all of the icons).  To remove a component from a document, select it's icon in the component tray and press the Delete key.

  1. The designer generated code for the component is automatically linked to the EasyLanguage document and can be viewed using the View > Designer Generated Code menu sequence.  The designer code is protected and may not be directly edited using the editor.  Component values are modified using the Properties editor (see step # 5).
  2. Click on the Properties tab on the right side of the TDE window to open the Properties editor. This is where you manage and modify component values, inputs, and events.  Use the drop-down list at the top of the Properties editor to select a component whose values you want to view or modify. Property names appear in the left column and property values appear in the right column.  For example, the name of the component appears in the Design section and may be changed by entering a new name in the Value column of the Name field.
Modifying Component Properties

 

Example 1 (Timer component named Timer1)

To turn on the Timer component (Timer1 is this case) so that when the EasyLanguage document is applied to a chart or grid it will start counting, click the initial Enable property and select True from the drop-down list.  The value changes to True in the properties editor.

The matching EasyLanguage component (designer generated code) will now read:

 Timer1.Enable = true ;

 

Example 2 (Creating a handler method that will run with the timer elapses)

Click the Event icon at the top of the Properties editor for Timer1, then double-click on the Elapsed property to create an event handler named Timer1_Elapsed.  

A new method will be added to your EasyLanguage document that reads:

method void Timer1_Elapsed( elsystem.Object sender, elsysetm.TimerElapsedEventArgs args )

begin

 { Insert your EasyLanguage statements below }

 

end;


Simply add your own EasyLanguage statements and every time the Timer object elapses the EasyLanguage statements will be executed.  Since the AutoReset property of the Timer is set to True, your EasyLanguage will execute every 1000 milliseconds (1 second) by default).

 

See Also

 

About the Toolbox

About the Properties editor