Русский 中文 Español Deutsch 日本語 Português
Running MetaTrader 4 Client Terminal on Linux-Desktop

Running MetaTrader 4 Client Terminal on Linux-Desktop

MetaTrader 4Examples | 28 June 2007, 14:04
7 022 11
Bazilevich Vadim
Bazilevich Vadim

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 Ltd.
Original article: https://www.mql5.com/ru/articles/1433

Other articles by this author

Last comments | Go to discussion (11)
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.

[Deleted] | 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?
[Deleted] | 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.

CTM Capital
Cian Murphy | 8 Oct 2019 at 10:11

Great article!

I am using MT4 on Windows and on Ubuntu Linux, the only problem I have noticed is that I can use MQL Storage on Windows but not on Linux through Wine. Is this a known bug?

Thanks

Cian

MQL4 Language for Newbies. Difficult Questions in Simple Phrases. MQL4 Language for Newbies. Difficult Questions in Simple Phrases.
This is the second article from the series "MQL4 Language for Newbies". Now we will examine more complex and advanced constructions of the language, learn new options and see, how they can be applied in everyday practice. You will get acquainted with a new cycle type 'while', new condition type 'switch', operators 'break' and 'continue'. Besides you will learn to write your own functions and work with multidimensional arrays. And for a dessert I have prepared an explanation about a preprocessor.
MQL4 Language for Newbies. Introduction MQL4 Language for Newbies. Introduction
This sequence of articles is intended for traders, who know nothing about programming, but have a desire to learn MQL4 language as quick as possible with minimal time and effort inputs. If you are afraid of such phrases as "object orientation" or "three dimensional arrays", this article is what you need. The lessons are designed for the maximally quick result. Moreover, the information is delivered in a comprehensible manner. We shall not go too deep into the theory, but you will gain the practical benefit already from the first lesson.
ZUP - Universal ZigZag with Pesavento Patterns. Part 1 ZUP - Universal ZigZag with Pesavento Patterns. Part 1
The article gives a short description of ideas underlying indicator ZUP - Universal ZigZag with Pesavento Patterns. The article also describes indicators of ZigZag embedded in ZUP.
How to Develop a Reliable and Safe Trade Robot in MQL 4 How to Develop a Reliable and Safe Trade Robot in MQL 4
The article deals with the most common errors that occur in developing and using of an Expert Advisor. An exemplary safe automated trading system is described, as well.