Powerpoint Templates Page 1 Powerpoint Templates MATLAB 2011A SECRETS by Bryan Downing.

18
Powerpoint Templates Page 1 Powerpoint Templates MATLAB 2011A SECRETS by Bryan Downing

Transcript of Powerpoint Templates Page 1 Powerpoint Templates MATLAB 2011A SECRETS by Bryan Downing.

Page 1: Powerpoint Templates Page 1 Powerpoint Templates MATLAB 2011A SECRETS by Bryan Downing.

Powerpoint TemplatesPage 1

Powerpoint Templates

MATLAB 2011A SECRETS

by Bryan Downing

Page 2: Powerpoint Templates Page 1 Powerpoint Templates MATLAB 2011A SECRETS by Bryan Downing.

Powerpoint TemplatesPage 2

First Page :

1. Online business which focuses on building trading models for the finance industry. Revenue model is subscription based with additional potential auxiliary revenue.

2. Financial models are used to generate dozens of daily reports of high performing equities and other market securities to help traders, researchers, and analysts to optimize their trading decisions.

QUANTLABS.NET

Page 3: Powerpoint Templates Page 1 Powerpoint Templates MATLAB 2011A SECRETS by Bryan Downing.

Powerpoint TemplatesPage 3

Chosen Technologies: MATLAB

1. MATLAB is the investment community’s #1 commerical statistical tool for financial research, prototyping, etc..

2. Has excellent resources including online demos, documentation, and community support.

3. Enables you to quickly get experienced as compared to R or other similar tools.

4. Free MATLAB open source clones include Octave or SciLab but not extensible.

QUANTLABS.NET

Page 4: Powerpoint Templates Page 1 Powerpoint Templates MATLAB 2011A SECRETS by Bryan Downing.

Powerpoint TemplatesPage 4

Chosen Technologies: C++

1. C++ is the primary development programming language used for implementing re-coded models and strategies. It is commonly used to develop trading platforms as well.

2. C++ is fastest possible programming language as it gets applications closest to the target operating system. For example, there is no garbage collector as in Java.

3. C++ is very portable.

QUANTLABS.NET

Page 5: Powerpoint Templates Page 1 Powerpoint Templates MATLAB 2011A SECRETS by Bryan Downing.

Powerpoint TemplatesPage 5

Highlights :Disclaimer: Not teaching Matlab, C++, or C#.

1. MATLAB Coder Toolbox demo of HelloWorld.m script to C++

2. Import MATLAB HelloWorld Converted project into Visual Studio C++ Express and use it in a C# client application. Quick high light of use in Visual C++.

3. Discussion of a popular Open Source Trading platform in C#

4. List components of a C++ primitive trading platform.

5. MATLAB import of Yahoo Finance data6. Export MATLAB data into MYSQL

database.

QUANTLABS.NET

Page 6: Powerpoint Templates Page 1 Powerpoint Templates MATLAB 2011A SECRETS by Bryan Downing.

Powerpoint TemplatesPage 6

Helpful URLS :

1. YouTube Channel Video tutorials at www.Youtube.com/quantlabs

2. Online code samples and 600+ research white papers: www.quantlabs.net/labs

3. Daily blog updates: www.quantlabs.net/blog 4. PRIVATE Email 1000+ opt-in list.

Register at www.quantlabs.net5. Tech quant LinkedIn group:

http://www.linkedin.com/groups/Quant-Matlab-C-C-Java-3427378?goback=%2Egna_3427378

6. Toronto based Meetup group: www.Meetup.com/quant-finance

QUANTLABS.NET

Page 7: Powerpoint Templates Page 1 Powerpoint Templates MATLAB 2011A SECRETS by Bryan Downing.

Powerpoint TemplatesPage 7

MATLAB Coder Toolbox :

1. Could use MATLAB Builder JA toolbox for a Java or .NET assembler bridge. This does does not generate native code (e.g. Java) but enables you to access through a compiled MEX file.

2. MATLAB Coder Toolbox works as of MATLAB 2011A. Most expensive toolbox available at $6K.

3. Coder converts Matlab M File scripts (e.g.Model or Algorithm) into native C or C++.

4. Removes need of extra coding to manually convert MATLAB M file to C/C++. Saves times in optimizing C or C++ source files.

QUANTLABS.NET

Page 8: Powerpoint Templates Page 1 Powerpoint Templates MATLAB 2011A SECRETS by Bryan Downing.

Powerpoint TemplatesPage 8

DLL Creation and Use :

DEMO

Demo Matlab Coder Toolbox to generate C++ from HelloWorld.m

Coder GUI to openC:\matlab_m_scripts\coder_test

Untitled1.prj

Build conversion results in C:\matlab_m_scripts\coder_test\codegen\

lib\hello_world

QUANTLABS.NET

Page 9: Powerpoint Templates Page 1 Powerpoint Templates MATLAB 2011A SECRETS by Bryan Downing.

Powerpoint TemplatesPage 9

DLL Creation and Use :

1. Create Visual Studio 2010 C++ DLL solution.

2. Copy converted C++ code into project.3. Manipulate source code for

compatibility with Visual C++. 4. Build DLL or Static Library (LIB) for re-

use5. Create C# client application to access

DLL.6. There is a 3 part video series at

QuantLabs Youtube channel.

QUANTLABS.NET

Page 10: Powerpoint Templates Page 1 Powerpoint Templates MATLAB 2011A SECRETS by Bryan Downing.

Powerpoint TemplatesPage 10

DLL Creation and Use :

DEMO C:\Users\ratman\Documents\Visual Studio

2010\Projects

HelloWorldMatlab C++ sln HelloWorldMgdDLLC++ slnHelloWorldClientCS C# sln

QUANTLABS.NET

Page 11: Powerpoint Templates Page 1 Powerpoint Templates MATLAB 2011A SECRETS by Bryan Downing.

Powerpoint TemplatesPage 11

DLL Resuse in Visual C++:

1. Following instructions at: Walkthrough: Creating and Using a Dynamic Link Library (C++) at http://msdn.microsoft.com/en-us/library/ms235636.aspx

2. static __declspec(dllexport) modifier exports in DLL to be used by other C++ client applications.

3. Integrate converted code into above example Visual Studio solution.

QUANTLABS.NET

Page 12: Powerpoint Templates Page 1 Powerpoint Templates MATLAB 2011A SECRETS by Bryan Downing.

Powerpoint TemplatesPage 12

DLL Creation and Use :

DEMO

Matlab converted code from:C:\Users\ratman\Documents\Visual Studio

2010\Projects\ShrinkageDynamicLibrary\Shrinkage -

c++

C:\Users\ratman\Documents\Visual Studio 2010\Projects\

ShrinkageDynamicLibrary

ShrinkageDynamic Library C++ sln

QUANTLABS.NET

Page 13: Powerpoint Templates Page 1 Powerpoint Templates MATLAB 2011A SECRETS by Bryan Downing.

Powerpoint TemplatesPage 13

Potential Trading Broker:

1. LMAX is established in 2010 out of London UK.

2. Legitimate with British Financial Services Authority regulation and Goldman Sachs ownership of 12.5%

3. Supports API trading through FIX with .NET, and Java support.

4. No minumum deposit or access fees to market multi second tick data.

5. Trade CFD and Forex. 6. Canadians can use LMAX.

QUANTLABS.NET

Page 14: Powerpoint Templates Page 1 Powerpoint Templates MATLAB 2011A SECRETS by Bryan Downing.

Powerpoint TemplatesPage 14

Trading Platforms:

1. Suggested Open source trading platform is TRADELINK. http://code.google.com/p/tradelink/

2. Developed in C# and completely free with source code. Used by established hedge funds and prop shops. Over 18000 downloads.

3. Connects to multiple brokers but does include Interactive Brokers.

4. Has decent documentation and community support. There are frequent updates after bugs are reported.

5. Various components for tick capture, easily converted DLL implementation, & other supporting various applications.

6. Various affordable support at http://www.pracplay.com/buy

QUANTLABS.NET

Page 15: Powerpoint Templates Page 1 Powerpoint Templates MATLAB 2011A SECRETS by Bryan Downing.

Powerpoint TemplatesPage 15

Proposed C++ PRIMITIVETrading Platform Components:1. Will be built in C++ for speed,

portability, and potential HFT scaling capabilities.

2. Capable to plug in to LMAX as trading broker for CFDs and Forex API execuction.

3. Multiple listeners to LMAX tick data of chosen currency pairs.

4. Use OTL 4 library to connect to MYSQL table for historical tick data.

5. Use TA-Lib library for forex strategy development

6. Use QuantLib library for mature quant finance modelling needs

7. Import custom Matlab Coder DLLs as shown.

QUANTLABS.NET

Page 16: Powerpoint Templates Page 1 Powerpoint Templates MATLAB 2011A SECRETS by Bryan Downing.

Powerpoint TemplatesPage 16

Proposed C++ PRIMITIVETrading Platform Components:

OTL 4 DEMO

Need to Install MYSQL Connector DSN!http://www.geeksengine.com/article/mysql-odbc.html

otl4 C++ sln

QUANTLABS.NET

Page 17: Powerpoint Templates Page 1 Powerpoint Templates MATLAB 2011A SECRETS by Bryan Downing.

Powerpoint TemplatesPage 17

MATLAB Yahoo Finance Data Capture with MYSQL:

1. Need Data Capture Toolbox for example MATLAB interaction: y = yahoo; FastFood = fetch(y, {'ko', 'pep', 'mcd'},'Last') FastFood = Last: [3x1 double] FastFood.Last ans = 42.96 45.71 23.70

2. Alternative for Yahoo data capture at http://luminouslogic.com/how-to-download-historical-stock-data-into-matlab.htm

3. Get detailed Yahoo download data info http://www.gummy-stuff.org/Yahoo-data.htm

4. Demo with MYSQL at: http://www.youtube.com/watch?v=5QNyOe79l-sQUANTLABS.NET

Page 18: Powerpoint Templates Page 1 Powerpoint Templates MATLAB 2011A SECRETS by Bryan Downing.

Powerpoint TemplatesPage 18

MATLAB Yahoo Finance Data Capture:

DEMO

C:\matlab_m_scripts\db\mysqltest.m

QUANTLABS.NET