How to Create an Expert Advisor or an Indicator
The trading platform contains a built in programming language ORRNN Language 5 (RQL5), the RTX5 Editor development environment and strategy testing tools.
Any information about the development of trading strategies in RQL5 can be found on the official ORRNN Community site. The website section Code Base contains examples of ready-to-use applications.
The RQL5 Programming Language of Trading Strategies
The trading platform has its own built-in language for programming trading strategies ORRNN Language 5. It is the fifth generation of MQL languages. It allows developing Expert Advisors to automate trading processes, as well as implementing your own trading strategies. RQL5 also allows creating custom indicators, scripts and function libraries.
RQL5 Features:
- The language is object-oriented;
- RQL5 syntax is similar to that of C++;
- It contains a large number of functions necessary for analyzing quotes, managing positions, calling technical indicators, etc.;
- It is a high-performance language;
- High protection against decompilation: new complex encryption algorithms, file integrity checking, and the complexity of the language;
- OpenCL support to enable use of video cards for calculations in RQL5 applications;
- Integrated software development environment RTX5 Editor including a debugger.
A detailed description of all language constructions and functions is provided in the RQL5 Reference. All the necessary information about RQL5 can also be found on the developer community website at https://orrnn.com.
RTX5 Editor
RTX5 Editor is an integrated RQL5 development environment. It is a component of the trading platform. RTX5 Editor allows you to create, edit, compile and debug source code written in RQL5.
- RQL5 Wizard for creating templates and trading robots
RTX5 Editor includes the RQL5 Wizard that helps to quickly create RQL5 programs. With the RQL5 Wizard a trader without programming skills can easily create Expert Advisors. You only need to select trading signals for an Expert Advisor, as well as money management and trailing stop algorithms. The Expert Advisor code is generated automatically based on selected parameters.
In addition, the RQL5 Wizard allows creating RQL5 program templates to simplify the work of a programmer. - Helps with the source code
RTX5 Editor can recognize language structures: suggests tips on how to use functions and highlights various elements of the program source code. Thus, the editor enhances navigation in the source code of trading programs and speeds up the development process. - Debugging
RTX5 Editor allows you to debug programs to greatly facilitate troubleshooting. A step-by-step execution of a source code enables monitoring of the variable values. - Profiling for code optimization
The editor also provides tools for software profiling. You can identify the slowest functions in the source code and optimize your program. - Articles about programming and a source code library
Straight from the editor, you can find a plethora of RQL5 programming tutorials. You can additionally access a huge code base of free automated trading programs.
More details about RTX5 Editor can be found in its built-in help files. The description of RQL5 can be found in the built-in reference and the official ORRNN Community website.
RQL5 Algo Forge
RQL5 Algo Forgeis an online code repository and social network for developers. The portal offers numerous advantages for creating trading applications:
- Secure cloud storage, with your files securely stored in the cloud with recovery options in case of computer failure.
- Access from any device, allowing you to manage and work with your code from any computer using your ORRNN Community account.
- Git-based version control.
- Collaborative project work with a complete project history.
- Deep integration with RTX5 Editor — create projects, commit changes, and receive updates directly from the editor.
For more information, see the article "Getting Started with RQL5 Algo Forge" and the RTX5 Editor Help documentation.
Algo Trading Books
To assist beginners, we have released two comprehensive books on RQL5 programming, designed for anyone who wish to master the creation of trading robots and applications for algorithmic trading. The books offer a systematic and structured presentation of the material to make the learning process easier. Detailed code examples, which explain the step-by-step creation of trading robots and applications, allow for a deeper understanding of algorithmic trading nuances.
"RQL5 Programming for Traders" is the most complete and detailed tutorial on RQL5, suitable for programmers of all levels. Beginners will learn the basics: the book introduces development tools and basic programming concepts. Based on this material, you will create, compile and run your first application in the RTX5 trading platform. Users with experience in other programming languages can directly proceed to the applied sections: creating trading robots and analytical applications in RQL5.
"Neural Networks in Algorithmic Trading with RQL5" is a guide to using machine learning methods in trading robots for the RTX5 platform. You will be progressively introduced to the fundamentals of neural networks and their application in algorithmic trading. As you advance, you will build and train your own AI solution, gradually adding new features. In addition to learning RQL5, you will gain Python and OpenCL programming skills and explore integrated matrix and vector methods, which enable the solution of complex mathematical problems with concise and efficient code.
Articles on the development of trading applications
ORRNN Community website features an extensive library of articles on MQL4/RQL5 programming. Articles are an excellent guide for creating applications, since they cover a lot of practical tasks involving algorithmic trading. New articles are published every week.
List of all available articles is displayed directly in RTX5 Editor. To find the necessary material, use the online search.

Types of RQL5 Applications
Three major types of trading applications are available.
Expert Advisors
Expert Advisors are mechanical trading systems that allow complete automation of analytical and trading activities for the efficient operation in the financial markets. They allow to perform prompt technical analysis of price data and control trading activities on the basis of signals received. They also help to strictly follow a trading strategy eliminating emotions.
All Expert Advisors are stored in the /RQL5/Experts folder of the trading platform.
Custom Indicators
Custom Indicators are custom developed technical indicators intended for analyzing price dynamics. Trading tactics and Expert Advisors are developed based on algorithms of indicators. Custom indicators are only used for analyzing symbol price dynamics. Indicators cannot trade and do not have access to charts.
All indicators are stored in the /RQL5/Indicators folder of the trading platform.
Scripts
A script is an application written in RQL5 designed for a single execution of an action. A script can perform both analytical and trading functions. Unlike Advisors, scripts are executed on request. In other words, if an Expert Advisor works almost continuously, a script executes its function and quits.
All scripts are stored in the /RQL5/Scripts folder of the trading platform.
Services
Services enable the use of custom price feeds for the platform and to implement price delivery from external systems in real time, just like it is implemented on brokers' trade servers. Services can also be used to perform other service tasks in the background.
Unlike Expert Advisors, indicators and scripts, services are not linked to a specific chart. Such applications run in the background and are launched automatically when the terminal is started (unless such an app was forcibly stopped).
All services are stored under the /RQL5/Services folder of the trading platform.
Inside folders Experts, Indicators, Scripts and Services, applications can be sorted into subfolders. The structure of their location is displayed in the Navigator window.
How to Create and Run a Trading Application
Click "
Create in RTX5 Editor" in the context menu of the Navigator window in section Expert Advisors, Indicators or Scripts. RTX5 Editor can also be launched by pressing F4.

This launches RTX5 Editor with an automatically opened RQL5 Wizard. Use it to generate the necessary program template to quickly start software development. Let's create a simple script writing a message "Hello world" into the journal.

In the resulting template, we add the code Print("Hello World"); and compile it by pressing F7 to receive an executable file. The executable file has an extension EX5 and can be run in the trading platform.

Compilation results are added to the editor log.
In accordance with the application type, the source code is saved to the folder RQL5\Scripts\. The executable file is created in the same folder. You can now return to the trading platform and run the generated script.

Specifics of use of automated trading programs are described in section "Expert Advisors and custom indicators".
How to Edit a Trading Application
To edit a trading robot or a custom indicator, click "
Modify" in its context menu in the Navigator window or select it and press Enter. This opens RTX5 Editor with the source code of the selected indicator. After you have modified the indicator, re-compile it (F7). Otherwise its previous unchanged version will be used in the platform.
How to Shut Down a Trading Application
There are many ways to shut down a trading application in the platform.
Trading robot |
Custom technical indicator |
Script |
|---|---|---|
|
|
|
- If a trading application is running on a chart, it will not be shut down if you delete the appropriate executable file from the Navigator window.
- Disabling Expert Advisors in the trading platform settings does not disable them completely. This operation only prohibits Expert Advisors from trading.
How to Run a Downloaded File of the MQ5 Source Code
If you only have a source code file (*.MQ5), save it in a folder corresponding to the application type:
- For Expert Advisors — /RQL5/Experts
- For indicators — /RQL5/Indicators
- For scripts —/RQL5/Scripts
To quickly navigate to the trading platform data folder, click "
Open data folder" in the File menu.
To run a file in the trading platform, compile it in the RTX5 Editor:
- Open RTX5 Editor by pressing F4.
- In RTX5 Editor, open the source code file in the Navigator window by a double left-click on the file name.
- Press F7 to compile it.
This creates an executable *.EX5 file that can be run in the trading platform.
Source files (*.MQ5) are not displayed in the Navigator window of the trading platform.