Skip to content

Instantly share code, notes, and snippets.

@briangordon
Last active May 4, 2021 01:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save briangordon/08ef3aa81008d761a0984229bc7c5659 to your computer and use it in GitHub Desktop.
Save briangordon/08ef3aa81008d761a0984229bc7c5659 to your computer and use it in GitHub Desktop.

Session 1: Preliminaries

  • Bid/ask spread
    • Stock quotes
    • Measure of liquidity
    • Steady state (order book, market depth, types of orders)
    • How prices move
  • Market makers
    • NYSE vs NASDAQ vs crypto
    • Advantages given in exchange for risk
    • Charge "takers" for liquidity
  • Options - a taste of derivatives
    • Basics of puts and calls
    • Assignment risk
    • Hedging
      • Selling cash covered puts
      • Selling covered calls
      • Sophisticated investors with complex risk models
    • Gambling (r/WSB)

Session 2: Types of securities, part 1

Introduction

  • What is a security? (fungible/negotiable)
  • The prospectus
  • Benefits of securitization

Funds

  • Active/passive distinction
    • Passive funds. Fees are greater than zero (careful about comparing to the performance of the benchmark!) but less than active
    • Active funds. Long-only funds, long-short funds
    • Smart beta funds / "factor investing"
  • Structure
    • Mutual funds
      • Open and closed end funds
      • How closed end fund shares get issued (one-time IPO with a fixed amount of capital, then listing)
      • How open end fund shares get issued (direct sales to investors daily)
      • Fee structure (front/back end loads to broker, transaction fees to fund, management fee, share classes, warning about 12b-1 advertising fee)
    • ETFs
    • Hedge funds
      • "2 and 20"

Equity

  • What does owning a share mean? (Buybacks, dividends, voting rights, liquidation)
  • IPOs
  • After the IPO, why do companies still care about their own stock price on the secondary market? One reason is dilution:
    • Secondary offerings
    • Stock-based compensation
    • Stock used for acquisitions
    • Convertible debt
  • Share classes and tech
  • Categories along different dimensions: Small cap, mid cap, large cap, mega cap. REITs, utilities, energy, tech, financials, health, consumer staples. Growth, value, income. Diversify!
  • Probably more literature and strong opinions than any other asset class, but that's all for now. A later session will address the workings of stocks in more detail.

Debt

  • Sovereign (US treasury debt safety and liquidity), muni, investment grade, "high yield"
  • Principal and coupon
  • Interest rates, price vs yield
  • Duration and the yield curve
  • The US treasury bond market
    • T-bills (explain zero-coupon and buying below par), T-notes, T-bonds, and TIPS. Mention treasurydirect.gov (buy only, transfer to broker to sell)
    • STRIPS (coupons stripped to become zero-coupon)
    • Liquidity of equivalent off-the-run issues
    • Monetization
  • Bankruptcy, the cap table, secured and unsecured debt, senior and subordinated debt.
  • Inversely correlated with equity (at least until the Q4 2018 market crash)
  • Liquidity and bond funds
  • Money market funds
    • Breaking the buck
    • What do they buy? (prime, government, treasury)
    • Very nearly as safe as CDs (FDIC, cautionary tale of Iceland in the GFC)

Session 3: Types of securities (part 2)

Futures

  • Basic concept
  • Commodities, financial futures (e-mini, weekend stock moves)
  • Explain why WTI futures went negative before April 2020 expiration https://files.brian-gordon.net/wti-futures-negative.png
  • Hedging (business, farmer case study), speculation (bigger in futures than in options)
  • Why are futures so great for speculation? Leverage.
    • Counterparty risk / clearinghouse solution (CME)
    • Margin
      • "typically 3-12% per futures contract as opposed to up to 50% of the face value of securities purchased on margin"
      • Mark-to-market and "truing up" daily to the market value of the contract

Currencies

  • Liquidity
  • Currency pairs
  • Hedging (products provided by FX desks)
    • FX exposure to investors ("carry trade")
    • FX exposure to central banks (IRFCL published by most IMF members - ECB Switzerland Thailand)
    • FX exposure to companies (wide variety of products- FX futures, FX swaps, cross currency swaps, basis swaps)
  • Speculation (forex traders)

OTC

  • CDOs
    • Tranches / risk
    • 2008
    • CLOs of corporate credit in 2020
  • Other structured products exist (mortgages: CMOs, debt: CDOs, corporate credit: CLOs)
  • CDSes
  • Forward contracts (futures but OTC and non-marginable)
  • ISDA (counterparty risk, recourse)

Session 4: Okay, but how do I make money?

  • There's money to be made trying to beat the market... but there's more money to be made selling services to people who think there's money to be made trying to beat the market. (Milken at Drexel - ~$1.3 billion inf. adj. in 1987)
  • S&P reports that almost 90% of US active funds failed to beat their benchmark (not a perfect measure - passive fees) https://files.brian-gordon.net/spiva-us-year-end-2019.pdf
  • Efficient markets hypothesis
  • Renaissance's Medallion Fund ("best physics department in the world"), Warren Buffet (insurance float)
  • Play the markets if you want, but be prepared to lose it all.
  • Heinlein's "no free lunch" - outsized returns usually mean outsized risk (Sharpe ratio)
  • Retirement savings
    • Fees and taxes.
    • Target date funds
    • Robos - modern portfolio theory
    • Index funds. ETF or MF, wherever you can get the least fees at your broker.
    • Risk tolerance. Adjust with age.
    • Bonds and stocks. Old advice is 60/40.
    • Passive equity funds, active bond funds.
    • Diversify, save, max out tax advantaged funds
  • Gambling money / stock picking
    • Value vs growth
    • The big picture: building a portfolio, risk parity, set rules about how much you're willing to put into a single stock
    • Technical analysis
      • Momentum investing (day traders and swing traders)
      • Chartists reading tea leaves
      • Support levels (market depth vs just drawing lines)
      • Moving averages
      • Technical indicators
        • The "death cross" (typically the 50-day SMA crossing the 200-day SMA)
        • Humans up against algorithms
        • Somewhat democratized by users writing their own scripts for identifying indicators (...and charging for them)
        • Still futile (colocated servers in NJ, Spread Networks's $300 million fiber WAN between NYC and the CME)
      • Chart patterns
        • "Trading within a range"
        • "Cup and handle," "head and shoulders," etc
        • Lots of free and premium chart annotation tools. Go back to TradingView and show charts graffitied with lines
        • Same issue with competing against algorithmic trading firms
    • Fundamental analysis
      • Valuation models
        • Determine what the stock price "should" be based on the financial data. Buy it or sell it depending on the actual market price
        • P/E, but EV/EBITDA is cap structure neutral
        • Ben Graham formula - "The Intelligent Investor"
        • DCF (issues with predicting future cash flows)
        • Dividend discount model (same as DCF but for dividends instead of FCF)
      • Comparative models
        • Figure out how the company is doing relative to its peers. Potential for spread trading.
        • Calculate and compare fundamentals
        • DuPont analysis
    • Stock picking worked example (TODO: link spreadsheet)
      • Pick a "boring" stock
      • Show financials, explain what the important ones mean
      • Show the 10-K. Talk about GAAP vs non-GAAP (adjusted earnings, "community-adjusted EBITDA," difficulty of detecting accounting shenanigans)
      • Discounted cash flow spreadsheet

Session 5: Banking

  • Investment banking
    • What they do
      • Traders: proprietary trading desks
      • Analysts: research
      • Bankers: bespoke products for corporates
      • Bankers: M&A
      • Bankers: underwriting debt/equity offerings
      • Sales
      • Prime brokerages
      • Dealers (primary dealers, commercial paper)
    • Glass-Steagall Act (repealed in 1999)
    • Dodd-Frank Act / Volcker rule (prohibition of banks making risky investments on their own books)
  • Commercial banking
    • Mortgates (GSEs)
    • Deposits / account services
      • Bank runs
      • "Borrowing short and lending long" (S&L crisis)
      • Liquidity coverage ratio, capital adequacy ratio
    • Personal credit
    • Commercial credit (as distinct from debt)
  • Central banking
    • Balance of payments
    • FX reserves, currency crisis
    • The United States Dollar, "global reserve currency," how the US maintains such an astonishing trade imbalance (foreign capital investment, US debt as a haven, petrodollars)
    • Dual mandate
    • Interest rates / monetary transmission mechanism
      • Fed funds rate
      • Discount window
      • IOER
      • Lender of last resort
    • Monetary vs fiscal stimulus

Session ?: Taxes

  • Tax alpha: 0-2%
  • Discussion scoped to just US federal taxes

Overview

  • Short term capital gains (e.g. profit from selling stock held <= 1 year) count towards your ordinary income and are therefore taxed at your income tax rate.
  • Long term capital gains (e.g. profit from selling stock held > 1 year) are taxed separately from ordinary income, at either 0%, 15%, or 20%. Note that if you get a capital gains distribution from a mutual fund or ETF, it's always counted as long-term capital gains regardless of how long you've held the shares.
  • Stock dividends can either be taxed as ordinary income or as long-term capital gains, depending on whether they're qualified (generally based on holding the stock for 2-3 months). Either way you pay taxes, which is one reason why many companies prefer to buy back their own shares instead of paying dividends.
  • Interest income (bonds, bank deposits, money market funds, etc) is generally taxed as ordinary income. State and local bond interest is always tax-free at the federal level. If you own shares of a fund that distributes interest income (e.g. a bond ETF) as a "dividend" then you don't get to claim that as a qualified dividend - it's still interest. Note that the same fund may still send you separate capital gains distributions (e.g. from the fund selling bonds before maturity).
  • Futures trading income is taxed with 60% classified as long term capital gains/losses and 40% classified as short term capital gains/losses (open contracts are marked to market at the end of the year)
  • Options: either short or long term capital gains
  • All of these may also be subject to an additional 3.8% tax if you make enough money.
  • Full time professional traders get additional perks

Offsetting

  • You can use up to $3000 of capital losses to offset ordinary income.
  • Capital losses offset capital gains
    • Short-term capital losses offset short-term capital gains
    • Long-term capital losses offset long-term capital gains
    • Any losses of one type left over from fully offsetting gains of that type can be applied to the other type
  • You can carry forward capital losses to future years as long as you offset all of your capital gains

Cost basis

  • Tax lots and cost bases
  • Tax loss harvesting
    • Sell a losing position and buy the same thing again.
    • You can realize capital losses whenever you want! If you have a lot of realized gains you can harvest some losses to reduce your immediate tax bill.
    • You now have a lower cost basis though, so the tax benefit now will be balanced by higher taxes in the future when you ultimately sell the new shares. All you're doing is moving taxable gains around from one year to another. But you may be able to spread them out to take advantage of deductions and ultimately pay less in total taxes. Also, it's effectively an interest-free loan from the Treasury if you can push your net tax payments into the future.
    • Fig leaf: wash sale rule
      • If you sell a lot at a loss but replace it with a "substantially identical" security within 30 days (before or after the sale), the sale becomes a wash sale.
      • A wash sale disqualifies the capital loss from being realized, but adds it to the cost basis of the replacement lot. Basically, you get no tax benefit from the sale of your old shares but you still maintain the unrealized benefit going forward with your new shares.
      • Normally you think of wash sales as selling first and then re-buying, but you can also trigger wash sales by buying first and then selling. Otherwise you could defeat the wash sale rule by just flipping the order of the transactions. Wash sales are triggered in this scenario only when the purchased lot was a replacement for the sold lot (i.e. you have lot A, buy lot B, and then sell lot A). If you buy a share, do nothing for a week, and then sell that exact share, there's no wash sale even though it's within the 30-day window. I think you can always sell shares out of the most recently-acquired remaining tax lot for a given "substantially identical" security without triggering a wash sale - just unwind through the stack - but be wary of buys...
      • What is a "substantially identical" security? (Selling VOO and buying SPY seems to be okay with the IRS...)
      • Options?
        • Buying a call counts the same as buying the underlying security for causing wash sales of the underlying security
        • Selling a put could be the same as buying the underlying security for causing wash sales of the underlying security, if it's deep enough ITM
        • Sales of options contracts at a loss can themselves be wash sales.
      • Be aware of pitfalls:
        • If you want to realize a loss without closing out your whole position, make sure you specify to your broker which tax lot(s) you want to sell from. For a given lot, the cost basis determines how much of a loss you will realize, and the acquire date determines whether it will be considered a long or short term loss. Also, some lots might be considered replacement lots and trigger a wash sale.
        • The wash sale rule applies globally across all of your accounts, even with different brokers, and even if some are tax-advantaged accounts.
        • Be very careful if you have an IRA (either traditional or Roth) because their cost basis cannot be adjusted to preserve the tax benefit of a capital loss disallowed by a wash sale. If you trigger a wash sale and the replacement shares are in an IRA, you lose that capital loss permanently. It does not accrue onto the replacement lot like it would if the replacement shares were in a taxable account.
        • If you have RSUs as part of your employment compensation, vesting of shares counts as "acquiring" them for the purposes of the wash sale rule. It can be easy to inadvertently trigger wash sales, especially if you're vesting new shares every month. I think you won't run into wash sales as long as you never sell an older share while keeping a newer share.
    • You can sell/rebuy some of a winning position to realize capital gains early, and this would be unaffected by the wash sale rule. This could conceivably be useful in spreading out tax payments if you're planning to sell a ton of stock to buy a house or something.

Retirement accounts

  • 401k
    • TODO
  • Traditional IRA
    • TODO
  • Roth IRA
    • TODO
  • Roth 401k
    • TODO

Alternative minimum tax (AMT)

  • TODO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment