Download MetaTrader 5

Running MetaTrader 4 Client Terminal on Linux-Desktop

28 June 2007, 14:04
Bazilevich Vadim
10
3 136

Introduction


Like the majority of programs, written exceptionally for a family of Windows operation systems, the MetaTrader 4 Client Terminal was long unavailable for use by Linux operation system admirers. Launching this program using vmware emulator doesn't count. This emulator uses too many resources. Besides it is not an opensource, which the author of the article considers a disadvantage. Moreover, the developers of this generally good program make the registration, necessary for receiving and using their product, more difficult with each new version. There is also Lin4Win. It is also paid, so the opensource fans do not face a wide choice - only wine. GPL license, under which the program is distributed, allows involving a great number of programmers from all over the world in the development of this non-emulator. That is why the new versions of this program appear on the average twice a month, sometimes even more often. With each new version the number of programs, working under Windows, that now can be launched using this emulator increases. Now let's get directly to running MetaTrader 4 Client Terminal.


Preparations for the Installation of MetaTrader 4


To start the MetaTrader 4 the following software was used:

  1. FontForge (fontforge_full-20061019.tar.bz2) - fonts editor, used for creating own fonts of the following types: postscript, truetype, opentype, cid-keyed, multi-master, cff, svg and bitmap (bdf, FON, NFNT) or editing the existing scripts. Actually it is not necessary to start with its installation, but anyway later you will need this program. Better take the last version. During the time, when the article was written, the version in the link was actual;
  2. Non-emulator wine (http://www.winehq.com/), the software developer insists, that wine is not a true emulator. He (the software developer) is in a better position to judge. For installation the author used the version wine-0. 9.21, downloaded at http://sourceforge.net/project/showfiles.php?group_id=6241&package_id=77449. When writing the article the author enthusiastically acknowledged about a new version wine - 0.9.23. What version to use does not make great difference. But it shouldn't be earlier than 0.9.21. The author didn't experiment with older versions because of lack of time. Later this point will become clear;
  3. MetaTrader 4 Client Terminal;
  4. For launching MetaTrader 4 Client Terminal MFC42.DLL library was used. This library belonged to ОS WindowsXP. Its length is 995383 bites.

The following two moments are very important for the users that will install MetaTrader on Linux-desktop:

  1. The author of the article thinks that errors of MetaTrader 4 operation under wine may occur in case of a wrong version of MFC42.DLL, that is why try to find a library of the indicated length. Perhaps users more experienced in Windows know how to discover the version of a library. After more than five years' working in Linux only, the author became disaccustomed even to the look of this Bill Gates' software;
  2. MFC42.DLL library, whose location in wine system will be specified later, must have exactly this name (all capitals). For *nix family operation systems files of the same name, differing only in capitals in the name, are different files. That is why if the library that you have honestly borrowed contains small letters in its name or extension, rename it.

X-server enabled Linux and *.ttf fonts should be installed on your computer. There are two ways to get the latter.

The first way is to use Windows fonts. They must be stored in the folder Windows\Media\Fonts or on Windows-machine.

The second way is the legal one. Using the following links: http://www.microsoft.com/truetype/fontpack/win.htm, http://www.sisyphus.ru/srpm/fonts-ttf-xorg you may find and install Windows-like fonts in your Linux system.

Depending on the distributive you use, the location of fonts may differ. In the ideal case they can be already installed in your system. If not, specify the location of the file xorg.conf or xconfig.conf. They might be somewhere at /etc/X11. Viewing the content of the X-server installation package from your distributive will help you find the exact location. After you find this file, define a path to the directory, where the honestly borrowed files of ttf-fonts will be located. If this file already contains paths to other fonts, you need just so add your directory, where ttf-fonts will be located.

Example:


Paths: /usr/X11R6/lib/X11/fonts/TTF_win, /usr/X11R6/lib/X11/fonts/TTF_corel_u, /usr/X11R6/lib/X11/fonts/TTF_corel_w were added.


Installation of MetaTrader 4


If all the preparation steps were taken, you may start the installation. Start it in that sequence, in which the programs were enumerated in the list of the necessary software. So, begin with FontForge. Installation operations or at least "make install" command should be performed with root superuser rights. Unpack "fontforge_full-20061019. tar.bz2" package with source texts into any catalogue (you may create a temporary one) and start the command of the automatic configuration ./configure in the folder with the unpacked folder. After the end of the autoconfiguration start the compilation command - make. When it is ended - make install. After the last command is performed, the package will be installed.

To facilitate the operation of the programs that update packages and have different names in different distribution packages, let's create a package. The author thinks that the most successful program for the creation of installation packages for the majority of common Linux distributives is the program 'checkinstall' (http://asic-linux.com.mx/~izto/checkinstall), with the current version 1.6.0. To create a package in the directory, where compilation took place, after unpacking and installation it is necessary to perform checkinstall command and the command will help you in the interactive mode to create an installation package for your distributive.

After the installation of fontforge_full-20061019.tar.bz2 package, you may start wine installation. The unpacking of this package does not differ from the previous one.

Users should note the following:

  1. In order not to have to restart the wine package compilation, it is necessary to provide enough space in the directory, where the wine compilation will take place, about 1.5 Gb;
  2. The wine compilation a little bit differs from the common one. The directory with the unpacked program has a sub-directory ./tools. Exactly there the wineinstall program should be started;
  3. The launched by wineinstall autoconfiguration will not start, if this command was started by a user in the name of a superuser - root. That is why start the command in the name of a current user;
  4. The configuration speed, as well as later compilation and the wine program installation, fully depends on the operation speed of your computer;
  5. When the autoconfiguration is completed, standard commands make and makeinstall are used;
  6. The installation can be completed by the same program of packages creation - checkinstall;
  7. The commands: make install and checkinstall must be performed by a superuser - root. Though in this particular case you may face lack of space on the dedicated partition because of the big size of the created files (during package creation). That is why in the case of wine it is not necessary to create a package. The program will work without it.

Running MetaTrader 4


The first start of MetaTrader 4 is performed this way: 'wine . /mt4setup.exe'. After that a standard window of MetaTrader 4 installation opens. The author thinks it not necessary to show the screenshots of MetaTrader installation in this article, because the qualification of users that use Linux everyday, is enough for installing the program without such hints. New versions of wine usually do not require additional setup. To get the sound, users, preferring the sound subsystem ALSA, would probably have to view the settings file or start winecfg and make necessary setup in the interactive way.

Example:




After the start of the above command 'wine ./mt4setup.exe' a new catalogue '.wine' will be automatically created in the home directory of the current user. That is why, ito avoid changing rights on the folder '.wine' and moving it into a catalogue of the user that will work with MetaTrader, the author strongly recommends to launch MetaTrader installation command from the name of a user, who will work with this program. The author of the article makes an apology to Linux gurus for such a detailed description of the commonplace truth.

The setup of MetaTrader connection to a terminal is identical to that of Windows.

And finally the finishing strokes.

To start MetaTrader 4 from the menu of ANY window manager, one can use the following sequence of commands:

'cd /home/user/.wine/drive_c/'Program Files'/MTrader4/; wine ./terminal.exe', where /home/user is the home directory of the current user.

Here is the result of the work done:



Best regards Basilevich Vadim aka bvv2001.

P.S. In future the author plans to write an article describing programs, intended for operation on Linux platform, that assist the work of traders. During the article proofs, the author had the chance to check MetaTrader operation using the new wine version 0.9.24, downloaded from the abovementioned site. The installation of the new version is identical to that, described in the article. At a glance the time of MetaTrader start with the new wine version decreased by 15-20%.


Translated from Russian by MetaQuotes Software Corp.
Original article: https://www.mql5.com/ru/articles/1433

Last comments | Go to discussion (10)
Mucahit Savas
Mucahit Savas | 3 Dec 2009 at 00:09

Hi

i have a question:

WHat i must do for a vServer with linux ??

I have then the root rights but what i must do for using this with a cheap Linux vServer??

Thanks for all answers

bernd
bernd | 15 Jun 2010 at 22:43

why doesn't metaquotes provide linux and mac builds of metatrader?


I don't really understand it. These days it getting harder and harder to even find development tools/toolkits/frameworks that are not cross platform.

MQL4 Comments
MQL4 Comments | 29 Oct 2010 at 02:14

Hello,

Which version of the MFC42.DLL you talking about?

because I copied the dirver from windows 7 and appear the following

cannot find 'MFC42.DLL', Please re-install this application

I need to know if any can help me

I use centos 5.4

Regards.

Andrew Ho
Andrew Ho | 25 Nov 2011 at 00:39
I installed all that but I can't get MT4 to launch. Help?
MQL4 Comments
MQL4 Comments | 28 Jan 2012 at 19:04
Test it by virtual machine.
dgaray:

Hello,

Which version of the MFC42.DLL you talking about?

because I copied the dirver from windows 7 and appear the following

cannot find 'MFC42.DLL', Please re-install this application

I need to know if any can help me

I use centos 5.4

Regards.

Try to get help on WineHQ forum, http://appdb.winehq.org/objectManager.php?sClass=version&iId=2893

or just use winetricksk.

Wine Users report bugs.

Step on New Rails: Custom Indicators in MQL5 Step on New Rails: Custom Indicators in MQL5

I will not list all of the new possibilities and features of the new terminal and language. They are numerous, and some novelties are worth the discussion in a separate article. Also there is no code here, written with object-oriented programming, it is a too serous topic to be simply mentioned in a context as additional advantages for developers. In this article we will consider the indicators, their structure, drawing, types and their programming details, as compared to MQL4. I hope that this article will be useful both for beginners and experienced developers, maybe some of them will find something new.

Here Comes the New MetaTrader 5 and MQL5 Here Comes the New MetaTrader 5 and MQL5

This is just a brief review of MetaTrader 5. I can't describe all the system's new features for such a short time period - the testing started on 2009.09.09. This is a symbolical date, and I am sure it will be a lucky number. A few days have passed since I got the beta version of the MetaTrader 5 terminal and MQL5. I haven't managed to try all its features, but I am already impressed.

False trigger protection for Trading Robot False trigger protection for Trading Robot

Profitability of trading systems is defined not only by logic and precision of analyzing the financial instrument dynamics, but also by the quality of the performance algorithm of this logic. False trigger is typical for low quality performance of the main logic of a trading robot. Ways of solving the specified problem are considered in this article.

Using text files for storing input parameters of Expert Advisors, indicators and scripts Using text files for storing input parameters of Expert Advisors, indicators and scripts

The article describes the application of text files for storing dynamic objects, arrays and other variables used as properties of Expert Advisors, indicators and scripts. The files serve as a convenient addition to the functionality of standard tools offered by MQL languages.