Comment on page
BotBrains is a no-code platform for trading robot development. This means you can build trading robots without any programming.
Instead of writing code for a trading robot, you can build trading robots on BotBrains using pre-made blocks that you can drag and drop onto the scheme, set their settings, and make connections between them.
You can not only develop the logic of the robot, but also create full-fledged trading interfaces. You can connect trading robots to Telegram and send messages and/or chart screenshots directly to you in Telegram - no need to do any programming, just drag and drop necessary blocks onto the scheme.
An implementation of a simple trading strategy "Moving Average Crossover" is shown in the screenshot below.
The table of available blocks categories is shown below. For a complete list of all available blocks, see the "Blocks list" article.
You can combine blocks by linking. Open the editor and place 2 blocks on the scheme: "Timer" even block and "Journal message" block:
Open settings of the "Timer" event block:
By default, the "Timer" block is activated once per second - you can change blocks parameters to provide the desired behavior.
Open "Journal message" block settings:
This block has only one parameter as well: "Text message".
Note, you can use variables and constants as blocks parameters values. In order to use a variable or a constant as a parameter value, you should click the switch next to a parameter input field. Working with variables and constants is cover in more detail in the correpsonding article.
Pree "~" key in order to generate robot code. Go to the "Code" tab in order to see the generated code:
As you can see, the code of our trading robot has been successfully generated.
In order to launch trading robots made with BotBrains editor, you need to install the following dependencies:
- botbrains_lib.ex5 code library
- botbrains_lib.mqh include file
- botbrains_constants.mqh include file
- Sound files
Go to the MetaTrader 5 terminal and open the MetaQuotes Language Editor:
In the "Navigator" window click on the "MQL5" folder with the right mouse button. In the context menu click "Open Folder":
Each user has a license key, and it needs to be checked if your subscription is activated and some paid blocks are used.
In order for the robot to check your license key, a connection to the BotBrains server is needed. To do this, add https://botbrains.app to the list of allowed URLs for web requests.
Open your MetaTrader 5 terminal, go to "Tools -> Options -> Expert Advisors". Check the "Allow WebRequest for the following URLs" checkbox. Add the following URL to the table below: https://botbrains.app
In order for the telegram functionality to work correctly, add the following URL to this table: https://api.telegram.org
In order to launch your robot, you can just create a .mq5 file in the "Experts" directory, copy generated code and just paste it into the created file.
You can also just download generated code as a .mq5 file. In order for this save your project and click on the "download project" button in the right toolbar:
In the dialog box that appeared, you are given a choice:
- Download .mq5 file only
- Download .mq5 file and all dependencies
Move downloaded .mql5 file to "Experts" directory.
Then open the file in the MetaQuotes Language Editor and compile the code of the robot:
After the code was compiled, pay attention to the "Errors" tab of the "Toolbox" window.
Always make sure that the compilation was successful. If some errors occurred during the compilation, make sure that the robot scheme does not contain any errors.
Go to the terminal and find the robot file in the "Navigator" window. Then launch the robot by clicking twice on the robot file.
The behavior of the robot is fully consistent with the scheme we created - exactly once a second the specified message is printed.
Test the robot only on a demo account! Do not switch to real trading if you haven't fully tested the robot's performance on the demo account!
If you have any suggestions regarding the work and development of the application, feel free to suggest an idea - we will take your opinion into account. You can always contact us by the following email: [email protected]