Credit card sized computers in trading: Trading Forex using the ODROID-XU4

On my first post about credit card sized computers and their use in trading we discussed the use of the ODROID-XU4 computer for back-testing purposes. I showed you how this little but powerful computer can do system simulations and can even do octa-core optimizations using OpenMP and the F4 framework from the Asirikuy community. Today we are going to take this little computer a step further and actually use it for the live trading of a strategy portfolio to see how it performs compared to an i7-4770K desktop processor. Through this post you will read about how I managed to live trade using this little computer and the advantages and disadvantages you face when trading using this type of computer platform.

rdesktop - 192.168.0.7_528

To do live trading on the ODROID-XU4 you need a platform that allows you to execute your trading system under linux and which is not limited to being built on x86/amd64 architectures but that can actually be built under the ARM architecture. To do this I used the Asirikuy F4 framework and the Asirikuy Trader software both which can be built and used under ARM. The F4 framework is C/C++ and can be built using gmake and the Asirikuy Trader is actually coded in python and therefore allows for even more transparent cross-platform usage. The Asirikuy Trader is able to execute trades through an Oanda demo/live account using their REST/Java implementations. I decided to use an Oanda demo account and tested both the REST and Java APIs to see which one would give better results.

For the actual trading setup I decided to use a 63 system machine learning portfolio which represents a quite processor-hungry setup that should take the ODROID to the limits of its IO and single core capabilities. The setup uses 63 strategies that trade using constantly retraining linear regression machine learning algorithms across two different pairs (USD/JPY and EUR/USD). The setup therefore demands that the ODROID execute a large amount of systems per pass and also makes the ODROID load a large amount of historical data per system call (these systems require more than 5000 1H bars to make the calculations they need to trade).

Setting up all the above was quite easy. Since I had already built the F4 framework for back-testing on the ODROID-XU4, it was simply a matter of installing the libraries needed by the Asirikuy Trader and getting this platform to launch. I did have a few issues with the jpype library (needed for the Oanda Java API) available in the ARM ubuntu repository as the setup using apt-get does not adequately configure the library. In the end to get it to work I had to properly define the JAVA_HOME and JVM_PATH environmental variables and download the jpype library from github (the one from sourceforge is very old and does not work). This now maintained jpype implementation provides several bug fixes and improvements over the much older 2009 release that many of us had to use up until now.

rdesktop - 192.168.0.7_535

Actual trading then went on quite well although the ODROID-XU4 is – as you would expect – much slower than the i7-4770K processor. The setup I have configured was executed on 25 seconds on the i7 while it took the ODROID-XU4 and excruciating 300 seconds to execute it. This means that the ODROID was at least 10 times worse than the i7 in the execution of this portfolio. However the reason is not the processor speed – as I thought at first – but actually the IO speed of the ODROID-XU4. Since I am using a class 10 micro SD card the ODROID-XU4 has a really pathetic IO compared to the SATA2 that the i7 can use to access the hard-drive. While data transfer rates are not that critical for back-testing (since everything that is needed is loaded to RAM before the testing starts), when live trading you must continuously read data from disk buffers and write data, especially considering the use of a virtual order wrapper necessary to trade complex strategies through Oanda accounts.

The above means that the performance of the ODROID-XU4 is really suboptimal when using a large number of systems and a micro SD card. When using low numbers of systems the ODROID-XU4 performs quite brilliantly and it actually performs only around 2 to 3 times worse than the i7 because when using low system numbers the main limitation is actually communication with the broker which basically takes just as long for the two setups since they are trading through the same network. Therefore if you’re trading accounts with low system numbers the ODROID-XU4 is a perfectly viable solution to replace a much more expensive and power hungry desktop solution.

Selection_536

If you want to trade large portfolios then you start facing significant problems due to the IO of the ODROID-XU4. In this case getting an eMMC card might bring a big boost in performance but in either case making use of a multi-core trading implementation that can do asynchronous execution of the different systems might also be the best thing to do (although with an SD you would remain hopelessly IO bound).  Either way the ODROID-XU4 does provide a viable alternative to a much more expensive desktop computer for live trading, this is especially relevant if your accounts are small and power consumption can eat into your profits or if you simply want to run tests on demo accounts without having to pay a lot on dedicated servers, power usage or virtual private servers.

If you would like to learn more about trading outside of Windows and how you too can code and build your systems to trade on a cross-platform programming framework through a direct broker interface with Oanda or Dukascopy please consider joining Asirikuy.com, a website filled with educational videos, trading systems, development and a sound, honest and transparent approach towards automated trading.

Print Friendly
You can leave a response, or trackback from your own site.

5 Responses to “Credit card sized computers in trading: Trading Forex using the ODROID-XU4”

  1. Kevin says:

    Hi Daniel,

    The 63 system setup takes 25 seconds to run on an i7. A recent post had a combination of a few thousand systems – how do you find sufficient computational power to run it?

    Thanks,
    Kevin

    • admin says:

      Hi Kevin,

      We have some alternative software implementations to run very large price action based system portfolios. Currently it takes us around 30 seconds to execute 2600 price action based systems on around 50 Oanda account simultaneously. Let me know if you have other questions,

      Best Regards,

      Daniel

  2. Vadim says:

    Hi Daniel,

    Actually, you can run x86 apps on ARM(including Odroid XU4) with ExaGear Desktop.
    In fact I know one guy who ran metatrader under ExaGear on Raspberry Pi 2 :)
    If you are interested ping me via email.

    • admin says:

      Hi Vadim,

      Thanks for posting. I know about that but it’s simply much slower than running native applications on the ARM processor. Since speed is so important for us for both back-testing and live trading using something like ExaGear is not an option (also unnecessary since we can compile everything to run on ARM natively). Running something like a 65 system portfolio using ExaGear and MT4 is simply not possible. Thanks again for posting :o)

      Best Regards,

      Daniel

Leave a Reply

Subscribe to RSS Feed Follow me on Twitter!