Free VPS for Zorro and Metatrader on Linux

Posted By: fran

Free VPS for Zorro and Metatrader on Linux - 10/31/17 20:12

Hi,
I leave you a step by step guide to run a free VPS in AWS for 12 months. This guide is to set up the Linux VPS Server to run Zorro and Metatrader and connect to it via Windows Remote Connection (RDP):

1. Create an account in AWS (https://aws.amazon.com)
2. Create an EC2 instance:
2.1. Select Ubuntu Server 16.04 (t2.micro, Free tier elegible)
2.2. Follow the AWS guide to connect to your Server via ssh (with PuTTy for example)
2.3. Go to EC2 Dashboard - Security Groups and edit the security group attached to the instance created in step 2.1, edit Inbound Rules and add the TCP port 3389 for RDP
3. Login to your server via ssh with PuTTY
4. Change the ubuntu's user password: sudo passwd ubuntu
5. Update the system: sudo apt update && sudo apt upgrade
6. Install the LXDE desktop:
sudo apt-get install lxde
sudo apt install lxsession-logout
sudo apt-get install language-selector-gnome
(If you want the full Lubuntu desktop: sudo apt install lubuntu-desktop)
(If you prefer XFCE desktop: sudo apt install xfce4)
(If you prefer Gnome 3 desktop: sudo apt-get install gnome-shell)
(If you prefer KDE desktop: sudo apt-get install kubuntu-desktop)
7. Install a Windows help chm file reader: sudo apt-get install xchm
8. Install XRDP to connect via "Remote Desktop" from Windows
sudo add-apt-repository ppa:hermlnx/xrdp
sudo apt-get update
sudo apt-get install xrdp
9. Install wine to run Windows apps:
sudo dpkg --add-architecture i386
wget -nc https://dl.winehq.org/wine-builds/Release.key
sudo apt-key add Release.key
sudo apt-add-repository https://dl.winehq.org/wine-builds/ubuntu/
sudo apt-get update
sudo apt-get install --install-recommends winehq-stable
10. Open "Remote Desktop Connection" on Windows:
Computer: ec2-xxx-xxx-xxx-xxx.xxxxxxxxxxxxxxxx.amazonaws.com
11. Login:
user: ubuntu
password: the one you set in step 4
12. Open a terminal and check if the keyboard is in your language, if it is not your local language do this:
12.1. Edit this file with vi or nano: sudo nano /etc/xrdp/xrdp_keyboard.ini
12.2. Go to [default_rdp_layouts] and add in the first one your layout code (layouts codes here: https://github.com/eby/rdesktop/blob/master/doc/keymap-names.txt)
12.3. Go to [default_layouts_map] and in the first one add your language

Example for Spanish keyboard:
[default_rdp_layouts]
rdp_layout_es=0x0000040A

[default_layouts_map]
rdp_layout_es=es

13. Download and install Zorro and Metatrader via wine

UPDATE: if you get a message in wine saying that MT requires Windows 7 with Service Pack 1, run "winecfg" in the terminal and set the operative system to Windows 7 or Windows 10.

This guide is only to set up your environment, Zorro or Metatrader works under Linux but I have not tested how reliable it works.
Hope it helps.



Posted By: Sphin

Re: Free VPS for Zorro and Metatrader on Linux - 11/04/17 10:55

Code:
Zorro or Metatrader works under Linux but I have not tested how reliable it works


Did you try TradeMode already and if how long did you let it run? I did't face problems with Metatrader so far but (on my platform) Zorro dies frequently while trading. The cause is most likely wine because in Windows Zorro does not but I'd like to find out the reason a bit closer.
Posted By: fran

Re: Free VPS for Zorro and Metatrader on Linux - 11/04/17 16:37

I did not try TradeMode yet, At the moment I have been trading Zorro Z1 via MT bridge in demo account and everything works fine so far (I have just checked the VPS server right now and is still fine), I have 2 trade operations opened by Zorro. I started to test it just 2 days ago with 2 different brokers. I will try TradeMode to see what happens. If you give me details about what you are testing I can try to reproduce it in my VPS to see what happens.
Posted By: Sphin

Re: Free VPS for Zorro and Metatrader on Linux - 11/04/17 18:39

If you are trading you are just using TradeMode. It doesn't mind if it's on a demo account. If all works fine for you than I guess my troubles concern to my setup so I have to dig deeper. Thanks for the info!
Posted By: fran

Re: Free VPS for Zorro and Metatrader on Linux - 11/05/17 14:25

Did you follow all the steps above?
Posted By: Hredot

Re: Free VPS for Zorro and Metatrader on Linux - 11/05/17 16:29

I'm confused. Why get ubuntu when you can have a windows server from the same retailer. Isn't Zorro written for Windows? Why get the wrong operating system for the task at hand?
Posted By: fran

Re: Free VPS for Zorro and Metatrader on Linux - 11/05/17 18:09

In my case for these reasons:
- In AWS, in free tier elegible (a free basic VPS for 12 months), Ubuntu with MT4 has better performance than Windows (with the same hardware machine conditions)
- Under the same machine conditions, in AWS a VPS Ubuntu based is cheaper that Windows VPS
Ubuntu just more economic and better performance for cheaps VPS with the same hardware. If you wanna use Zorro and MT4 in a free VPS for 12 months, under Windows is very hard because of the slow performance. If you can afford a good paid VPS Windows based go for it.
Posted By: Sphin

Re: Free VPS for Zorro and Metatrader on Linux - 11/05/17 18:30

I agree to fran and beside of this: I like to experiment. The biggest surprise for me so far is that MT4 on Linux seems to bind really less ressources as on Windows where it often slows down the machine especially if one uses several MT4 processes.
Posted By: Hredot

Re: Free VPS for Zorro and Metatrader on Linux - 11/05/17 23:31

Wait, so you are saying that running a windows native application on linux works faster than on windows having the same hardware?
That sounds hard to believe...
What are the stats you observe? By how much is it faster?
Posted By: fran

Re: Free VPS for Zorro and Metatrader on Linux - 11/06/17 18:39

I do not mean just MT or Zorro performance, I mean mainly operative system performance, that also affects the overall computer performance. If the operative system runs faster, the apps run faster.

You can do the test:
create two t2.micro instances in AWS, free for 12 months. One of them with Windows + MT and the other one Ubuntu + MT. Which one can you work better?

I am running several Ubuntu machines with MT4/MT5 with and without Zorro since few days ago. Zero problems so far, they keep running and trading 24h/day.
Posted By: pascalx

Re: Free VPS for Zorro and Metatrader on Linux - 11/06/17 19:00

How do you measure the performance and how much faster is Ubuntu for that use case vs Windows (10?)?
Posted By: fran

Re: Free VPS for Zorro and Metatrader on Linux - 11/06/17 19:30

I haven't done any benchmark test or similar. I just use both systems and with Windows Server the user's response time is slower (because the Windows GUI, even if you configure it for best performance), LXDE (or XFCE) is a lightweight desktop that requires less RAM and CPU resources than Windows GUI.
And also Linux VPS is cheaper.
Posted By: pascalx

Re: Free VPS for Zorro and Metatrader on Linux - 11/06/17 19:44

But that is a really subjective approach to compare performance between operating systems by how the UI response feels, isn't it? Wouldn't it be better to measure the average cpu usage over a certain time frame? Afterall, with trading automation we don't expect to click the UI all day and night.
Posted By: fran

Re: Free VPS for Zorro and Metatrader on Linux - 11/06/17 20:11

I do not expect to give a measured and scientific test.
I just can afford a cheap VPS, so it comes with strong hardware limitations. So, under these limitations, between Windows and Linux I can work much better and much faster with Linux, with Windows I couldn't work because of its performance, this is just my personal user experience that I am trying to explain with technical reasons.
If you can pay a good VPS hardware with Windows go for it and forget this post laugh
Posted By: pascalx

Re: Free VPS for Zorro and Metatrader on Linux - 11/06/17 20:42

I am a fan of free stuff, so I think your post is very valuable.
Posted By: Sphin

Re: Free VPS for Zorro and Metatrader on Linux - 01/07/18 18:19

@fran: if I install 2x MT4 on my Linux wine environment, create an account.csv with 2 separate MT4 brokers each using an individual copy of the ZorroMT4.dll inside the plugin directory (and an individual Assets.csv) and start 2 Zorro instances, one with account/broker A and one with account/broker B and let them trade they get mixed up completely. It seems they cannot distinguish between the individual DLLs for MT4. On Windows this setup works without problems so far. If you would like to try it out, I would be curious if this is the case with your system too.
© 2024 lite-C Forums