<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Quantooox</title>
    <description>The latest articles on DEV Community by Quantooox (@quantooo).</description>
    <link>https://dev.to/quantooo</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4208016%2Fe136c512-1fd5-4b33-a0c9-06f9997cc636.png</url>
      <title>DEV Community: Quantooox</title>
      <link>https://dev.to/quantooo</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/quantooo"/>
    <language>en</language>
    <item>
      <title>The SEC timestamp that was shifted twice: a point-in-time data bug</title>
      <dc:creator>Quantooox</dc:creator>
      <pubDate>Mon, 16 Nov 2026 11:16:32 +0000</pubDate>
      <link>https://dev.to/quantooo/the-sec-timestamp-that-was-shifted-twice-a-point-in-time-data-bug-3b62</link>
      <guid>https://dev.to/quantooo/the-sec-timestamp-that-was-shifted-twice-a-point-in-time-data-bug-3b62</guid>
      <description>&lt;p&gt;A backtest is only honest if every piece of data enters it at the moment it became public. For company filings that moment is the SEC's acceptance time. We use the EDGAR submissions API's &lt;code&gt;acceptanceDateTime&lt;/code&gt; field, and it was wrong.&lt;/p&gt;

&lt;h2&gt;
  
  
  The symptom
&lt;/h2&gt;

&lt;p&gt;Apple's 8-K was accepted at 16:30:41 Eastern on 30 April 2026, according to the EDGAR filing index page. The API served it as &lt;code&gt;2026-05-01T00:30:41Z&lt;/code&gt;. The correct UTC time is 20:30:41. The API's value is the Eastern time converted to UTC &lt;strong&gt;twice&lt;/strong&gt; (+4 hours, then +4 again).&lt;/p&gt;

&lt;p&gt;Another filing accepted at 16:30:33 Eastern on 29 January (winter, UTC−5) came back as 02:30:33 the next day: shifted +5 twice. Same pattern.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why it matters
&lt;/h2&gt;

&lt;p&gt;Shifted eight hours late, an after-close filing lands in the &lt;em&gt;next&lt;/em&gt; trading day. In a backtest that is conservative (the data looks later than it was), but for anything that measures the market's reaction to a filing, it attributes the move to the wrong day.&lt;/p&gt;

&lt;h2&gt;
  
  
  The fix
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;pd&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;to_datetime&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;raw&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kt"&gt;str&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;19&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;dt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;tz_localize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"UTC"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;once&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;dt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;tz_convert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"America/New_York"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;dt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;tz_localize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;None&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;dt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;tz_localize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"UTC"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;   &lt;span class="c1"&gt;# undo one shift&lt;/span&gt;
&lt;span class="n"&gt;true&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;once&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;dt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;tz_convert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"America/New_York"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;dt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;tz_localize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;None&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;dt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;tz_localize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"America/New_York"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ambiguous&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"NaT"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;nonexistent&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"NaT"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;dt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;tz_convert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"UTC"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Undo one shift, then read the result as Eastern time. A unit test pins the two filings above against their index pages.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;General lesson:&lt;/strong&gt; never trust a timestamp field until you've checked a few against a primary source. A whole class of look-ahead and look-behind bugs lives in timezone handling.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;From Quantooo Lab, the makers of &lt;a href="https://quantooo.com/method" rel="noopener noreferrer"&gt;quantooo.com&lt;/a&gt;, a free, open and educational quant lab: every formula, every test and every failure is public. See it here: &lt;a href="https://quantooo.com/method" rel="noopener noreferrer"&gt;https://quantooo.com/method&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Educational, not investment advice.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>datascience</category>
      <category>finance</category>
      <category>pandas</category>
    </item>
    <item>
      <title>Positive IC, negative Sharpe: why a ranking and a portfolio can disagree</title>
      <dc:creator>Quantooox</dc:creator>
      <pubDate>Sun, 15 Nov 2026 11:13:47 +0000</pubDate>
      <link>https://dev.to/quantooo/positive-ic-negative-sharpe-why-a-ranking-and-a-portfolio-can-disagree-1nof</link>
      <guid>https://dev.to/quantooo/positive-ic-negative-sharpe-why-a-ranking-and-a-portfolio-can-disagree-1nof</guid>
      <description>&lt;p&gt;On development data our US score had a mean rank IC of +0.0085: very slightly right, on average. Yet the long-short portfolio built from it (top 10% against bottom 10%, rebalanced weekly, after costs) had a Sharpe ratio of −0.21. How can a ranking be right and the portfolio wrong?&lt;/p&gt;

&lt;h2&gt;
  
  
  1. IC uses everyone, the portfolio uses the tails
&lt;/h2&gt;

&lt;p&gt;Rank IC measures the whole ranking, all ~100 stocks. The portfolio only owns the top and bottom 10. A score can order the middle of the pack slightly well and the extremes badly, and the portfolio only feels the extremes.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Averages hide size
&lt;/h2&gt;

&lt;p&gt;IC treats each day equally. A portfolio's result is dominated by a few big days. Many small correct days can be wiped out by a handful of large wrong ones. In our sealed US year, three stocks (QCOM, DOW, TMO) accounted for 43% of the portfolio's result.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Costs
&lt;/h2&gt;

&lt;p&gt;Weekly rebalancing means turnover, and every trade costs something. We charge 5 basis points per unit of turnover, and also report the result at double costs. An IC near zero rarely survives costs.&lt;/p&gt;

&lt;h2&gt;
  
  
  The India example goes the other way
&lt;/h2&gt;

&lt;p&gt;India's sealed year had IC +0.009 (t 0.21, meaningless) but a long-short Sharpe of +0.81. Same lesson in reverse: one portfolio number from a tiny edge is mostly luck about which stocks landed in the tails.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Takeaway:&lt;/strong&gt; report both, plus the version without the top three names. If they disagree, believe neither yet.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;From Quantooo Lab, the makers of &lt;a href="https://quantooo.com/research" rel="noopener noreferrer"&gt;quantooo.com&lt;/a&gt;, a free, open and educational quant lab: every formula, every test and every failure is public. See it here: &lt;a href="https://quantooo.com/research" rel="noopener noreferrer"&gt;https://quantooo.com/research&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Educational, not investment advice.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>statistics</category>
      <category>finance</category>
      <category>datascience</category>
      <category>beginners</category>
    </item>
    <item>
      <title>LSTM, GRU and LightGBM against a 2-line trend rule: the rule came first</title>
      <dc:creator>Quantooox</dc:creator>
      <pubDate>Sat, 14 Nov 2026 11:19:23 +0000</pubDate>
      <link>https://dev.to/quantooo/lstm-gru-and-lightgbm-against-a-2-line-trend-rule-the-rule-came-first-131j</link>
      <guid>https://dev.to/quantooo/lstm-gru-and-lightgbm-against-a-2-line-trend-rule-the-rule-came-first-131j</guid>
      <description>&lt;p&gt;Every model in our "zoo" gets the same features, the same label (stock minus S&amp;amp;P 500 over the next 20 trading days) and the same walk-forward schedule: refit every 63 trading days on the trailing 756, with a 20-day gap so no label leaks into training.&lt;/p&gt;

&lt;h2&gt;
  
  
  The leaderboard (development period, mean daily rank IC)
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Model&lt;/th&gt;
&lt;th&gt;IC&lt;/th&gt;
&lt;th&gt;t-stat&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Trend rule (price vs 100-day average + 12-1 momentum)&lt;/td&gt;
&lt;td&gt;+0.0149&lt;/td&gt;
&lt;td&gt;0.64&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GRU&lt;/td&gt;
&lt;td&gt;+0.0101&lt;/td&gt;
&lt;td&gt;0.50&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ridge regression&lt;/td&gt;
&lt;td&gt;+0.0091&lt;/td&gt;
&lt;td&gt;0.50&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;LightGBM&lt;/td&gt;
&lt;td&gt;+0.0086&lt;/td&gt;
&lt;td&gt;0.53&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;LSTM&lt;/td&gt;
&lt;td&gt;−0.0018&lt;/td&gt;
&lt;td&gt;−0.09&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MLP&lt;/td&gt;
&lt;td&gt;−0.0090&lt;/td&gt;
&lt;td&gt;−0.49&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Low-volatility rule&lt;/td&gt;
&lt;td&gt;−0.0251&lt;/td&gt;
&lt;td&gt;−0.98&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Twelve families in total. The best Deflated Sharpe probability, which accounts for how many we tried, was 0.16.&lt;/p&gt;

&lt;h2&gt;
  
  
  Three observations
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Nothing is significant.&lt;/strong&gt; A t-stat of 0.64 is well inside the noise. "Top of the table" here means "least bad".&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The year-by-year numbers swing.&lt;/strong&gt; LSTM's IC was −0.07 in 2022 and +0.14 in 2025. A model that looks brilliant in
one year and broken in the next has not found structure; it has found that year.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Complexity added nothing.&lt;/strong&gt; With roughly 100 stocks and a noisy one-month label, there isn't enough structure
for a sequence model to learn what a moving average can't.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;We also run a LightGBM on &lt;em&gt;shuffled&lt;/em&gt; labels as a control. Its IC was −0.004, about where the real models sit.&lt;/p&gt;

&lt;p&gt;The full leaderboard, including each model's code idea and yearly numbers, is public on the models page.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;From Quantooo Lab, the makers of &lt;a href="https://quantooo.com/models" rel="noopener noreferrer"&gt;quantooo.com&lt;/a&gt;, a free, open and educational quant lab: every formula, every test and every failure is public. See it here: &lt;a href="https://quantooo.com/models" rel="noopener noreferrer"&gt;https://quantooo.com/models&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Educational, not investment advice.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>deeplearning</category>
      <category>python</category>
      <category>datascience</category>
    </item>
    <item>
      <title>Same score, two markets: flat in India, backwards in the US</title>
      <dc:creator>Quantooox</dc:creator>
      <pubDate>Fri, 13 Nov 2026 11:15:59 +0000</pubDate>
      <link>https://dev.to/quantooo/same-score-two-markets-flat-in-india-backwards-in-the-us-5712</link>
      <guid>https://dev.to/quantooo/same-score-two-markets-flat-in-india-backwards-in-the-us-5712</guid>
      <description>&lt;p&gt;We built one simple stock score (equal weights on trend, stability, fundamentals and the market backdrop, plus news tone for the US) and tested it the same way in two markets: the S&amp;amp;P 100 and India's Nifty 50.&lt;/p&gt;

&lt;h2&gt;
  
  
  The setup
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Development data 2020 to September 2025; the final 12 months sealed and opened exactly once after the score was frozen.&lt;/li&gt;
&lt;li&gt;Label: each stock against its index over the next 20 trading days.&lt;/li&gt;
&lt;li&gt;Measure: daily rank IC, the correlation between the score's ranking and what happened next.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The results
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Market&lt;/th&gt;
&lt;th&gt;Development IC&lt;/th&gt;
&lt;th&gt;Sealed-year IC&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;US (S&amp;amp;P 100)&lt;/td&gt;
&lt;td&gt;+0.0085 (t 0.46)&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;−0.0585 (t −2.47)&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;India (Nifty 50)&lt;/td&gt;
&lt;td&gt;+0.0187 (t 1.12)&lt;/td&gt;
&lt;td&gt;+0.0087 (t 0.21)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;In the US the sealed year came out significantly &lt;em&gt;negative&lt;/em&gt;: higher-scored stocks did worse. In India it was flat, indistinguishable from random rankings.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to take from it
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Neither market shows a usable ranking.&lt;/strong&gt; India's numbers are not "better"; t 0.21 means nothing either way.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One market is not a replication.&lt;/strong&gt; If we had tested only India, a flat result would have looked like a tame
failure. The US result shows how far a frozen score can drift.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;India has less data.&lt;/strong&gt; Four parts instead of five (no per-company news feed yet) and about four years of NSE
filings. Small samples make wide error bars.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Both reports, with every candidate weighting we tried, are published on the research page. The score is shown on the site as a summary of each stock's data, not as a forecast.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;From Quantooo Lab, the makers of &lt;a href="https://quantooo.com/in" rel="noopener noreferrer"&gt;quantooo.com&lt;/a&gt;, a free, open and educational quant lab: every formula, every test and every failure is public. See it here: &lt;a href="https://quantooo.com/in" rel="noopener noreferrer"&gt;https://quantooo.com/in&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Educational, not investment advice.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>datascience</category>
      <category>machinelearning</category>
      <category>statistics</category>
      <category>python</category>
    </item>
    <item>
      <title>Three margins, one company: why our 5.9% and the news's 5.5% were both right</title>
      <dc:creator>Quantooox</dc:creator>
      <pubDate>Thu, 12 Nov 2026 11:45:14 +0000</pubDate>
      <link>https://dev.to/quantooo/three-margins-one-company-why-our-59-and-the-newss-55-were-both-right-j4i</link>
      <guid>https://dev.to/quantooo/three-margins-one-company-why-our-59-and-the-newss-55-were-both-right-j4i</guid>
      <description>&lt;p&gt;Maruti Suzuki reported its July–September 2026 quarter, and our site said its margin fell from 10.1% to 5.9%. The news said 5.5%, down from 8.4%. Another report said 8.9%. Nobody was wrong. They were measuring three different things.&lt;/p&gt;

&lt;h2&gt;
  
  
  The three margins
&lt;/h2&gt;

&lt;p&gt;Start with sales (about ₹53,000 crore for the quarter) and subtract costs in layers:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Margin&lt;/th&gt;
&lt;th&gt;What is subtracted from sales&lt;/th&gt;
&lt;th&gt;Maruti, this quarter&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;EBITDA margin&lt;/td&gt;
&lt;td&gt;Running costs only (materials, staff, other expenses)&lt;/td&gt;
&lt;td&gt;8.9%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;EBIT margin&lt;/td&gt;
&lt;td&gt;Also depreciation of factories and machines&lt;/td&gt;
&lt;td&gt;5.5%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Pre-tax margin&lt;/td&gt;
&lt;td&gt;Also interest paid, &lt;strong&gt;plus other income&lt;/strong&gt; such as interest earned on cash&lt;/td&gt;
&lt;td&gt;5.9%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Maruti holds a large pile of cash and investments, so its other income is big. That is why its pre-tax margin sits&lt;br&gt;
&lt;em&gt;above&lt;/em&gt; its EBIT margin, which surprises people who expect each layer to be smaller.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why we use pre-tax margin for India
&lt;/h2&gt;

&lt;p&gt;The quarterly results that Indian companies file with the NSE (XBRL) report revenue and profit before tax in a consistent way across all 50 Nifty companies. EBIT needs extra line items that are labelled differently from company to company. So the score uses profit before tax ÷ sales for every Indian stock, and the same measure a year earlier.&lt;/p&gt;

&lt;h2&gt;
  
  
  The bug was in the label, not the number
&lt;/h2&gt;

&lt;p&gt;Our first "results explained" post called it "operating margin". For US filings that is roughly what we compute; for India it isn't. The fix was one word in three places, but it matters: a reader who checks the number against the news should find the same definition we used.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lesson for anyone building a data pipeline:&lt;/strong&gt; store the &lt;em&gt;name&lt;/em&gt; of the measure with the number, and show it. Two correct figures with the same label look like an error.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;From Quantooo Lab, the makers of &lt;a href="https://quantooo.com/in/ticker/MARUTI" rel="noopener noreferrer"&gt;quantooo.com&lt;/a&gt;, a free, open and educational quant lab: every formula, every test and every failure is public. See it here: &lt;a href="https://quantooo.com/in/ticker/MARUTI" rel="noopener noreferrer"&gt;https://quantooo.com/in/ticker/MARUTI&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Educational, not investment advice.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>finance</category>
      <category>datascience</category>
      <category>beginners</category>
      <category>python</category>
    </item>
    <item>
      <title>Two checks before you trust a backtest: one-stock luck and regime change</title>
      <dc:creator>Quantooox</dc:creator>
      <pubDate>Wed, 11 Nov 2026 11:47:24 +0000</pubDate>
      <link>https://dev.to/quantooo/two-checks-before-you-trust-a-backtest-one-stock-luck-and-regime-change-4k22</link>
      <guid>https://dev.to/quantooo/two-checks-before-you-trust-a-backtest-one-stock-luck-and-regime-change-4k22</guid>
      <description>&lt;p&gt;A backtest's headline number is an average. Averages hide two common problems. Both have cheap checks.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Is it just one stock?
&lt;/h2&gt;

&lt;p&gt;A portfolio of 20 names can look great because one of them went up tenfold. That isn't a strategy. That's one lucky pick, and it won't repeat.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The check:&lt;/strong&gt; report what share of the total gain came from the top three names.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;contrib&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;weights&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;moves&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;axis&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;        &lt;span class="c1"&gt;# each stock's total contribution&lt;/span&gt;
&lt;span class="n"&gt;top3_share&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;contrib&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;nlargest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;contrib&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;contrib&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If most of the result comes from three names, you're looking at concentration, not skill. Our portfolio page shows this number for each of our hypothetical portfolios.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Is it just one year?
&lt;/h2&gt;

&lt;p&gt;What worked in 2021 failed in 2022. Interest rates, inflation and what investors fear all change, and a model can be tuned, without anyone meaning to, to one kind of market.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The check:&lt;/strong&gt; show results year by year, not one average. Better still, mark the different market periods.&lt;/p&gt;

&lt;p&gt;A model that's strong in one year and weak in all the others hasn't found something stable. One that's mildly positive in most years is more interesting than one with a high average driven by a single year.&lt;/p&gt;

&lt;h2&gt;
  
  
  What we do
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The top-three share on the portfolio pages.&lt;/li&gt;
&lt;li&gt;Year-by-year results on every model page.&lt;/li&gt;
&lt;li&gt;Both reported whether they look good or bad.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The general idea
&lt;/h2&gt;

&lt;p&gt;Before trusting any average, break it down: by stock, by year, by market condition. If the result only lives in one slice, it's probably luck.&lt;/p&gt;

&lt;p&gt;(Our portfolios are hypothetical paper portfolios, not a claim of real-world results, and they could easily do worse than their benchmarks.)&lt;/p&gt;




&lt;p&gt;&lt;em&gt;From Quantooo Lab, the makers of &lt;a href="https://quantooo.com/portfolios" rel="noopener noreferrer"&gt;quantooo.com&lt;/a&gt;, a free, open and educational quant lab: every formula, every test and every failure is public. See it here: &lt;a href="https://quantooo.com/portfolios" rel="noopener noreferrer"&gt;https://quantooo.com/portfolios&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Educational, not investment advice.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>datascience</category>
      <category>statistics</category>
      <category>beginners</category>
      <category>python</category>
    </item>
    <item>
      <title>A track record nobody can edit: SHA-256, git and Bitcoin timestamps</title>
      <dc:creator>Quantooox</dc:creator>
      <pubDate>Tue, 10 Nov 2026 11:45:52 +0000</pubDate>
      <link>https://dev.to/quantooo/a-track-record-nobody-can-edit-sha-256-git-and-bitcoin-timestamps-3fmn</link>
      <guid>https://dev.to/quantooo/a-track-record-nobody-can-edit-sha-256-git-and-bitcoin-timestamps-3fmn</guid>
      <description>&lt;p&gt;Anyone can show an impressive track record after the fact. The question is whether the predictions existed &lt;em&gt;before&lt;/em&gt; the outcomes. We wanted a way to prove that, cheaply, without asking anyone to trust us.&lt;/p&gt;

&lt;h2&gt;
  
  
  The setup
&lt;/h2&gt;

&lt;p&gt;Every night:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The day's scores are written to a CSV file, before the next market open.&lt;/li&gt;
&lt;li&gt;The file's &lt;strong&gt;SHA-256&lt;/strong&gt; fingerprint goes into a ledger, with the publication time.&lt;/li&gt;
&lt;li&gt;The file and the ledger are committed to git and pushed to a public repository.&lt;/li&gt;
&lt;li&gt;The file is timestamped with &lt;strong&gt;OpenTimestamps&lt;/strong&gt;, which anchors its hash in the Bitcoin blockchain.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A ledger row looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csvs"&gt;&lt;code&gt;&lt;span class="n"&gt;date&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;version&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;sha256&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;rows&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;published_at&lt;/span&gt;
&lt;span class="mi"&gt;2026&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;19&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;v1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;scores&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;2026&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;19&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;csv&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;c657649932bf899f72043e60cad05f74527c9d6c22e51f7a44d57c79b2a1a560&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;99&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;2026&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;20T10&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;51&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;00&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;00&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Why each layer
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;SHA-256:&lt;/strong&gt; change a single character in the file and the fingerprint changes completely.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;git:&lt;/strong&gt; history is public; rewriting it shows up for anyone who cloned earlier.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;OpenTimestamps:&lt;/strong&gt; the strongest layer. The hash is committed into a Bitcoin transaction, so it proves the file
existed by that block's time, and it doesn't depend on GitHub or us. It's free.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One practical gotcha: git can normalise line endings on checkout, which changes the bytes and breaks the hash. A &lt;code&gt;.gitattributes&lt;/code&gt; rule keeps the files byte-exact.&lt;/p&gt;

&lt;h2&gt;
  
  
  Verify one yourself
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sha256sum track_record/scores/2026-10-19.csv     &lt;span class="c"&gt;# compare with the ledger&lt;/span&gt;
ots verify track_record/scores/2026-10-19.csv.ots
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  And when we make a mistake?
&lt;/h2&gt;

&lt;p&gt;It goes into a public corrections log. The original file stays as it was. Corrections are new entries, never edits.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why bother
&lt;/h2&gt;

&lt;p&gt;Because "trust me" isn't evidence. With this, the scores either beat random picks over time or they don't, and nobody can quietly rewrite which.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;From Quantooo Lab, the makers of &lt;a href="https://quantooo.com/track-record" rel="noopener noreferrer"&gt;quantooo.com&lt;/a&gt;, a free, open and educational quant lab: every formula, every test and every failure is public. See it here: &lt;a href="https://quantooo.com/track-record" rel="noopener noreferrer"&gt;https://quantooo.com/track-record&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Educational, not investment advice.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>python</category>
      <category>security</category>
      <category>datascience</category>
    </item>
    <item>
      <title>We scored every headline with FinBERT. News tone didn't predict the next month.</title>
      <dc:creator>Quantooox</dc:creator>
      <pubDate>Mon, 09 Nov 2026 16:28:26 +0000</pubDate>
      <link>https://dev.to/quantooo/we-scored-every-headline-with-finbert-news-tone-didnt-predict-the-next-month-3dh1</link>
      <guid>https://dev.to/quantooo/we-scored-every-headline-with-finbert-news-tone-didnt-predict-the-next-month-3dh1</guid>
      <description>&lt;p&gt;One of the five parts of our stock score is news tone: how positive or negative the recent headlines about a company are. We used &lt;strong&gt;FinBERT&lt;/strong&gt;, a BERT model fine-tuned on financial text, to read them.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it works
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Collect headlines per company.&lt;/li&gt;
&lt;li&gt;Run each one through FinBERT, which gives probabilities for positive, negative and neutral.&lt;/li&gt;
&lt;li&gt;Turn that into one number from &lt;strong&gt;−1 to +1&lt;/strong&gt; (positive minus negative).&lt;/li&gt;
&lt;li&gt;Average the recent headlines per stock, then rank against the other stocks.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;transformers&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;pipeline&lt;/span&gt;

&lt;span class="n"&gt;clf&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;pipeline&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;text-classification&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;ProsusAI/finbert&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;top_k&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;tone&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;headline&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;label&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;score&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;clf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;headline&lt;/span&gt;&lt;span class="p"&gt;)[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]}&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;positive&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;negative&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The timing detail that matters
&lt;/h2&gt;

&lt;p&gt;A headline published at 5 pm New York time, after the market closed, couldn't have affected that day's trading. So headlines after the US close count for the &lt;strong&gt;next&lt;/strong&gt; trading day. Getting this wrong is a quiet form of look-ahead bias, and it flatters news-based models a lot.&lt;/p&gt;

&lt;h2&gt;
  
  
  The result
&lt;/h2&gt;

&lt;p&gt;Positive news tone did &lt;strong&gt;not&lt;/strong&gt; help predict which stocks did better over the following month, in our tests.&lt;/p&gt;

&lt;p&gt;The likely reason is simple: by the time something is a headline, the price has usually already moved. Markets react in minutes; our horizon is a month.&lt;/p&gt;

&lt;h2&gt;
  
  
  So why keep it?
&lt;/h2&gt;

&lt;p&gt;Because the score's job is to &lt;em&gt;describe&lt;/em&gt; a stock, not predict it. Knowing that the news about a company has been unusually negative this week is useful context. It's just not a forecast, and the site says so.&lt;/p&gt;

&lt;h2&gt;
  
  
  Takeaway
&lt;/h2&gt;

&lt;p&gt;If you build a news-sentiment model, check two things first: the timestamp rule (before or after the close?) and the horizon. Tone that's already in the price can't tell you much about next month.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;From Quantooo Lab, the makers of &lt;a href="https://quantooo.com/ticker/AAPL" rel="noopener noreferrer"&gt;quantooo.com&lt;/a&gt;, a free, open and educational quant lab: every formula, every test and every failure is public. See it here: &lt;a href="https://quantooo.com/ticker/AAPL" rel="noopener noreferrer"&gt;https://quantooo.com/ticker/AAPL&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Educational, not investment advice.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>nlp</category>
      <category>machinelearning</category>
      <category>datascience</category>
      <category>python</category>
    </item>
    <item>
      <title>Where machine learning did help: forecasting market volatility</title>
      <dc:creator>Quantooox</dc:creator>
      <pubDate>Sun, 08 Nov 2026 12:10:50 +0000</pubDate>
      <link>https://dev.to/quantooo/where-machine-learning-did-help-forecasting-market-volatility-1gm1</link>
      <guid>https://dev.to/quantooo/where-machine-learning-did-help-forecasting-market-volatility-1gm1</guid>
      <description>&lt;p&gt;Guessing whether a stock goes up next month turned out to be close to impossible in our tests. Guessing how &lt;em&gt;bumpy&lt;/em&gt; the market will be is a different problem, and an easier one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why volatility is more predictable
&lt;/h2&gt;

&lt;p&gt;Calm periods tend to follow calm periods, and stormy ones follow stormy ones (volatility clustering). That persistence is real structure a model can learn. Direction has very little of it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The setup
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Target:&lt;/strong&gt; the variance of S&amp;amp;P 500 (SPY) daily moves over the next 20 trading days.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Baseline:&lt;/strong&gt; HAR, the standard textbook model. It's a regression on recent volatility over the last day, week and
month.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Measure:&lt;/strong&gt; QLIKE, a loss function suited to variance forecasts (lower is better).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Test:&lt;/strong&gt; a 2025–26 holdout, with the Diebold-Mariano test to check whether the difference is more than noise.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Results
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Model&lt;/th&gt;
&lt;th&gt;QLIKE (lower is better)&lt;/th&gt;
&lt;th&gt;vs HAR&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;HAR (baseline)&lt;/td&gt;
&lt;td&gt;1.047&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;LightGBM on SPY features (pre-registered)&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0.816&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;p = 0.047&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;GARCH(1,1), Student-t (exploratory)&lt;/td&gt;
&lt;td&gt;0.385&lt;/td&gt;
&lt;td&gt;p = 0.044&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Chronos-Bolt, zero-shot (exploratory)&lt;/td&gt;
&lt;td&gt;0.594&lt;/td&gt;
&lt;td&gt;p = 0.065, not significant&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The LightGBM model was the one we registered before the test, and it beat HAR, just inside the usual 5% line. The exploratory runs came afterwards, so they count as hints, not findings. Still, it's notable that the decades-old GARCH model did best of all, and a pretrained time-series foundation model, with no training on this data, landed in between.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keeping it honest
&lt;/h2&gt;

&lt;p&gt;One window, one market, p-values close to 0.05. That's a small win. So the model keeps forecasting live, every night, and the forecasts are logged before the outcome is known. If the edge was luck, the live record will show it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The bigger lesson
&lt;/h2&gt;

&lt;p&gt;It matches the research paper the project is built on: machine learning is much more useful for &lt;strong&gt;measuring risk&lt;/strong&gt; than for &lt;strong&gt;picking winners&lt;/strong&gt;.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;From Quantooo Lab, the makers of &lt;a href="https://quantooo.com/research" rel="noopener noreferrer"&gt;quantooo.com&lt;/a&gt;, a free, open and educational quant lab: every formula, every test and every failure is public. See it here: &lt;a href="https://quantooo.com/research" rel="noopener noreferrer"&gt;https://quantooo.com/research&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Educational, not investment advice.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>datascience</category>
      <category>timeseries</category>
      <category>python</category>
    </item>
    <item>
      <title>Information coefficient and the t-statistic: is 0.02 better than 0.01?</title>
      <dc:creator>Quantooox</dc:creator>
      <pubDate>Sat, 07 Nov 2026 11:31:06 +0000</pubDate>
      <link>https://dev.to/quantooo/information-coefficient-and-the-t-statistic-is-002-better-than-001-3l41</link>
      <guid>https://dev.to/quantooo/information-coefficient-and-the-t-statistic-is-002-better-than-001-3l41</guid>
      <description>&lt;p&gt;Model A has an average score of 0.02. Model B has 0.01. Is A better?&lt;/p&gt;

&lt;p&gt;Maybe. Maybe not. You need two numbers to say.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. The information coefficient (IC)
&lt;/h2&gt;

&lt;p&gt;For a model that ranks stocks, the IC on a given day is the &lt;strong&gt;rank correlation&lt;/strong&gt; (Spearman) between the model's scores and what each stock did over the following period.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;scipy.stats&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;spearmanr&lt;/span&gt;

&lt;span class="n"&gt;ic_by_day&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nf"&gt;spearmanr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;scores&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;outcome&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;]).&lt;/span&gt;&lt;span class="n"&gt;correlation&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;dates&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;mean_ic&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;mean&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ic_by_day&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;0&lt;/strong&gt; means no skill: the ranking and the outcome are unrelated.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Negative&lt;/strong&gt; means the ranking pointed the wrong way.&lt;/li&gt;
&lt;li&gt;In real markets, an IC around &lt;strong&gt;0.05 held consistently&lt;/strong&gt; would be strong. Most ideas sit much closer to zero.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  2. The t-statistic
&lt;/h2&gt;

&lt;p&gt;The IC bounces around from day to day. The t-statistic asks: is the &lt;em&gt;average&lt;/em&gt; big compared with how much it bounces?&lt;/p&gt;

&lt;p&gt;Roughly: &lt;code&gt;t = mean_ic / (std_ic / sqrt(n))&lt;/code&gt;, but with one catch. Our IC compares rankings with outcomes 20 trading days ahead, so neighbouring days' outcomes overlap and aren't independent. A naive t-statistic overstates confidence. We use a correction for overlapping observations (Newey-West), which makes the t-statistic smaller and more honest.&lt;/p&gt;

&lt;p&gt;Rule of thumb: &lt;strong&gt;below about 2 means "can't tell"&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Our numbers
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Score&lt;/th&gt;
&lt;th&gt;Period&lt;/th&gt;
&lt;th&gt;IC&lt;/th&gt;
&lt;th&gt;t&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;US v1&lt;/td&gt;
&lt;td&gt;Development&lt;/td&gt;
&lt;td&gt;+0.0085&lt;/td&gt;
&lt;td&gt;0.46&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;US v1&lt;/td&gt;
&lt;td&gt;Sealed year&lt;/td&gt;
&lt;td&gt;−0.0585&lt;/td&gt;
&lt;td&gt;−2.47&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;India in-v1&lt;/td&gt;
&lt;td&gt;Sealed year&lt;/td&gt;
&lt;td&gt;+0.009&lt;/td&gt;
&lt;td&gt;0.21&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Most of our models sit in the "can't tell" zone. One result is clearly away from zero, and it's the negative one.&lt;/p&gt;

&lt;h2&gt;
  
  
  So, is 0.02 better than 0.01?
&lt;/h2&gt;

&lt;p&gt;Only if the gap is large compared with the noise in both. Usually it isn't. Ranking models by their average IC without the t-statistic is ranking them by luck.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;From Quantooo Lab, the makers of &lt;a href="https://quantooo.com/method" rel="noopener noreferrer"&gt;quantooo.com&lt;/a&gt;, a free, open and educational quant lab: every formula, every test and every failure is public. See it here: &lt;a href="https://quantooo.com/method" rel="noopener noreferrer"&gt;https://quantooo.com/method&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Educational, not investment advice.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>statistics</category>
      <category>datascience</category>
      <category>python</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Before costs vs after costs: why we double the trading cost in every test</title>
      <dc:creator>Quantooox</dc:creator>
      <pubDate>Fri, 06 Nov 2026 13:28:46 +0000</pubDate>
      <link>https://dev.to/quantooo/before-costs-vs-after-costs-why-we-double-the-trading-cost-in-every-test-2m7</link>
      <guid>https://dev.to/quantooo/before-costs-vs-after-costs-why-we-double-the-trading-cost-in-every-test-2m7</guid>
      <description>&lt;p&gt;A strategy that looks good before costs can look bad after them. The gap is usually &lt;strong&gt;turnover&lt;/strong&gt;: how much of the portfolio changes at each rebalance.&lt;/p&gt;

&lt;h2&gt;
  
  
  How costs add up
&lt;/h2&gt;

&lt;p&gt;Every trade pays something:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Commission:&lt;/strong&gt; often zero now for retail, not zero for everyone.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Spread:&lt;/strong&gt; the gap between the price to get in and the price to get out.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Slippage:&lt;/strong&gt; the price moving while you trade, more for bigger orders.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A model that replaces half its stocks every month pays these on half the portfolio, twelve times a year.&lt;/p&gt;

&lt;h2&gt;
  
  
  What we charge
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;5 basis points (0.05%) per trade&lt;/strong&gt;, on every stock that changes.&lt;/li&gt;
&lt;li&gt;Then the same test with &lt;strong&gt;double the cost (10 bp)&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The doubled-cost test is a stress test. Our cost estimate could be optimistic, and real costs rise in stressed markets. A result that only survives at exactly 5 bp is fragile.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;net_result&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;gross&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;weights_prev&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;weights_new&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;bp&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;turnover&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;weights_new&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;weights_prev&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;abs&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;gross&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;turnover&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;bp&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;10_000&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What we saw
&lt;/h2&gt;

&lt;p&gt;None of our twelve model families had a significant edge before costs, so costs didn't change the overall answer. But the doubled-cost column is the first one to check on any model page: the more often a model changes its picks, the more it loses there.&lt;/p&gt;

&lt;h2&gt;
  
  
  The question to ask
&lt;/h2&gt;

&lt;p&gt;Whenever you see a backtest: &lt;strong&gt;is that before or after costs? And what turnover?&lt;/strong&gt; If the answer isn't on the page, assume before.&lt;/p&gt;

&lt;p&gt;Every model page on the site shows the result at 1x and 2x costs side by side.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;From Quantooo Lab, the makers of &lt;a href="https://quantooo.com/models" rel="noopener noreferrer"&gt;quantooo.com&lt;/a&gt;, a free, open and educational quant lab: every formula, every test and every failure is public. See it here: &lt;a href="https://quantooo.com/models" rel="noopener noreferrer"&gt;https://quantooo.com/models&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Educational, not investment advice.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>datascience</category>
      <category>statistics</category>
      <category>python</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Survivorship bias: testing on today's winners flatters every strategy</title>
      <dc:creator>Quantooox</dc:creator>
      <pubDate>Thu, 05 Nov 2026 11:43:43 +0000</pubDate>
      <link>https://dev.to/quantooo/survivorship-bias-testing-on-todays-winners-flatters-every-strategy-3fpk</link>
      <guid>https://dev.to/quantooo/survivorship-bias-testing-on-todays-winners-flatters-every-strategy-3fpk</guid>
      <description>&lt;p&gt;Take today's S&amp;amp;P 100. Test any strategy on those 100 names going back ten years. It will look better than it should.&lt;/p&gt;

&lt;p&gt;Why? Today's list is the companies that &lt;em&gt;survived and grew&lt;/em&gt;. The ones that shrank, were taken over or failed dropped out along the way. Testing on today's list means your past quietly skips every loser.&lt;/p&gt;

&lt;h2&gt;
  
  
  Two examples from our own data
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;A delisted stock.&lt;/strong&gt; Walgreens Boots Alliance (WBA) left the US market during our data period. If we'd built the universe from current listings, it would vanish from history. We keep its SEC identifier in a list of "extra" companies so its filings stay in the past data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A renamed ticker.&lt;/strong&gt; BNY Mellon changed its ticker from BK to BNY in 2026. Join on today's ticker and the old history disappears. Small things like this silently shrink a dataset in a biased way.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where we couldn't fix it
&lt;/h2&gt;

&lt;p&gt;Our India history uses &lt;em&gt;today's&lt;/em&gt; Nifty 50 members. We don't yet have point-in-time membership for past years. That makes the India backtest look better than real time could have, and we say so on the research page wherever it applies.&lt;/p&gt;

&lt;p&gt;Being open about a bias you couldn't remove is better than hiding it.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to reduce it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Use &lt;strong&gt;point-in-time&lt;/strong&gt; index membership: the list as it was on each date.&lt;/li&gt;
&lt;li&gt;Keep delisted companies and their full price and filing history.&lt;/li&gt;
&lt;li&gt;Map ticker changes to a permanent ID (CIK for SEC filers, ISIN elsewhere).&lt;/li&gt;
&lt;li&gt;When you can't, say so next to the result.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The question to ask
&lt;/h2&gt;

&lt;p&gt;When you see a backtest on "the S&amp;amp;P 500 since 2010", ask: &lt;em&gt;which&lt;/em&gt; S&amp;amp;P 500? The one in 2010, or today's?&lt;/p&gt;




&lt;p&gt;&lt;em&gt;From Quantooo Lab, the makers of &lt;a href="https://quantooo.com/research" rel="noopener noreferrer"&gt;quantooo.com&lt;/a&gt;, a free, open and educational quant lab: every formula, every test and every failure is public. See it here: &lt;a href="https://quantooo.com/research" rel="noopener noreferrer"&gt;https://quantooo.com/research&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Educational, not investment advice.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>datascience</category>
      <category>statistics</category>
      <category>beginners</category>
      <category>python</category>
    </item>
  </channel>
</rss>
