Algorithmic Trading With MATLAB - Humusoft

2y ago
58 Views
8 Downloads
1.14 MB
25 Pages
Last View : 8d ago
Last Download : 18d 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

Algorithmic trading From Wikipedia, the free encyclopedia Jump to: navigation, search In electronic financial markets, algorithmic trading or automated trading, also known as algo trading, black-box trading or robo trading, is the use of computer programs for entering trading orders with the computer algorithm deciding on aspects of the order such as

Treleaven et al. (2013), algorithmic trading accounted for more than 70% of American stocks trading volume in 2011. Therefore, algorithmic trading systems are the main focus of regulatory agencies. There are several challenges that algorithmic trading faces. American stocks usually exhibit drastic fluctuations in end-of-day (EOD).

United States by algorithmic trading. (3) An analysis of whether the activity of algorithmic trading and entities that engage in algorithmic trading are subject to appropriate Federal supervision and regulation. (4) A recommendation of whether (A) based on the analysis described in paragraphs (1), (2), and (3), any

Chapter 1: Overview of the Algorithmic Trading Accelerator The Algorithmic Trading Accelerator (ATA) installs with the Capital Markets Foundation (CMF). Unlike solutions that offer commoditized, pre-defined strategies, the ATA enables you to quickly develop, refine, and deploy unique algorithmic trading strategies built upon your own intellectual

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

2.3 Gresham’s Law 2.4 Money and near money 2.5 Role of money in Capitalist, Socialist and mixed Economy 3. Money Supply and Banks (14) 3.1 Narrow and broad definition of money 3.2 Alternative measures of money supply in India and their components 3.3 Concept of High Powered Money 3.4 Definition of Bank – Functions of bank 3.5 Multiple credit creation by bank and limitations to it. 4 .