MQL4 - automated forex trading   /  


Login | Register | Language: ru cn en
Dozens financial books in MetaTrader Market

Articles  Features  Practical Use of the Virtual Private Server (VPS) for Autotrading To post a new article, please log in or register

Automated trading in
and Trade on the Go!
and Trade on the Go!

This article is about
MetaTrader 4
Download MT 4 - 455 Kb

and Trade on the Go!

and Trade on the Go!

Practical Use of the Virtual Private Server (VPS) for Autotrading [ ru ]

Setting a Task: Finding a Working Place for Robots

Each autotrader has its trading robots that trade in financial markets, and a computer, on which these Expert Advisors run and operate. One launches Expert Advisors at home, another at work, the third one on the friends' server or a dedicated server. What is clear, is that Expert Advisors need a working place (office), and traders want less woe, connected with this office.

All the enumerated offices have their advantages and disadvantages, so I will not labor the point. I will offer my own variant. So, we have a task to find an office for the operation of trading robots, which will meet the following requirements: remote installation, connection from any point of the world, quick setup, quick failure recovery, easy migration, entire archive backup, preferably first-class hardware, protection, system upgrade with such services as trading reports publishing, quotes, etc. And preferably not too expensive.

Choosing an Office for the Autotrading

The task is set. Let us begin our search. A home computer does not suit. A computer at work does not suit at all, moreover the management "interferes". Friends offer a terminal access to the server, but they often overcharge it, and I don't want to depend on anyone. What is left is a dedicated server. To rent a server or buy your own is cool. But one has to look after it, and, frankly speaking, I am lazy about it. A dedicated server requires much time and power. So, let us dwell on a new possibility - VPS. VPS is a virtual private server. The powerful server divides its resources between 30-40 users, each having his own virtual copy or simulator of a full-blown PC (server). Be honest, I decided on a VPS at once. It differs from other offers and meets my requirements to an office for Expert Advisors. The only thing left to decide on is a platform: Windows VPS or Linux VPS? Here I didn't think much. I have worked with both operating systems. I hate the first one and love the second. Pity, I have no MetaTrader 4 for Linux, I wouldn't have any problems. But life is not that easy...

(General scheme of the trading area components)

Arranging a Remote Office

Now we need to run MetaTrader 4 under Linux. So, MetaTrader works under Wine (an emulator of Windows), but not all the buttons function interactively. I.e. the system operates unreliably by now. So, let us run MetaTrader 4 under VMWare, Xen and QEMU on a virtual privat server. If it doesn't work, we will rent Windows VPS.

Installation of a Virtual Machine QEMU

VMWare, Xen did not operate on the VPS, while they needed a peculiar module in Linux kernel, and VPS does not allow this. QEMU functioned without an accelerator. Let us decide on it:

  1. buy Linux VPS with a preinstalled operating system Ubuntu Dapper (for example, here);
  2. download SSH-client (all Linux systems are remotely controlled through such clients) here;
  3. connect to the server:

  4. install virtual QEMU from the repository (a storage of programs, which is connected on default) using commands:
    aptitude search qemu,
    aptitude install qemu

    (in Linux all program distributives are saved in repository and are easily installed, as described earlier)

Creating the Image of Windows 2003 Server + Terminal Services

The virtual machine is ready for the start. All we need is to create the image of Windows Server 2003 with activated terminal servers for the virtual QEMU. Creating the image of Windows Server 2003+ Terminal Services is quite a complicated procedure.

Creating the image involves the following steps:

  1. creating a file of several gigabytes' size;
  2. starting QEMU with start key from CD drive;
  3. installing Windows 2003 Server;
  4. activating terminal services;
  5. installing network card drivers.

It is the most difficult stage. But you can omit it and get the ready image here:

To enter Windows use the following:

  • login: Administrator
  • password: no. You can set your own password

Download the file w2k3.img at (image of Windows 2003 Server for a virtual machine) onto your private server into any folder. For the file interchange with your server you will need WinSCP program. It can load files directly onto your private server.

Starting a Remote Office

You can start Windows 2003 Server image under a virtual machine on a remote private server using the task planner AT or locating it in the autorun (/etc/rc.local). First install the task scheduler for Linux using the command 'aptitude install at'. Also install Midnight Commander (analogue of Norton Commander) using the command 'aptitude install mc'. Midnight Commander is started by the command 'mc'. After that the following window will appear:

Using the task planner, a virtual machine with Windows image is started using the commands:

Autostart of a Virtual Machine

After the starting procedure is completed, press Enter, and then Ctrl-D. I would recommend to locate the start of the virtual machine in Autostart (file /etc/rc. local). But before this you will need the additional program of divided sessions (screen). Install this program using commands:

  • aptitude search screen
  • aptitude install screen

After that open the file /etc/rc.local and write there the autostart of the virtual machine with Windows image of the server.

Check that the virtual machine is started with the command ps ax.

So, the virtual machine is started with Windows image. End working with the server using the command exit:

Connecting to a Remote Office

Connect to the remote terminal server in a common way: Start - Programs - Standard - Connection - Remote Desktop Connection.

As a result we get the following server with started MetaTrader 4.0:

You can install on VPS also FTP- and Web-servers, your own Forum and other services. This article does not contain the information about their installation.

List of Web-Sites

  1. Providing a virtual private server (VPS)
  2. SSH-client
  3. File interchange with VPS, WinSCP program :
  4. The official site of QEMU for Linux
  5. The official site of QEMU for Windows
  6. Installation of QEMU in Linux :
  7. Discription of the virtual machine QEMU
  8. Free task planner nnCron

Translated from Russian by MetaQuotes Software Corp.
Created: 2007.08.06  Author: Nick Revych
Warning: All rights to these materials are reserved by MetaQuotes Software Corp. Copying or reprinting of these materials in whole or in part is prohibited.
ZUP - Universal ZigZag with Pesavento Patterns. Part 2
ZUP - Universal ZigZag with Pesavento Patterns. Part 2

ZUP - Universal ZigZag with Pesavento Patterns. Part 2 - Description of Embedded Tools

MQL4 Language for Newbies. Technical Indicators and Built-In Functions
MQL4 Language for Newbies. Technical Indicators and Built-In Functions

This is the third article from the series "MQL4 Language for Newbies". Now we will learn to use built-in functions and functions for working with technical indicators. The latter ones will be essential in the future development of your own Expert Advisors and indicators. Besides we will see on a simple example, how we can trace trading signals for entering the market, for you to understand, how to use indicators correctly. And at the end of the article you will learn something new and interesting about the language itself.

3 comments  To add comments, please, log in or register

i go off topic, you sau" You can install on VPS also FTP- and Web-servers, your own Forum and other services" i'd like make a my website based on wordpress with a forum and e-Commerce Shopping Carts. what is a good solution and is there a guide that explain how to do that?

You are grat !CMaster

2008.08.23 14:15 zukkaweb
New Version TradeServer2in1_w2k_v2.0 -under Windows 2000 Server + DevCon.exe  :)
(Qemu + Windows 2000 Server + Activated Terminal Services + NOD32 + nnCron + DevCon + Far + MT4)
login : 1CMaster
password : 123

2007.08.13 11:35 1CMaster
... At last

MetaTrader on Linux VPS

Wow, many thank's, will try it
2007.08.12 11:59 musanto