Navigation:  Charts > User Indicator Editor >

2. Editor User Interface

Print this Topic Previous pageReturn to chapter overviewNext page

To open the user indicator editor, go to the main application menu => Charts => User Indicators Editor. The User Indicators Editor has the following interface:

 

 

1) Editor menu

2) Open script file

3) Save script file

4) Close current script tab

5) Compile script

6) Compile script and export it to charts

7) Script tabs

8) Current script

9) Vertical cursor position in the editor (line #)

10) Horizontal cursor position in the editor (column #)

11) Debugger.

 

To start working in the User Indicator Editor either click on File=>New , or open an existing script file by selecting File => Open (or alternatively by pressing on button).  When you finish and compile your script you will need to export it by pressing Tools => Import Current.  After that you will be able to see your indicator in the Chart Indicator Set-up window in the User Indicators section.

 

You can manage existing scripts by opening the List of User Indicators (Tools => List Of Imported Indicators). There you can see all currently added indicators, add or remove indicators, or open an indicator script for editing.

Before you can use your script, you will need to compile it. To do so, select Tools=>Compile Current (or press the icon or the F9 key). If the script contains no programming syntax errors, you will receive a “Compiled successfully” message in the debugger section. If some error(s) were found, the debugger section will show the type of error and its location in the script.

In order to compile the indicator and make it immediately available in charts, select Tools=> Compile And Apply, (or press the icon or Ctrl+F9).

Example: Lets add an indicator which will be shown on the main body of the chart. This indicator will form a line connecting the candles closing rates. We will need to go through the following steps:

1) Open the User Indicator editor: Charts => User Indicators Editor.

2) Open a new script page:  File => New.

3) Write/create the script:

 

Const   // Declaration of constants

IndicatorName = 'Test Script'; //Indicators name as it will appear in User Indicators List

Layout = Embedded;     // This indicator will be plotted directly on the chart

 

Var   // Declaration of variables

Graph: TLineGraph; //Declare Chart type variable

                                     //line indicator

 

procedure Init; // Initialization procedure

begin

Graph := TLineGraph.Create; //Creation of line Indicator

end;

 

procedure Add(const Index: Integer); //procedure of adding indicator onto chart

begin

if Index > 0 then

   Graph.AddXY(SourceGraph.XValue(Index),SourceGraph.YValue(Index));

//Drawing the indicator

end;

 

procedure Recalculate; //procedure of  recalculation of indicators values.

begin

FullRecalculation;

end;

 

 

4) Save the entered script : File => Save or click the icon (dont forget to name your file).

5) Compile your script: Tools => Compile Current or click the icon.

6) Provided that there were no errors during compilation, export the indicator : Tools => Import Current.

7) In a chart window open the indicator setup dialog and select 'Test Script' from the list of user indicators.

9) Click OK. The indicator will appear in the chart window.