Algorithmic Trading With MATLAB - Humusoft

1y ago
37 Views
3 Downloads
1.14 MB
25 Pages
Last View : 15d ago
Last Download : 5m ago
Upload by : Carlos Cepeda
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 MATLABBreak Credit Risk Modeling with MATLAB Risk Management using various VaRcomputation methods Overview of derivatives pricing capabilities and furtherfinancial computing products Q&A2

RWE Develops and Deploys an AutomatedSystem for Natural Gas and Power Tradingand Risk ManagementChallengeAutomate business processes for quoting gascontracts and hedging against price fluctuationsSolutionEngage MathWorks Consulting to develop anddeploy to a production environment an automatedpricing and risk management system that fits withinthe company’s existing IT infrastructureResults Models created in minutes, not weeks 100% accurate results delivered Technical expertise applied to core businessgoalsRWE headquarters in Essen.“MathWorks consultants were wellqualified, professional, and fast. Theyunderstood not only the technicalissues but also the business goals,which is essential when working on acore business system. We got morethan we expected from MathWorksConsulting.”Dr. Norbert TönderRWELink to user story3

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-prone4

Agenda Introduction: Algorithmic tradingDeveloping an automated trading decision engine– Identify a successful trading rule– Extend trading rule set– Automate trading rule selection Implementing MATLAB into your production tradingenvironmentWrap up and Q&A5

The problem at hand: Identifying profitabletrading strategies Commodities analystDeveloping a trading strategy– Multiple trading rules– High frequency Management requirements:– Tested on historical data– Uses sophisticated analytics toidentify optimal trading rulecombination– Integrates with existing data andexecution APIs6

Trading decision engineDevelopment and testingHistorical DataStrategy ModelingBack TestingEnd of Day / IntradayResearch / AlgorithmsProfit / LossFilesModel DevelopmentDatabasesCalibrationRisk ExposureLive DataDecision EngineExecutionReal-Time FeedsModelsBroker APIEvent-BasedTrading RulesOrder RoutingImplementation7

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 engine8

Trading decision engineGoal:Task 1: Build a back testing environment around historical data and apreliminary trading ruleTask 2: Move to a higher frequency (minute-by-minute) and re-calibratethe modelTask 3: Develop a rule selection system for instruments usingevolutionary learningDevelopment and testingHistoricalDataEnd of Day/ IntradayStrategyModelingResearch/ AlgorithmsBack TestingFilesDatabasesModel DevelopmentCalibrationRisk ExposureLive DataDecision EngineExecutionReal-Time FeedsEvent-BasedModelsTrading RulesBroker APIOrder RoutingProfit / LossImplementation9

Task 1: Develop a back testing environmentGoal: Build a back testing environment around historicaldata and a preliminary trading ruleDevelopment and testingHistorical DataStrategy ModelingBack TestingEnd of Day / IntradayResearch / AlgorithmsProfit / LossFilesModel DevelopmentDatabasesCalibrationRisk ExposureLive DataDecision EngineExecutionReal-Time FeedsModelsBroker APIEvent-BasedTrading RulesOrder RoutingImplementation10

Task 1: Develop a back testing environmentKey tasks Import data from files Create a preliminary rule Test the rule’s performanceMax Sharpe Ratio 0.758 for Lead 17 and Lag 1200.80.60.60.40.20.40-0.20.2-0.4-0.6Solutions MATLAB data tools High-level programming andpre-built functions Powerful 406080100120-0.611

Task 2: Expand the scale of the engineGoal: Move to a higher frequency (minute-by-minute) andre-calibrate the modelDevelopment and testingHistorical DataStrategy ModelingBack TestingEnd of Day / IntradayResearch / AlgorithmsProfit / LossFilesModel DevelopmentDatabasesCalibrationRisk ExposureLive DataDecision EngineExecutionReal-Time FeedsModelsBroker APIEvent-BasedTrading RulesOrder RoutingImplementation12

Task 2: Expand the scale of the engineKey tasks Importing data fromdatabases Increase computational speedSolutions MATLAB data tools: DatabaseToolbox High-performance computing:Parallel Computing Toolbox,MATLAB DistributedComputing Server13

Task 3: Rule selection engineGoal: Develop a rule selection system for instrumentsusing evolutionary learningDevelopment and testingHistorical DataStrategy ModelingBack TestingEnd of Day / IntradayResearch / AlgorithmsProfit / LossFilesModel DevelopmentDatabasesCalibrationRisk ExposureLive DataDecision EngineExecutionReal-Time FeedsModelsBroker APIEvent-BasedTrading RulesOrder RoutingImplementation14

Task 3: Rule selection engineKey tasks Increase number of rules Incorporate advancedanalytics to select bestcombination15

Working with multiple strategiesShould I trade?Signal 1YesANDORSignal 2YesANDORSignal 3NoDempster et. al., Computational learning techniques for intraday fx trading using popular technical indicators,IEEE Transactions on Neural Networks (2001).16

Working with multiple strategiesRepresent different combinations as bit strings00AND1Signal 21Signal 2AND01ORSignal 3OR1Signal 3Signal 1Signal 1 111SignalsActive?17

Building Custom Evolution Algorithms Selection– Retain the best performing bit strings from one generation tothe 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– child [1 0 1 0 0 1 1 0 0 0] [0 1 0 1 0 1 0 0 0 1]18

Task 3: Rule selection engineKey tasks Increase number of rules Incorporate advancedanalytics to select bestcombinationEvolutionary Learning Results, Sharpe Ratio 2.381005001000 2000 3000 4000 5000 6000 7000 8000 9000 10000Final Return 239 (249%)200Price (USD)Solutions High-level programming MATLAB Toolboxes: GlobalOptimization, Price (USD)150150100PositionCumulative Return5001000 2000 3000 4000 5000 6000 7000 8000 9000 10000Serial time number19

Agenda Introduction: Algorithmic tradingDeveloping an automated trading decision engine– Identify a successful trading rule– Extend trading rule set– Automate trading rule selection Implementing MATLAB into your production tradingenvironmentWrap up and Q&A20

Implementing the Decision EngineGoal: Evaluate and test the decision engine with real-timefeeds and execution through a messaging busDevelopment and testingHistorical DataStrategy ModelingBack TestingEnd of Day / IntradayResearch / AlgorithmsProfit / LossFilesModel DevelopmentDatabasesCalibrationRisk ExposureLive DataDecision EngineExecutionReal-Time FeedsModelsBroker APIEvent-BasedTrading RulesOrder RoutingImplementation21

Key TasksKey tasks Read live market data from data feed Connect to trading “engine”Solutions Datafeed Toolbox Many external APIs– .NET, Java, C/C , etc.– 3rd party APIs22

Deploying Applications with MATLAB Give MATLAB codeto other usersMATLAB Compiler Share applicationswith end users whodo not need MATLABMATLABBuilder EXMATLABBuilder JAMATLABBuilder NE– Stand-aloneexecutables– Shared libraries– Software components.exe.dllExcelJavaWebCOM.NET23

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 engine24

MATLAB’s solutions Sophisticated analytics– Advanced graphics environment– Toolboxes give access to hundredsof new techniques– Flexible and customizable Scalable speed– Parallel computing solution Quick to develop and deploy– High-level programming– Automated deployment25

Introduction: Algorithmic trading Developing an automated trading decision engine – Identify a successful trading rule – Extend trading rule set – Automate trading rule selection Implementing MATLAB int

Related Documents:

Algo trading TOTAL TRADING ALGORITHMIC TRADING HIGH FREQUENCY TRADING . Algorithmic trading: In simple words an algorithmic trading strategy is a step-by-step instruction for trading actions taken by computers (au

MATLAB tutorial . School of Engineering . Brown University . To prepare for HW1, do sections 1-11.6 – you can do the rest later as needed . 1. What is MATLAB 2. Starting MATLAB 3. Basic MATLAB windows 4. Using the MATLAB command window 5. MATLAB help 6. MATLAB ‘Live Scripts’ (for algebra, plotting, calculus, and solving differential .

19 MATLAB Excel Add-in Hadoop MATLAB Compiler Standalone Application MATLAB deployment targets MATLAB Compiler enables sharing MATLAB programs without integration programming MATLAB Compiler SDK provides implementation and platform flexibility for software developers MATLAB Production Server provides the most efficient development path for secure and scalable web and enterprise applications

MATLAB tutorial . School of Engineering . Brown University . To prepare for HW1, do sections 1-11.6 – you can do the rest later as needed . 1. What is MATLAB 2. Starting MATLAB 3. Basic MATLAB windows 4. Using the MATLAB command window 5. MATLAB help 6. MATLAB ‘Live Scripts’ (for

3. MATLAB script files 4. MATLAB arrays 5. MATLAB two‐dimensional and three‐dimensional plots 6. MATLAB used‐defined functions I 7. MATLAB relational operators, conditional statements, and selection structures I 8. MATLAB relational operators, conditional statements, and selection structures II 9. MATLAB loops 10. Summary

Algorithmic Trading Table: Proportions of trading volume contributed by di erent category of algorithmic and non-algorithmic traders in the NSE spot and equity derivatives segment (for the period Jan-Dec 2015) Custodian Proprietary NCNP Total Spot Market Algo 21.34% 13.18% 7.76% 42.28% Non-

the algorithmic trading strategy’s design; typically, broker algorithmic trading systems seek to minimize the cost of trading by optimizing the execution strategy—that is, minimize market impact cost or time to execution, optimize the price, and so on—whereas proprietary algo - rithmic

trading is not inherently harmful to market integrity or quality – in fact algorithmic trading plays an important role in developing liquidity. Equally, algorithmic trading is not, by definition, inherently good for market quality and integrity. Significant order f

distinguishes a normal technical trading from the core of algorithmic trading. The key fact to consider is that though most of the formulas in algorithmic might look complex the basic framework and practical usage of these factors are simple and can be used with ease in algorithmic trading. Importance of Statistical Analysis

foundation of basic MATLAB applications in engineering problem solving, the book provides opportunities to explore advanced topics in application of MATLAB as a tool. An introduction to MATLAB basics is presented in Chapter 1. Chapter 1 also presents MATLAB commands. MATLAB is considered as the software of choice. MATLAB can be used .

I. Introduction to Programming Using MATLAB Chapter 1: Introduction to MATLAB 1.1 Getting into MATLAB 1.2 The MATLAB Desktop Environment 1.3 Variables and Assignment Statements 1.4 Expressions 1.5 Characters and Encoding 1.6 Vectors and Matrices Chapter 2: Introduction to MATLAB Programming 2.1 Algorithms 2.2 MATLAB Scripts 2.3 Input and Output

Compiler MATLAB Production Server Standalone Application MATLAB Compiler SDK Apps Files Custom Toolbox Python With MATLAB Users With People Who Do Not Have MATLAB.lib/.dll .exe . Pricing Risk Analytics Portfolio Optimization MATLAB Production Server MATLAB CompilerSDK Web Application

Lecture 14: MATLAB I “Official” Supported Version in CS4: MATLAB 2018a How to start using MATLAB: CS Dept. Machines - run ‘cs4_matlab’ Total Academic Handout (TAH) Local Install - software.brown.edu MATLAB Online (currently 2019a) - matlab.mathworks.com Navigating the Workspace (command window, variables, etc.) Data types in MATLAB (everything is a 64-bit .

MATLAB Functionality for Digital Speech Processing MATLAB Speech Processing Code MATLAB GUI Implementations Lecture_3_2013 1. . MATLAB signal array is to be stored - for wavwrite the MATLAB array xoutneeds to be scaled to the range 1 xin 1 whereas for savewav the MATLAB array xoutneeds to be .

Algorithmic trading (automated trading, black-box trading, or simply algo-trading) is the process of using computers programmed to follow a defined set of instructions for placing a trade in order to generate

Algorithmic trading is any software which follow a predefined algorithm to place trading instructions High-frequency trading is algorithmic trading characterized with very

uninformed trading is algorithmic trading, which has become increasingly dominant in the stock market. Skjeltorp et al. (2016) document that algorithmic trading originating from large insti-tutional investors is likely to be uninformed. Uninformed trading may also result from hedging activities of financial institutions.

Elements Of Algorithmic Trading 17 - Data is everything 17 - Charting Platforms 19 - Programming 20 - Brokers 20 - A . - Ways to become an Algo trading professional 34 - Get placed, learn more and implement on the job 36 Future Of Algo Trading 37 Career In Algo Trading 40 .

The Effect of Algorithmic Trading on Liquidity in the Options Market Abstract Algorithmic trading consistently reduces the bid-ask spread in options markets, regardless of firm size, option strike price, call or put option, or volatility in the markets. Howeve

Grade 2 ELA Curricular Frameworks with ELL Scaffolds . Grade 2 Unit 2 Reading Literature and Reading Informational Unit 2: RL.2.1, RI.2.1, and WIDA Standards . Reading Literature and WIDA Standards Reading Informational Text and WIDA Standards Critical Knowledge and Skills WIDA Criterion RL.2.1. Ask and answer such questions as who, what, where, when, why, and how to demonstrate .