User
Write something
SPREAD: SAME TRADE, TWO SPREADS. YOUR BACKTEST CHARGES YOU 35X TOO MUCH (VIDEO + SCRIPT)
Okay so if you came here because you commented SPREAD, welcome. The video from the reel is attached, and so is the script, so you can run the same check on your own tickers. And before you pay for any data, use my code RICK10, it gets you the best price (more on that at the bottom). What you're watching is one AAPL session, 16 Nov 2026, played out twice. Top screen is a backtest that guesses the spread from daily highs and lows, that's the Corwin-Schultz estimator, the one half the Python libraries ship with. Bottom screen is what Nasdaq actually quoted. Same price path, same three round trips of 100 shares, buy at the ask, sell at the bid. The only thing that changes is the data. - Backtest spread: $1.80 a share (50.9 bps) - Real spread: $0.05 a share (1.45 bps, Nasdaq's best bid and offer, time-weighted) - Three round trips: -$540 in the backtest, -$15 for real That's 35x. And look at the magnified part at the end of the video, the red wall is what your backtest thinks you pay every time you cross the spread, the thin green line is what you actually pay. Why it matters, right? Charge 50 bps a round trip on anything that trades often and you throw away strategies that are actually fine. And the estimator isn't even consistently wrong, on 7 of the 20 days it said the spread was exactly zero, on 30 Oct it said 143 bps. So your cost model is basically noise. Being cheap with data loses you money, just not always in the direction you'd expect. Honest caveat: the bands in the video use the 20-day averages (26 Oct to 20 Nov 2026) on the 16 Nov price path, not that one day's estimate. The real side is Nasdaq's own best bid and offer, not the national best, sampled in six 10-minute windows a day. HOW TO RUN IT - pip install lse-data pandas pyarrow numpy - Make a free account on London Strategic Edge and create an API key - export LSE_API_KEY=your_free_key - python spread.py Part A runs on the free key: a year of AAPL 1-minute bars, daily highs and lows, Corwin-Schultz on them, plus how many days come out as zero. Part B pulls the real Nasdaq quotes for the last 5 sessions and gives you the ratio, that one needs their Nasdaq TotalView data, so set LSE_NASDAQ_KEY as well.
0
0
SPREAD: SAME TRADE, TWO SPREADS. YOUR BACKTEST CHARGES YOU 35X TOO MUCH (VIDEO + SCRIPT)
AUCTIONS: TWO PRINTS A DAY THAT BREAK YOUR VOLUME BARS (SCRIPT)
Okay so if you came here from Instagram because you commented AUCTION, welcome. The script from the reel is attached at the bottom of this post. Quick idea first. Volume bars close a new bar every X shares. You pick X so you get a normal number of bars a day, say 78, the same as 5-minute bars. So X = the day's volume divided by 78. Simple, right? The problem is the opening and the closing auction. Each one is a single print, and on a stock like AAPL that single print can be millions of shares. If you leave them in the volume when you set X, X gets way too big and your continuous trading gets far fewer bars than you asked for. The math is one line. If s is the share of the volume in the auctions, the threshold with them in is 1 / (1 - s) times the threshold without them. So your bars a day go from 78 to about 78 x (1 - s). Here's what I measured on AAPL, 20 sessions of Nasdaq trades (26 Oct to 20 Nov 2026): - The opening and closing cross together: 54% of AAPL's Nasdaq volume in regular hours. Two prints a day. - Threshold set on continuous trading only: 78 volume bars a day, like you wanted. - Threshold set on all the volume, auctions in: 36 bars a day in continuous trading. 54% fewer. - The biggest single print, the closing cross on 20 Nov 2026: 14,712,751 shares in one trade. That's 71 volume bars on its own, and a volume bar can't split a trade. So nothing is wrong with the data here, the auctions are real trades. It's a calibration mistake. Set your bar size on continuous trading and treat the open and close auctions as their own events, they're a different kind of trading. HOW TO RUN IT - pip install lse-data pandas pyarrow numpy - Make a free account on London Strategic Edge and create an API key - export LSE_API_KEY=your_free_key - python auctions.py Part A runs on the free key: AAPL 1-minute bars for the last 30 days. The closing auction lands in the 16:00 bar, so the script compares that bar to a normal minute and counts your volume bars a day in continuous trading with the threshold set with vs without it. Mine on 23 sessions to 25 Nov: the 16:00 bar was 209x a median minute, and continuous trading got 54 bars a day instead of 72 (24% fewer). These are all-venue bars, so the auction is a smaller share there than on Nasdaq alone. Part B finds the actual opening and closing cross prints in the Nasdaq tape over the last 10 sessions, that needs their Nasdaq TotalView data, so set LSE_NASDAQ_KEY as well.
0
0
FAT TAILS: HOW MUCH OF IT IS JUST YOUR BARS? (SCRIPT)
Okay so if you came here from Instagram because you commented TAILS, welcome. The script from the reel is attached at the bottom of this post. Quick idea first. Most textbook models assume returns follow a bell curve. The number that tells you how far off that is, is excess kurtosis: a bell curve has 0, anything above means more big moves than the bell curve allows. Jarque-Bera is the test on top of it, it combines skew and kurtosis into one number, and the bigger it is the less your returns look normal. Everybody knows real returns have fat tails. What people don't check is how much of that comes from how they sample. A 5-minute bar at the open holds way more trading than a 5-minute bar at lunch, so the bars are not alike and you mix quiet bars with crazy ones. Dollar bars close a new bar every X dollars traded, so every bar holds about the same amount of trading. Here's what I measured on AAPL, 20 sessions of Nasdaq trades (26 Oct to 20 Nov 2026), auctions removed, both bar types sized to 78 bars a day: - 5-minute bars: excess kurtosis 5.1, Jarque-Bera 1,642. - Dollar bars, same trades: excess kurtosis 2.5, Jarque-Bera 398. About half. - Moves bigger than 4 standard deviations: 12 of the 5-minute bars. A bell curve expects 0.10 in that many bars. Dollar bars: 4. - The biggest 5-minute bar: 19 Nov, 09:35, a 6.2 sigma drop. Under a bell curve that's 1 in 1.7 billion per bar. The biggest dollar bar was 5.3 sigma. - SPY is even clearer: kurtosis 4.4 on 5-minute bars, 0.7 on dollar bars. So the tails don't disappear, 2.5 is still not a bell curve, the market really has fat tails. But about half of what you saw on 5-minute bars came from the clock. If your risk model, your stop sizes or your position sizing are calibrated on time bars, you're mixing two things: the market's tails and your own sampling. HOW TO RUN IT - pip install lse-data pandas pyarrow numpy - Make a free account on London Strategic Edge and create an API key - export LSE_API_KEY=your_free_key
0
0
ACTIVITY CLOCK: WHY YOUR 5-MINUTE BARS RUN ON THE WRONG CLOCK (SCRIPT)
Okay so if you came here from Instagram because you commented CLOCK, welcome. The script from the reel is attached at the bottom of this post. Quick idea first. A 5-minute bar treats every minute of the day the same. 09:30 to 09:35 is one bar, 13:50 to 13:55 is one bar, same weight in your model. But the market doesn't trade evenly at all. It's busy at the open, it goes to sleep at lunch, and then it goes crazy into the close. So when you sample on the clock you're sampling the boring middle of the day just as often as the part where most of the trading actually happens. Here's what I measured on AAPL, 20 sessions of Nasdaq trades (26 Oct to 20 Nov 2026), auction prints taken out: - On average 394 trades a minute over the whole day. - Lunch (12:00 to 13:30): 251 a minute. The quietest 5 minutes, 13:50 to 13:55, only 220. - The first 5 minutes: 1,521 a minute, that's 6.1x lunch. - The last 5 minutes: 3,748 a minute. 15.0x lunch. Same "one bar" as the lunch one. - The first and last half hour together: 38% of all the trades, in 15% of the clock. - SPY has the same shape, a bit flatter: the close is 6.5x lunch. Now flip it around. Say you close a bar every N trades instead, and you size N so you still get 78 bars a day, the same as 5-minute bars. Then the last half hour gets 17 bars and the clock gives it 6. Lunch gets 3 to 4. That's the point, your bars follow the activity instead of the wall clock, and each bar holds about the same amount of information. This is not a "time bars are evil" thing. It's just that if you compute volatility, signals or features on time bars, the open and the close are crammed into a handful of bars and lunch is spread over dozens. Your model sees the wrong mix of the day. HOW TO RUN IT - pip install lse-data pandas pyarrow numpy - Make a free account on London Strategic Edge and create an API key - export LSE_API_KEY=your_free_key - python activity_clock.py Part A runs on the free key: AAPL 1-minute bars for the last 30 days, they carry a trade count per minute, so you get trades per minute through the day, open and close vs lunch, and a little histogram of how many trade bars land in each half hour vs the 6 from the clock. Part B uses every single Nasdaq trade over the last 5 sessions, that needs their Nasdaq TotalView data, so set LSE_NASDAQ_KEY as well. Mine on the free key (23 sessions to 25 Nov): open 5.8x lunch, close 7.3x lunch, last half hour 10.7 trade bars vs 6 on the clock. The free bars count trades on all venues, so the levels differ from the Nasdaq-only numbers, the U-shape is the same.
0
0
BAD PRINTS: ONE TRADE 50 BPS OFF THE MARKET (SCRIPT)
Okay so if you came here from Instagram because you commented PRINT, welcome. The script from the reel is attached at the bottom of this post. Quick idea first. A bad print is a trade reported far away from where everybody else is trading, and then the price snaps straight back. On a chart it hides inside a high or a low you'd never question. In a backtest it's worse, your stop or your limit gets filled at a price the market never really traded at, and you think you found something. How do you catch them? Two steps. First the classic filter: flag any return beyond 5 rolling standard deviations, where the standard deviation only uses the returns before it, so a big move can't hide by blowing up its own yardstick. Second, on trades you can ask the real question: did the price stay there, or did it snap back? If within 20 trades it gave back more than half of the jump, it's a single print, not a move. Here's what I found on AAPL, four sessions of trades (28 Nov, 10 Dec and 19 Dec 2025, 20 Nov 2026): - 19 Dec 2025, 15:55:30: a derived consolidated feed printed AAPL at $271.15, 50 bps below the market. The very next trade was back at $272.49. - Nasdaq TotalView, same 7 seconds: every trade between $272.45 and $272.60. On the exchange's own feed the price never went there. - Over the four days: 5,510 single prints on the derived feed, that's 46 per 10,000 trades. Nasdaq TotalView: 286, 5.3 per 10,000. - Worst day was 19 Dec 2025, an index rebalance day: 2,125 single prints on the derived feed, 82 on Nasdaq. And daily bars? A 5-sigma filter flags a day and that's it, it can't tell you if it was one stray trade or real trading. So clean your data on the level where you can actually see it, and know what feed you're testing on. Same idea as always, garbage in, garbage out. HOW TO RUN IT - pip install lse-data pandas pyarrow numpy - Make a free account on London Strategic Edge and create an API key - export LSE_API_KEY=your_free_key - python bad_prints.py Part A runs on the free key: a year of AAPL 1-minute bars, the 5-sigma filter on the closes (overnight gaps left out), and it prints the flagged minutes. Mine on 25 Nov: 306 flagged minutes out of 98,227, 31 per 10k. You'll see the problem straight away, a bar can't tell you what the flag was. Part B needs their Nasdaq TotalView data, set LSE_NASDAQ_KEY as well: it runs the filter trade by trade on one day and classifies every flag as single print or sustained. Mine on 25 Nov: 95 single prints in 165,601 trades. You can pass a date, python bad_prints.py 2025-12-19.
0
0
1-29 of 29
powered by
Quantamentals for traders
skool.com/quantamentals-for-traders-5814
Beginners education under construction by Rick (Free)
Build your own community
Bring people together around your passion and get paid.
Powered by