Loading video...

Video Failed to Load

Go Home

➡️ Quantitative Finance From Scratch, Part 20: Backtesting. A backtest tests a trading strategy on historical data, as if you had used it back then, to see whether it would have made money and how much risk it took along the way. Portfolio managers, analysts and quant researchers run...

35,300 views • 1 month ago •via TikTok

0 Comments

No comments available

Comments from the original post will appear here

Related Videos

➡️ Quantitative Finance From Scratch, Part 22: Hypothesis Testing. You start with the null hypothesis: the strategy's true average return is zero, so there is no edge. Then you ask how often pure luck would produce a result at least as extreme as yours if that were true. The t statistic divides the average return by its standard error (the typical size of the random error in an average). The p value is the probability of a t statistic at least this far from zero when there is really no edge. At the 95% confidence level, a result counts as significant when the p value is below 5%, and that matches a 95% confidence interval that does not include zero. In this video we simulate a strategy with a small real edge built in (a true Sharpe ratio of 1, daily swings of 1%) for five years. It reaches a t statistic of 1.50 and a two-sided p value of 13.3%. The 95% interval for the average daily return goes from -0.013% to +0.096%, so it includes zero and the result is not significant at the 5% level, even though the edge is real. By chance, the run only showed a Sharpe ratio of 0.67 instead of 1, and five years of data were not enough this time. A useful rule: the t statistic is about the yearly Sharpe ratio times the square root of the number of years. With a Sharpe ratio of 1, you need about four years to reach a t statistic of 2. The biggest trap is testing many rules. Test 100 strategies with no edge at all, and about 5 will still pass at the 5% level by luck. In our run, 7 did. A p value is not the probability that your strategy works. The test assumes independent returns and a market that stays the same, and a real edge can still be too small to survive trading costs. All numbers come from one simulated run with assumed numbers (seed 22). No real market data, no strategy recommendation. Education only, not financial advice. #quantitativefinance #quant #hypothesistesting #trading #statistics

QuantFinanceToGo

101,200 views • 1 month ago

➡️ 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 views • 1 month ago

Citadel and Renaissance make billions on one test you've never heard of. It's now free. And almost no trading strategy survives it Most traders don't even know their strategy is dead. Because they never do the one thing every hedge fund does Split the history in half. Build the strategy on the first half. Don't touch the second one, the strategy must never see it Then test it only on that second half. If the edge is gone, it was never there. It was a fit to the past But here's the trap few people know. If you tried 200 versions and kept the best one, even this check will lie to you. Because one of the 200 passes it by pure luck That's what funds count and you don't. Not how pretty the chart is, but how many times you tried before it got pretty I took a simple rule: hold the S&P when it's above its 200-day average, exit when it's below On the years it had never seen, the same growth as buy-and-hold, but half the drawdown Then I ran it with the average at 50, 100, 150, 200, 250 days. A real edge holds across all of them. Luck works on one number and dies on the next Most textbook strategies don't pass this test. Your meme-coin one has no chance And here's the main trap: the prettier the chart, the more you believe it. The more you believe, the more you bet So the strategy you love most takes the most money The market will test your strategy either way. The only question is whether it's before or after you put money into it How to run this test on real data, before your strategy touches your money, in the article below

qwinsi

10,334 views • 28 days ago

➡️ Quantitative Finance From Scratch, Part 24: Momentum. Momentum means that assets which rose the most over the past months tend to keep rising a little longer, and the biggest losers tend to keep falling. It is the opposite of mean reversion from part 23. Quants usually measure it as the return over the past 12 months, leaving out the most recent month, because very short moves tend to reverse. In research, a classic momentum portfolio ranks many stocks by this past return, buys the top group, sells the bottom group and repeats this every month. In practice there are two common versions: long only (you only hold the top ranked stocks, for example through a momentum fund) and long short (winners minus losers, so the ups and downs of the whole market largely cancel out). In this video we simulate 500 stocks for 30 years with a small built-in continuation: expected returns that drift slowly. The long short version earns 5.9% a year with a t statistic of 6.00 and a beta of -0.01 to the market. The long only version earns 13.7% a year, but with a beta of 0.99 it moves almost one for one with the market, which itself earned 10.5% a year in this simulated path. Momentum has been found in stocks, bonds, currencies and commodities, and in more than 200 years of stock data. It also has a dangerous side: after a market fall, a sharp rebound can lift the past losers fast, and momentum portfolios have had sudden, very large losses, for example in spring 2009. Some studies find it weaker and more volatile in recent decades, and trading costs eat a part of it, but it has not disappeared. All numbers come from one simulated run with assumed numbers (seed 24). No real market data, no strategy recommendation. Education only, not financial advice. #quantitativefinance #quant #momentum #factorinvesting #finance

QuantFinanceToGo

54,000 views • 1 month ago

Ant Group's AI agents found a trading strategy on their own, and with it the fund hasn't lost once in the past year Sharpe ratio came out at 2.5. What used to take a team of PhDs and years of work, the agents did overnight, for free But the real power of this result isn't the number itself Agents can run thousands of times more strategy variations than any human could in a lifetime And the more variations you test, the higher the chance that one of them looks profitable purely by accident Your brain can't tell "I found a pattern" from "I got lucky on the hundredth try." The feeling is identical in both cases The only way to tell them apart: test the result on data the strategy has never seen A real edge survives there. Luck falls apart I got curious what this difference looks like live, so I took two real academic quant strategies and ran both through this exact test The first, Time Series Momentum on Bitcoin, passed: +1,537%, Sharpe 1.02. It looked honest, and it stayed honest The second, Betting Against Beta, a textbook classic in every finance course, looked flawless on paper. Under this test it fell apart: -7.78% a year, while the market grew 14.86% And the second result turned out to be the more valuable one. Not because it's positive, but because it's true, and it showed that before it could take real money I simply described both ideas in plain words, the AI built the exact rules itself and ran them on real data, with no peeking at future data You can test your own idea here (free trial period after sign-up): The same test on momentum and Betting Against Beta, step by step, so you can run it on your own idea tonight, is in the article below

qwinsi

16,825 views • 1 month ago

Ken Griffin, who runs Citadel, just admitted that the most expensive skill of his quants, the one he paid them millions for, now costs nothing And for the first time in history, that skill belongs not just to a hedge fund, but to anyone with access to AI A fund's entire quant team runs one cycle: come up with a strategy, turn it into code, test it on history, deploy it to the market Every step used to cost separate people and years of training. Now AI does the whole cycle You describe an idea in words, it writes the strategy itself, runs it on years of real data, and if it's alive, deploys it straight to a broker But the speed isn't the point. The point is what the retail trader doesn't understand You take a strategy with a beautiful chart and you believe it. But a beautiful chart is no proof Run enough versions and a profitable curve will appear even on random numbers. One just got lucky, and you decided you found gold Funds don't trust any curve until they test it on data the strategy has never seen. There the fit falls apart, and a real edge survives I ran two of the most-cited quant papers through this cycle Time Series Momentum on Bitcoin: +1,537%. Alive Betting Against Beta, a classic from every textbook: minus 7.78% a year while the market rose 14.86%. A corpse One still prints money, the other died long ago. And trading blind, you'd never know which is which until it took your deposit If you want to run your own idea through the same test, it takes minutes here (free trial after signing up): The entire hedge fund is six steps. AI already ate four of them. Which ones, I broke down in the article below

qwinsi

425,352 views • 1 month ago

The company behind DeepSeek makes more money from trading than from AI. Their weapon isn't a secret model, it's one principle that's now available to everyone Few people know this, but DeepSeek didn't grow out of an AI lab. It grew out of a quant fund that spent years making money in the markets, then poured that money into the model And the principle they profit from is more boring than everyone thinks They don't search for one genius trading idea. They take a thousand ideas, run each through a machine, and only let the ones that pass survive to trade While a human tests one idea a week, their system kills 999 a night That's the whole difference between them and a retail trader. Not brains. The speed and ruthlessness of the testing Because here's what few understand about their own losses. You find a strategy with a beautiful chart and you believe it But a beautiful chart is no proof it works. Run enough versions and a profitable curve will appear even on random numbers One of the dozens just got lucky, and you decided you found gold This filtering used to be locked inside funds like these. It took a team and millions. This year it was compressed into AI I described an idea in plain words, and AI built the strategy itself, ran it on years of real data, and showed whether it was real or just luck I took two of the most-cited quant papers, so I wouldn't take it on faith Time Series Momentum on Bitcoin: +1,537%. Alive Carry trade, a strategy cited for years: Sharpe dropped from 0.61 to 0.11. The premium almost dead One still prints money, the other dried up long ago. And trading blind, you'd never know which is which until it took your deposit The same principle DeepSeek paid millions for is now one prompt. You can test or build your own strategy here (free trial after signing up): The full breakdown of both strategies is in the article below

qwinsi

41,007 views • 1 month ago

Millions of people are asking AI to find them a profitable trading strategy. The problem is AI will find one even where it doesn't exist One quant proved it. He gave an AI agent 4 years of prices with, by design, no pattern in them whatsoever. Pure noise The agent came back with a long/short strategy and a Sharpe of 2.1 on the backtest. It even added a paragraph explaining the economics of an effect that doesn't exist in nature It didn't lie on purpose. It just found a pattern where there was none And that's the scariest part. Because that's exactly how any AI will behave when you hand it your idea. It will always hand you back a beautiful curve, and you'll believe it, because it looks perfect 89% of retail traders lost money last year. Not because they had no ideas. Because not one of their ideas ever went through this kind of test That's why generating strategies is worth nothing. Anyone and anything can draw a profit on history Only one thing matters: testing on data the strategy has never seen. The moment the beautiful curve either survives or falls apart That's the whole difference between a hedge fund and a trader who blows up. A fund doesn't trust any curve until it's been through fire. It kills 97 ideas out of 100 before risking a single cent I ran the most-cited quant strategies in history through exactly this test, with AI. Momentum on BTC returned +1,537%. Carry trade on currencies fell apart and showed its premium is dead. And it was the one that fell apart that would have saved me money AI will draw you a strategy in seconds. The only question is whether you test it before it tests your account You can try it here: How to set up that test for yourself, the same one that separates a hedge fund from a casino, is in the article below

qwinsi

48,045 views • 1 month ago

Jane Street made $16 billion in a single quarter with a team smaller than an average school. And their entire edge is one process anyone can now repeat And it's not gut-feeling trading. It's a cold assembly line they've been running for years Here's how it actually works They take an idea and split the history in two. On the first part they build the strategy. The second stays sealed, the strategy never sees it Then they test it on exactly that sealed part. Falls apart, they throw it out. Survives, it's a real edge, not a fit to the past And here's why this is critical, something few understand Your brain sees patterns where there are none. You tweak the parameters, the curve finally turns beautiful, and you feel the thrill of winning. The same chemistry as a real win But you won nothing. You just kept iterating until one version got lucky Here's the proof. Give AI pure noise, where making money is impossible, and ask it for a strategy. It'll hand you a beautiful curve and even explain why it works A chart can be drawn on anything. That's why a beautiful backtest proves nothing And here's the main trap. The prettier the chart, the more you believe it. The more you believe, the more you bet So the strategy you love most takes the most money This whole cycle used to need a team of quants and millions. Now AI does it. You describe an idea in words, it writes the strategy and runs it through the sealed-data test itself I ran two legends through it, so I wouldn't take it on faith Time Series Momentum on Bitcoin: +1,537%. It survived on the sealed data. A real edge, not a fit Betting Against Beta, a textbook classic: on that same data it fell apart. Minus 7.78% a year while the market rose 14.86%. A corpse One held up, the other didn't. And without this step you'd never know which is which, until it took your deposit The whole process with both tests, and how to repeat it, is written up in the article below

qwinsi

98,955 views • 1 month ago

Jim Simons made $104 billion with one rule most traders break every day. Now anyone can follow it for free His fund made 66% a year for 30 years. Not because his people were smarter. Because they never trusted a strategy they hadn't tried to kill Here's how it actually works Take an idea. Split the history in two. Build the strategy on the first half. The second stays sealed, the strategy never sees it Then test it only on that sealed half. Falls apart, throw it out. Survives, it's a real edge, not a fit to the past And here's the trap few people know Your brain sees patterns where there are none. You tweak the settings, the chart finally turns beautiful, and you feel like you won But you won nothing. You just kept trying until one version got lucky Here's the proof. Quantopian looked at 888 real trading strategies people built and ran live How good the backtest looked predicted almost nothing about how they did with real money. Less than 3% The prettiest charts were often the ones that died fastest. Because the more you tweak, the better it fits the past and the worse it trades the future And here's the main trap. The prettier the chart, the more you believe it. The more you believe, the more you bet So the strategy you love most takes the most money This test used to need a team of PhDs and millions. Now AI runs it. You describe an idea in words, it builds the strategy and puts it through the sealed data itself The market will test your strategy either way. The only question is whether it's before or after you put money into it How to plug your AI into real market data and run this exact test on your own idea, in the article below

qwinsi

16,624 views • 18 days ago

Ken Griffin, who runs Citadel, just admitted that the biggest advantage of giant funds, armies of people and billion-dollar budgets, is disappearing And for the first time in history, a small team with AI can move faster than a hedge fund He’s seen it in his own firm. His AI agent does in 2-3 hours what used to take Citadel’s PhD researchers 6-8 weeks A fund runs one cycle: come up with a strategy, turn it into code, test it on history, deploy it to the market Every step used to cost separate people and years of training. Now AI does the whole cycle You describe an idea in words, it writes the strategy itself, runs it on years of real data, and if it’s alive, deploys it straight to a broker But the speed isn’t the point. The point is what the retail trader doesn’t understand You take a strategy with a beautiful chart and you believe it. But a beautiful chart is no proof Run enough versions and a profitable curve will appear even on random numbers. One just got lucky, and you decided you found gold Funds don’t trust any curve until they test it on data the strategy has never seen. There the fit falls apart, and a real edge survives I ran two of the most-cited quant papers through this cycle Time Series Momentum on Bitcoin: +1,537%. Alive Betting Against Beta, a classic from every textbook: minus 7.78% a year while the market rose 14.86%. A corpse One still prints money, the other died long ago. And trading blind, you’d never know which is which until it took your deposit Griffin says the future belongs to small teams with AI. But the only ones who win are the ones who test before they bet How to plug your AI into real market data so it runs this exact test instead of guessing, in the article below

qwinsi

68,034 views • 21 days ago

➡️ 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,300 views • 10 days ago

Wall Street burns billions trying to predict Bitcoin. A 28-year-old self-taught coder in Warsaw made $377,000 by not even trying. He'd lost money on three trading bots before this one. Each looked perfect on paper, then started losing money the moment he ran it for real market. So he built bot that doesn't trust itself. His wallet: The truth is simple: you can't predict the next five minutes of Bitcoin. It's a coin flip. Anyone selling you a "prediction" is selling you nothing. So he stopped predicting. The bot hunts the moments the crowd is wrong instead. Here's the part that makes the money, and it's the opposite of what everyone builds. Any strategy can be made to look amazing on past data. On a 5-minute chart, most of them are just lucky, not real - and they stop working fast. So the bot treats every strategy it finds as fake until it proves otherwise. Each one has to pass a hard test: > test it on old data → test it on data it's never seen → try to break it on purpose → cut it down to the one thing that matters → run it forward → keep it only if it still works Last round, 10 of its 12 "winning" strategies turned out to be fake. It kept the 2 that actually worked and dropped the rest. And it never stops - building, testing, and dumping strategies around the clock. What worked yesterday can stop working today, so the second one starts losing, it gets cut before it costs you a thing. The result: $433,000 across 2,955 trades All his old bots tried to be right. This one just tries to catch itself being wrong - and that's why it's still alive. Bookmark this article below - it's the breakdown that explains why your last bot died. It's pruning and trading right now. Copy its wallet and skip to the edges that survived:

cvxv666

27,854 views • 4 months ago

Trading without AI in 2026? You're done. Purely on the math, before anyone even out-trades you. You are not up against other people anymore. 75% of US stock volume runs through machines. Jane Street put $6 billion and 4,032 GPUs behind agents that write trading strategies, test them and kill them all night. Man Group's AI turns out hundreds of new signals a week where its human desk used to manage about 20 a quarter. You're on the other side of that with a chart and a feeling. 89% of retail traders lost money last year. The gap was never brains. Testing one idea properly costs a desk about $87,500 in salary time or massive computing power for AI. You don't have any of those things. That part is over. You have your own AI trading agent now, built by a team backed by Entrée Capital and hedge fund managers, and trying it costs nothing: No code, no desk, no excuses left. What it does with one English sentence: > compiles your idea into entry, exit, sizing and risk rules > backtests 5 years of data in about 12 seconds, 1-minute bars in 47 > scores it 0 to 100 on Sharpe, Sortino, profit factor and max drawdown > kills anything with a half-life under 10 days no matter how pretty the curve looks > runs walk-forward and Monte Carlo on whatever survives, then years of data it has never seen > puts it live on your exchange in about 90 seconds and keeps running while you sleep Same machine the funds run, minus the hiring, the salaries and the three-week wait. 4,800+ traders are already inside. Save this and put one idea through it tonight after read full breakdown below. You'll know in 12 seconds what three weeks of hoping never told you.

cvxv666

38,982 views • 3 months ago