How to build high frequency trading with our matlab secrets with c++ and mysql


Published on

How to build high frequency trading with our matlab secrets with c++ and mysql
This is our highly secretive document on how to use Matlab to build an HFT platform with C++ and MYSQL

Published in: Economy & Finance
  • You can claim over 6,000,000 a year for yourself RIGHT NOW. Here's how to do it: TRY NOW
    Are you sure you want to  Yes  No
    Your message goes here
  • I am using ANDY LANK TOOLS since 3 weeks and i am getting good profit.
    Are you sure you want to  Yes  No
    Your message goes here
  • Never used go lang. I am now using c# since it is easier to use as compared to c++
    Are you sure you want to  Yes  No
    Your message goes here
  • You obviously know your stuff. I am a Javascript/NodeJS developer and am interested in learning another language which would play nicely.

    What do you think of And of that, everyone suggests C/C++ for trading but I don't think success is the more apparent option.

    Thank you for posting this.
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

How to build high frequency trading with our matlab secrets with c++ and mysql

  1. 1. MATLAB 2011A SECRETS by Bryan Downing Powerpoint Templates Page 1
  2. 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. Powerpoint Templates QUANTLABS.NET Page 2
  3. 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. Powerpoint Templates QUANTLABS.NET Page 3
  4. 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. Powerpoint Templates QUANTLABS.NET Page 4
  5. 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. Powerpoint TemplatesQUANTLABS.NET Page 5
  6. 6. Helpful URLS :1. YouTube Channel Video tutorials at Online code samples and 600+ research white papers: Daily blog updates: PRIVATE Email 1000+ opt-in list. Register at www.quantlabs.net5. Tech quant LinkedIn group: 3427378?goback=%2Egna_34273786. Toronto based Meetup group: Powerpoint Templates QUANTLABS.NET Page 6
  7. 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. Powerpoint Templates QUANTLABS.NET Page 7
  8. 8. DLL Creation and Use : DEMODemo Matlab Coder Toolbox to generate C++ from HelloWorld.m Coder GUI to open C:matlab_m_scriptscoder_test Untitled1.prj Build conversion results inC:matlab_m_scriptscoder_testcodegenlibhell o_world Powerpoint Templates QUANTLABS.NET Page 8
  9. 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. Powerpoint Templates QUANTLABS.NET Page 9
  10. 10. DLL Creation and Use : DEMOC:UsersratmanDocumentsVisual Studio 2010Projects HelloWorldMatlab C++ sln HelloWorldMgdDLLC++ sln HelloWorldClientCS C# sln Powerpoint Templates QUANTLABS.NET Page 10
  11. 11. DLL Resuse in Visual C++:1. Following instructions at: Walkthrough: Creating and Using a Dynamic Link Library (C+ +) at us/library/ms235636.aspx2. 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. Powerpoint Templates QUANTLABS.NET Page 11
  12. 12. DLL Creation and Use : DEMO Matlab converted code from: C:UsersratmanDocumentsVisual Studio 2010ProjectsShrinkageDynamicLibraryShri nkage - c++ C:UsersratmanDocumentsVisual Studio 2010ProjectsShrinkageDynamicLibrary ShrinkageDynamic Library C++ sln Powerpoint Templates QUANTLABS.NET Page 12
  13. 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. Powerpoint Templates QUANTLABS.NET Page 13
  14. 14. Trading Platforms:1. Suggested Open source trading platform is TRADELINK. 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 Powerpoint Templates QUANTLABS.NET Page 14
  15. 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 development6. Use QuantLib library for mature quant finance modelling needs7. Import custom Matlab Coder DLLs as shown. Powerpoint Templates QUANTLABS.NET Page 15
  16. 16. Proposed C++ PRIMITIVETrading Platform Components: OTL 4 DEMO Need to Install MYSQL Connector DSN! otl4 C++ sln Powerpoint Templates QUANTLABS.NET Page 16
  17. 17. MATLAB Yahoo FinanceData 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.702. Alternative for Yahoo data capture at historical-stock-data-into-matlab.htm3. Get detailed Yahoo download data info Demo with MYSQL at: Powerpoint Templates QUANTLABS.NET Page 17
  18. 18. MATLAB Yahoo FinanceData Capture: DEMO C:matlab_m_scriptsdbmysqltest.m Powerpoint Templates QUANTLABS.NET Page 18