Showing posts with label Metatrader 5. Show all posts
Showing posts with label Metatrader 5. Show all posts

In the world of online trading, staying ahead of the game requires access to cutting-edge tools and platforms that provide seamless execution and in-depth analysis. MetaTrader 5 (MT5) has emerged as a powerful and versatile trading software that has revolutionized the way traders approach financial markets. Developed by MetaQuotes Software Corp., MT5 offers an extensive array of features and functionalities that cater to the needs of both novice and experienced traders. In this article, we will explore the key aspects of MetaTrader 5, its advantages, and why it has become a popular choice among traders worldwide.


Unveiling the MetaTrader 5 Platform:

MetaTrader 5 is a multi-asset trading platform designed to facilitate trading across various financial markets, including forex, stocks, commodities, and futures. It serves as a comprehensive solution for traders, offering an all-in-one platform with advanced charting tools, trading analysis, algorithmic trading capabilities, and a customizable user interface.





Key Features and Benefits

1. Multi-Asset Trading: MT5 enables traders to access a wide range of financial instruments from a single platform. This versatility allows for diversification and the exploration of different market opportunities.

2. Advanced Charting and Analysis: The platform boasts an extensive selection of analytical tools, technical indicators, and charting options. Traders can conduct in-depth market analysis, identify trends, and make informed trading decisions.

3. Algorithmic Trading: MetaTrader 5 supports automated trading strategies through the use of Expert Advisors (EAs). Traders can create, test, and optimize their own EAs or choose from a vast library of ready-made EAs, providing flexibility and efficiency in executing trades.

4. Market Depth and Depth of Market: MT5 provides access to real-time market depth information, allowing traders to gauge liquidity levels and make more accurate trading decisions. Depth of Market (DOM) provides transparency by showing the order book and available liquidity at different price levels.

5. Mobile Trading: MT5 offers a mobile application compatible with iOS and Android devices, enabling traders to access their accounts and trade on the go. This flexibility ensures that traders can monitor markets and execute trades at any time, from anywhere.

6. MQL5 Programming Language: MetaTrader 5 features the MQL5 programming language, which allows traders to develop custom indicators, scripts, and EAs. This robust programming language opens up endless possibilities for traders to create personalized trading strategies.

7. Copy Trading and Signals: The platform supports social trading, enabling users to subscribe to trading signals and copy trades from successful traders. This feature is particularly useful for beginners or those lacking the time to develop their own strategies.

8. Security and Reliability: MetaTrader 5 employs advanced security protocols to ensure the safety of client data and transactions. The platform encrypts all communication between the client terminal and the trading server, providing a secure trading environment.


Revolutionizing Trading with MetaTrader 5

MetaTrader 5 has established itself as a leading trading platform, providing a comprehensive suite of features and functionalities to meet the needs of traders across various financial markets. Its multi-asset capabilities, advanced charting tools, algorithmic trading options, and mobile accessibility make it a preferred choice among traders worldwide. Whether you are a beginner or an experienced trader, MT5 offers a user-friendly and flexible solution to enhance your trading experience.

As the financial markets continue to evolve, MetaTrader 5 remains at the forefront of innovation, adapting to the changing needs of traders. With its robust infrastructure, extensive customization options, and advanced analytical tools, MT5 empowers traders to make informed decisions and capitalize on market opportunities. Whether you're an individual trader, an institutional investor, or a broker, MetaTrader 5 is a platform that provides the tools and capabilities necessary to succeed in the dynamic world of online trading.

One of the big improvements of the new Metatrader 5 strategy tester is the possibility to use individual calculation frameworks ( agents ) to distribute the load within the multiple (remote) cores and as result, to greatly increase the speed of trading strategies optimization / calculation. The agents can be installed on remote computers in your local home/work network or on other internet-connected pc's around the world.

Thus, the time for optimization using multiple cpu core's is greatly reduced. The Metatrader 5 strategy tester automatically assigns each agent the testing parameters and the interval to for the next passage. As said above, you can use any available pc, both on a local network and via the Internet. To do this you need to install on the remote computers that you want to use the MetaTester.exe utility. This utility is part of the Metatrader 5 installation package, so there's no need for a separate download. Simply install the Metatrader 5 terminal.

The remote agent receives the required testing history from the tester, so there's no need for multiple requests to the broker servers. Access to remote agents is securely protected by a password. Within the agents the following security mechanisms are implemented:

- Fully encrypted network protocol between the client terminal and the remote agent with a compression of traffic;
- Password protection;
- Ability to specify a list of IP addresses from which connection to the client terminal is allowed;
- Only local agents can use the DLL with the appropriate terminal resolution. DLL call is prohibited on remote agents;
- The transmitted EA's code is never stored on the agent's HDD, but is instead transferred in a transformed state, which is inaccessible by the dump. On remote agents, messages of Expert Advisors (Print() function), as well time of trade operation execution, are not recorded to the journal;
- The agent does not know the name of the EA and doesn't store the miscalculation results on the HDD;
- The agent is protected by a security shield from dissemble and modification.

Here is a detailed guide how to use the remote agents. I'm going to use the dual-core cpu on my laptop as a remote agent on my desktop pc.

1. Open the MetaTester.exe utility on the computer that you want to use for the remote-agent service. The Metatester agents manager program MetaTester.exe is located in the Metatrader 5 installation folder ( default: C:\Program Files\MetaTrader 5\metatester.exe

metatrader 5 agents
2. Specify a password and a port range for the remote agent connection. The best option is to choose port numbers that are not used by other programs. You can find a list of standard and unassigned ports here: Iana.org port numbers

metatrader 5 agents
In my example i'm using the 4435-4436 port range. Press the "Add" button. The number of available local agents must be equal to the number of logical cores of the processor. In my case, i have a dual core Intel cpu, so i installed 2 remote-agent services. Also, write down your ip address stated above ( in my case, 192.168.1.12 )

3. Now go to the computer where you will be using the Metatrader 5 strategy tester and the remote agents. Open Metatester 5 and go to the "agents" tab. You will see the "local" and "remote" tabs. The local cpu is listed on the "local" tab. Via the context menu on the "remote" tab you can add the remote agents:

metatrader 5 agents
A pop-up window will appear. You must input the password, ip address and port number that you specified earlier. In my case, i use the ip address:port number 192.168.1.12:4435 for the remote agent 1 and 192.168.1.12:4436 for the remote second agent.

4. In case you have a firewall installed on the computer with the remote-agents service running, allow the connection. You may also open the ports on your router if they are closed. I'm using the Comodo Firewall program, so i had to allow the outgoing connection:

metatrader 5 agents
5. After you have added all remote agents you can test them by running a EA optimization. In my case the remote agents were successfully activated

As said above, all agents are shown in a table divided into two parts - local and remote agents. The "Hardware" column contains information about the type of the processor, CPU clock, RAM size and internal performance rate (the higher the rate is, the the more powerful the hardware is); CPU Usage — indicator of the core usage level; Status — the status of the agent: busy, ready, unavailable.

metatrader 5 agents
You can add as many remote agents as you want, so you can build your own supercomputer. The Metatrader 5 strategy tester provides a solutions with the remote agents feature for complex Expert Advisor optimization, which traders would not dream of being able to solve without access to supercomputers.

Read more about Metatrader 5 Strategy Tester

Many people asked MetaQuotes to develop a mobile version of Metatrader 4 for Iphone. Unfortunately, the mobile version of MT4 is only available for the Windows Mobile platform ( Smartphones and Pocket PC's, look for the download links in "MT downloads" sidebar ). However the good news is that Metatrader 5 will be available for Iphone and Google Android platforms! It was recently confirmed by MetaQuotes staff in this thread. The development of the Iphone app is progressing, and it will be probably released first. Bad news is that there wont be a version anymore for the Windows Mobile platfrom, Windows Phone 7 will be also avoided. I think this is because of the bad reputation Microsoft got with the countless bugs of Windows Mobile 6 and the drastic changes in code in the 7th version.

Metatrader 5 for Iphone The Metatrader 5 Iphone app will feature a uniform design that will seamlessly fit in the Iphone interface. The app is developed from scratch and will be 100% native to the Iphone OS. Also, it will be different from the interface in Metatrader 4 Windows Mobile. The release date is not known yet. If the mobile version of Metatrader 5 is one of the reasons you will buy a smartphone, this information will help you to decide what platform to buy. I personally like the Android OS.

If you want to use Metatrader 4 on your Iphone, you can use tools that create a remote connection to your desktop, where Metatrader 4 is running. For example, you can use the TeamViewer app for Iphone, it connects to any PC around the world and you can remotely control the PC as if you were sitting right in front of it. You can also seamlessly use iPhone to login directly to your PC running MT4 using the PC2ME app. With PC2Me you can remote control of your Windows PC, using your iPhone via the Safari browser. There is also a Iphone app that allows you to monitor your Metatrader 4 accounts using myfxbook.com's backend:

Metatrader 5 for IphoneActually, the remote connection to the desktop version of the Metatrader terminal is in some cases better than a mobile version of MT for the smartphone. On the smartphone you have always limited computing resources and not all features of the full version of Metatrader. For example, if you are using a expert advisor on your desktop, you can only control it via a remote connection. But if you want to quickly check the market quotes, the mobile version is better.

In Metatrader 5 Strategy Tester you can test an Expert Advisor using different currencies, but you can also automatically test a multi-currency EA without the need of switching the currencies as in MT4.

To test a single currency EA using different currencies you must select the option "All Symbols Selected in Market Watch" in the optimization types selection. You can also select the currencies you want to test in the Market Watch window. In my case, i have selected the Heiken Ashi Expert from the example EA's folder using 5 different symbols. The input parameters were standard:

Multi-Currency Strategy Testing with MetaTrader 5

Note that for each tested symbol, around 10-15MB of history will be downloaded, so if you have selected a lot of symbols it may take a while.

In the optimization results you can see which currencies have performed the best. So using the "All Symbols Selected in Market Watch" option you can automatically test an EA on many symbols, without the need to do it manually.

Multi-Currency Strategy Testing with MetaTrader 5

One of the big advantages of the new Metatrader 5 strategy tester is the option to backtest multi-currency EA's. This was not possible in MT4. The testing and optimization process of an multi-currency expert advisor is the same as with other EA's. Metatester 5 will automatically read the code for multiple-symbol testing. The optimization results ad the equity curve will combine all symbols in one result.

To demonstrate the multi-currency EA testing i have modified the GuruEX03 EA so that it will have 3 currencies. But you can always add more symbols if you want, it's very simple, just copy the code for symbol 4 from previous symbols at the comment "// add more symbols". The EA is a simple moving average crossover trading system. It will enter the market when the slow MA and fast MA are crossed. In the input parameters you can specify all the EA variables. The symbols used in this EA are EURUSD, GBPUSD and USDJPY. You can change them in the line 25-27 of the EA's source code. Download the multi-currency MA crossover EA (.mq5)

Multi-Currency Strategy Testing with MetaTrader 5
I have done a simple 96 step fast optimization and here are the results:

Multi-Currency Strategy Testing with MetaTrader 5
In the log file you can see that the testing process has used all 3 symbols:

Multi-Currency Strategy Testing with MetaTrader 5

A few months ago MetaQuotes released the beta version of the MetaTrader 5 Strategy Tester - Metatester 5. In this article i will do a quick review of it's options and features. Note that Metatester 5 in still in development, so new options and features can be added to it later (for example, visual backtesting and the option to display your backtested trades on the chart are missing).

There is no separate download file for the Metatester 5, the tester is one of components of the client terminal so it's distributed along with the MetaTrader 5 setup file. To open the tester press CTRL+R or click on its icon. The main window is not so different from MT4 tester. The "expert properties" button from the old tester is gone ( along with "symbol properties", "open chart" and "modify expert") the options are now present under the inputs tab and optimization properties below in the main window:

MetaTrader 5 Strategy Tester image
During the testing process, history for the selected currency will be automatically downloaded from the MetaQuotes servers ( around 10-15MB for one symbol). The history is stored in M1 format from 1999, before only in D1 format ( tick data or xx seconds bars are not available ). For the demo-account, the history is stored in C:\Program Files\MetaTrader 5\Bases\MetaQuotes-Demo\history\"symbol"\ folder and has the .hcc (uncompressed) format, per symbol it takes around 180MB of hdd space. Currently, there is no easy option to use separate external history like in MT4 (there is no mql5 DDE server), but according to MetaQuotes, the option to edit history and view history like in MT4 will be probably added later ( it was also recently confirmed by MetaQuotes staff on the MQL5 forums ).

MetaTrader 5 Strategy Tester image

MetaTrader 5 Strategy Tester image
Settings in Metatester 5:

1. Optimization

MetaTrader 5 Strategy Tester image
Optimization ( Testing of the EA on history data with different sets of parameters, aimed at finding their best combination. During multiple runs, different combinations of the input parameters of the EA are tried and the best ones are selected. Note that an EA must have some input parameters that can be optimized like take profit, trailing or technical parameters like period etc. ). If optimization is disabled, the EA is tested with default input parameters.

- Fast Genetic Based Algorithm is based on the genetic algorithm of searching the best values of input parameters. This type is much faster than the slow complete algorithm and is almost of the same quality.

- Slow Complete Algorithm: runs are performed for all possible combinations of values of the input variables selected for optimization. This method is the most precise one, but also takes much more time.

From the MQL5 documentation: Genetic optimization is based on the constant selection of the most "adapted" parameters (values that give the best result). From the total number of all possible combinations of parameters, two populations (sets) are selected by a random sample. After that, both sets are tested and the one with the best results (according to the optimization criterion) is left. The set members are randomly crossed with one another, undergoing random mutations and inversions of parameters. The descendants are sorted out by the best results, and crossing repeats.

Operations of sorting and crossing repeat until there is improvement of results (the best result among descendants is better than the best one among the parents). The completion of optimization requires absence of improvement of the optimization criterion during several crossings (generations). During a genetic optimization, the number of testing runs is much lower, which provides such a quickness of optimization.
- All Symbols Selected in Market Watch: unlike the above described optimization types, this one allows to test an EA with the same input parameters but using different symbols. Only the main symbol of testing is changed in each pass, i.e. the symbol of chart the EA would be attached to. The optimization is performed only with symbols that are currently chosen in the "Market Watch" window. So, by selecting the various symbols, you can manage the optimization.

2. Optimization Criterion

MetaTrader 5 Strategy Tester image
The optimization criterion is a certain factor, whose value defines the quality of a tested set of parameters. The higher the value of the optimization criterion is, the better the is testing result with the given set of parameters:

Balance max — the highest balance;
Balance + max Profit Factor — balance and profit factor;
Balance + max Expected Payoff — balance and expected payoff;
Balance + min Drawdown — balance and lowest drawdown; ( recommended )
Balance + max Recovery Factor — balance and the recovery factor;
Balance + max Sharpe Ratio — balance and the Sharpe ratio;
Custom max — the optimization criterion here is the value of the OnTester() function in the EA. This parameter allows using any custom value for the optimization of the EA.

3. Forward Mode

This option allows checking optimization results to eliminate fitting on certain time periods. During the forward optimization, the period set in the "Date" field is divided into two parts in accordance with the selected forward period (half, one third, a fourth or a custom period, when the start date of the forward testing is set). On the first part, the EA optimization is conducted. After that the best passes are selected (10% at the full parameters fitting, or 25% at a genetic algorithm), and only they are started on the forward period. The results of the best passes in the optimization on both periods can then be compared on the "Optimization Results" tab.

Tick Generation Mode

- Every tick: the most accurate mode but also the slowest one. All ticks are modeled in it;
- 1 Minute OHLC: only 4 prices (Open, High, Low and Close) of each minute bar are modeled;
- Open prices only — OHLC prices are modeled, however only the open price is used for testing/optimization.

4. Input Parameters

MetaTrader 5 Strategy Tester image
This options tab allows managing the Expert Advisor's input parameters. An EA must have at least 1 input parameter that can be optimized. Select the input parameters that must be optimized, select a start and stop value ( for example, take profit from 50 to 200 ) and a step value ( step of trying of the parameter values ). If there are to many steps, the optimization process will take a very long time. So the best strategy is to use a big step value, and then after some optimization rounds reduce it to smaller values:

MetaTrader 5 Strategy Tester image
If you right click on the Input Parameters window, a context menu window will appear where you can load or save your input parameters or select the default options:

MetaTrader 5 Strategy Tester image
Agents:

The process of testing and optimization of Expert Advisors is performed using "agents". The number of available local agents (started on the computer where the terminal is installed) is equal to the number of logical cores of the processor. Agents are created automatically. MetaTrader 5 Strategy Tester allows working with the unlimited number of external (remote) agents using all available computation powers. I will write about it in the next article.

MetaTrader 5 Strategy Tester image
Optimization results:

MetaTrader 5 Strategy Tester image

MetaTrader 5 Strategy Tester image
Results of the EA's optimization are displayed on the Optimization results tab. You can sort the optimization results by data such as Result (the resulting value of the parameter that is the optimization criterion used for selecting the best runs), profit factor etc. There is also a context menu ( via right click ) where you can execute commands like "Run Single Test" (start testing of the EA with the parameters of the selected run), etc. You can also view the Optimization Graph, a visual representation of the optimization process in the Optimization Graph Tab.
From the MQL5 documentation:
- Pass — pass number;
- Result — the resulting value of the parameter that is the optimization criterion used for selecting the best runs;
- Profit — obtained profit/loss for this run;
- Total trades — total number of trades executed for the run;
- Profit factor — ration of the total profit to the total loss in percents. One means that the total of profits is equal to the total of losses;
- Expected payoff — this is a statistically calculated value that reflects the average profitability/loss of one trade;
- Drawdown — the relative drawdown of equity, the largest loss in percents from the maximal value of equity;
- Recovery factor — this value reflects the riskiness of the strategy - the amount of money risked by the Expert Advisor to make the profit it obtained. It is calculated as the ratio of a profit obtained to the maximal drawdown;
- Sharpe Ratio — this ratio characterizes efficiency and stability of a strategy. It reflects the ratio of the arithmetical mean profit for the position holding time to the standard deviation from it. Plus to that, it accounts for the risk-free rate which is the profit on a certain deposited amount of money;
- Optimized inputs — in addition to the common statistical values, values of input parameters set for this run are shown here.
Strategy testing results:

MetaTrader 5 Strategy Tester image
Results of an EA testing are displayed in the Results tab. You can view the trading history of the EA for the period of testing and different statistical results.
From the MQL5 documentation:
- Initial Deposit — the initial deposit for testing;
- Bars — number of bars generated for the symbol the testing is conducted on;
- Ticks — number of ticks during testing;
- Gross Profit — sum of all profitable trades in monetary units;
- Gross Loss — sum of all losing trades in monetary units;
- Total Net profit — the financial result of all trades. This values is the difference between the Gross Profit and Gross Loss;
- Profit Factor — ratio of the gross profit to the gross loss in percents. One means that the sum of profits is equal to the sum of losses;
- Expected Payoff — this is a statistically calculated value showing the average profitability/loss of one deal. This value can also be considered as a forecasted profitability/loss of the next deal;
- Recovery Factor — this value reflects the riskiness of the strategy - the amount of money risked by the Expert Advisor to make the profit it obtained. It is calculated as the ratio of a profit obtained to the maximal drawdown;
- Sharpe Ratio — this ratio characterizes efficiency and stability of a strategy. It reflects the ratio of the arithmetical mean profit for the position holding time to the standard deviation from it. Plus to that, it accounts for the risk-free rate which is the profit on a certain deposited amount of money;
- Balance Drawdown Absolute — the maximal loss on the balance below the initial deposit;
- Balance Drawdown Maximal — the maximal loss from the local maximum in the deposit currency and as percent from the deposit;
- Balance Drawdown Relative — the maximal drawdown from the highest balance value in percents, and the appropriate money value;
- Equity Drawdown Absolute — the largest loss on assets below the initial deposit;
- Equity Drawdown Maximal — the largest loss from the local maximum in the deposit currency and as percent from the deposit;
- Equity Drawdown Relative — the largest loss in percents from the maximal value of assets, and the appropriate money value;
- Total trades — the total number of executed trades;
- Short Positions (won %) — number of short positions and percent of winning short positions;
- Long Positions (won %) — number of long positions and percent of winning long positions;
- Profit Trades (% of total) — number of winning trades and their percentage in the total number of trades;
- Loss trades (% of total) — number of losing trades and their percentage in the total number of trades;
- Largest profit trade — the largest profit among all winning trades;
- Largest loss trade — the largest loss among all losing trades;
- Average profit trade — the average profit value per a trade (the total of profits divided by the number of winning trades);
- Average loss trade — the average loss value per a trade (the total of losses divided by the number of losing trades);
- Maximum consecutive wins ($) — the longest series of winning trades and their total profit;
- Maximum consecutive losses ($) — the longest series of losing trades and their total loss;
- Maximal consecutive profit (count) — the maximal profit for one series of winning trades and the number of winning trades in it;
- Maximal consecutive loss (count) — the maximal loss for one series of losing trades and the number of losing trades in it;
- Average consecutive wins — the average number of winning trades in winning series;
- Average consecutive losses — the average number of losing trades in losing series.
Via the context menu ( right click ) you can export the report as a html/xml file.

MetaTrader 5 Strategy Tester image
In the Graph tab, the results of the EA testing are represented in a graphical form with the balance curve (blue line) and the equity curve (green). The margin level is displayed the bottom (histogram of margin level in percents). Via the context menu ( right click you can export the graph to other programs like MS Excel or save the image to clipboard.

Log

MetaTrader 5 Strategy Tester image
In the Log tab you can find a record of the actions, performed by the tester during the EA's testing and optimization and warning/error messages. The log file is automatically saved to the C:\Program Files\MetaTrader 5\Tester\... folder. ( *.log files ).




Read more about the MetaTrader 5 Strategy Tester here: The Algorithm of Ticks’ Generation within the Strategy Tester of the MetaTrader 5 Terminal: http://www.mql5.com/en/articles/75 and here ( at the end of the article, the optimization process is shown) - An Example of a Trading System Based on a Heiken-Ashi Indicator: http://www.mql5.com/en/articles/91

You can leave feedback, suggestions and bug reports in the Metatester 5 thread on the MQL5 website: http://www.mql5.com/en/forum/851

MetaTester 5
MetaQuotes is about to release the MetaTrader 5 trading strategy tester ( MetaTester 5 ). One of the big improvements of the new tester is the possibility to create individual calculation frameworks ( agents ) to increase the speed of trading strategies optimization / calculation. On the local computer, each agent represent 1 logical processor core, so for example if you have a quad-core cpu, you can have 4 agents running. The agents can be also installed on remote computers in your local network or other Internet-connected computers around the world. This means that you can create a distributed computing (grid computing) project with as much cpu power as you want. This concept is similar to the popular SETI@home or Folding@Home projects.

MetaTester 5
The installation of (remote) agents is very simple, according to information from MetaQuotes, all you need is to use MetaTester.exe (a single file, nothing else is required) and install agents as services according to the number of cores or one by one. A separate access password is set for each agent, to ensure that only authorized users connect to it. The client terminal on the central computer plays a manager role and coordinates all the (remote) agents. Each agent opens one local TCP port and waits for connection from the manager client terminal. You can configure all the connections in your router/firewall if it's necessary. The connections will be encrypted and protected by password to ensure maximum security. Once you have everything configured, the entire system will operate in automatic mode. If an agent will interrupt his work, his task will be transferred to the next available agent.

MetaTester 5
The new Metatrader 5 strategy tester will be much faster than in MT4 because the tester will function as a standalone application. Also, there will be a x64 version of the Metatrader 5 terminal & tester and the MQL5 code will be automatically compiled to native x64 code with access to all available memory. This means that you can use computers with dozens of gigabytes of memory. However, the strategy tester does not support Nvidia CUDA platforms because they are slow in processing of general purpose algorithms, and this is any program on MQL5. Instead of CUDA, every cpu that uses SSE2 (Pentium 4 or higher) is supported.

MetaQuotes will also launch a service on the MQL5 community website where computer power for remote agents will be sold. Everyone will be able to sell it, for example, you can sell your quad core cpu power from 1 to 6 AM. You can also buy the computer power direct form the MQL5 website. For it's services, MetaQuotes will take a small fee from the money which go to the seller.

Of course, the security measures will be also great:

* Fully encrypted compressed traffic network protocol between the client terminal and the agent;
* Access by password;
* Ability to specify a list of the IP addresses allowed to connect to the client terminal;
* Only local agents can use the DLL libraries with the appropriate authorization in the terminal;
* The EA's code wich is passed to the remote agent is never stored on the HDD of the agent and is passed in a modified form, it is impossible to dump;
* A remote agent does not know the name of the EA and does not save the results of calculated data to it's HDD;
* The agent program is also good protected from disassembly or modification.

According to MetaQuotes, the Metatrader 5 strategy tester will be soon available. Probably March/April 2010.

Read more about Metatrader 5 Agents

This is the second article in a 5-part series about the Metatrader 5 Fibonacci Tools. In this article we are going to customize the Fibonacci Fan settings within Metatrader 5 so it can better identify major support and resistance levels. The customized Fibonacci Fan can be used also as a powerful stand-alone trading system.

In Metatrader 5 you can find the Fibonacci Fan tool under the menu Insert -> Objects -> Fibonacci -> Fibonacci Fan. First, place the Fibonacci Fan anywhere on the chart and go to the properties window:

Metatrader 5 Fibonacci Fan 1
Now, add 2 more levels: 0,764 and 0,854. After adding the new levels, the fan should be like this:

Metatrader 5 Fibonacci Fan 2
The main Fibonacci Fan levels are:

1: 0,382 - Signal Level
2: 0,5 - Mid-way
3: 0,618 - magnetizes the Target Level
4: 0,764 - Correction Level
5: 0,854 - Target Level

You can customize the description of within the Metatrader 5 Fibonacci Fan levels properties like this:

Metatrader 5 Fibonacci Fan 3

There are 3 basic models of the price movement within the Fibonacci Fan levels.

1. Rebound model, when the price is repelled ( bounces off ) from the current target level (0,854)
2. Bolt model, when the price, before reaching the current target level bounces off a level of the Fibonacci Fan with a higher priority ( higher timeframe )
3. Breakthrough model, when the price is breaking through the current target level, because it is attracted by a level of the Fibonacci Fan with a higher priority ( higher timeframe )

Metatrader 5 Fibonacci Fan 4

Metatrader 5 Fibonacci Fan 5

Metatrader 5 Fibonacci Fan 6
The price runs from the target level of the last Fibonacci Fan to the target level of current Fibonacci Fan.

A - previous fan
B - current fan
A1 - current target level (0,854)
B1 - support level and the target level for the future fan C-C1.

On the chart above you can see the Rebound model and the Breakthrough model in action. Usually, within the Bolt and Breakthrough model, the price reaches high volatility when it is reversing its course.

Metatrader 5 Fibonacci Fan 8
Target Level: After the price reversal, the target is set on the target level (0,854) of the previous Fibonacci Fan ( previous wave ). If we look at current EUR/USD position, the target for the major wave will be around 1.3000 end July/begin Augustus this year. Another important instrument are the Fibonacci Arcs, with this tool we can clarify the target level within a certain time period, it is the crossing of the Fibonacci Fan's target level (0,854) with the Fibonacci Arc's 0.764 level. I'm going to write about the Fibonacci Fan & Fibonacci Arcs combination in the next article.

There is a wonderful indicator that is build for Fibonacci Fan trading, Fiba +, currently it is available only for Metatrader 4. You can download it below with the indicator template. It draws the main Fibonacci Fan levels as described above and gives them priorities. Recommended time-frame for this indicator is H4.

Metatrader 5 Fibonacci Fan 7

Another important this is the Fibonacci Fan Mirror. You can create it buy reversing the price value in the properties windows of the Fan that you want to mirror:

Metatrader 5 Fibonacci Fan 9

The Fibonacci Fan Mirror can be used to identify resistance levels for the current price move within the current Fibonacci Fan. For example, if the price bounces off the 0,618 level of the fan mirror, the target level of the mirror becomes a major resistance. You can also use the Fibonacci Fan Mirror for placing stop loss or lock positions ( however as we know, in Metatrader 5 it's not possible :( ), the stop loss level should be placed above the mirror's target level 0,854. I'm going to write more about this in future articles.

Metatrader 5 Fibonacci Fan 10

There is also a indicator for Metatrader 4 that draws Fibonacci Fan Mirrors automatically, it works in combination with the Fibo + indicator, download it below:



Downloads:
Download the Fibo + indicator
Download the Fibo + indicator template
Download the Fibo Fan Mirror indicator

mql5 magazine logo
Check out this great blog about MQL programming and Metatrader 5 related stuff: http://mqlmagazine.com The authors of the blog are Bogdan Caramalac and Bogdan Baltatu, professional traders and MQL programmers from Romania. The blog has many great articles, for example: Tick events in MQL5: complicated for now, but functional or Quoting – A new activity in MT5

About their blog:

MQLmagazine.com is a web magazine for MetaTrader users and MQL programmers, covering automated trading in forex, futures, options and equities.

Metatrader 5 – A Probably New Beginning For Everything

This was the title of my last post in my former blog on the vamist.ro website – the romanian forex community. At that time I was announcing my decision to move my blog on a brand new domain – my own. However, things changed and there had come the decision to write a magazine. But what kind of magazine ? Well, there are plenty magazines for traders. Take a look at the ones better known – CurrencyTrader , Futures & Options Trader… They target most of the time the strategical type of trader. The one that takes long term trades that span on months. This is why most of their analysis are floating around market forecasts. Of course, around these, different platform commercials and explanations of “forex” terms.

The retail forex market is around for some good years. In the so-called “western world”, these markets became known and called for retail traders right from beginning. But here, in Romania, where the authors are located, forex is still not too much known. However, we will not make a forex magazine. As I said, forex was what was offered to beginners at that time.

Things have started to change a bit a few years ago, when forward steps have been made by several brokerages, that started to offer futures and equities under MetaQuotes’ most acclaimed platform, Metatrader 4. But it wasn’t the time of a revolution in retail trading. Because Metatrader 4 was not designed – although it is the best retail trading platform – to trade the manner professional traders think and do it. Therefore, several trading strategies that were known to professional traders and , in general, to the hedge fund world, have remain hidden from the sight of retail traders.

Even more, brokerages commercials and forums accentuated the traders indoctrination that forex was the ultimate market that could have been traded. Lots of trading strategies and markets were hidden : pair trading strategies, quoting, forex arbitrage (although it was tackled at that time by a few, including myself) , forex / futures arbitrage, commodities arbitrage, and finally option strategies. Option strategies still are, at this time, the realm of derivatives quants. Even professional option traders don’t trade the way they might think – because either the platforms can’t do it and the NFA regulations restrict it. Here are some facts about trading platforms and regulations:

- most of them do not have a backtesting module;
- most of them do not support even exchange traded options, not speaking about exotics;
- most of them do not offer automation for options, and that including the well-known TradeStation and OptionStation;
- option stations may not support any other assets – example RAN Order and IKON.
- the ones that have a backtesting module may not backtest multiple assets;
- data feed is dependant on either broker or data provider; so you may have, or not, what you desire to trade;
- they might offer their own scripting language or API ; professional platforms might offer only FIX specification and leave automation on the hands of extremely skilled C++ programmers;
- under NFA regulations you cannot trade in a forex account anything else besides forex, gold and silver. Anything else, including forex options or real futures, trade in a separate account;
- under NFA regulations you cannot trade CFDs (broker manufactured assets that mimic real market, being tailored to small investors);
- under NFA regulations you can trade futures, equities, and options in the same account;
- and finally, under NFA regulations, you cannot hedge – that is, you cannot be long and short at the same time on an instrument ; even more, positions open and close in a FIFO manner.

Unfortunately, Metatrader 4 didn’t score too much either ; a limited platform, extremely latent , which can’t backtest anything but strategies trading one asset and with no implementation of options. As a result, anything quite constructive that could have been built in theoretical conditions (i.e. textbook strategies) could not be backtested or not even implemented at all.

But with the emergence of the new MetaQuotes’ flagship platform, Metatrader 5, things have started to change. At the time this article is being written, Metatrader 5 is in open beta. The “Strategy Tester” module (which is well known by some of our readers and will be also presented in future articles) is not present in the platform. It is our belief that the Strategy Tester will allow development of multiasset strategies. Multiasset backtesting is needed in a lot of situations. I might even say that all successful trading is multiasset trading. You might ask why. And the answer is simple. All [successful] trading is a form of arbitrage. Some will argue and say that very good trading systems don’t arbitrage – but when you look at a sheet with trades and see a good percentage of profitable trades that are not offset by bad trades, somehow the system knew to buy something cheap and sell something expensive, so it does nothing else than a price-value arbitrage. But one-asset markets are just too random for the unexperienced trader to handle. After all, what is of value is the multiasset approach, because markets can’t be too efficient overall. Correlations are broken, parity relations are broken, add to this the magic of options, and look at the big picture : markets become full of opportunities! Now don’t ask why they got into the crysis : they had too much money, way too much money in order to make enough using opportunities. After all, we’re not interested in universal strategies that apply to everyone. But in strategies that apply to US, THE SMALL GUYS.

So, given that the new Metatrader 5 comes with new features, like multiasset backtester, option trading and event-based programming, we decided it was time for a magazine for all things MetaTrader. Of course, with the accent on MQL programming. The magazine will be addressed to all categories of MetaTrader users: absolute beginners that never heard of trading and are making the first steps in the world of markets, MetaTrader traders that use the terminal , and finally all categories of MQL programmers – task specific programming and also complex strategies design and programming.
Source: Mqlmagazine.com

This is the first article in a 5-part series about the Metatrader 5 Fibonacci Tools:

Fibonacci retracement is a very popular and extremely useful for setting the stop-loss and take-profit levels and strategic places for transactions. The notion of retracement is used in many technical indicators such as Gartley patterns, Tirone levels, Elliott Wave theory etc. Many traders use Fibonacci retracement indicators in their daily or long-term Forex trading. These methods are good known in the Forex community and have a lot of literature en resources about them. Fibonacci retracement is created by taking two extreme points (local top and bottom) and dividing the vertical distance by the key Fibonacci ratios as showed on the picture below. The horizontal lines are used to identify possible support and resistance levels.

In this article we are going to customize the Fibonacci settings within Metatrader 5 so that it can plot both retracements & extensions simultaneously.

Metatrader 5 Fibonacci Tools 1

In Metatrader 5 you can find the tool under the menu Insert >> Objects >> Fibonacci >> Fibonacci Retracement. On the chart simply do a random placement, place it anywhere on the chart, does not matter:

Metatrader 5 Fibonacci Tools 2

Then, Right-click anywhere on your chart where there is open space. Select Objects List from the pop-up menu ( or press Ctrl + B on the keyboard ) and left-click. Within the Objects window, select Fibo and then click on the Edit button. You should see this:

Metatrader 5 Fibonacci Tools 3

On the Fibo properties screen, use the Delete button to remove all existing levels. After that use the Add button to add the following values as shown below and click OK.

Metatrader 5 Fibonacci Tools 3

Main Fibonacci Retracements Levels:

Level
0
0.146
0.236
0.382
0.5
0.618
0.786
0.86
0.942
1
-0.18
-0.27
-0.382
-0.618
-1
-1.618
-3.236
Description
0.0 - %$
14.6 - %$
23.6 - %$
38.2 - %$
50.0 - %$
61.8 - %$
78.6 - %$
86.0 - %$
94.2 - %$
100.0 - %$
118.0 - %$
127.0 - %$
138.2 - %$
161.8 - %$
200.0 - %$
261.8 - %$
423.6 - %$


After that you should see the following prices and percentages appearing on the Fibonacci line labels:

Metatrader 5 Fibonacci Tools 5

As described above, a Fibonacci Retracement is created by taking a local top and bottom and dividing them with the vertical distance line:

Metatrader 5 Fibonacci Tools 6

Here are the C-to-D rules:

23.6% >> 118% | 127%
38.2% >> 138.2%
50% | 61.8% >> 161.8%
78.6% >> 0% | 161.%
86.0 >> 0%
100.0+ >> Reversal ( thanks to Black_Knight for the C-to-D rules)

In the future, i will write more about the trading techniques with Metatrader 5 Fibonacci Retracements. For example, you can draw the Fibonacci Retracement at the beginning of the day to know the direction of the movement expected and it is important to have two points of view, one large view, where the Fibonacci Retracement is located on the historical high and one other small view with the last daily high. Try to compare the moment position to these two Fibonacci levels and the daily pivot levels so you can locate the important support and resistance levels.

You can also read more about the trading here.

mql5 website
The website mql5.com is now online! ;) The forum , mql5 documentation and articles section are already working, but the code base is still in development. Great news for all MQL5 developers: a MQL5 book is planned and it will be written by Sergey Kovalyov, author of the MQL4 book.

Now that the MQL5 documentation is online, you don't need a local version of the MQL5 help. The MQL5 language continues developing and the official documentation will be extended and improved, so the online version will contain always the last updates. So if you plan to learn MQL5, the mql5 documentation is the best place to start!

All forum accounts were moved from the MQL4 website, so you can use your existing login, you should only fill your profile and upload an avatar if you use one.

In MetaTrader 5 the history of quotes is stored only in M1 format (from 1993, before - D1 format) and all the charts are built based on it. When the terminal is first installed, the history is empty. The history is stored in \MetaTrader 5\Bases\Default\History\"currency"\ folder and has the .hcc (uncompressed) format. The history is transferred from the MQ's server in a space-efficient archive format of data storing so for example the 10 years 1-minute history of quotes for GBPUSD takes around 10-13 megabytes, uncompressed around 100-150 megabytes.

In order to download all history for a selected currency and show it on the chart, first open the options menu, then charts and select "unlimited bars in chart" option.

History in Metatrader 5

After that go to the maximum timeframe of 1 month or 1 week and simply move your chart to the beginning and the history will begin to download. You can press the "Home" button on your keyboard and hold it until the download is finished.

History in Metatrader 5

History in Metatrader 5

According to MetaQuotes, the option to edit history and view history like in MT4 will be added later.