FXDreema
fxDreema is a software tool that helps you to create programs (Expert Advisors and Scripts) for MetaTrader 4 and MetaTrader 5 (by MetaQuotes Software Corp).
The normal way of creating such programs is to manually code them using special programming languages, such as MQL4 or MQL5. Of course, not everyone is a programmer, so if you only want to try some trading strategies without coding them from scratch, you are in the right place.
More than that, fxDreema is also suitable for programmers, because it's so easy to make small or big changes in the program.
How does it work?
fxDreema allows you to connect blocks in a logical tree. Each block does some complex action and you can fine-tune it by editing its parameters. The end goal is to generate a program - the output product of fxDreema.
Here is how fxDreema looks like (without the list of available blocks):
You can imagine that every block is a module, a black box designed to do something - either to check certain conditions or do some actions. Each block has one input and at least one output. When the block does what it has to do, it activates its output, which means that if there are other blocks connected to it, they will be the next to run. There are 3 types of outputs:
By selecting the proper blocks and connecting their outputs with the inputs of other blocks, you can create many different trading structures.
When you are done, you can export/save the actual program and use it in your trading terminal. It is strongly recommended to backtest it first!
Basics
Create a New Project
In the Builder, go to File -> New project, select the type and programming language of the project, give it a name and click Create.

Create New Blocks
In the Builder, there is a list of blocks that you can create and a big empty field. Pick a block from the list, drag it and drop it somewhere over the empty field.

Connecting Blocks
If you have a block that is not connected to another block, it is not included in the final strategy! Leave blocks alone only if you want to keep them for later use, but don't forget that they are not used in the strategy.
Each block has one input and one or two outputs. The input is the white semi-circle at the top, and the outputs are at the bottom.

The meaning of the outputs is as follows:
To connect one block with another, drag the output of the first block and drop it over the input of the other:

Now when the first block runs and does its job, through the connection it will make the other block run.
Disconnected Blocks Do Not Work
If you want a block to do something, it must be connected to another block. Disconnected blocks do not participate in the final strategy. You can have them around in case you want to connect and use them later, but otherwise, they are useless.

If you still want to run only one block, connect it with a Pass block. Pass is just an empty block and does not have side effects.
You can Right-Click and Double-Click
- Right-click on a block to open a context menu with options.
- Double-click on a block to open the window with its specific properties.

You Can Have Multiple Branches Of Blocks
It's not mandatory to start with a single block and connect everything else below that block. You can have multiple branches of blocks and each one of them would work its job. In the picture below you see two branches ob blocks - one that starts with block #1 and another one that starts with block #4. Because both branches are in the on Tick event, both of them would be executed on every tick. Just imagine that the on Tick button is a block and is connected to blocks #1 and #4.

Block Numbers - When They Matter?
When you have two or more blocks parallel to each other (not visually, but logically), there is an order in which they run. The rule is that the block with a lower number runs first.

Block Numbers Could Be Text
You can replace any block's number with text and use it as a label.

Note: Better use only latin characters and numbers.
Copy/Cut Blocks
You can cut or copy one or more blocks within the same project or from one project to another. Select the blocks with the mouse, right-click on any of them, click Copy (or Cut), right-click on an empty space where you want to place them, and click Paste. For a single block, you can just right-click on it without selecting it.
Note: Avoid having the same group of blocks copied many times in the same project. When possible, try to reuse one group.
Expert Advisor
An Expert Advisor (EA) is a small program that contains set of trading instructions for MetaTrader. You can also call it a Robot, because it does something instead of you. Expert Advisors can be put to work in real time or they can be back-tested over past periods of time.
Expert Advisors (EAs) are written in MQL4 (for MetaTrader 4) or MQL5 (for MetaTrader 5) programming language, and none of them can work on its own as a standalone program. To run any EA you need MetaTrader. MetaTrader loads your EA and feeds it with data, contros its events and executes all instructions inside.
Expert Advisors are files and you can find them at these locations:
- For MetaTrader 4: "%Data Folder%/MQL4/Experts/"
- For MetaTrader 5: "%Data Folder%/MQL5/Experts/"

You can run as many EAs as you want at the same time, but you can only have 1 EA per chart.
Always backtest your EAs first, then try them on a live DEMO account. Then, and only if you are sure that your EA works properly and is not dangerous, allow it to wotk on a REAL account.
What you can do with an Exper Advisor?
An Expert Advisor can...
- Read your account information - Balance, Equity, Margin, Leverage, Server name, Account name and more
- Communicate with you using different kind of messages - Alert message, Print message (Experts/Journal tabs), Message box, Write comment on the chart (upper left corner), Play sound, Send mail and more
- Read OHLC (Open, High, Low, Close) data of any bar that you can see on the chart.
- Read indicators data for each bar
- Read files and write files
- Send/Read data to other EAs using Global Variables (hit F3 on MetaTrader to see the list of Global Variables)
- Create different objects on the chart (arrows, lines...) / Read attributes of created objects on chart / Modify their attributes
- Create trades and pending orders / Access to all the current trades and orders and those from the history / Modify their parameters (stop-loss, take-profit, volume size...)
- Do any mathematical and logical stuff like any other program
- ... and more
How does the Exper Advisor work?
In short, every EA works like this: Event => Checks and Calculations => Trading Actions
In general, your EA should get some data from MetaTrader, make some checks and calculations with that data and then tell MetaTrader what trading action to make - Buy, Sell or whatever.
Below you can see one very basic EA. You see that the blocks are put under the on Tick event, which means that the No trade block runs on every tick. When there is no trade, the Buy now block runs and creates a new trade:
For this example we have the following structure:
Event (on Tick) => Checks and Calculations (No trade) => Trading Actions (Buy now)
Events
When an Event is detected by MetaTrader, it executes certain part of the EA code. The most important event is when you receive a new Tick and there are few other events:
It's very important to understand that every EA works because of few basic Events. Read about them below.
- Tick - fired when a new tick comes. Normally the biggest portion of your EA works on every tick
- Init - fired once when the EA starts
- Deinit - fired once when the EA is stopped
- Trade - fired every time you open, close or modify trades or orders
- Timer - fired on certain period of time, for example every 60 seconds
- Chart - fired when you create, modify, delete or click on objects on the chart
Script
Scripts are similar to Expert Advisors, but they do something once. You can run a Script by double-click on it in the Navigator. When the Script does all its work, which normally happens in less than a second, it automatically exits. Scripts does not work on every tick, they just do whatever they are supposed to do once, as fast as possible, and then they immediately exit.
Scripts are suitable when you want to create simple trading actions like closing all your trades with a single (actually double) click. In a sense, scripts extend the interface of the terminal by adding more quick actions to it.
Here is where Scripts are located:
- For MetaTrader 4: "%Data Folder%/MQL4/Scripts/"
- For MetaTrader 5: "%Data Folder%/MQL5/Scripts/"
Put your .mq4/.ex4 or .mq5/.ex5 files in these folders.
In MetaTrader you can find your Script under Scripts in the Navigator panel.

Events
There is only one event:
- Start - fired once when the Script starts
More
[alert type=alert_outline alert_success]- Indicators
- Chart Objects
- Data Types
- Constants and Variables
- Crossover
- Looping trades and orders
- Groups and Magic Numbers
- Money Management
- Trailing Stop
- Testing and Optimization Limits
- Things Not to Do
Sumber : fxDreema EA Builder
