Algorithmic Trading with MATLAB Martin Demel, Application Engineer

Similar documents
How To Build A Trading Engine In A Microsoft Microsoft Matlab (A Trading Engine)

Credit Risk Modeling with MATLAB

Turning Data into Actionable Insights: Predictive Analytics with MATLAB WHITE PAPER

Deploying MATLAB -based Applications David Willingham Senior Application Engineer

Introduction to MATLAB for Data Analysis and Visualization

Data Analysis with MATLAB The MathWorks, Inc. 1

Introduction to MATLAB Gergely Somlay Application Engineer

MATLAB in Business Critical Applications Arvind Hosagrahara Principal Technical Consultant

MathWorks Products and Prices North America Academic March 2013

Origins, Evolution, and Future Directions of MATLAB Loren Shure

From Raw Data to. Actionable Insights with. MATLAB Analytics. Learn more. Develop predictive models. 1Access and explore data

Microsoft High-Performance Computing Capital Markets Survey

MATLAB for Use in Finance Portfolio Optimization (Mean Variance, CVaR & MAD) Market, Credit, Counterparty Risk Analysis and beyond

Fraud Detection with MATLAB Ian McKenna, Ph.D.

SOLUTION BRIEF. TIBCO StreamBase for Foreign Exchange

SOLUTION BRIEF. TIBCO StreamBase for Algorithmic Trading

Speeding up MATLAB and Simulink Applications

Parallel Computing with MATLAB

MATLAB in Production Systems, Database Integration, and Big Data Eugene McGoldrick

Elastic Application Platform for Market Data Real-Time Analytics. for E-Commerce

Echtzeittesten mit MathWorks leicht gemacht Simulink Real-Time Tobias Kuschmider Applikationsingenieur

PERFORMANCE STABILITY CONNECTIVITY TIME TO MARKET. A Bloomberg offering

What s New in MATLAB and Simulink

The Future of Algorithmic Trading

Market Trends in Finance & Technology / An Open Platform for Business Growth

Real-time trading in MATLAB

Titolo del paragrafo. Titolo del documento - Sottotitolo documento The Benefits of Pushing Real-Time Market Data via a Web Infrastructure

TRADING STRATEGIES Urs Rutschmann, COO Tbricks

WHITE PAPER. Modelling the Way

White Paper Electronic Trading- Algorithmic & High Frequency Trading. PENINSULA STRATEGY, Namir Hamid

Machine Learning with MATLAB David Willingham Application Engineer

21 Ways to Use Spreadsheets in Your Java Applications

How to incorporate high frequency trading into your business model? Peter van Kleef

Radar Live. A new era in real-time price delivery

IBM: An Early Leader across the Big Data Security Analytics Continuum Date: June 2013 Author: Jon Oltsik, Senior Principal Analyst

For more than 35 years the world s investment professionals have trusted FactSet to power their research, analytics, and data integration.

THE ADVANTAGES OF CLOUD BASED TECHNOLOGY FOR HEDGE FUNDS

Numerical Methods in MATLAB

SpreadSheet Inside. Xenomorph White Paper. Spreadsheet flexibility, database consistency

Medusa. A new alternative.

MARKETMAP Innovative, global, cost-effective market data

Harnessing the power of advanced analytics with IBM Netezza

WHITE PAPER. Harnessing the Power of Advanced Analytics How an appliance approach simplifies the use of advanced analytics

Lab 4: 26 th March Exercise 1: Evolutionary algorithms

Outils pour l'analyse prédictive parallèle de multiples sources de données non structurées

Intraday FX Trading: An Evolutionary Reinforcement Learning Approach

Symantec Global Intelligence Network 2.0 Architecture: Staying Ahead of the Evolving Threat Landscape

Bring your data to life with Microsoft Power BI. Peter Myers Bitwise Solutions

Entwicklung und Testen von Robotischen Anwendungen mit MATLAB und Simulink Maximilian Apfelbeck, MathWorks

How To Use Mts Bondspro From A Computer To A Trading System

X_TRADER 7. The World's Most Powerful Trading Tool

How To Handle Big Data With A Data Scientist

Results of the GECCO 2011 Industrial Challenge: Optimizing Foreign Exchange Trading Strategies

Welcome to the second half ofour orientation on Spotfire Administration.

OVERVIEW HIGHLIGHTS. Exsys Corvid Datasheet 1

A Generic Business Logic for Energy Optimization Models

The SAMANTA platform. Emeritus Expert SNECMA. Department Prognostic Health Monitoring Systems SNECMA

Microsoft Power BI. Nov 21, 2015

QL Integration into Scala and Excel. Martin Dietrich

IBM Software Enabling business agility through real-time process visibility

Find the Hidden Signal in Market Data Noise

Development Testing for Agile Environments

NetDania. Platforms and Services by. NetStation The flexible and feature-rich cloud trading platform

Overview. Integrated Front-mid-back office as well as standalone Front office or Back-office solution or Trading Channels

Design of an FX trading system using Adaptive Reinforcement Learning

ni.com/vision NI Vision

Java TM WorkShop TM and Beyond. Joe Keller Director of Marketing SunSoft Developer Products

Insurance Fraud Detection System

Keywords revenue management, yield management, genetic algorithm, airline reservation

APT Integrated risk management for the buy-side

IBM BPM Solutions Addressing the Enterprise Business Process Management

White Paper Customer Preference Management (CPM) for Utilities Industry using SAP CR&B. Contents.

Managing Big Data with Hadoop & Vertica. A look at integration between the Cloudera distribution for Hadoop and the Vertica Analytic Database

VMware vcenter Log Insight Delivers Immediate Value to IT Operations. The Value of VMware vcenter Log Insight : The Customer Perspective

ORACLE UTILITIES ANALYTICS

Pentaho Data Mining Last Modified on January 22, 2007

StreamBase White Paper StreamBase versus Native Threading. By Richard Tibbetts Co-Founder and Chief Technology Officer, StreamBase Systems, Inc.

IBM Global Services September Reducing IT support costs through automated electronic end-user support.

Data Integration Models for Operational Data Warehousing

Cisco TelePresence Management Suite

Cisco TelePresence Management Suite

Parallels VDI Solution

KnowledgeSTUDIO HIGH-PERFORMANCE PREDICTIVE ANALYTICS USING ADVANCED MODELING TECHNIQUES

TURNING INSIGHT INTO FORESIGHT: USING PREDICTIVE SIMULATION TO CREATE BUSINESS ADVANTAGE

Planning and Deploying a Disaster Recovery Solution

STATISTICA Solutions for Financial Risk Management Management and Validated Compliance Solutions for the Banking Industry (Basel II)

Abdullah Mohammed Abdullah Khamis

A Robust Method for Solving Transcendental Equations

Ulrich A. Muller UAM June 28, 1995

Valuation, Model and Data Risk Management

How To Build A Data Hub For A Bank

Programming models for heterogeneous computing. Manuel Ujaldón Nvidia CUDA Fellow and A/Prof. Computer Architecture Department University of Malaga

BUILT FOR THE SPEED OF BUSINESS. Copyright 2013 Pivotal. All rights reserved.

Velocimetrics for Post-Trade Processing

MATLAB as a Collaboration Platform Marta Wilczkowiak Senior Applications Engineer MathWorks

TIBCO Live Datamart: Push-Based Real-Time Analytics

TimeScapeTM EDM + The foundation for your decisions. Risk Management. Competitive Pressures. Regulatory Compliance. Cost Control

Market Data Feed. Go with the flow.

Overview. Swarms in nature. Fish, birds, ants, termites, Introduction to swarm intelligence principles Particle Swarm Optimization (PSO)

Transcription:

Algorithmic Trading with MATLAB Martin Demel, Application Engineer 2011 The MathWorks, Inc. 1

Agenda Introducing MathWorks Introducting MATLAB (Portfolio Optimization Example) Introducting Algorithmic Trading with MATLAB Break Credit Risk Modeling with MATLAB Risk Management using various VaR computation methods Overview of derivatives pricing capabilities and further financial computing products Q&A 2

RWE Develops and Deploys an Automated System for Natural Gas and Power Trading and Risk Management Challenge Automate business processes for quoting gas contracts and hedging against price fluctuations Solution Engage MathWorks Consulting to develop and deploy to a production environment an automated pricing and risk management system that fits within the company s existing IT infrastructure Results Models created in minutes, not weeks 100% accurate results delivered Technical expertise applied to core business goals Link to user story MathWorks consultants were wellqualified, professional, and fast. They understood not only the technical issues but also the business goals, which is essential when working on a core business system. We got more than we expected from MathWorks Consulting. RWE headquarters in Essen. Dr. Norbert Tönder RWE 3

Challenges when building trading strategies Increasing complexity More data More complicated models Increasing computational speed Push to higher frequency Long deployment cycle (Re)coding is costly and error-prone 4

Agenda Introduction: Algorithmic trading Developing an automated trading decision engine Identify a successful trading rule Extend trading rule set Automate trading rule selection Implementing MATLAB into your production trading environment Wrap up and Q&A 5

The problem at hand: Identifying profitable trading strategies Commodities analyst Developing a trading strategy Multiple trading rules High frequency Management requirements: Tested on historical data Uses sophisticated analytics to identify optimal trading rule combination Integrates with existing data and execution APIs 6

Trading decision engine Development and testing Historical Data End of Day / Intraday Files Databases Strategy Modeling Research / Algorithms Model Development Calibration Back Testing Profit / Loss Risk Exposure Implementation Live Data Real-Time Feeds Event-Based Decision Engine Models Trading Rules Execution Broker API Order Routing 7

Requirements for the trading engine Sophisticated analytics Custom rules & indicators Non-traditional techniques Scalable speed Higher frequency data More trading rules Quick to develop and deploy Try different strategies Embed in trading engine 8

Trading decision engine Goal: Task 1: Build a back testing environment around historical data and a preliminary trading rule Task 2: Move to a higher frequency (minute-by-minute) and re-calibrate the model Task 3: Develop a rule selection system for instruments using evolutionary learning Development and testing Historical Data End of Day / Intraday Files Databases Strategy Modeling Research / Algorithms Model Development Calibration Back Testing Profit / Loss Risk Exposure Implementation Live Data Real-Time Feeds Event-Based Decision Engine Models Trading Rules Execution Broker API Order Routing 9

Task 1: Develop a back testing environment Goal: Build a back testing environment around historical data and a preliminary trading rule Development and testing Historical Data End of Day / Intraday Files Databases Strategy Modeling Research / Algorithms Model Development Calibration Back Testing Profit / Loss Risk Exposure Implementation Live Data Real-Time Feeds Event-Based Decision Engine Models Trading Rules Execution Broker API Order Routing 10

Task 1: Develop a back testing environment Key tasks Import data from files 0.8 Max Sharpe Ratio 0.758 for Lead 17 and Lag 120 Create a preliminary rule 0.6 0.4 0.6 Test the rule s performance 0.2 0 0.4-0.2 0.2-0.4 Solutions MATLAB data tools -0.6-0.8 0 20 40 60 0-0.2-0.4 High-level programming and pre-built functions 80 100 120 0 20 40 60 80 100 120-0.6 Powerful graphics environment 11

Task 2: Expand the scale of the engine Goal: Move to a higher frequency (minute-by-minute) and re-calibrate the model Development and testing Historical Data End of Day / Intraday Files Databases Strategy Modeling Research / Algorithms Model Development Calibration Back Testing Profit / Loss Risk Exposure Implementation Live Data Real-Time Feeds Event-Based Decision Engine Models Trading Rules Execution Broker API Order Routing 12

Task 2: Expand the scale of the engine Key tasks Importing data from databases Increase computational speed Solutions MATLAB data tools: Database Toolbox High-performance computing: Parallel Computing Toolbox, MATLAB Distributed Computing Server 13

Task 3: Rule selection engine Goal: Develop a rule selection system for instruments using evolutionary learning Development and testing Historical Data End of Day / Intraday Files Databases Strategy Modeling Research / Algorithms Model Development Calibration Back Testing Profit / Loss Risk Exposure Implementation Live Data Real-Time Feeds Event-Based Decision Engine Models Trading Rules Execution Broker API Order Routing 14

Task 3: Rule selection engine Key tasks Increase number of rules Incorporate advanced analytics to select best combination 15

Working with multiple strategies Should I trade? Signal 1 AND OR Signal 2 AND OR Signal 3 Yes Yes No Dempster et. al., Computational learning techniques for intraday fx trading using popular technical indicators, IEEE Transactions on Neural Networks (2001). 16

Signal 1 Signal 2 Signal 3 Working with multiple strategies Represent different combinations as bit strings Signal 1 AND Signal 2 OR Signal 3 1 0 0 1 0 1 1 1 1 1 AND OR Signals Active? 17

Building Custom Evolution Algorithms Selection Retain the best performing bit strings from one generation to the next. Favor these for reproduction Crossover parent1 = [ 1 0 1 0 0 1 1 0 0 0 ] parent2 = [ 1 0 0 1 0 0 1 0 1 0 ] child = [ 1 0 0 0 0 1 1 0 1 0 ] Mutation parent = [ 1 0 1 0 0 1 1 0 0 0 ] child = [ 0 1 0 1 0 1 0 0 0 1 ] 18

Price (USD) Price (USD) Task 3: Rule selection engine Key tasks Increase number of rules Incorporate advanced analytics to select best combination Solutions High-level programming MATLAB Toolboxes: Global Optimization, 150 100 50 0 200 150 100 Evolutionary Learning Results, Sharpe Ratio = 2.38 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000 Final Return = 239 (249%) Position Cumulative Return 50 0 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000 Serial time number 19

Agenda Introduction: Algorithmic trading Developing an automated trading decision engine Identify a successful trading rule Extend trading rule set Automate trading rule selection Implementing MATLAB into your production trading environment Wrap up and Q&A 20

Implementing the Decision Engine Goal: Evaluate and test the decision engine with real-time feeds and execution through a messaging bus Development and testing Historical Data End of Day / Intraday Files Databases Strategy Modeling Research / Algorithms Model Development Calibration Back Testing Profit / Loss Risk Exposure Implementation Live Data Real-Time Feeds Event-Based Decision Engine Models Trading Rules Execution Broker API Order Routing 21

Key Tasks Key tasks Read live market data from data feed Connect to trading engine Solutions Datafeed Toolbox Many external APIs.NET, Java, C/C++, etc. 3 rd party APIs 22

Deploying Applications with MATLAB Give MATLAB code to other users MATLAB Compiler Share applications with end users who do not need MATLAB Stand-alone executables Shared libraries.exe.dll MATLAB Builder EX Excel MATLAB Builder JA Java Web MATLAB Builder NE COM.NET Software components 23

Review: Requirements for the trading engine Sophisticated analytics Custom rules & indicators Non-traditional techniques Scalable speed Higher frequency data More trading rules Quick to develop and deploy Try different strategies Embed in trading engine 24

MATLAB s solutions Sophisticated analytics Advanced graphics environment Toolboxes give access to hundreds of new techniques Flexible and customizable Scalable speed Parallel computing solution Quick to develop and deploy High-level programming Automated deployment 25