Transcript

PROGRAMMING LANGUAGESFOR WHEN USING QUANT ANALYSIS FOR HIGH FREQUENCY TRADING

COVERING FOR BEST TRADING USES

• Notes

• Prototyping research and interpretive scripting languages

• Legacy compiled languages

• Why MATLAB is special

• CRITICAL Factors to consider for live trading

NOTES

• No comments on database or other coding applications

MODEL IDEA RESEARCH PROTOTYPING LANGUAGES

• R

• PYTHON

• MATLAB (left to end of presentation)

SCRIPTING AND INTERPRETIVE LANGUAGES: R

• Splintering into two versions of 2.15 and 3.xx?

• R packages are not compatible with each path so not future proof

• R packages can be broken for months with potential NO fix

• Transforming between data type for compatibility with other packages limits performance and simplicity of code

SCRIPTING AND INTERPRETIVE LANGUAGES: R

• Rstudio excellent IDE for self contained scripts but cannot extend

• Rjava and Rcaller seems to be riddled with complexity

• No order management

• Painfully slow but have fun

SCRIPTING AND INTERPRETIVE LANGUAGES: PYTHON

• Splintering into two versions of 2.7 and 3.xx? Splintering

• Too many options with IDEs which confuses with no standard

• Data packages stand outs like Pandas or Numpy

• S-l-o-w: No matter how they speed it up, still cryptic and painful

• Matlab 2015b and Visual Studio 2015 natively call it

• How to easily extend into a live trading app built in C++ or Java?

• Limited order management capability with no direct support for standard Interactive Brokers API

LEGACY LANGUAGES FOR LIVE OR PRODUCTION TRADING

• Java

• C#/.NET

• C/C++

LEGACY LANGUAGES FOR LIVE TRADING: JAVA

• Over engineered frameworks which become heavy and complex

• Write once deploy anywhere

• For ultra lowest frequency, many need to hack JVM for optimal performance

• GUI based is highly limited pretty well only on Java FX

• Performance out of box is peppy

• Extending into other languages can be limited

• New to programming? 2nd language of choice to learn from nothing

• Performance COULD be limited by garbage collection

LEGACY LANGUAGES FOR LIVE TRADING: .NET/C#

• Best language to start with for Newbies since it is easy to grasp

• Visual Studio best IDE hands down

• Limited since you can run only on Windows exclusively for optimal performance

• GUI library choices is best for charting or front end design

• Advanced techniques do exist thanks to Microsoft Research

• Integrates nicely with C++ back end DLLs

• Multiple database integration

• Performance COULD be limited by garbage collection but optimal performance options available

LEGACY LANGUAGES FOR LIVE TRADING: C/C++

• Complex but highly adaptable language

• Most optimal performing language for speed and memory management with no garbage collection

• Defacto language for both quant analysis and high frequency trading

• High end/High speed Institutional systems are Deployed on Linux with optimal integration with Kernel customization or hardware deployment (i.e. FPGA)

MATLAB IS UNIVERSAL WITH PROTOTYPING, SCRIPTING, AND EXTENDING TO LEGACY LANGUAGES

• All newbies should embrace this platform

• Powerful toolboxes to cover all universal needs of all aspects of trading including data acquisition, analysis, and extending for order management

• Ability to code generate certain toolboxes to C or C++ with strict compliance

• Ability to extend ANY M script to be directly called from Python, C++, C, Java, .NET, and even Excel addins

MATLAB IS UNIVERSAL WITH PROTOTYPING, SCRIPTING, AND EXENDING TO LEGACY LANGUAGES (CONT’D)

• Prototyping for research can access any Java, .NET, or Python component

• Advanced trendy support of machine language, quant, advance math support, etc

• Ability to embed scripts into a high performing web server (i.e. Matlab Production Server) which can be even run in a co-located on a trading exchange

• Visually design trading models with Simulink and Stateflow with code generation to C+, C, or even FPGA for ultra lowest latency (think HFT)

• Mupad used to verify any scientific notation equation

• Home Edition makes Matlab affordable

CRITICAL FACTORS FOR LIVE TRADING

• Your broker will limit you e.g. Interactive Brokers API is layered of confusion so I use TWSLink2 which is Windows only

• Data provider also limits but my choice of IQFeed works on Windows but can work within Linux using WINE

• Would prefer Linux since it is more lightweight and more control of experience

• Can move to pure Linux but trading account needs be significant for advanced broker options (i.e. >$500k for Lime etc)

• ATT NEWBIES: Windows is easier to use and make you more productive


Recommended