A few weeks ago I closed all of my Metatrader 4 accounts in order to start trading outside of this unprofessional trading platform. Using the Oanda Java API – which I access using the Asirikuy Trader python front-end – the possibility to move outside of Windows has also become a reality. Trading from Linux is something I have always wanted since the Linux operating system offers a much higher level of stability with a much more powerful console implementation and open source solutions for an extremely wide array of applications. Today I am going to talk about the setup of my Linux trading server for algorithmic trading, why I decided to set it up here instead of using an online Virtual Private Server (VPS), which precautions I had to care about and which distribution and system specifications I have decided to use for this setup. After reading this article you should be able to analyse whether a Linux home trading server is the right choice for you and what you need to take into account before moving in this direction.
When deciding to move away from Windows and into a Linux trading server, the first thing I considered was to migrate my trading to a VPS setup similar to the Windows setup I was previously using. Linux VPS are usually cheaper or the same price for the same technical specifications so it seemed like a good idea to migrate to a Linux server. However upon reviewing the commercial offerings available I quickly noticed some problems with what was available, Linux VPS offered only single core implementations (for the same price as windows dual core ones) and – more importantly – these VPS implementations were thought more for web hosting than for hosting processor intensive software implementations like those I intended to use for trading. While the Windows VPS commercial offering has adapted to offer solutions catering to what traders using MT4 need, the Linux VPS offering has been limited to offering what the web hosting community demands (which is what the Linux VPS are most often used for).
Since I was going to be paying about 300 USD a month in servers (to host all the accounts I wanted to trade), it became evident that a home solution might be cheaper and more suitable to my needs. Using our trading setups the RAM consumption per account is around 30-80 MB while the processing needs vary depending on the strategies used with most accounts consuming roughly less than 10% of an intel i7 processor when they are executed (roughly every 30 seconds). For the amount of accounts I want to trade an intel i7 processor (which is a quad core) with 8GB of RAM seemed ideal. I also decided to go with a solid state drive (100 GB) in order to have reliable storage. The computer is connected directly to my internet router using an ethernet cable (no wifi to increase reliability) and I have also added a 4G modem (about 30 USD/month) in order to provide internet access whenever my primary connection is down. The computer is also connected to a UPS (Universal Power Supply) that contains enough charge to allow for about 2 hours of sustained use if the power goes out. Electricity costs for this server setup should be about 25 USD/month where I live, so total costs are around 55 USD/month including the secondary internet option.
Regarding the operating system, I decided to setup Linux Mint instead of Ubuntu (to avoid some of Canonical’s bloatware), which provides a similar look-and-feel without some of the added unnecessary complexities of Ubuntu for the setup I wanted. I also decided to go with a desktop type distribution instead of a hard-core server distribution because I still want to be able to have a good level of regular user usability (like a user-interface, etc). The computer is connected to one of my screens and keyboard/mouse through a KVM (Keyboard-Video-Mouse switch), which allows me to access this computer whenever I want without having a completely separate setup. Installation of all my trading software went without any issues. I was able to compile F4 without any problems (as I have done on Ubuntu for a while) and launch the Asirikuy Trader program to connect with the Oanda trading servers via the Java API. I have also setup a BitTorrent Sync service so that I can backup everything during the week-end (clearly backups during the week aren’t ideal due to the constant log writing of the trading instances) and I have also added all my accounts to the system startup (via a simple script). After all this setup I still have a good chunk of my hard drive (+50%) free, so the 100GB choice was just right for what I wanted to achieve.
The above setup seems to be very robust. The Asirikuy Trader is a very slick console application that is only concerned with algorithmic execution (no bloatware like MT4 with its marketplace, charts, etc) so trading systems are ran in a much more efficient manner. The program is also executed within a bash shell loop, so any exceptions that may cause the program to crash are easily recovered from by simply launching the program again. The Asirikuy Trader also contains emailing functionality so I can easily receive emails in case of any failure or problem with any of the trading instances (like disconnections or other such problems). Right now I am testing demo implementations of all the setups I want to trade live in order to iron out any issues before moving into actual live trading. Up to now execution has been completely in-line with my expectations, finally giving me that professional trading setup feeling I had always been looking for – but never found – with Metatrader 4.
From this experience I have to say that the cost/control/reliability of a Linux trading server implementation can be just as good as that of a Linux VPS, provided that you care for things such as internet connection redundancy, backups and power redundancy. In the case of Windows VPS implementations this difference is not so strong because the Windows market has already adapted significantly to the needs of the Metatrader community (therefore providing good performance/price ratios for these needs) but in the Linux market I failed to find a powerful solution that offered me an acceptable performance to price ratio. Another thing worth considering is server latency, if you’re far away from the trading server and you’re trading systems that operate at a higher frequency then trading closer to the source (which an adequate VPS host can give you) might be completely worth the additional price to pay. In my case the savings are tremendous, from paying what would cost 300 USD/month I ended up paying significantly less than 100 USD. With the initial price of the computer setup (around 600 USD), the investment will be completely worth it after a few months. That said, I am happy to say that I am now MT4 free!
The truth is that a Windows/Linux VPS is not always worth it. Depending on the connection speed, power costs, redundant internet connection costs, computer costs, etc, a local solution might be much better than a remotely hosted solution. This might not be true when you consider the cheapest VPS solutions (like the horrible VPSLand) but trading from this type of hosting is completely crazy as their level of reliability is extremely low (see my open later to VPSLand). It is also true that if your power costs are high then a good Windows VPS (like with accuwebhosting) might make more sense. If you would like to learn more about trading outside of MT4 and how you too can build your own trading portfolio to trade from Linux please consider joining Asirikuy.com, a website filled with educational videos, trading systems, development and a sound, honest and transparent approach towards automated trading in general . I hope you enjoyed this article ! :o)