Discussion of article "MetaTrader 5 on Linux" - page 9

 
Péter Kovács #: Thanks, its great!
You are welcome!
 
Wasin Thonkaew #:
Latest build breaks and mt5 shortly closes itself.
My solution is to use winehq-devel package whose version is 8.0-rc1 as seen on Ubuntu 20.04.

You might want to back up your wine prefix directory in case you have important settings there, and for safety.

Thanks, that worked.

 
Using wine-devel or wine-staging instead of wine-stable solves the issue
 
Adegbenga Omotowoju #:
hi team please can any help, i'm having issues with my mt5 terminal [ Always closing itself ]

Same here.

Running with WINE on ubuntu system.

 
Does this works in ARM Linux??
 
i need help on the last part of data directory guys how do u go about that
 

Unfortunately, on the date that I posted this, the Debian script was not worked for Debian 11 Bullseye

I noticed that there is a code line need to be modified.

You can make your own shell script by using your text editor first.

nano mt5debian.sh

Then, type/insert below lines.

#!/bin/bash

# Copyright 2022, MetaQuotes Ltd.
# edited 2023, Fatchul Bari Hikmawan.

# MetaTrader download url
URL="https://download.mql5.com/cdn/web/metaquotes.software.corp/mt5/mt5setup.exe"
# Wine version to install: stable or devel
WINE_VERSION="stable"

# Prepare: switch to 32 bit and add Wine key
sudo dpkg --add-architecture i386
wget -nc https://dl.winehq.org/wine-builds/winehq.key
sudo mkdir /etc/apt/keyrings
sudo mv winehq.key /etc/apt/keyrings/winehq-archive.key

# Get Debian version and trim to major only
OS_VER=$(lsb_release -r |cut -f2 |cut -d "." -f1)
# Choose repository based on Debian version
if (( $OS_VER >= 12)); then
  wget -nc https://dl.winehq.org/wine-builds/debian/dists/bookworm/winehq-bookworm.sources
  sudo mv winehq-bookworm.sources /etc/apt/sources.list.d/
elif (( $OS_VER < 12 )) && (( $OS_VER >= 11 )); then
  wget -nc https://dl.winehq.org/wine-builds/debian/dists/bullseye/winehq-bullseye.sources
  sudo mv winehq-bullseye.sources /etc/apt/sources.list.d/
elif (( $OS_VER <= 10 )); then
  wget -nc https://dl.winehq.org/wine-builds/debian/dists/buster/winehq-buster.sources
  sudo mv winehq-buster.sources /etc/apt/sources.list.d/
fi

# Update package and install Wine
sudo apt update
sudo apt upgrade
sudo apt install --install-recommends winehq-$WINE_VERSION

# Download MetaTrader
wget $URL

# Set environment to Windows 10
WINEPREFIX=~/.mt5 winecfg -v=win10
# Start MetaTrader installer
WINEPREFIX=~/.mt5 wine mt5setup.exe

Save the shell script, then make it executable

chmod +x mt5debian.sh

Done, 

Finally you can install the Metatrader 5 on Debian 11 Bullseye.

./mt5debian.sh

Note:

If MetaQuotes's admin read this post, the failure is because winehq repository sources are looking the public key to directory `/etc/apt/keyrings` instead of `/usr/share/keyrings`.

So we need to pass it to correct directory in order the winehq can be installed successfully.

 
Hi everyone!
I'm running Metatrader 5 build 3815 on wine-8.0.1 in 64-bit Ubuntu 20.04.6 LTS.
In my Expert Advisor I use a function from imported C# DLL (.NET Framework 4.8). Regardless of what the exported function do, the Expert works well the first time I launch it, and the second time Metatrader 5 just crashes. Debugger never hit breakpoints in the Expert before Metatrader 5 crashes.
Looks like some resources related to the DLL are not being released after the Expert deinitialization. 
Is there a way to fix this?

C# DLL code:
namespace Test
{
    public static class TestStatic
    {
        public static string TestFunc()
        {
            return "test return value";
        }
    }
}
Expert Advisor code:
#import "Test.dll"
#import

int OnInit()
  {
   // 2nd run crash if this line used
   Print("DLL function result: ", TestStatic::TestFunc());
   
   // no 2nd run crash if this line used
   //Print("no DLL functions used");
   
   return(INIT_SUCCEEDED);
  }
void OnDeinit(const int reason){}
void OnTick() {}

 
WStranger #:
Hi everyone!
I'm running Metatrader 5 build 3815 on wine-8.0.1 in 64-bit Ubuntu 20.04.6 LTS.
In my Expert Advisor I use a function from imported C# DLL (.NET Framework 4.8). Regardless of what the exported function do, the Expert works well the first time I launch it, and the second time Metatrader 5 just crashes. Debugger never hit breakpoints in the Expert before Metatrader 5 crashes.
Looks like some resources related to the DLL are not being released after the Expert deinitialization. 
Is there a way to fix this?

C# DLL code:
Expert Advisor code:

I guess a wine reboot windows will do it...


 
Dominik Christian Egert #:
I guess a wine reboot windows will do it...


Tried, didn't help. Every second EA launch since the terminal start results in a crush, even after wineboot
Reason: