Intelligent management
For ease of programming, RTX5 Editor provides various tools from auto substitutions of names and tips to functions up to bookmarks and hot keys. These tools allow you to speed up the process of code writing, make navigation easier and help prevent errors.
This section describes the following functions:
- Auto substitution of function names
- Information on parameters
- Code folding
- Match highlighting
- Moving to definition
- List of functions
- Inserting comments
- Additional code editing features
- Working with bookmarks
- Go to Line
- Snippets
- Inserting resources
- Text conversion
- Clipboard tracking
Any changes can be undone by executing
Undo command in the Edit menu or on the Standard toolbar, or by pressing Ctrl+Z.
Auto substitution of function names
When you write the program code, RTX5 Editor automatically offers possible substitution options for built-in and custom functions, constants, variables, class members, keywords, etc. This speeds up the code writing. For example, as soon as you enter the first letters of the function name, a list of functions with suitable names immediately opens. Select the appropriate option with keyboard arrows and press Enter:

If an option list is too large, type a few more letters of the function name. To call the list manually, click
List Names in the Edit menu or Ctrl+Space after entering the first characters of the name.
Information on parameters
You can see the function signature right when writing the code without opening the language help. To do this, place the cursor after the opening parenthesis which starts the description of the function parameters, and then click
Parameter Info in the Edit menu or Ctrl+Shift+Space. Info on parameters and type of a function return value is displayed in tooltips:

The following info is displayed for the function in the image above:
- [1 of 2] means that the function has call options with different parameters. To switch between them, use the arrows on the keyboard or left-click on the prompt line.
- bool specifies the value type returned by a function.
- ObjectSetInteger – function name.
- (long chart_id, ... ) – enumeration of possible function parameters, a type is specified before each parameters (here it is long). The parameter the cursor is currently located on is displayed in bold.
Code folding
Code folding lets you collapse or hide sections of your code. This makes a file containing many lines of code easier to read, navigate, and manage. Common foldable sections include functions, event handlers, classes, loops, and conditional blocks.
Clicking
next to a code section hides the block, with { ... } representing the hidden section. Clicking
unhides the block.

You can disable code folding feature completely from the RTX5 Editor settings. This will hide
buttons and make the row number section slightly thinner saving more space for code editing window.
Match highlighting
Match highlighting automatically illuminates all occurrences of a highlighted element across a file. This makes tracking variable lifecycles, navigating long functions, analyzing problems, and auditing changes easier and faster.
Simply select a specific element in your code and all instances of that element will become visible.

Jump to definition
This tool enables a quick navigation to the definition (implementation) of the selected class type or element. Place the cursor over its name and select
"Go to Definition" in the context menu or press Alt+G. If the definition is located in another file, it will be opened and the cursor will be placed in its corresponding position.
The function also enables the navigation to include files. To do this, place the cursor anywhere on the line where the include is declared (the #include directive) and execute the above command.
Jump to declaration
This tool enables quick navigation to a variable or class member declaration. Place the cursor over the element name and select "Go to Declaration" in the context menu. If the declaration is located in another file, it will be opened and the cursor will be placed in its corresponding position.
List of functions
This tool allows you to see a list of all declared functions in the current file. To open the list, click
List Functions in the Edit menu or Alt+M.

The function parameters are indicated in parentheses to the right of its name. To go to the function, click on its name in the list. Each type of functions in the list is marked by its icon:
– function.
– event handling function (On*).
– public class method (public).
– protected class method (protected).
– private class method (private).
Inserting comments
To simplify working with comments in the program code, use a number of functions in the Edit menu and Standard toolbar:
Function Header – insert a comment blank for a function;
Block Comment – insert symbols of a single-line comment;
Comment Lines – insert "//" comments at the beginning of each selected line;
Uncomment Lines – remove "//" comments from the beginning of each selected line.
The
Block Comment command (Ctrl+/) inserts single-line comment characters in the current position:
//---
The
Function Header (Ctrl+.) inserts a comment blank for a function in the current cursor position:
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
Additional code editing features
You can easily move code fragments from one part of the program to another. To do this, highlight the fragment and drag it to the necessary position (Drag'n'drop).
The Advanced sub-menu of the Edit menu features a series of commands simplifying the source code editing:
Increase Line Indent – insert three spaces (tab symbol) at the beginning of the selected lines. To insert spaces in a single line, position the cursor at its beginning. To insert spaces in several lines, select them in full.
Decrease Line Indent – remove three spaces (tab symbol) at the beginning of the selected lines. A similar action is performed by the Tab+Shift hot key.
Make Uppercase – change all characters of a selected phrase to uppercase. A similar action is performed by the Ctrl+Shift+U hot key.
Make Lowercase – change all characters of a selected phrase to lowercase. A similar action is performed by the Ctrl+U hot key.
Working with bookmarks
Bookmarks allow you to quickly jump to different parts of a code. Mark the required lines with bookmarks and navigate between them using the Edit – Bookmarks menu commands and the context menu of a source code:
Toggle Bookmark – enable/disable a bookmark on the current line depending on its current status. The same can be done using the Ctrl+F2 hot key;
Next Bookmark – move to the next bookmark in the current code. The same can be done by F2 key;
Previous Bookmark – move to the previous bookmark in the current code. The same action can be performed by pressing Shift+F2 hot key;
Clear All Bookmarks – remove all bookmarks from the current code. The same can be done by the Ctrl+Shift+F2 hot key.
RTX5 Editor also features named bookmarks – the ones having a digital ID assigned to them. To set such a bookmark, click 0-9 while holding Ctrl. To go to the previously set tab, press the corresponding number while holding Alt.
Go to Line
To quickly jump to any line of code in the current file, click
Go to Line in the Search menu or press Ctrl+G. The following window is opened:

The window displays the range of lines with a code in the current file. To go to the line, enter its number and click OK.
Snippets
Snippets are small template fragments of a source code that describe a certain MQL4/RQL5 language construction. They make it easier and faster to write a source code. For example, they allow you to quickly add a workpiece to a program code to describe a class or a loop. To do this, simply enter a key word – 'class' or 'for'. The cursor changes to
meaning that it is now possible to insert a snippet. Press Tab and a blank for class or 'for' loop is inserted to a program code according.

In order to switch between active snippet fields (here, these are name, class constructor and destructor), use Tab and Shift+Tab.
Changing one active field automatically changes the rest. For example, when changing the class name, constructor and destructor names are changed automatically as well. When changing a variable name in one of the 'for' loop expressions, the variables in its other expressions are changed as well.
The system of working with snippets also recognizes already described structures, classes, enumerations, methods and functions. Place the cursor within the description of the corresponding structure and press Ctrl+Enter. After that, you can navigate between members (classes, structures and enumerations) and arguments (methods and functions) using Tab and Shift+Tab keys and edit them together as described above.
The following snippets are supported at the moment:
Keyword |
Value |
|---|---|
#import |
Import declaration. |
OnBookEvent |
OnBookEvent handler. |
OnCalculate |
OnCalculate handler. |
case |
'case' selector. |
OnChartEvent |
OnChartEvent handler. |
class |
Class declarations. |
OnDeinit |
OnDeinit handler. |
do |
Declaration of the 'do while' loop. |
enum |
Declaration of enumeration. |
for |
Declaration of the 'for' loop. |
if |
Declaration of the 'if' condition. |
else |
Declaration of the 'else' condition. |
OnInit |
OnInit handler. |
OnStart |
OnStart handler. |
struct |
Structure declaration. |
switch |
'switch' selector. |
OnTester |
OnTester handler. |
OnTesterInit |
OnTesterInit handler. |
OnTesterPass |
OnTesterPass handler. |
OnTesterDeinit |
OnTesterDeinit handler. |
OnTick |
OnTick handler. |
OnTimer |
OnTimer handler. |
OnTrade |
OnTrade handler. |
OnTradeTransation |
OnTradeTransation handler. |
while |
Declaration of the 'while' loop. |
Inserting resources
Commands from the Edit – Insert menu allow to quickly insert resource files and thus can facilitate application development.
Options as #property
Inserts in the current position the #property directive and immediately opens the list of all program properties available in the language.
BMP/WAV as #resource
To add an image or a sound file to the program resources, run this command and select a BMP or WAV file (the appropriate file must be located in the\ RQL5 directory). The #resource directive with the proper path to the selected file will be inserted at the current position of the program.
#resource "\\Images\\image.bmp"
DLL/EX5 as #import
You can import functions from an external library or an EX5/EX4 file by executing this command and selecting the appropriate file (the file must be located in the\ RQL5 directory). A pair of #import directives with the proper path to the selected file will be inserted at the current position of the program.
#import "..\Experts\SendNotification.ex5"
#import
Add a description of the imported functions between the directives.
MQH as #include
To insert an include file to the program code, run this command and select an MQH file (the appropriate file must be located in the \RQL5 directory). The #include directive with the proper path to the selected file will be inserted at the current position of the program.
#include <Arrays\Array.mqh>
A set of parameters as #property
To insert to a program code a set of parameters for Expert Advisor testing, run this command and select a SET file (the appropriate file must be stored in the\ RQL5 directory). The #property directive with the proper path to the selected file will be inserted at the current position of the program.
#property tester_set "\\Profiles\\Tester\\Moving Average.set"
Data and time as YYYY.MM.DD hh:mm:ss / UNIX time
Use this command to insert the date and time in the required format, into your code. The command selection opens an interactive calendar. Select the date and time in the calendar, and it will be inserted into the current program position in the selected format.

Color as clrColor
Use this command to easily insert the color in the required format, into your code. A click on the command opens an interactive palette. Select a color from the palette, and it will be inserted into the current position in the CLRColor format used in RQL5 functions.

File as Binary Array
This command allows you to add to the program text any file in the form of a binary array. Run the command and select the desired file (the appropriate file must be located in the\ RQL5 directory). A char array will be inserted at the current position of the program.
Among others, this function allows you to transfer chart templates with Expert Advisors or indicators: insert your template in the program code as an array, and save it to disk then using the FileSave function. After that the template can be applied on the desired chart using the ChartApplyTemplate function.
//+------------------------------------------------------------------+
//| Script program start function |
//+------------------------------------------------------------------+
void OnStart()
{
//--- a template file as a binary array
unsigned char my_template[]=
{
0xFF,0xFE,0x3C, ... ,0x00 // the data array in this example is shortened
};
//--- saving and applying the template
if(FileSave(my_template.tpl,my_template))
{
Print("Custom template saved in \\MQL5\\Files");
if(ChartApplyTemplate(0,"\\Files\\my_template.tpl"))
Print("Custom template applied to the current chart");
else
Print(Failed to apply custom template);
}
else
Print(Failed to save custom template);
}
CSV as a text array
To add data from a text file to the program code, run this command and select a TXT or CSV file (the appropriate file must be located in the\ RQL5 directory). A string array of the required dimension containing data from the file will be inserted at the current program position:
string data[][3]=
{
{"name1","value1"},
{"name2","value2"},
{"name3","value3"}
};
Text conversion
The RTX5 Editor allows you to easily convert the format of source data. Open the desired file, select text in it and execute one of the commands from the Edit – Convert menu:
- ASCII to HEX
- ASCII to Base64
- ASCII to Binary Array
- HEX to ASCII
- Base64 to ASCII
Clipboard tracking
The clipboard tracking manager improvements the source code convenience by enabling quick access to the last used data. Press Alt+V anywhere in the source code, select any of the previously copied lines from the menu, and it will be pasted in place.

You can enable/disable tracking by using the corresponding toolbar command or via editor settings.