Wednesday, November 30, 2016

Testing and Analysis of Algorithmic Trading Strategies in MATLAB (Part 2) – Easy-to-use GUI

In this post, in continuation of Part 1, I will try to describe the most common problems which occur while testing algorithmic trading strategies in MATLAB when using one's own groundwork or the code from the automated trading webinars.

Easy-to-use GUI

Let's start with the fact that there is no graphical interface because if we presume that almost the whole process of testing and analysing trading strategies is standardised (it is 99%), you would like to have the interface which helps you call up the necessary data and start the testing process with one click.

Someone (experienced users of MATLAB, in particular), might argue that the use of ready-made functions is not any worse and actually is even sometimes better and more convenient that the static GUI. It's possible, but a GUI however has a number of advantages:

  1. For new (and not only) users of MATLAB it is much more convenient to use a GUI with buttons and entry fields than to search in the code; therefore, there is a GUI even in the MathWorks Toolboxes in most cases because it is more convenient. 
  2. It allows focusing only on the code of your strategy because use of a GUI does not at all imply that it somehow limits your ability to write a strategy.

Thus, in WFAToolbox, we created a possibility to write any codes for your strategy, using any of MATLAB toolboxes and working with multiple assets for the strategies such as pairs trading, basket trading or triplet arbitrage, etc.; but at the same time this code is easily integrated in the GUI by use of patterns, which are simple enough to apply in the code and they do not limit opportunities.

In order to easily master the patterns of code to create your strategies, not only we created detailed WFAToolbox Documentation, but also WFAToolbox Video Tutorial, which provides an opportunity to a full-scale work with the app in a few minutes.

Easy to use GUI of WFAToolbox - Walk-Forward Analysis Toolbox for MATLAB
Easy-to-use GUI of WFAToolbox

Tuesday, November 29, 2016

Testing and Analysis of Algorithmic Trading Strategies in MATLAB (Part 1) - Introduction

Hello, my name is Igor Volkov, I have been developing algorithmic trading strategies since 2006 and have worked in several hedge funds. In this article, I would like to discuss difficulties arising on the way of MATLAB trading strategies developer during testing and analysis, as well as to offer possible solutions.

I have been using MATLAB for testing of algorithm strategies since 2007 and I have come to conclusion that this is not only the most convenient research tool, but also the most powerful one because it makes possible using of complex statistical and econometric models, neural networks, machine learning, digital filters, fuzzy logic, etc by adding toolbox. The MATLAB language is quite simple and well documented, so even a non-programmer (like me) can master it.

How It All Started...

It was 2008 (if I am not mistaken) when the first webinar on algorithmic trading in MATLAB with Ali Kazaam was released, covering the topic of optimising simple strategies based on technical indicators, etc. in spite of a rather “chaotic” code, tools were interesting enough to use. They served as a starting point for research and enhancement of a testing and analysis model which would allow to use all the power of toolboxes and freedom of MATLAB actions during creation of one's own trade strategies, at the same time it would allow to control the process of testing and the obtained data and their subsequent analysis would choose effective portfolio of robust trading systems.

Subsequently, Mathworks webinars have been updated every year and gradually introduced more and more interesting elements. Thus, the first webinar on pairs trading (statistical arbitrage) using the Econometric Toolbox was held in 2010, although the Toolbox of testing and analysis remained the same.

In 2013, Trading Toolbox from Mathworks appeared which allowed to connect MATLAB to different brokers for execution of their applications. Although there were automatic solutions for execution of the transactions, from that point MATLAB could be considered a system for developing trading strategies with a full cycle: from data loading to the execution of automated trading strategies.

Why Should Every Algotrader Reinvent the Wheel?

However, Mathworks has not offered a complete solution for testing and analysis of the strategies – those codes that you could get out of webinars were the only "elements" of a full system test, and it was necessary to modify them, customise them, and add them to the GUI for ease of use. It was very time consuming, thus posing a question: whatever the strategy was, it must go through the same process of testing and analysis, which would allow it to be classified as stable and usable – so why should every algotrader reinvent the wheel and write his/her own code for proper testing strategies in MATLAB?

So the decision was made to create a product that would allow to perform the whole process associated with the testing and analysis of algorithmic trading strategies using a simple and user-friendly interface. 
WFAToolbox - Walk-Forward Analysis Toolbox for MATLAB®

We decided to call the solution WFAToolbox - Walk-Forward Analysis Toolbox which demo version has been available on since 2013.

Monday, November 7, 2016

Whoa?! What happened with the blog?


My name is Igor Volkov and I'm the founder and developer of WFAToolbox - Walk-Forward Analysis Toolbox for MATLAB. WFAToolbox is an add-on that is aimed to ease the life of MATLAB users, who develop their own algorithmic trading strategies. This add-on has lots of benefits that are too many to enumerate here, but I will suggest you try it now by downloading its demo version from our official website:

WFAToolbox - Walk-Forward Analysis Toolbox for MATLAB (Algorithmic Trading)
WFAToolbox - Walk-Forward Analysis Toolbox for MATLAB

First of all, I would like to answer the following questions:

What happened with the blog?

1. Jev Kuznetsov is not the owner anymore

The blog was purchased from our friend, Jev Kuznetsov, who has moved to his other blog He concluded that Python is better than MATLAB for trading, which I considered to be false. MATLAB remains one of the best software in the world for algorithmic trading purposes IMHO (I have some facts about this though for future discussion).

2. We have changed the brand

From this moment the blog will be called MatlabTrading, which is much more understandable regarding the topics it will include. Furthermore, the domain name has been changed to instead of the initial, although the old domain is still working redirecting from the primary domain name.

What will happen to the blog?

1. More posts and articles

We hope to bring life to this blog by posting relevant contents once or twice a week. In the first few months, we will post mostly those articles and videos that we already have to make it easier for our dear readers to search for information on one resource and have crosslink on them.

Then we have plans to write posts about practical aspects of algorithmic trading in MATLAB. How to create modern automatic trading strategies such as:

  • Statistical arbitrage pairs trading / mean reversion / market neutral trading strategies based on cointegration / bollinger bands / kalman filter etc for commodities, stocks and Forex.
  • Trend following strategies with Jurik Moving Average and other sophisticated digital filters;
  • Forecasting strategies with machine learning (Support Vector Machines) and other methods;
  • Creating robust trading strategies using visual walk-forward testing money management for reinvesting your capital (science on how to get $1M from $10K in a year with maximum, but estimated risk and sweat rewards). Maybe after reading this you've thought this is going to be another dumb article for those poor guys seeking how to become rich through "trading on forex" and all that. Well, that is totally false! We are working in MATLAB, and majority of us are scientists and experts in that aspect so everything is serious.

2. More interactivity

I will be happy if we can all relate through comments in posts. Subscribe to our news to get alerted about the newest posts and events. Later on, we have plans to make Google Hangouts webinars. Don't miss it, click on "Follow" button at the upper right corner to join our community.

What would you like to read in our blog posts? What topics can you suggest? Please write here in comments.