Загрузка видео...

Не удалось загрузить видео

На главную

➡️ Quantitative Finance from Scratch, part 49: Adverse Selection. A market maker earns the spread, but the job comes with two big risks. The first one was inventory. The second one is adverse selection: trading with someone who knows more than you do. Most people buy or sell for...

14,300 просмотров • 4 дней назад •via TikTok

Комментарии: 0

Нет доступных комментариев

Здесь появятся комментарии из оригинального поста

Похожие видео

➡️ 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

33,700 просмотров • 5 дней назад

➡️ Quantitative Finance from Scratch, part 48: Inventory Risk. A market maker always quotes a price you can buy at (ask) and a price you can sell at (bid) and earns the gap. Its inventory is the stock it holds right now: when you sell to it, the inventory grows, when you buy from it, the inventory shrinks. In a calm market, buyers and sellers arrive about equally often, so the inventory stays near zero. Orders often come in waves. When many people sell at once, the market maker keeps buying and the shares pile up. Then every move in the price hits the whole position. Example: with 5,000 shares, a drop of 10 cents costs $500, as much as the spread earns on 12,500 shares at 4 cents each (P&L = cash + inventory × fair price). So it fights back with its prices. With too much stock, it lowers both its bid and its ask: the cheaper ask attracts buyers, the lower bid brings in fewer sellers, and the inventory shrinks again. With too little stock, it raises both prices. This is called skewing the quotes. When prices move fast, it also widens the spread, and if the position still grows too large, it hedges it or sells part of it. Avellaneda and Stoikov (2008, Quantitative Finance 8(3)) turned this into a formula, the reservation price r = s − q·γ·σ²·(T − t): s fair price, q inventory, γ risk aversion, σ volatility, T − t time left. The more inventory, risk aversion and volatility, the further the quotes move away from the fair price. The code (inv_reel.py, 15 lines of plain Python without packages) is general on purpose: booking a fill, the profit and loss, a half spread that grows with volatility, and quotes around the reservation price. Part 49 looks at the second risk, trading with someone who knows more. If you want to go deeper, check out the full course I built: quantfinancetogo.com #quantfinance #marketmaking #inventoryrisk #finance #python Education only, not financial advice.

QuantFinanceToGo

15,000 просмотров • 5 дней назад

➡️ Quantitative Finance from Scratch, part 51: Market Impact. After the market maker series, we switch sides and look at a big trader who wants to buy a lot of shares. Market impact is the price move that your own order causes. In the order book, sellers wait with limit orders, and each of them only sells a certain number of shares at their price. A big order first takes the cheapest offers, then the next ones at a slightly higher price. It walks up the order book, and every next share costs a little more. Send a huge order all at once, and you push the price up yourself. Market makers react as well: a large buy order looks like someone who knows something, so they move their prices up. Many studies of real trades found a simple rule of thumb, the square root law: impact ≈ Y · σ · √(Q / V). Sigma is the daily volatility, Q is the size of your order, V is the normal daily volume, and Y is a constant close to one. An order four times as large moves the price only about twice as much. So big traders split the order into small pieces and spread them over the day. Each piece moves the price only a little, and the order book can fill up again in between. But waiting has a price too: the longer you wait, the more the stock can run away from you. Robert Almgren and Neil Chriss turned this trade off into a model. A buyer who only cares about the average cost spreads the order evenly. A buyer who fears price swings buys more at the start and slows down later. Either way the big order is hidden in many small trades, so market makers move their prices less. That is why large funds use trading algorithms, for example with the goal of the volume weighted average price (VWAP): each piece follows the normal trading volume of the day. The code (mi_reel.py, 16 lines of Python) is general on purpose: the square root rule, walking up the book, the Almgren-Chriss schedule of shares left, and VWAP pieces. If you want to go deeper, check out the full course I built: quantfinancetogo.com #quantfinance #marketimpact #algorithmictrading #vwap #python Education only, not financial advice.

QuantFinanceToGo

26,300 просмотров • 2 дней назад

➡️ 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: two stocks in the same business that move together. The gap between them, the spread = P_A − β · P_B (P_A price of stock A, P_B price of stock B, β the hedge ratio), keeps coming back to its average. That is the edge: the trade treats this return almost like a law, so the further the spread moves away, the more it should come back, and that way back is the profit. The rule: z = (spread − average) / standard deviation. When z reaches +2 or −2, you sell the expensive stock, buy the cheap one, and close both when the gap is back at its average. Because one stock is long and the other short, a move of the whole market mostly cancels out. News about one company can still hit a single pair, so funds make many such trades at once, and the surprises average out. The big risks: the link between two stocks can break for good, for example after a merger, and when many funds hold the same trades, they can all lose at once. The code (statarb_reel.py, 16 lines of plain Python without packages) is general on purpose: the spread from two prices and the hedge ratio, the z score, and the signal that sells the expensive stock and buys the cheap one at two standard deviations and closes at the average. If you want to go deeper, the link to my website is in my bio. #quantfinance #statisticalarbitrage #pairstrading #meanreversion #python Education only, not financial advice.

QuantFinanceToGo

44,000 просмотров • 7 дней назад

➡️ 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

110,000 просмотров • 18 дней назад

stop scrolling and clone this before it gets paywalled. someone put their entire trading loop on GitHub. the model, the order logic, the dashboard. all of it. it makes one decision every ~300 milliseconds and quotes a fresh limit order on every single block. the brain is Jev. it can't write a word. it looks at the order book and returns buy or sell with a probability. what the loop does each block: -> reads the live order book -> asks Jev: buy or sell? -> posts a post-only limit order one tick inside the touch -> replaces the last order -> waits for a taker to hit it the useful part: it never crosses the spread. fills only happen when someone else takes the order, so the bot is built to earn the spread instead of paying it. and every block is logged: the decision, the probabilities, the latency, the quote. the setup: git clone cp .env.example .env bun install bun run start -> with no private key it dry-runs: real book, real decisions, simulated fills then in .env: MODEL=jev TYPESAFE_AI_API_KEY=your-key -> swaps the built-in momentum stand-in for Jev want the full desk instead of one loop? -> QuantDinger ships Jev as a pre-trade gate: research, Python strategies, backtest, paper and live the workflow: order book in -> Jev decides -> code prices the order -> the market fills it or doesn't start here: one clone -> dry run -> watch 1,000 blocks of decisions before a single real order the catch: fast is not the same as right. quoting inside the spread can still lose money when the price moves against you. none of this is an ATM. > let the big model do the research. > let Jev make the call. > let code place the order. clone it now. dry-run it tonight. decide tomorrow.

kiosa

23,935 просмотров • 1 месяц назад

➡️ Quantitative Finance From Scratch, Part 21: Linear Regression in finance Linear regression finds the straight line that best describes how one quantity moves with another. In finance, that is often a stock's daily return against the market's daily return. Least squares: for every day, you measure how far the real return lies from the line, square that distance and add everything up. The best line makes this sum as small as possible. The line has two numbers. The slope is the beta from Part 14: how strongly the stock follows the market. The intercept is alpha: what the stock earns on average on a day when the market does not move. What the line cannot explain is the residual, and R² tells you which share of the swings (the variance) the line explains, from 0 for nothing to 1 for everything. In this video we simulate two years (504 trading days) of a market and a stock with a built-in beta of 1.2, a second factor with a beta of 0.6 and no alpha. The line finds a beta of 1.26 (the 1.2 lies within the range of chance for two years of data), an alpha of +0.05% a day and an R² of 52%. With two inputs, the line becomes a plane: betas 1.27 and 0.60, R² 63%. Quants use regression to estimate betas, to size hedges, to test whether a strategy earns more than its risk, and to check whether two assets really move together. The limits: a regression only finds a relationship in the data you give it. It does not prove that one thing causes the other, a few extreme days can pull the line (three invented extreme days move our slope from 1.26 to 1.10), and a relationship from the past can change. Education only, not financial advice. #quantitativefinance #quant #finance #regression #beta

QuantFinanceToGo

59,100 просмотров • 1 месяц назад

HOLY SH*T this guy buys a dollar for 98 cents on Polymarket EVERY TIME. his bot's been doing it all night and it's up $4,293 now. total PnL is over $294k thanks to one rule: buy only when YES + NO < $1 public wallet: [ here's how it works: every 15 minutes bitcoin gets an up market and a down market. up on one pan, down on the other. when the window ends, one pan is worth a dollar and the other is worth nothing, so a fair price for the pair is exactly one dollar. buy up at 54 cents and down at 46 and you paid a dollar for a dollar. pointless. but the scale doesn't always sit at a dollar. every so often up is 54 and down is 44, and the pair only costs 98 cents. that's the scale breaking. you buy both pans for 98, one of them settles at a hundred, and the 2 cents is yours no matter which way bitcoin moved. you never guessed. you weighed two numbers and bought only when they came up short of a dollar. why does the scale break? because up and down are priced by two different crowds that never look at each other. a buyer leans on the up pan, its price rises, and the down pan hasn't moved yet. for a few seconds the pair is cheap. the bot lives for those seconds and does nothing the rest of the time. now the honest part, because this clip doesn't sell you a fantasy. it's not a moonshot. look at the equity line, a slow staircase, not a rocket. 63% hit rate. real losses sitting right in the log, minus 109, minus 21, a flat one at minus 71. it wins about six times out of ten, the wins are two and three cents, and the bank grinds from 683 to 4,293 while it sleeps. boring and up. that's the whole personality. the losses come from one thing: the scale tips before you get both pans. you buy up, and down runs off before your second order lands, and now you're holding one side, a real bet on bitcoin you never wanted. that's the only wound. get both pans or get out. the strategy end to end is this small: weigh up against down, buy when they're under a dollar, bail if you only catch one side. that's it. a scale and a stopwatch. and the people already running it will never point at a live scale, because the second they do, everyone leans on it and it stops breaking. so they stay quiet and the boring staircase climbs in private. the full build + one rule that stops a half-fill from becoming a real loss is in the article below. good luck.

Oracle Boar

93,881 просмотров • 2 месяцев назад

Don’t get fooled by that big number on your chart, it’s not the price just waiting for you. I want to be clear about that up front. That bold price you see is just where two traders shook hands on a deal. That’s history. Honestly, I used to look at it like it was some live pulse on the market. I’d plan my whole trade around it, hoping to get filled close to that number. More than once, I watched my fill slip further away, and yeah, I used to blame the exchange before I admitted I just misunderstood the book. So let’s get real about what’s actually moving. A buyer can say this is the highest price I'm willing to pay( $100 that's the bid) Right now, the top bid might be $100, while the the seller can say best offer sits at $101. That $1 gap? That’s your spread. The bid and ask is the conversation still happening right in front of you. When you fire off a market order, it doesn’t chase down that last print. It grabs the best available price, and if there’s not enough there, it keeps reaching for the next one in line. The number flashing on your screen and the price you actually get can end up pretty far apart. I used to think that meant something was wrong with my broker, but it’s almost always the market talking. Thin order books, volatile moments, or simply dropping an order bigger than what’s sitting there, any of those will throw your fill off the mark. Usually, a tight spread means buyers and sellers are pushing hard against each other. If the spread’s wide, it’s just more expensive to jump in or out. But here’s something that took me a while to learn. A close bid and ask doesn’t mean there’s real weight behind those numbers. Sometimes, there’s just a tiny sliver of size sitting there, and it can disappear in a blink, leaving you chasing worse prices. The spread doesn’t judge your asset or hand out prizes. It’s just a snapshot of what’s happening right now. Every time I size up for a trade, I check four things: Where’s the best bid? Where’s the best ask? How wide is the spread? And how much size is actually parked at those prices? That’s the difference between being a spectator and actually reading the market. That’s what Opportunity Compass was all about. The gold, stocks, Blbitcoin, doesn’t matter. It’s all just auctions in action. But the feel changes with every market because rules, hours, and liquidity change the look of the book. MEXC rolled out Opportunity Compass to help people read those conditions, not just add another trading pair to their list. Anyone can pull up an order book. Understanding what it’s telling you is how you hear the market speak before your trade becomes the next deal. Last price is just your receipt. Bid and ask is the live discussion. The spread tells you how far apart buyers and sellers really are. Depth shows you how much weight a price can hold before it budges. So tell me, when you hover over that buy button, what grabs your eye first? The last price? The spread? Or the stack behind those numbers? Check Out Full Opportunity Compass path: Not financial advice. DYOR. #MEXC

Andy Lui

22,294 просмотров • 2 месяцев назад

➡️ Quantitative Finance from Scratch, part 41: Volatility Targeting. In quant finance, risk is usually measured as volatility, how strongly a price swings up and down. Volatility comes in clusters, so stormy days tend to follow stormy days, and that makes it possible to forecast it to some extent. GARCH from parts 39 and 40 is one way to do that; rolling averages and exponentially weighted averages are others. Volatility targeting takes that forecast and compares it with a risk target you choose yourself. If your target is 10 % a year and the forecast for the market is 20 %, the market is twice as wild as you want, so you hold 10 / 20 = 50 % of your money in the market, and your risk stays at 10 %. In general: exposure = target volatility / forecast volatility. When the forecast is above your target, you hold less than all of your money. When it is below, the rule asks for more than 100 %, which means borrowing, so the exposure usually gets a cap. One limit remains: every forecast looks back. A sudden crash after a calm stretch still hits a full position, and only afterwards does the forecast jump and the position shrink. The code (vt_reel.py, 15 lines of Python with numpy) is general on purpose: a GARCH forecast for tomorrow from today's move and today's forecast (omega 0.05, alpha 0.10, beta 0.85 in percent squared per day, as in part 39), the rule exposure = target / forecast with a cap, and a daily loop over the returns that sets the exposure before each day and updates the forecast after it. #quantfinance #volatility #riskmanagement #finance #portfoliomanagement Education only, not financial advice.

QuantFinanceToGo

10,700 просмотров • 12 дней назад