Loading video...

Video Failed to Load

Go Home

➡️ Quantitative Finance from Scratch, part 45: Statistical Arbitrage. The arbitrage from the last part was a profit without any risk. Statistical arbitrage is the practical version: many small bets that can each lose, but win on average. One of the best known and simplest forms is pairs trading:...

0 Comments

No comments available

Comments from the original post will appear here

Related Videos

➡️ Quantitative Finance from Scratch, part 47: What does a market maker actually do? A market maker is a trading firm that always provides two prices for a stock: the ask (higher, what you pay when you buy) and the bid (lower, what you get when you sell). When you trade as a retail investor, the other side is usually a market maker. It stands in the middle, so someone is always there to trade with you. This is called providing liquidity. In return, it earns the spread (spread = ask − bid). Buy at 99.98 dollars, sell at 100.02 dollars, and it earns four cents per share. That sounds tiny, but it repeats all day across many stocks. The job comes with two big risks. Inventory: when many people sell at once, the market maker ends up holding a lot of stock, and if the price then falls, it loses money (P&L = cash + inventory × fair price). Informed traders: someone who hears news first sells to the market maker right before the price drops. A good market maker adjusts its two prices all day, moving them with its inventory and widening the gap when the risk grows. On many exchanges, official market makers promise to quote within a maximum spread and pay lower fees in return. The code (mm_reel.py, 16 lines of plain Python without packages) is general on purpose: two quotes around a mid price, what happens when a customer buys or sells, the profit and loss, and a quote shifted with the inventory. If you want to go deeper, check out the full course I built: quantfinancetogo.com #quantfinance #marketmaking #marketmaker #finance #python Education only, not financial advice.

QuantFinanceToGo

10,200 views • 11 hours ago

➡️ Quantitative Finance From Scratch, Part 23: Mean Reversion. Mean reversion means that a quantity which moves far from its long run average tends to drift back toward it. A single stock price behaves much like a random walk, but spreads, ratios and rates (the gap between two related stocks, interest rates, volatility) often show a pull back. The simplest model: every day the distance from the average shrinks by a fixed share, plus a random shock. The half life is the time it takes for half of that distance to disappear, so a short half life means a strong pull back. To test for the pull, you regress today's change on yesterday's distance from the average. A negative slope means a pull back. But even pure chance often looks like a pull here: in our test, 34% of pure random walks passed the usual limit of -2. So quants use a stricter limit for the t statistic of about -3 (the Dickey-Fuller limit, about -2.9). In this video we simulate one spread with a built-in half life of 10 days for four years. The regression finds a slope of -0.070, a t statistic of -6.05 and a half life of 9.5 days, far beyond that limit. The z score measures how many standard deviations the spread is from its average. Is it profitable? Only if the pull is real, strong enough to beat trading costs and still there in data you did not use for testing. A 2016 study of 97 published return signals found that their returns were on average 58% lower after publication. The average can shift, the pull can vanish, and a spread can keep widening before it comes back. Short samples can even make a pure random walk look mean reverting: in our test, three months of a pure random walk typically showed a half life of about 10 days. Education only, not financial advice. #quantitativefinance #trading #meanreversion #statisticalarbitrage #finance

QuantFinanceToGo

23,000 views • 28 days ago

➡️ Quantitative Finance from Scratch, part 44: Arbitrage Pricing Theory (APT). Stephen Ross published it in 1976 as an alternative to the CAPM. The CAPM explains expected returns with one risk, the market. The APT allows several risks, called factors, for example surprises in economic growth, inflation or interest rates. Every stock gets its own beta for each factor, plus swings of its own that have nothing to do with any factor. A factor model describes how a return moves when a factor changes. The APT asks a different question: what return should an investor expect for carrying that risk? In a factor model each stock can have its own alpha. The APT says this alpha should be zero, because two stocks with the same exposures carry the same risk and should earn the same expected return. The formula: E[R_i] = r_f + β_i1 λ_1 + β_i2 λ_2 + ... + β_iK λ_K, with r_f the risk free rate, β the exposure of the stock to one factor and λ the premium the market pays per unit of that factor's risk. If two stocks have the same exposures and one is expected to earn more, you buy that one and sell the other. Every factor cancels out, and with many such pairs their own swings average away. Traders who exploit such gaps push prices back, so expected returns line up on the formula, at least approximately. The theory leaves open which factors to use; researchers pick them from data, like Chen, Roll and Ross (1986) with economic factors, and the Fama-French model follows the same logic. The code (apt_reel.py, 15 lines of plain Python without packages) is general on purpose: the expected return from the risk free rate, the betas and the premiums, the alpha as the part the betas leave unexplained, and the arbitrage rule for two stocks with the same betas. Honest notes: the plane, the stocks and the long-short pairs in the video come from a simulation (seed 44), not from market data. Assumed: 100 stocks, two factors, betas between 0 and 1.5, risk free rate 2 %, premiums 4 % and 2 % per year, one stock with an alpha of 3 %, monthly factor surprises with 4.5 % and 3 % volatility, own swings 6 % per month, 64 pairs over 120 months. In the simulation the hedged position has exactly zero factor exposure and zero net cost, and the leftover swings shrink roughly with the square root of the number of pairs. Real arbitrage has costs, limits and estimation error in the betas. Sources: Ross, S. A. (1976), The Arbitrage Theory of Capital Asset Pricing, Journal of Economic Theory 13(3), 341-360. Chen, N.-F., Roll, R. and Ross, S. A. (1986), Economic Forces and the Stock Market, Journal of Business 59(3), 383-403. #quantfinance #apt #arbitragepricingtheory #factormodels #capm Education only, not financial advice.

QuantFinanceToGo

49,200 views • 3 days ago

➡️ Quantitative Finance from Scratch, part 35: how market makers make money. The first source is the spread. Like an exchange booth, a market maker buys a little below the fair price at the bid and sells a little above it at the ask, so every trade earns half the gap whatever the stock does next. After selling a call, it buys delta shares, so small moves no longer matter. The second source comes from the other Greeks: theta is the income, because the call it owes loses value every day, and gamma is the cost, because after every big move it must buy shares high and sell them low to keep the hedge. If the stock moves exactly as much as the implied volatility in the price, income and cost cancel. If it stays calmer, the market maker earns, and if it moves more, it loses. Vega is the risk to this income, because a jump in implied volatility makes the call it owes more expensive. If a customer sells it the call instead, everything flips. The code (marketmaker.py, 16 lines) sells our call from part 33 at the ask (fair $10.45, ask $10.55, bid $10.35) and hedges it every day on 2,000 simulated years with an implied volatility of 20 %. With a real volatility of 16 % it earns $1.59 per call on average and every path ends in profit; at 20 % it earns $0.10, about the spread; at 24 % it loses $1.41 and only 0.3 % of paths end in profit. Honest notes: a simplified model with one option, daily hedging, Black Scholes prices, constant volatility, no trading costs, no dividends and no other customers. Real market makers manage many options at once and also face fees, inventory limits and jumps. #quantfinance #options #marketmaking #greeks #finance

QuantFinanceToGo

93,300 views • 13 days ago

➡️ Quantitative Finance from scratch part 12 closes season 1. Every part was one step in a single story about a bet with an edge, and every number below comes from that part's own run. Part 1, expected value: a $1 bet on red wins 18 times out of 37, so it loses 2.7 cents on average, and over a million bets the casino made $27,288. Part 2, the random walk: coin flips add up to something that looks like a stock chart, and the same edge becomes a drift of 2.7 cents per step. Part 3, the square root rule: after 100 random steps the typical distance is about 10, because randomness grows with the square root of time. Part 4, the bell curve: many small random steps build it, with 68 % of results within one standard deviation. Part 5, returns: percent moves multiply, so after -50 % you need +100 % to get back. Part 6, present value: at 5 % interest, $100 paid in ten years is worth $61.39 today. Part 7, volatility: two investments with the same average swing about 4 % and 32 % a year. Part 8, the Sharpe ratio (William F. Sharpe, 1966): extra return per unit of risk, 0.36 for the wild investment and 0.99 for the calm one. Part 9, volatility drag: +50 % and then -50 % leaves you 25 % down. Part 10, correlation: the less two assets move together, the less a 50/50 mix swings, from 19 % down to 10 %. Part 11, diversification: ten assets cut the risk from 20 % to 12.2 %, above a floor of 11 % that the shared market sets (Markowitz, "Portfolio Selection", Journal of Finance, 1952). The big picture: how big the edge is, how much it swings, and how much of that swing you can spread away. Season 2 brings portfolios, bets and evidence. This video is for education only, and nothing in it is financial advice. #quantfinance #finance #riskmanagement #portfolio #probability

QuantFinanceToGo

109,700 views • 1 month ago

In 1991 a Stanford professor turned $120,000 into $7 million off two stocks that went nowhere, using nothing but their swings. Nobody on Wall Street wanted this getting out, and the math sat buried for 35 years. His name was Tom Cover, and in information theory he was royalty, he wrote the textbook the whole field still learns from. Then he did something no one asked for. He pointed Claude Shannon's math at the stock market. He took two forgettable stocks. On their own, over 20 years, one rose 4x and the other 8x, nothing special. But they jumped around hard, and out of sync. So he rebalanced them daily: trim the one that popped, add to the one that dropped. That pair returned over 70x. The gain never came from the companies. It came from the shaking. The rule behind it is one line: W* = max E[log bᵀX] Maximize the expected log of your wealth, not the average return. Average return says dump everything into the top stock. Log says spread and rebalance, because compounding runs on the geometric mean, and volatility becomes fuel instead of risk. Then Cover went further. He built a portfolio that keeps pace with the best rebalancing you could have picked with a year of hindsight, no forecasts, no model. It held through the crashes of 1929 and 1987. And the same constant that runs it shows up in file compression. To Cover, beating the market and zipping a song were the same problem. He never found a better stock. He found the money hiding in the fact that stocks move at all. Watch this 57-min lecture, the answer is in this video. Worth watching right now.

MindArch

62,900 views • 2 months ago

Howard Marks did the math out loud on why the next ten years of your stock returns are already mostly decided. It is not the economy. It is not earnings. It is not the news. It is one number you paid on the day you bought. He co-founded Oaktree, manages around 190 billion dollars, and called the 2000 tech crash and the 2008 collapse before either one arrived. His warning has nothing to do with the headlines. It is not about a recession, an election, or a war. It is about the price on the sticker the day you buy in. Buy the S&P 500 at 23 times earnings, and history gives one answer. Your return over the next ten years lands near zero, somewhere between plus two and minus two percent a year, almost every time it has been this expensive. Price is not what you get. It is what caps what you can get. A great company bought at a rich price is still a poor investment, because the good news was already paid for. That is the part nobody wants to hear at the top. The number feels boring while the crowd feels rich. And feeling rich is what makes people pay any price right before the decade of nothing. Most people do not lose because they picked the wrong stock. They lose because they paid too much for the right one. The market today sits near 25 times. Marks did not call a crash. He just read the sticker, and the sticker already gave the answer. The clip is 90 seconds, free, from a man who saw the last two crashes coming. Almost nobody wants to hear it at the top, and fewer still act on it.

Mary

99,808 views • 1 month ago

Why is Palantir so expensive? You don’t need to look at spreadsheets. Just consider this: The market knows NVIDIA sells the shovels for the AI goldrush. The market is realizing that AI isn’t being monetized at the commercial level because although it’s cool, it’s not unlocking any real insights yet. The market now anticipates that Palantir is selling the maps to find the gold…. Gold being AI-driven insights that actually solve difficult problems. Software that works. Since 2021, NVIDIA’s revenue has exploded from $16B to $96B. Palantir’s TTM revenue is $2.5B. The trajectory of Palantir has changed since AIP released in 2023, which is enabling the company to scale. If NVIDIA sells the shovels, and Palantir provides the maps, then the market believes Palantir will see the same explosion of growth within the commercial market, which the market believes has an almost unlimited TAM for Palantir. A lot of people missed out on NVIDIA. While Palantir’s market cap is expensive at $95B, it is nothing compared to NVIDIA’s $3.26T market cap in terms of size. The market doesn’t want to miss out on the next big thing. At this point, investors have thrown all standard methods of valuation out of the window… Those days were years ago. To me, at this point, buying the stock is betting on NVIDIA-like growth (No I’m not saying the company will shoot to a $3T market cap in 2 years — you get the point). If the company does not show this sort of revenue growth, the stock will be punished. This is the risk investors are willing to take. While I am very bullish on the company in the long run, I, like everyone else, have no clue what will actually happen in the short term. This is not a stock to play on the short term. This is why I continue to hold, regardless of how “expensive” the stock gets. I personally believe Palantir does in fact carry the potential to see explosive revenue growth to more than enough justify its current ratios. I’m not saying it will happen this quarter. But the potential is there. It’s a matter of when, in my opinion. I would never risk selling what I view as my golden ticket to wealth with the justification of “it’s too expensive, the price will come back down and I can buy even more then”. If the stock crashes, I can start buying more shares regardless — I don’t want to get greedy and try to time the market. I would never forgive myself if I sold and the stock ended up soaring so high that even after a crash, it would be far too expensive for me to get back in with my original position size (plus capital gains tax). I don’t care who agrees with me or who thinks I’m crazy for saying this — it’s a real risk to me and I’m not willing to take it. This is not me telling you to buy $PLTR. My average is $8.50. Only you can decide what is right, and your decision should be made on your own level of conviction from studying the company — nothing else. This is me telling you why it’s so expensive. Again, I believe that if the stock does not continue to crush earnings each quarter, even the slightest miss, the stock will be punished in the short term. For longs, it’s another opportunity to accumulate more. This is my opinion, of course. 5-10 years from now, we’ll see who was right. Chips & Ontology.

Jack Prescott

278,422 views • 2 years ago

➡️ Part 27 of Quantitative Finance From Scratch: the Fama-French three factor model. The market beta alone (parts 14 and 15) explains stock returns only in part, so Fama and French added two more factors, size (part 26) and value (part 25). They introduced the model in 1993 in the Journal of Financial Economics ("Common risk factors in the returns on stocks and bonds"). A factor is the return of one portfolio minus another: small minus big (SMB) and high minus low (HML, cheap minus expensive). In the regression, a stock's return above the risk-free rate equals alpha, plus a beta times each factor's return, plus an error term for the stock's own swings. Alpha is what the three factors cannot explain. In our simulation (nine portfolios, three simulated factors, 50 years of monthly returns, assumed numbers, true alpha zero), the market alone leaves the small value portfolio with an alpha of 7.9 % a year and explains only 46 % of its ups and downs. With all three factors, its alpha drops to -0.9 % a year, close to the built-in zero, the model explains 90 %, and the regression finds betas of 1.00, 1.00 and 0.96. The structure is built into the model, so it shows how the method works and makes no claim about real markets. In real data, the three factors explain much of the differences in average returns, though not all: in their 1996 tests, the continuation of short-term returns (momentum) stayed unexplained, and Fama and French later added two more factors. Eugene Fama shared the 2013 Nobel Memorial Prize in Economic Sciences with Lars Peter Hansen and Robert Shiller "for their empirical analysis of asset prices". Education only, not financial advice. #quantfinance #famafrench #factorinvesting #python #finance

QuantFinanceToGo

19,300 views • 24 days ago

implied volatility is a price. realized volatility is what actually happens. the gap between them is one of the most durable edges in markets the chart in that clip is the whole story each dot is a day: what options priced in (IV) versus what the market actually delivered over the next 30 days (RV) the regression line has a negative slope and sits below the diagonal that isn't noise. it's the variance risk premium VRP = IV − RV on average, across decades, implied vol prints higher than the volatility that follows options are, structurally, priced for more movement than actually shows up the reason isn't a mistake. it's insurance whoever sells an option is underwriting risk, the same way an insurer underwrites a house fire they demand a premium above fair value to carry that risk, and buyers pay it because they want protection so the seller of volatility is the insurance company and insurance companies, on average, win. not every policy. on average, over a large book that's the edge retail never sees because retail is almost always the buyer buying calls, buying puts, paying the premium, standing on the losing side of a spread that is baked into the price before the trade even opens on the clip's data: IV was 10.95%, the realized vol that followed was higher on that specific day that's the risk. VRP is positive on average, not always. sometimes RV blows past IV and the seller takes the loss which is exactly why it's a premium and not free money you get paid to hold a risk that occasionally hurts. the edge is that the payment, over enough independent bets, exceeds the damage a desk harvests this systematically: sell the overpriced vol, hedge the direction, collect the spread, size so no single blowup ends the book retail buys the lottery ticket on the other side and wonders why theta bleeds it dry the data is public. IV comes off the options chain, RV is just the standard deviation of returns compute both, subtract, and the premium is right there on a chart you can build in an afternoon the number was never hidden retail was just standing on the paying side of it the whole time full breakdown in the article below

delost

24,189 views • 3 months ago