Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Ahmad Namini - Introduction to Algorithmic Trading

fawce
January 17, 2013
4.8k

Ahmad Namini - Introduction to Algorithmic Trading

Talk Summary:

In an increasing era of electronic trading, algorithmic trading is responsible for an ever greater share of market trading. This talk will present introductory information required for traders, quants, and risk managers to understand the fundamental framework required for successful algorithmic trading. The fields of market microstructure (order book, market impact, liquidity, price discovery), high performance computing, and the evolution of trading styles will also be discussed. Finally, the computational skills and hardware frameworks needed for implementation will be presented.

Bio:

Ahmad Namini is the Executive Director and Adjunct Professor of Boston University’s Mathematical Finance Program. Dr. Namini has served as a quantitative analyst/developer, desk strategist, and analytics head for a hedge fund (Fortress Investment Group) and investment banks (Deutsche Bank and Citigroup Capital Markets). He is an experienced builder, manager, and teacher of trading modes and applications, with models spanning the credit derivative, rates, and equity markets. He built Deutsche Bank’s first fixed income algorithmic trading platform. He currently teaches the course “Quantitative Strategies and Algorithmic Trading” at Boston University which has been featured in the Wall Street Journal. He also teaches a course entitled “C++ for Mathematical Finance, ” and is involved in research and publication in the mathematical finance field. Dr. Namini earned a PhD in computational mechanics from the University of Maryland and then served as a faculty member at the University of Miami for ten years where he developed a research program in computational aerodynamics and parallel computing.

fawce

January 17, 2013
Tweet

Transcript

  1. An Introduction to Algorithmic Trading Models Ahmad Namini, PhD Executive

    Director and Adjunct Professor Boston University Mathematical Finance Program
  2. Page § 3 About Me “There are 10 types of

    people in the world, those that know binary and those that don’t.” – Anonymous §  PhD, University of Maryland, Computational Mechanics §  MA, Boston University, Mathematics §  MS, University of Maryland, Computer-Aided Design §  BS, University of Maryland, Civil Engineering §  Citibank Capital Markets, Hong Kong §  Fortress Investment Group, New York §  Deutsche Bank, New York §  University of Miami §  Boston University §  Computer Programming §  Applied Mathematics §  Mathemtical Finance §  Life-long Learner
  3. Page § 4 Presentation Agenda Goals and Nature of Trading

    High Performance Computing Backtesting Questions 1 2 3 4 5 “Time is your friend; impulse is your enemy.” – Jack Bogle Trading Framework
  4. Page § 5 Goals of Trading Number 1. To Generate

    Profit “Wall Street people learn nothing and forget everything.” – Benjamin Graham Entry Mark to Market Exit Profit/Loss (PnL) §  Generate a trade to buy (long) or sell (short) a security at a given price for a specified quantity. §  Trade becomes a position in a security. §  As the security price changes, your position’s unrealized PnL changes. §  PnL = Side * Qty * ( Pbid – Pask ) §  For long position, Side = +1; For short position, Side = -1 §  Generate a trade to close out your position. Your unrealized PnL becomes a realized PnL. §  PnL = Side * Qty * ( Pexit – Pentry ) §  For long position, Side = +1; For short position, Side = -1 §  PnL is computed daily, over all positions within a portfolio. §  Annualized returns are better measures for comparison and reporting.
  5. Page § 6 Goals of Trading Number 2. To Reduce

    Risk “In this business if you're good, you're right six times out of ten. You're never going to be right nine times out of ten. .” – Peter Lynch Definition AUM Hedge Hedged Position §  Risk is another word for Uncertainty. §  Assets under Management (AUM) is referred to as Risk. §  Place a trade which reduces or eliminates a certain aspect of exposure. §  Example: To eliminate an equity option position’s risk due to the change of the underlying equity price, we can delta hedge the position. §  Hedging will cost money, but will reduce/eliminate unwanted risk exposure. §  Continuous hedging is preferred but not feasible or cost effective.
  6. Page § 7 Nature of Trading Constraints §  Regulations &

    Compliance §  Technology §  Electronic trading §  OTC (Over the counter) §  DMA (Direct Market Access) §  Accounting §  Middle- and Back-Office §  Market Microstructure §  Liquidity §  Information Flow §  Price Discovery and Execution §  Slippage §  Transaction Costs §  AUM (Assets Under Management) §  Trader’s or Firm’s Risk Aversion “Amateurs want to be right. Professionals want to make money.” – Anonymous
  7. Page § 8 Trading Framework Order Types §  Market § 

    Limit §  Fill-or-Kill §  Market-on-Open §  Market-on-Close §  Etc. Financial Instruments §  Equities §  Bonds §  Futures §  Foreign Exchange §  Swaps §  Equity Options §  CDS (Credit Default Swaps) §  ABS (Asset Backed Securities) §  Derivatives §  Etc. §  NYSE §  NASDAQ §  CME §  Interactive Brokers §  BrokerTec §  Etc. Exchanges/Broker/Dealers “Buy on the rumor, sell on the news.” – Anonymous Buy- vs Sell-Side §  Buy-Side – Proprietary Trading §  Sell-Side – Market Making
  8. Page § 9 Trading Framework (continued) Time Frames §  Long-Term

    (months or years) §  Retirement §  No timing of the market §  Short-Term (days, weeks, or months) §  Institutional Investors §  Hedge Funds §  Proprietary (Prop) Desks §  Intraday (seconds, minutes, or hours) §  Algorithmic (Algo) Shops §  Flow (Market-Maker) Desks §  Manage their Exposure §  High Frequency (fractions of seconds) Fundamental §  Stock picking (Analyst views) §  Ratio Analysis (Income/Balance sheets, etc.) §  Sector Analysis §  Executive Management §  Rule-based §  Econometric Forecasting §  Statistical Arbitrage (co-integration) Quantitative “What seems too high and risky to the majority generally goes higher and what seems low and cheap generally goes lower.” – William O’Neil Technical §  Charting §  Views based on recent Trends
  9. Page § 10 Trading Framework (continued) Sell-Side Strategies §  Increase

    Trading Flow §  Profit from the bid/ask spread §  Hedge unwanted risk §  Maintain inventory Rule-Based Strategies §  Active trading according to a fixed rule §  Set of assets that are long/short §  Determine a trading signal that dictates when to generate a trade §  An underlying inefficiency/anomaly that a rule aims to exploit §  Large majority of strategies are classied by §  Momentum §  Carry/Value §  Strategic or Tactical Buy-Side Strategies “When I'm bearish and I sell a stock, each sale must be at a lower level than the previous sale. When I am buying, the reverse is true. I must buy on a rising scale. I don't buy long stocks on a scale down, I buy on a scale up.” – Jessie Livermore Execution Traders §  Accumulate/Liquidate large positions with minimal market impact
  10. Page § 11 Trading Framework (continued) Money Management §  Reinvestment

    Profits Leverage §  Self-financing strategy §  Borrow and then invest §  Control a large asset with a small investment §  Margins in Futures Contracts §  Premium in Derivatives §  Beware of Maximum Drawdown §  Probability of Ruin §  Kelly Criteria §  Use your “alpha” to size trades Position Sizing “Stock market bubbles don't grow out of thin air. They have a solid basis in reality, but reality as distorted by a misconception.” – George Soros Uncertainties §  Market Risk §  Model Risk §  Operational Risk §  Etc.
  11. Page § 12 Trading Framework – Algorithmic Trading §  Trading

    service that enables order submissions §  Without human intervention §  Via direct market-access channels §  Based on quantitative models What? §  Ultra fast market data feed §  Low latency, high speed trading platforms §  Proximity to hosting services §  Pricing models designed for high frequency trading How? §  Cost effective with tight bid/ask spreads and large pools of liquidity §  Transparent with standardized contracts §  Scales trading activities better than humans Why? “A trader should have no opinion. The stronger your opinion, the harder it is to get out of a losing position.” – Paul Rotter
  12. Page § 13 Trading Framework – Algorithmic Trading Price Volume

    Prints (Executed Trades) Place the trade via OMS API Need to verify trade status Add to Blotter Monitor PnL and Risk Rule-based Generation of Trade Based on Backtest Results Contingency Planning to verify that Trade was Executed Correctly Data Feed Signal Trade OK Book “If past history was all there was to the game, the richest people would be librarians.” – Warren Buffet
  13. Page § 14 High Performance Computing “I have two basic

    rules about winning in trading as well as in life: 1) If you don’t bet, you can’t win; 2) If you lose all your chips, you can’t bet.” – Larry Hite Technology §  Feed handler/Ticker plant §  Messaging API §  Network stack §  Ethernet Switch §  Messaging Server §  Algorithm Performance §  Transition to Order Execution Ethernet Switch Messaging Server Algo Engines Orders for Execution Feed Handlers Feeds 1 2 4 3 5 6 7 3 3 2 1 2 3 4 5 6 7 Latency Sources §  Network I/O and High Volume Jitter §  Context Switching (OS Kernel) §  Physical Distance (Speed of Light)
  14. Page § 15 High Performance Computing Real-Time Low Latency § 

    Real-time – Meet expected task durations §  No Jitter – No variation in expected latency §  Scheduling – Timer §  Co-location – Establish Queue Position, which permits execution priority at desired price point §  Context-switching §  Garbage collection §  C++, Java Real Time §  Complex Event Handling (too slow) “Never underestimate stupidity.” – Ahmad Namini
  15. Page § 16 Backtesting Goal §  Driving the Strategy’s model

    through historical data to determine §  Performance Parameters §  Entry and Exit Signals §  Money Management §  Risk Profiles Please note that this is more art than science “The standard deviation is 7. We are going to make a lot of money.” – A trader that doesn’t understand probability
  16. Page § 17 Backtesting Data §  Historical Data §  In

    sample §  Out of sample §  Stress test under unusual conditions §  Crash of 1987 §  LTCM §  Tech bubble burst §  Credit crisis “I would never join a club that would take me as a member” – Groucho Marx
  17. Page § 18 Backtesting Paper Trade §  Use live data

    §  Do not Place Actual Orders §  Compute PnL and Risk §  Make sure that the Strategy’s implementation can be executed §  Cannot perform Execution Cost Analysis “I would never vote for someone that would run for office.” – Ahmad Namini
  18. Page § 19 Backtesting Go Live and Monitor §  Start

    trading §  Fill your book with trades §  Enjoy the ride and constantly monitor everything so as to increase PnL §  Modify backtesting performance parameters §  Re-engineer components of the implementation §  Execution Cost Analysis “You are only as good as your next trade.” – Anonymous