Friday, 14 May 2010

HOW TO Install MetaTrader 4 on Linux

How to run Meta Trader 4 on Linux using WINE.
  1. Sign up for an account at a forex broker, and download their MT4 installer. I used Easy-Forex, but this procedure should work for any version of Meta Trader 4.x.
  2. Install wine on your linux machine (I used wine 1.1.44 on an openSuSE 11.2 machine). Also download winetricks (used to install additional libraries required by MetaTrader).
  3. If you haven't used wine before, run 'winecfg' to create your installation directory. You can then click 'OK' to exit the dialog, or have a look around at the options (I used the defaults).
  4. Start up a Windows computer, and copy all the files in C:\WINDOWS\Fonts into the wine directory (/home/username/.wine/drive_c/windows/Fonts)
  5. Run winetricks to install mfc40 and mfc42:
      sh ./winetricks mfc40 mfc42
  6. Run the MetaTrader installer executable.
       wine ./mt4setup.exe
That's it! You should now be able to run MetaTrader4 by clicking on the icon on the desktop, or running the following command in your Linux shell:

wine /home/username/.wine/drive_c/Program\ Files/yourmt4installdirectory/terminal.exe

If you have any more problems or questions, please contact me by leaving a comment. MetaTrader is running fine for me under openSuSE 11.2 with the latest WINE from the repositories, once MFC40, MFC42 and the correct fonts had been installed.

More information:
http://appdb.winehq.org/objectManager.php?sClass=version&iId=2893
http://www.aboutcurrency.com/university/metatrader/installing_metatrader4_under_linux.shtml
http://easyforextrading4u.com/metatrader-linux/

Appendix:
When you first start MetaTrader4, it might take a while to initialise. You'll see something like the following in the shell output:

fixme:reg:GetNativeSystemInfo (0x58c4c8) using GetSystemInfo()
fixme:toolhelp:CreateToolhelp32Snapshot Unimplemented: heap list snapshot
MetaQuotes Language 4 compiler version 4.00 build 224 (14 May 2009)
Copyright 2001-2009, MetaQuotes Software Corp.

Exp file "Z:\home\david\.wine\drive_c\Program Files\MT4 at easy-forex\experts\MACD Sample.ex4" produced - 0 error(s), 0 warning(s)
Xlib: extension "Generic Event Extension" missing on display ":1000.0".
fixme:reg:GetNativeSystemInfo (0x58c4c8) using GetSystemInfo()
fixme:toolhelp:CreateToolhelp32Snapshot Unimplemented: heap list snapshot
MetaQuotes Language 4 compiler version 4.00 build 224 (14 May 2009)
Copyright 2001-2009, MetaQuotes Software Corp.

Exp file "Z:\home\david\.wine\drive_c\Program Files\MT4 at easy-forex\experts\Moving Average.ex4" produced - 0 error(s), 0 warning(s)
Xlib: extension "Generic Event Extension" missing on display ":1000.0".
fixme:reg:GetNativeSystemInfo (0x58c4c8) using GetSystemInfo()
fixme:toolhelp:CreateToolhelp32Snapshot Unimplemented: heap list snapshot
MetaQuotes Language 4 compiler version 4.00 build 224 (14 May 2009)
Copyright 2001-2009, MetaQuotes Software Corp.

Exp file "Z:\home\david\.wine\drive_c\Program Files\MT4 at easy-forex\experts\indicators\Accumulation.ex4" produced - 0 error(s), 0 warning(s)
Xlib: extension "Generic Event Extension" missing on display ":1000.0".
fixme:reg:GetNativeSystemInfo (0x58c4c8) using GetSystemInfo()
fixme:toolhelp:CreateToolhelp32Snapshot Unimplemented: heap list snapshot
MetaQuotes Language 4 compiler version 4.00 build 224 (14 May 2009)
Copyright 2001-2009, MetaQuotes Software Corp.


Some errors I was encountering before installing the mfc40 and mfc42 libraries:

err:module:import_dll Library KERNELBASE.dll (which is needed by L"C:\\windows\\system32\\MFC42.DLL") not found
err:module:import_dll Library API-MS-Win-Core-Debug-L1-1-0.dll (which is needed by L"C:\\windows\\system32\\MFC42.DLL") not found
err:module:import_dll Library API-MS-Win-Core-ErrorHandling-L1-1-0.dll (which is needed by L"C:\\windows\\system32\\MFC42.DLL") not found
err:module:import_dll Library API-MS-Win-Core-File-L1-1-0.dll (which is needed by L"C:\\windows\\system32\\MFC42.DLL") not found
err:module:import_dll Library API-MS-Win-Core-Handle-L1-1-0.dll (which is needed by L"C:\\windows\\system32\\MFC42.DLL") not found
err:module:import_dll Library API-MS-Win-Core-Interlocked-L1-1-0.dll (which is needed by L"C:\\windows\\system32\\MFC42.DLL") not found
err:module:import_dll Library API-MS-Win-Core-LibraryLoader-L1-1-0.dll (which is needed by L"C:\\windows\\system32\\MFC42.DLL") not found
err:module:import_dll Library API-MS-Win-Core-Localization-L1-1-0.dll (which is needed by L"C:\\windows\\system32\\MFC42.DLL") not found
err:module:import_dll Library API-MS-Win-Core-LocalRegistry-L1-1-0.dll (which is needed by L"C:\\windows\\system32\\MFC42.DLL") not found
err:module:import_dll Library API-MS-Win-Core-Memory-L1-1-0.dll (which is needed by L"C:\\windows\\system32\\MFC42.DLL") not found
err:module:import_dll Library API-MS-Win-Core-Misc-L1-1-0.dll (which is needed by L"C:\\windows\\system32\\MFC42.DLL") not found
err:module:import_dll Library API-MS-Win-Core-ProcessEnvironment-L1-1-0.dll (which is needed by L"C:\\windows\\system32\\MFC42.DLL") not found
err:module:import_dll Library API-MS-Win-Core-ProcessThreads-L1-1-0.dll (which is needed by L"C:\\windows\\system32\\MFC42.DLL") not found
err:module:import_dll Library API-MS-Win-Core-Profile-L1-1-0.dll (which is needed by L"C:\\windows\\system32\\MFC42.DLL") not found
err:module:import_dll Library API-MS-Win-Core-String-L1-1-0.dll (which is needed by L"C:\\windows\\system32\\MFC42.DLL") not found
err:module:import_dll Library API-MS-Win-Core-Synch-L1-1-0.dll (which is needed by L"C:\\windows\\system32\\MFC42.DLL") not found
err:module:import_dll Library API-MS-Win-Core-SysInfo-L1-1-0.dll (which is needed by L"C:\\windows\\system32\\MFC42.DLL") not found
err:module:import_dll Library MFC42.DLL (which is needed by L"Z:\\home\\david\\.wine\\drive_c\\Program Files\\MT4 at easy-forex\\MetaEditor.exe") not found
err:module:LdrInitializeThunk Main exe initialization for L"Z:\\home\\david\\.wine\\drive_c\\Program Files\\MT4 at easy-forex\\MetaEditor.exe" failed, status c0000135

3 comments:

Anonymous said...

Hi there
I found your blog whilst looking for help on using mt4 with Wine

I'm just wondering if you still use mt4 with Wine? If so, do you have troubles with it saving the order of the charts i.e. when re-starting mt4 are the tabs at the base of the profile window all there but are not saved in your last viewing order?

I can't fix this issue, otherwise all seems to work ok.

Best regards, Cinna

Blogger said...

I would like to suggest that you trade with the ultimate Forex broker.

Blogger said...

Quantum Binary Signals

Get professional trading signals sent to your cell phone daily.

Start following our trades NOW & profit up to 270% per day.