About the Debugger

The EasyLanguage Debugger is an integrated tool used to observe the run-time behavior of your EasyLanguage code and to locate logic errors. The debugger allows you to suspend execution at a specific location to examine your code, inspect variables, and review property values.

The debugger is part of the TS Development Environment and is controlled from the Debug drop-down menu. The debugger works on EasyLanguage documents that have been compiled (verified).

 VIDEO - EasyLanguage Debugger Intro - Learn about using the EasyLanguage debugger.

Layout

The debugger is accessed using the Debug menu from TradeStation Development Environment (TDE) .

The following describes the menu choices:

Windows - Opens the Autos, Bar Info / Plots, and Watch windows. Click on the menu choice to toggle its tab on or off.

Start Debugging - Starts the debugger.

Continue Debugging - When paused, restarts the debugger.

Stop Debugging - Stops the debugger.

Step Into - When paused, moves debugging into the highlighted method or function.

Step Over - When paused, moves the debugger to the next logical line of code.

Toggle Breakpoint - Sets a breakpoint or removes a previously set breakpoint.

To start debugging a verified EasyLanguage program, select Start Debugging in the Debug drop-down menu or press the <F5> function key. Once started, this item in the menu is replaced with Continue Debugging.

Set a breakpoint where you want the debugger to pause execution of your program. Breakpoints are identified by a red dot to the left of a line of program code. You may set multiple breakpoints.

Examine the variable contents in the Autos window. The line of your program that is analyzed in the Auto window is highlighted in light-blue.

If you are at a line that calls a function or method, you may "step into" it by pressing <F11> or selecting Step Into in the Debug drop-down menu. You may also "step over" the function call by pressing <F8> or selecting Step Over in the Debug drop-down menu. Use Step Over to move through the code one line at a time.

Break Mode

Your EasyLanguage program runs until a breakpoint is encountered. At that point the program halts and all variables can be examined in the Autos window.

You may "Step Over," <F8>, the breakpoint which moves the debugger to the next logical line or "Step In", <F11>, it to examine a method if the breakpoint is on a line that calls a function. Many programmers will set a breakpoint several lines before the suspect line. That permits them to view variable contents leading up to the problem.

You may continue one line at a time from the breakpoint by using "Step Over" or <F8>.

Autos

The Autos window displays information for all active variables and parameters at any point in your program, including local variables when you step into a function or method.

Autos window information is displayed in three columns: Name (the variable’s name), Value (the value current held in the variable), and Type/Desc (the type of the variable).

The Autos window is most conveniently displayed below the code editing window although you may position it anywhere within the TDE.

When data first appears in the Autos window, the variable names may not show any data values. Expand the variable name by clicking the "+" below the name. Several lines may appear, preceeded by [0] and [1]. These refer to datastream 0 (generally the top section of your chart) and datastream 1 (generally the bottom section of your chart.

Determine the datastream where your EasyLanguage program is running and read the variable values to the right.

Bar Information / Plots

The Bar Information / Plots window displays information about the bars and plots in your analysis window. This is the same type of bar and plot information that was previously available in the legacy debugger in the TradeStation platform.

Window information is displayed in three columns: Name (the variable’s name), Value (the value current held in the variable), and Type/Desc (the type of the variable).

The Autos window is most conveniently displayed below the code editing window although you may position it anywhere within the TDE.

Watch

The Watch window allows you to display only the information which is of interest to you during a debugging session, such as specified variables and study parameters.

To add an item to the Watch Window, simply double click the first unused cell in the Name column and then enter the name of the of the variable you'd like to track during the debugging session. Items can be removed from the Watch Window by simply selecting the item name and then pressing the Delete key.

Window information is displayed in three columns: Name (the variable’s name), Value (the value current held in the variable), and Type/Desc (the type of the variable). In addition to individual variables and parameters, you also have the ability to view object data for all collections classes: Stack, Vector, Queue, Dictionary, GlobalDictionary.

Usage
  1. To start debugging a verified EasyLanguage program, be sure that it is not currently running in a chart.
  2. Find an area of the code where program execution should halt. Put the cursor anywhere on that line and select Toggle Breakpoint from the Debug pull-down menu or press the <F9> function key.
  3. Select Start Debugging from the Debug pull-down menu or press the <F5> function key.
  4. The Process Ids window appears. Select the chart to be used to run the program.
  5. Your EasyLanguage code will run until it encounters the breakpoint line.
  6. View contents of all variables in the Autos window or of selected variables in the Watch wndow,
  7. Move through the code one line at a time by pressing <F8> or selecting Step Over in the Debug drop-down menu.