Shifting Timeframes in Deep Learning Algo Trading Model Production Processes

When creating Deep Learning Algo Trading systems based on history price data of a certain time period you can choose between several approaches to establish a model creation process:

  1. Splitting the complete history in exactly three sets (training, validation, test) and creating one model which you will use for your trading (Spoiler: Bad idea)
  2. Iterating over different timeframe sizes for the three datasets (training, validation, test) and this way only using a certain percentage of the available history to create exactly one model (as in 1.)
  3. Based on a fixed size of the three dataset timeframes (for training, validation, test) you create a shifting series of models and rate the series result instead of rating the result of a single model
  4. Based on a fixed size for the test dataset frame you create a series of models with variable training and validation dataset timeframe sizes. As size for the current training and test dataset timeframe size you select the training / validation timeframe combination with the highest validation-test result correlation in the previous period. The test dataset timeframe size defines the rhythm of model deployments.


Arbitrage bot between Metatrader and a FIX API broker

Now, that we know how to connect Metatrader to our node.js application and after we learned some basics of how to build a LMAX FIX API client the logical next step is to merge those two modules and build an arbitrage trading system. It’s nearly as simple as it sounds.

Long story short: I have done it. It does not work. The slippage of the Metatrader side will destroy every detected opportunity. Even with a LD4 Crossconnect to LMAX and with nearly every possible combination of MT4 Brokers and their different datacenters (which from my point of view are proxies that suggest a low latency).

Write me an email if you have further questions or would like to discuss this post.

Kind regards

Artur Brylka


Building a node.js implementation of a Forex FIX Protocol Client for LMAX – Part 1

For those who do not know what the FIX Protocol is: “The Financial Information eXchange (FIX) protocol is an electronic communications protocol initiated in 1992 for international real-time exchange of information related to the securities transactions and markets.” (Wikipedia).

Brokers, banks and many other players in the financial market use the fix protocol for financial communication. In the forex world – from the perspective of avergage guys like us – the FIX protocol is the pro version of Metatrader.

Advantages: Much smaller spreads, no technical limitation concerning the implementation, reliable connection latency (as the requests are not redirected), no “Last Look” (LMAX)

The combination of an extremley low latency (if you use a server with an interconnect to LMAX) and the missing “Last Look” for your opponent lead to a very low slippage.

Disadvantages: Usually the initial deposit is higher. (LMAX “Professional”: 10.000$/€)


Connect node.js to your MT4 Expert Advisor for a two-way realtime communication

You may think about the smartest, fastest and most reliable way to connect your node.js application with your Metatrader 4 instance. As I already went through the whole process of testing, approving and productive usage I will tell you the best way to connect MT4 to your node.js application.

As time is money I will start with the result without wasting your and my time telling you about the ways that did not work.


Liveconnect call for Applet ID 1 is not allowed in this JVM instance

Depending on how far you already went to update your applets  to JRE 7, Build 25+ you will discover problems accessing your applet’s methods via JavaScript, depending on your Java Security Settings:

If a signed applet can be accessed via JavaScript if you set Java’s Security Level to “Medium”, but not if you set it to “High”, but receive an error like:

Liveconnect call for Applet ID 1 is not allowed in this JVM instance+