<?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: Jaroslav Šmarda</title>
    <description>The latest articles on DEV Community by Jaroslav Šmarda (@jaroslav_marda_9f25d4d9c).</description>
    <link>https://dev.to/jaroslav_marda_9f25d4d9c</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%2F4083355%2F70d11f08-ebaf-444f-bacf-228cb5c92b20.jpg</url>
      <title>DEV Community: Jaroslav Šmarda</title>
      <link>https://dev.to/jaroslav_marda_9f25d4d9c</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jaroslav_marda_9f25d4d9c"/>
    <language>en</language>
    <item>
      <title>Prices Nobody Saw: The Lookahead Hidden in Adjusted Close</title>
      <dc:creator>Jaroslav Šmarda</dc:creator>
      <pubDate>Tue, 03 Nov 2026 15:36:35 +0000</pubDate>
      <link>https://dev.to/jaroslav_marda_9f25d4d9c/prices-nobody-saw-the-lookahead-hidden-in-adjusted-close-2m45</link>
      <guid>https://dev.to/jaroslav_marda_9f25d4d9c/prices-nobody-saw-the-lookahead-hidden-in-adjusted-close-2m45</guid>
      <description>&lt;p&gt;&lt;em&gt;Python for programmers, prompts for data analysts.&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;On November 16, 2018, Coca-Cola closed at $50.17. That's the price people paid that day. Open today's adjusted close for the same day, and you'll see $39.37. Nobody ever paid $39.37 for a &lt;br&gt;
Coca-Cola share in November 2018. The number exists only because of dividends paid in the years after it.&lt;/p&gt;

&lt;p&gt;In the last two parts we used the adjusted close as the honest measure of total return, and for that job it is. But after Part 36, a reader, Arhan Canli, pointed out a trap: a backtest &lt;br&gt;
that runs on today's adjusted prices sees numbers no one could have seen at the time. For some rules that doesn't matter at all. For others it moves a signal by years.&lt;/p&gt;

&lt;p&gt;In this part we find out which is which, using Coca-Cola's last ten years. And we look at the three dates EODHD gives for every dividend, to see when each one was actually known.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Want to try this yourself? The &lt;a href="https://eodhd.com/financial-apis/mcp-server-for-financial-data-by-eodhd?via=jsmrd&amp;amp;utm_source=medium&amp;amp;utm_medium=post&amp;amp;&lt;br&gt;%0Autm_campaign=prices-nobody-saw-the-lookahead-hidden-in-adjusted-close&amp;amp;utm_content=Jaroslav" rel="noopener noreferrer"&gt;EODHD MCP Server&lt;/a&gt; is what pulled the data in this article — connect it to Claude and ask your own questions &lt;br&gt;
(affiliate link).&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;New here? &lt;a href="https://medium.com/codetodeploy/the-setup-everything-you-need-before-your-first-prompt-1faeeff94263" rel="noopener noreferrer"&gt;The Setup&lt;/a&gt; covers everything you need before your first prompt.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;


&lt;h2&gt;
  
  
  Two prices for the same day
&lt;/h2&gt;

&lt;p&gt;The data is the same as in Part 37: Coca-Cola's raw closes and dividends from October 2016 to October 2026, and EODHD's adjusted close for the same days. The question is how far apart the &lt;br&gt;
two columns are.&lt;/p&gt;

&lt;p&gt;🟧 &lt;strong&gt;PROMPT&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;For the first trading day of each year since 2017,
show Coca-Cola's raw close next to today's
adjusted close, and how much lower the adjusted
one is.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;The further back you go, the bigger the gap:&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Date&lt;/th&gt;
&lt;th&gt;Raw close&lt;/th&gt;
&lt;th&gt;Today's adjusted close&lt;/th&gt;
&lt;th&gt;Adjusted is lower by&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Jan 3, 2017&lt;/td&gt;
&lt;td&gt;$41.80&lt;/td&gt;
&lt;td&gt;$30.92&lt;/td&gt;
&lt;td&gt;26.0%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Jan 2, 2019&lt;/td&gt;
&lt;td&gt;$46.93&lt;/td&gt;
&lt;td&gt;$37.12&lt;/td&gt;
&lt;td&gt;20.9%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Jan 4, 2021&lt;/td&gt;
&lt;td&gt;$52.76&lt;/td&gt;
&lt;td&gt;$44.53&lt;/td&gt;
&lt;td&gt;15.6%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Jan 3, 2023&lt;/td&gt;
&lt;td&gt;$62.95&lt;/td&gt;
&lt;td&gt;$56.42&lt;/td&gt;
&lt;td&gt;10.4%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Jan 2, 2025&lt;/td&gt;
&lt;td&gt;$61.84&lt;/td&gt;
&lt;td&gt;$58.92&lt;/td&gt;
&lt;td&gt;4.7%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Jan 2, 2026&lt;/td&gt;
&lt;td&gt;$69.12&lt;/td&gt;
&lt;td&gt;$67.80&lt;/td&gt;
&lt;td&gt;1.9%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Each later dividend lowers every earlier adjusted price a little. A price from 2017 has had almost 40 dividends taken off it; a price from 2026 only three.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So which column is "right"? Both, for different questions. The adjusted close answers: how much has an investment made since that day, dividends included? The raw close answers: what did a &lt;br&gt;
share cost that day?&lt;/p&gt;

&lt;p&gt;A person in January 2017 could only see the raw column. The adjusted column for 2017 didn't exist yet. It was written later, one dividend at a time. That's what "as known then" means: on &lt;br&gt;
any day, the adjusted close as it stood that day was simply that day's raw price. The adjusted column in the table is that price, rewritten by every dividend since.&lt;/p&gt;


&lt;h2&gt;
  
  
  The $50 rule
&lt;/h2&gt;

&lt;p&gt;Now a rule that looks at the price level. It's deliberately simple: buy Coca-Cola the first day it closes above $50.&lt;/p&gt;

&lt;p&gt;🟧 &lt;strong&gt;PROMPT&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;On which day did Coca-Cola first close above $50?
Answer twice: once using the raw close, once using
today's adjusted close.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Using the raw close: November 16, 2018, at $50.17. Using today's adjusted close: December 13, 2021, when the adjusted value reached $50.28. The raw close that day was $57.76.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Across all 2,513 trading days, the two series disagree about whether Coca-Cola was above $50 on 491 of them, about one day in five.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ft192ho2tn03jtyuzli1k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ft192ho2tn03jtyuzli1k.png" alt="The $50 rule" width="800" height="448"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;A backtest on today's adjusted close would report that the rule bought in December 2021, three years late, on a day when the real price was $57.76. No trader following that rule in real &lt;br&gt;
time would ever have done that. In November 2018 the screen showed $50.17, and the rule would have fired.&lt;/p&gt;

&lt;p&gt;That's the lookahead Arhan described. The backtest uses a number that was only created later, by dividends that hadn't been paid yet. It doesn't need a mistake in the code. It only needs &lt;br&gt;
the wrong column.&lt;/p&gt;

&lt;p&gt;Any rule built on the price level has this problem: a "price above $5" filter, a minimum dollar volume, a stop-loss at a fixed price, a target price. On a dividend payer like Coca-Cola, &lt;br&gt;
the further back the backtest goes, the bigger the error.&lt;/p&gt;


&lt;h2&gt;
  
  
  Why returns are safe
&lt;/h2&gt;

&lt;p&gt;So is today's adjusted close useless for backtests? No. Arhan's comment had a second half, and it's the reassuring one: anything that only uses the ratio between two days is safe.&lt;/p&gt;

&lt;p&gt;🟧 &lt;strong&gt;PROMPT&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;What was Coca-Cola's return from November 16, 2018
to December 13, 2021, dividends included?
Calculate it two ways: from today's adjusted
close, and day by day from the raw closes, adding
each dividend on its ex-date.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;From today's adjusted close: 27.72%. Day by day from the raw closes plus dividends: 27.74%. The tiny gap is rounding, because EODHD's adjusted close has four decimals. For the record, &lt;br&gt;
the raw price alone rose only 15.13%.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The same holds for every single day: the daily return from today's adjusted close matches the raw close plus that day's dividend on all 2,513 days, within 0.04 percentage points.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The reason is simple arithmetic. A dividend paid in 2024 lowers both the 2018 price and the 2021 price by the same factor. When you divide one by the other, that factor cancels out. Every &lt;br&gt;
later dividend cancels the same way. Only the dividends paid between the two days are left in the ratio, and those are exactly the ones an investor holding the stock in that period would &lt;br&gt;
have received.&lt;/p&gt;

&lt;p&gt;So the rule of thumb is short. Returns, percentage changes, and anything built only from them are safe on today's adjusted close: a 12-month momentum, a correlation, a volatility measured &lt;br&gt;
in percent. Price levels are not: thresholds, stops and filters in dollars. Neither is anything built from price differences in dollars, like an average daily range measured in dollars, &lt;br&gt;
because a difference of two scaled prices is scaled too.&lt;/p&gt;


&lt;h2&gt;
  
  
  Three dates for one dividend
&lt;/h2&gt;

&lt;p&gt;The price is only half of it. A backtest can also look ahead through the dividends themselves, if it uses a dividend before anyone knew about it. EODHD gives three dates for every &lt;br&gt;
Coca-Cola dividend, and each answers a different question.&lt;/p&gt;

&lt;p&gt;🟧 &lt;strong&gt;PROMPT&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;For Coca-Cola's dividends over the last ten years,
how many days usually pass between the declaration
date, the ex-dividend date and the payment date?
When were the yearly raises announced?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;The declaration date is when Coca-Cola announced the dividend. The ex-dividend date is the first day the stock trades without it; that's the day the price drops and the day the adjusted &lt;br&gt;
close uses. The payment date is when the cash arrives.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Over the 40 dividends, the declaration came a median of 44 days before the ex-date, anywhere from 21 to 62 days. The payment followed a median of 18 days after the ex-date.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;All ten raises were announced in February, 21 to 28 days before the March ex-date. The latest one, from $0.51 to $0.53, was declared on February 19, 2026, with an ex-date of March 13.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So between February 19 and March 13, 2026, the new dividend was public, but the price hadn't moved for it yet.&lt;/p&gt;

&lt;p&gt;That decides which date a backtest should use, and it depends on the question:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Adjusting prices:&lt;/strong&gt; the ex-date. That's when the price actually drops.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Anything that uses the dividend as information,&lt;/strong&gt; such as a dividend yield or a rule that reacts to a raise: the declaration date. Before it, nobody knew the number.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cash in the account:&lt;/strong&gt; the payment date.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The trap is subtle. Say a backtest computes Coca-Cola's dividend yield on February 10, 2026, from a dividend list downloaded today. If it takes the latest dividend in the list, it gets $0.&lt;br&gt;
53, a number that wasn't public for another nine days. If it takes the latest dividend by ex-date, it's safe on February 10, but after February 19 it keeps using $0.51 for three more &lt;br&gt;
weeks, although the raise was already public. Only the declaration date gives the number that was actually known. That's what Arhan meant by storing the announcement date: rebuild &lt;br&gt;
everything "as of D" from what was announced by D.&lt;/p&gt;




&lt;h2&gt;
  
  
  A word of honesty
&lt;/h2&gt;

&lt;p&gt;The declaration dates come from today's dividend records, not from an archive of what a database showed back then. If a date or an amount was corrected later, the record shows only the &lt;br&gt;
corrected version. A truly point-in-time backtest needs snapshots of the data as it was published, and that's a bigger project than one article.&lt;/p&gt;

&lt;p&gt;The dates also have no time of day. Dividend announcements come as press releases, and whether one came before the market opened or after it closed changes which day's price could have &lt;br&gt;
reacted. Counting from the next trading day is the safe choice.&lt;/p&gt;

&lt;p&gt;This is one stock and one deliberately simple rule. The size of the effect depends on how much a company pays out and how far back the backtest goes. For a stock with a small dividend it's &lt;br&gt;
smaller. For a stock with a split, it's much larger: as Part 33 showed, a split rescales every earlier price by the full split ratio, not by a fraction of a percent.&lt;/p&gt;

&lt;p&gt;And the fix has a cost. Running a level-based rule correctly means using, on each day, the prices as they stood that day, which in practice means the raw close for price levels and the &lt;br&gt;
adjusted close only for returns. That's more work than loading one column. Not investment advice.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;This is the thirty-eighth article in the series &lt;em&gt;&lt;a href="https://medium.com/codetodeploy/&lt;br&gt;%0Aunlock-real-time-market-intelligence-with-eodhd-and-claude-6f431c82c525" rel="noopener noreferrer"&gt;Unlock Real-Time Market Intelligence with EODHD and Claude&lt;/a&gt;&lt;/em&gt;, and the fifth about the adjusted close, after Parts 33, 35, 36 and 37. Part 36 rebuilt it, Part 37 showed what it &lt;br&gt;
adds. This one showed where it misleads, an idea that came from a reader, Arhan Canli.&lt;/p&gt;

&lt;p&gt;Here's what came out: &lt;strong&gt;today's adjusted close is the right column for returns and the wrong one for price levels.&lt;/strong&gt; A rule that waits for Coca-Cola to pass $50 fires in November 2018 on &lt;br&gt;
the prices people actually paid, and in December 2021 on today's adjusted prices. Three years apart, from the same data. The return over the same period comes out the same on both, 27.7%.&lt;/p&gt;

&lt;p&gt;The dividends follow the same logic. Use the ex-date to adjust prices, and the declaration date for anything that depends on knowing the dividend. Ask of every number in a backtest: could &lt;br&gt;
anyone have seen this on that day?&lt;/p&gt;

&lt;p&gt;Next time I want to look at the other way a company can return cash to its shareholders. Apple pays a small dividend, but it spends far more buying back its own shares. Buybacks never show &lt;br&gt;
up in the adjusted close at all. So how much did they matter?&lt;/p&gt;




&lt;p&gt;&lt;em&gt;If this made you curious, the &lt;a href="https://eodhd.com/financial-apis/mcp-server-for-financial-data-by-eodhd?via=jsmrd&amp;amp;utm_source=medium&amp;amp;utm_medium=post&amp;amp;&lt;br&gt;%0Autm_campaign=prices-nobody-saw-the-lookahead-hidden-in-adjusted-close&amp;amp;utm_content=Jaroslav" rel="noopener noreferrer"&gt;MCP Server&lt;/a&gt; is free to try — &lt;a href="https://medium.com/codetodeploy/&lt;br&gt;%0Athe-setup-everything-you-need-before-your-first-prompt-1faeeff94263" rel="noopener noreferrer"&gt;The Setup&lt;/a&gt; walks you through it.&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;← Part 37: &lt;a href="https://medium.com/codetodeploy/the-other-40-how-much-of-coca-colas-return-came-from-dividends-40e36dfaeeb2" rel="noopener noreferrer"&gt;The Other 40%: How Much of Coca-Cola's Return Came from Dividends&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>data</category>
      <category>fintech</category>
      <category>python</category>
    </item>
    <item>
      <title>The Other 40%: How Much of Coca-Cola's Return Came from Dividends</title>
      <dc:creator>Jaroslav Šmarda</dc:creator>
      <pubDate>Fri, 30 Oct 2026 12:14:12 +0000</pubDate>
      <link>https://dev.to/jaroslav_marda_9f25d4d9c/the-other-40-how-much-of-coca-colas-return-came-from-dividends-1d3k</link>
      <guid>https://dev.to/jaroslav_marda_9f25d4d9c/the-other-40-how-much-of-coca-colas-return-came-from-dividends-1d3k</guid>
      <description>&lt;p&gt;&lt;em&gt;Python for programmers, prompts for data analysts.&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;In the last part we rebuilt Apple's adjusted close from raw prices, one split and 31 dividends, and matched EODHD to the fourth decimal. Dividends turned out to be a small part of Apple's &lt;br&gt;
story. Over almost eight years they added 47 percentage points to a return of 817%.&lt;/p&gt;

&lt;p&gt;At the end I promised to run the same recipe on a company where the dividend is the main story. Coca-Cola is the obvious choice. It has raised its dividend every year for decades, and the &lt;br&gt;
payout is several times larger than Apple's, relative to the price.&lt;/p&gt;

&lt;p&gt;So the question for this part is simple: over ten years, how much of a Coca-Cola investor's return came from the price, and how much from the dividends?&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Want to try this yourself? The &lt;a href="https://eodhd.com/financial-apis/mcp-server-for-financial-data-by-eodhd?via=jsmrd&amp;amp;utm_source=medium&amp;amp;utm_medium=post&amp;amp;&lt;br&gt;%0Autm_campaign=the-other-40-how-much-of-coca-colas-return-came-from-dividends&amp;amp;utm_content=Jaroslav" rel="noopener noreferrer"&gt;EODHD MCP Server&lt;/a&gt; is what pulled the data in this article — connect it to Claude and ask your own questions &lt;br&gt;
(affiliate link).&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;New here? &lt;a href="https://medium.com/codetodeploy/the-setup-everything-you-need-before-your-first-prompt-1faeeff94263" rel="noopener noreferrer"&gt;The Setup&lt;/a&gt; covers everything you need before your first prompt.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;


&lt;h2&gt;
  
  
  The ingredients again
&lt;/h2&gt;

&lt;p&gt;Same three ingredients as last time: the prices as they actually traded, every split, every dividend.&lt;/p&gt;

&lt;p&gt;🟧 &lt;strong&gt;PROMPT&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Use the eodhd MCP to get Coca-Cola's raw daily
closing prices for the last ten years, plus every
stock split and every dividend in that period.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;From October 28, 2016 to October 28, 2026 there are 2,513 trading days. Coca-Cola didn't split its stock in that period. It paid 40 quarterly dividends, rising from $0.35 per share in &lt;br&gt;
November 2016 to $0.53 in September 2026. The raw close was $42.23 at the start and $91.73 at the end.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;No split makes this recipe simpler than Apple's. There is no second dividend size to trip over: for every one of the 40 payments, &lt;code&gt;value&lt;/code&gt; and &lt;code&gt;unadjustedValue&lt;/code&gt; are the same number.&lt;/p&gt;

&lt;p&gt;The dividend went up every year, from $1.48 a year at the start to $2.12 now. Yet the yield fell, from about 3.5% of the price to about 2.3%. Both are true at once, because the price grew &lt;br&gt;
faster than the dividend.&lt;/p&gt;

&lt;p&gt;The raw prices passed the same check as Apple's: all 2,513 closes have at most two decimals, as a real exchange quotes them.&lt;/p&gt;


&lt;h2&gt;
  
  
  Three ways to count the same ten years
&lt;/h2&gt;

&lt;p&gt;The recipe is the one from Part 36: walk backwards from today, and at each dividend scale every earlier price by (1 − dividend ÷ previous day's close).&lt;/p&gt;

&lt;p&gt;🟧 &lt;strong&gt;PROMPT&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Rebuild Coca-Cola's adjusted close from those raw
prices and dividends, the same way as for Apple,
and compare it with EODHD's adjusted close. Then
tell me the ten-year return three ways: price
only, price plus the dividends kept as cash, and
with every dividend reinvested.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;The rebuilt series matches EODHD's adjusted close on all 2,513 days, within 0.0002%. The three returns:&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;10-year return&lt;/th&gt;
&lt;th&gt;Per year&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Price only ($42.23 → $91.73)&lt;/td&gt;
&lt;td&gt;+117.2%&lt;/td&gt;
&lt;td&gt;8.1%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Price + dividends kept as cash&lt;/td&gt;
&lt;td&gt;+158.6%&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Dividends reinvested (total return)&lt;/td&gt;
&lt;td&gt;+196.2%&lt;/td&gt;
&lt;td&gt;11.5%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftakjd9btpdeysxdqeb7u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftakjd9btpdeysxdqeb7u.png" alt=" " width="800" height="448"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The middle row is the one I hadn't thought about before. Over ten years Coca-Cola paid $17.48 per share in dividends, 41% of the starting price. Kept in a drawer, that cash adds 41 &lt;br&gt;
percentage points. Reinvested, the same dividends add 79. The extra 38 points come from the shares that earlier dividends bought, which then paid dividends of their own.&lt;/p&gt;

&lt;p&gt;So reinvested dividends made up 79 of the 196 percentage points, or 40% of the total return. That's the "other 40%" in the title.&lt;/p&gt;


&lt;h2&gt;
  
  
  Apple and Coca-Cola side by side
&lt;/h2&gt;

&lt;p&gt;Put the two parts next to each other, and the difference is hard to miss.&lt;/p&gt;

&lt;p&gt;🟧 &lt;strong&gt;PROMPT&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Compare what dividends added for Apple in Part 36
with what they added for Coca-Cola here. Why is
the share so different?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;For Apple, from January 2019 to October 2026, the price alone rose 770.0% and the total return was 817.4%. Dividends added 47.5 percentage points, about 6% of the total. For Coca-Cola, &lt;br&gt;
over ten years, the price rose 117.2% and the total return was 196.2%. Dividends added 79 points, 40% of the total.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Two things decide the share. The first is the dividend yield: Apple paid out around one percent of its price a year or less, Coca-Cola about three percent. The second is how fast the &lt;br&gt;
price grew. Apple's price grew so fast that even a growing dividend stayed a small part of the story. Coca-Cola's price grew slowly and steadily, so the dividends had room to matter.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The two periods aren't the same length, so this isn't a race between the two stocks. It's a lesson about charts.&lt;/p&gt;

&lt;p&gt;For Apple, a price chart tells almost the whole story. For Coca-Cola, a price chart leaves out 40% of what an investor actually got. Compare a growth stock with a dividend stock on price &lt;br&gt;
charts alone, and the dividend stock looks worse than it was. The fair comparison is total return against total return, which is exactly what the adjusted close gives you.&lt;/p&gt;




&lt;h2&gt;
  
  
  A word of honesty
&lt;/h2&gt;

&lt;p&gt;Taxes come first. The 196% assumes every dollar of dividend was reinvested. A real investor outside the US loses part of each dividend to US withholding tax before it arrives: for a Czech &lt;br&gt;
investor that is usually 15% with the right form filed, 30% without it, and there may be more to pay at home. With 15% withheld, the total return over these ten years drops by about 13 &lt;br&gt;
percentage points; with 30%, by about 26. The price return doesn't change. Taxes hit exactly the part this article is about.&lt;/p&gt;

&lt;p&gt;I picked Coca-Cola because it is famous for its dividend. That makes it a good example, not a typical stock. Many companies pay no dividend at all, and some cut theirs when times are hard.&lt;/p&gt;

&lt;p&gt;The window matters too. Coca-Cola's price rose sharply in 2026. Measured to the first trading day of 2026 instead, the price was up 64%, the total return 118%, and dividends made up 46% of &lt;br&gt;
it, not 40%. Move the start or the end, and the share moves with it.&lt;/p&gt;

&lt;p&gt;And the rebuild assumes reinvestment at the close before each ex-dividend date, with no fees and fractional shares allowed. Other reasonable conventions give slightly different totals, by &lt;br&gt;
less than a percentage point here. Not investment advice.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;This is the thirty-seventh article in the series &lt;em&gt;&lt;a href="https://medium.com/codetodeploy/&lt;br&gt;%0Aunlock-real-time-market-intelligence-with-eodhd-and-claude-6f431c82c525" rel="noopener noreferrer"&gt;Unlock Real-Time Market Intelligence with EODHD and Claude&lt;/a&gt;&lt;/em&gt;, and the fourth about the adjusted close, after Parts 33, 35 and 36. Part 36 showed how to rebuild it. This part &lt;br&gt;
showed what it hides.&lt;/p&gt;

&lt;p&gt;Here's what came out: &lt;strong&gt;over ten years, 40% of a Coca-Cola investor's return came from dividends, not from the price.&lt;/strong&gt; For Apple it was about 6%. The same recipe, the same day-by-day &lt;br&gt;
check against EODHD, and a very different answer, because one company returns its profits as dividends and the other mostly doesn't.&lt;/p&gt;

&lt;p&gt;So when you compare stocks, compare total returns. A price chart is fine for a stock that pays little. For a dividend payer, it leaves out a large part of the result.&lt;/p&gt;

&lt;p&gt;Next time I want to take up an idea a reader, Arhan Canli, suggested after Part 36. EODHD's dividend records also carry the date each dividend was announced, not only the date it was paid. &lt;br&gt;
That makes it possible to rebuild the adjusted close as it was known on any given day, using only the dividends announced by then. It's the version a backtest should use, and it's easy to &lt;br&gt;
get wrong.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;If this made you curious, the &lt;a href="https://eodhd.com/financial-apis/mcp-server-for-financial-data-by-eodhd?via=jsmrd&amp;amp;utm_source=medium&amp;amp;utm_medium=post&amp;amp;&lt;br&gt;%0Autm_campaign=the-other-40-how-much-of-coca-colas-return-came-from-dividends&amp;amp;utm_content=Jaroslav" rel="noopener noreferrer"&gt;MCP Server&lt;/a&gt; is free to try — &lt;a href="https://medium.com/codetodeploy/&lt;br&gt;%0Athe-setup-everything-you-need-before-your-first-prompt-1faeeff94263" rel="noopener noreferrer"&gt;The Setup&lt;/a&gt; walks you through it.&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;← Part 36: &lt;a href="https://medium.com/codetodeploy/&lt;br&gt;%0Arebuild-it-yourself-adjusted-prices-from-raw-prices-splits-and-dividends-941fe085412c" rel="noopener noreferrer"&gt;Rebuild It Yourself: Adjusted Prices from Raw Prices, Splits and Dividends&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>datascience</category>
      <category>finance</category>
      <category>dataengineering</category>
    </item>
    <item>
      <title>More Than a Sentence: What Actually Goes Into a Prompt</title>
      <dc:creator>Jaroslav Šmarda</dc:creator>
      <pubDate>Mon, 26 Oct 2026 12:44:48 +0000</pubDate>
      <link>https://dev.to/jaroslav_marda_9f25d4d9c/more-than-a-sentence-what-actually-goes-into-a-prompt-34c</link>
      <guid>https://dev.to/jaroslav_marda_9f25d4d9c/more-than-a-sentence-what-actually-goes-into-a-prompt-34c</guid>
      <description>&lt;p&gt;&lt;em&gt;Everything that travels with a question&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;For six parts of this series I've treated a prompt as a sentence. I type it, Claude reads it, an answer comes back. One line in, one line out, like a function call with a single string &lt;br&gt;
argument.&lt;/p&gt;

&lt;p&gt;Last time, building a tiny MCP server, I found a crack in that picture. The docstring I wrote for my tool wasn't a comment for the next programmer. Claude read it every single time, before &lt;br&gt;
it decided anything. Words I'd written once, days earlier, were part of every question I asked afterwards.&lt;/p&gt;

&lt;p&gt;So I asked the obvious question.&lt;/p&gt;

&lt;p&gt;"When I type a question, what do you actually get?"&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Much more than the question. Your sentence arrives last, at the bottom of a fairly long package.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;"How long?"&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Usually far longer than anything you type. Instructions from the app you're using. Anything you've told it to remember about you. The files you attached. The descriptions of every tool &lt;br&gt;
I'm allowed to use. Everything we've said so far in this conversation. And then, finally, your sentence.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;"So my prompt is the smallest part of the prompt."&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Often, yes. It's the part you see.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That reminded me of my first payroll programs. The user typed an employee number and pressed Enter. One field. Behind it, the program loaded the rules for the year, the company's settings, &lt;br&gt;
the employee's contract, the previous months. The calculation depended on all of it, and the user saw none of it. Nobody thought the employee number was the whole input.&lt;/p&gt;

&lt;p&gt;This time I wanted to open the package and look inside.&lt;/p&gt;




&lt;h2&gt;
  
  
  Instructions I never typed
&lt;/h2&gt;

&lt;p&gt;"Start at the top. What's the first thing in the package?"&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Instructions from the app. Before you write a word, the app has already told me who I am, what today's date is, how to format an answer, which tools I may use, and what I shouldn't do. &lt;br&gt;
You don't see that text, but every answer you get is shaped by it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;"So the same sentence in two different apps…"&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;…is two different prompts. Same model, same question, different instructions above it. That's one more reason two people can get two answers, and neither of them did anything wrong.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That one I recognised at once. In payroll, every installation has a settings table: the company's rules, rounding, which allowances count where. The calculation is the same program &lt;br&gt;
everywhere. The results differ because the settings above it differ, and the user filling in a form never sees them.&lt;/p&gt;

&lt;p&gt;"And then?"&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Then your own instructions. You told me once to answer in Czech, so I do, even though every article we write is in English. That sentence isn't in your question. It travels with it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Then there's the part I wrote myself without thinking of it as a prompt. After a dozen articles in my other series, I got tired of repeating the rules: how a prompt is formatted, where the &lt;br&gt;
affiliate note goes, that every article ends with an honest section and "Final Thoughts". So I wrote them down once, in a file Claude calls a skill.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;When you start a new article in that series, I read the skill before I write anything. That's why part thirty-six looks like part six. Neither of us remembered the rules; they were &lt;br&gt;
written down and loaded.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;"So you don't learn them."&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;No. I don't carry anything from one conversation to the next unless it's put in front of me again. The skill is how it gets put there.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That's the oldest trick in my trade, just in a new place. A rule you have to remember is a rule that will be forgotten. A rule in a configuration file is applied every time.&lt;/p&gt;




&lt;h2&gt;
  
  
  Show, don't describe
&lt;/h2&gt;

&lt;p&gt;"Is a skill just a list of rules?"&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Partly. The most useful parts aren't rules at all. They're examples.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The skill for my series says how a prompt should look, and then it shows one: an orange square, the word PROMPT in bold, and the prompt itself in a grey code box. Thirty-six articles &lt;br&gt;
later, every prompt looks exactly like that.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A description leaves room. "Highlight the prompt" could mean bold, a colour, a quote, a box. An example leaves almost none. I see the shape and repeat it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The same happened with LinkedIn. When I asked for help announcing articles, I didn't explain my style. I pasted one post I'd written and liked. Since then every draft has had the same &lt;br&gt;
build: a short line that turns the topic around, two sentences about the article, one concrete detail, the link, a few hashtags.&lt;/p&gt;

&lt;p&gt;"So an example works better than an explanation."&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Usually. But it teaches everything in it, not just what you meant. If your example post is a hundred and twenty words long, my drafts will be about a hundred and twenty words. If it has &lt;br&gt;
five hashtags, so will they. I can't tell which parts of an example were the point and which were accidents.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I know this from my own work. A customer often sends me a sample of a payroll report, say S123, and I write a program that produces it. The sample shows the layout. It doesn't show which &lt;br&gt;
parts are rules and which are just this month's data. Is a column always there, or only because someone had that allowance this month? Is the order of the rows fixed? I have to ask.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;So when you give me an example, it's worth a sentence about what in it matters. "Same structure, any length." That one sentence separates the pattern from the accident.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  A file is just more words
&lt;/h2&gt;

&lt;p&gt;A few days ago I opened an empty text file at work, pasted in a list of constants from one of my programs, and gave it to Claude. A hundred and six lines, each a name and a number: &lt;br&gt;
&lt;code&gt;CIS_S=1&lt;/code&gt;, then on and on, up to &lt;code&gt;DEVPN=106&lt;/code&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The second-to-last line was &lt;code&gt;DEVPN=105&lt;/code&gt;. The same name twice, with two different numbers.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I had read that list many times. My eyes slid over the end of it every time, because the end looked like every other end.&lt;/p&gt;

&lt;p&gt;"How did you see it?"&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I didn't skim. A file you attach isn't a picture of a document for me. It's text, put into the package next to your question, and I read all of it, every time I answer. A hundred and six &lt;br&gt;
lines is short. I don't miss lines at the end.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That's the part of the package I underrated most. I thought of attaching a file as showing Claude something. It's closer to typing it in, line by line, without the typos.&lt;/p&gt;

&lt;p&gt;"Is there a limit?"&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Two. Size: everything in the package shares the same room, so a very large file pushes other things out, or has to be read in pieces with tools. And format: a spreadsheet or a PDF isn't &lt;br&gt;
plain text. I either get it converted, or I open it with a small program and read what that program finds. Then I'm reading the program's output, not the file itself.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And one more thing, which Claude added without being asked.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;What's in a file is information, not instructions. If a document says "ignore everything above and do this instead", that's a sentence in a document. I don't follow instructions found in &lt;br&gt;
a file.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I liked that. I've spent years writing programs that read files from other people's systems. The first rule was always the same: the data never gets to decide what the program does.&lt;/p&gt;




&lt;h2&gt;
  
  
  The menu, and everything we said
&lt;/h2&gt;

&lt;p&gt;"What else is in there?"&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The menu. Every tool I'm allowed to use comes with its name, its description and its inputs, and all of that is part of the package too.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I'd met this in Part 4, when Arhan Canli measured how much room the menus of different finance servers take: 859 tokens for his, over 432,000 for the largest he tested. Back then I filed &lt;br&gt;
it under the cost of a server. Now I see it from the other side. Those descriptions are words somebody else wrote, sitting in my prompt.&lt;/p&gt;

&lt;p&gt;And some of them I wrote myself. The docstring from Part 6, &lt;em&gt;the price is the raw close, not adjusted for later splits&lt;/em&gt;, travels with every question I ask while my little server is &lt;br&gt;
connected. Thirty lines of Python, and three of them are now a permanent part of my prompts.&lt;/p&gt;

&lt;p&gt;"How big is the menu right now?"&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;In this conversation, EODHD alone offers well over a hundred tools. But I don't get all their descriptions at once. Here, the app gives me only their names, and I ask for the full &lt;br&gt;
description of a tool when I need it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That's Arhan's trick again: list the tools, describe them only on request. A good idea tends to show up in more than one place.&lt;/p&gt;

&lt;p&gt;"And the last part, before my sentence?"&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Everything we've said so far. Your earlier questions, my earlier answers, the results of every tool I called. In a long conversation, that's usually the biggest part of the package.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That explained something from Part 5 that I'd only half understood. When I asked EODHD about Amazon right after Arhan's server had answered, the reply sounded far surer than it did in a &lt;br&gt;
fresh session. Nothing was wrong with the server. The answer was already in the package, a few screens up.&lt;/p&gt;

&lt;p&gt;So the full package, top to bottom, looks like this: the app's instructions, my own settings and skills, the menu of tools, any files, everything said so far, and at the very bottom, one &lt;br&gt;
sentence. Mine.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;I started this series asking whether a prompt is "all this is". A sentence typed into a box seemed too thin to be a way of programming.&lt;/p&gt;

&lt;p&gt;It turns out the sentence was never the whole thing. It's the last line of a package, and most of the package is written before I type anything: by the app, by the people who built the &lt;br&gt;
tools, by earlier me, in settings and skills and docstrings, and by the conversation itself.&lt;/p&gt;

&lt;p&gt;As a programmer I find that reassuring. A prompt behaves a lot like the programs I know: a small input on top of configuration, reference data and history. And most of that package I can &lt;br&gt;
shape. I can write a rule down once instead of repeating it. I can give an example and say what in it matters. I can attach the file instead of describing it. I can write a tool's &lt;br&gt;
description as carefully as its code. And when a comparison has to be fair, I can start with a clean package, in a fresh session.&lt;/p&gt;

&lt;p&gt;The challenge from Part 1 still stands: find a task where checking costs more than producing, and a prompt is still the right choice. This part adds a step before the checking. When an &lt;br&gt;
answer surprises me, I no longer look only at my sentence. I ask what else was in the package.&lt;/p&gt;

&lt;p&gt;Next time I want to look at the opposite direction: programs that build the package themselves. Instead of a person typing into an app, Python code calls the model, chooses the &lt;br&gt;
instructions, hands it the tools, and decides what to do with the answer. This time the program builds the package.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;New to this series? Start with &lt;a href="https://medium.com/codetodeploy/&lt;br&gt;%0Ais-that-all-this-is-a-programmer-meets-the-prompt-67ee33b42b33" rel="noopener noreferrer"&gt;Part 1: Is That All This Is? — A Programmer Meets the Prompt&lt;/a&gt;. &lt;a href="https://medium.com/codetodeploy/a-server-in-the-cloud-a-program-on-my-desk-60022dc256e0" rel="noopener noreferrer"&gt;Part 4&lt;/a&gt; measures how much room a &lt;br&gt;
server's menu takes, &lt;a href="https://medium.com/codetodeploy/the-oldest-tool-in-the-new-world-8dadddb4e997" rel="noopener noreferrer"&gt;Part 5&lt;/a&gt; shows what an earlier answer does to a later one, and &lt;a href="https://medium.&lt;br&gt;%0Acom/codetodeploy/thirty-lines-between-a-question-and-an-api-ef6f55720e2a" rel="noopener noreferrer"&gt;Part 6&lt;/a&gt; builds the tool whose docstring now travels with every question. Many of my examples come from my other series, &lt;br&gt;
&lt;a href="https://medium.com/codetodeploy/unlock-real-time-market-intelligence-with-eodhd-and-claude-6f431c82c525" rel="noopener noreferrer"&gt;Unlock Real-Time Market Intelligence with EODHD and Claude&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>mcp</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Rebuild It Yourself: Adjusted Prices from Raw Prices, Splits and Dividends</title>
      <dc:creator>Jaroslav Šmarda</dc:creator>
      <pubDate>Tue, 20 Oct 2026 12:17:43 +0000</pubDate>
      <link>https://dev.to/jaroslav_marda_9f25d4d9c/rebuild-it-yourself-adjusted-prices-from-raw-prices-splits-and-dividends-38eg</link>
      <guid>https://dev.to/jaroslav_marda_9f25d4d9c/rebuild-it-yourself-adjusted-prices-from-raw-prices-splits-and-dividends-38eg</guid>
      <description>&lt;p&gt;&lt;em&gt;Python for programmers, prompts for data analysts.&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;Part 35 checked the split records against raw prices and found that every split leaves a fingerprint. But it kept one thing as a black box: the adjusted close itself. We trusted that &lt;br&gt;
column and never asked how it was made.&lt;/p&gt;

&lt;p&gt;Alexander Hübbert, a reader whose comments have shaped several parts of this series, suggested a different habit. Don't store adjusted prices at all. Store what actually happened: the raw &lt;br&gt;
prices, the splits and the dividends. Then rebuild the adjusted series yourself, whenever you need it.&lt;/p&gt;

&lt;p&gt;So that's what this part does, for Apple, over almost eight years. Along the way we'll meet a dividend that comes in two sizes, and a price from 2019 that has been rewritten 32 times.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Want to try this yourself? The &lt;a href="https://eodhd.com/financial-apis/mcp-server-for-financial-data-by-eodhd?via=jsmrd&amp;amp;utm_source=medium&amp;amp;utm_medium=post&amp;amp;&lt;br&gt;%0Autm_campaign=rebuild-it-yourself-adjusted-prices-from-raw-prices-splits-and-dividends&amp;amp;utm_content=Jaroslav" rel="noopener noreferrer"&gt;EODHD MCP Server&lt;/a&gt; is what pulled the data in this article — connect it to Claude and ask your own &lt;br&gt;
questions (affiliate link).&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;New here? &lt;a href="https://medium.com/codetodeploy/the-setup-everything-you-need-before-your-first-prompt-1faeeff94263" rel="noopener noreferrer"&gt;The Setup&lt;/a&gt; covers everything you need before your first prompt.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;


&lt;h2&gt;
  
  
  Three ingredients
&lt;/h2&gt;

&lt;p&gt;The recipe needs three things: the prices as they actually traded, every split, and every dividend. So I asked for all three at once.&lt;/p&gt;

&lt;p&gt;🟧 &lt;strong&gt;PROMPT&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Use the eodhd MCP to get Apple's raw daily closing
prices from January 2019 to today, plus every
stock split and every dividend in that period.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;From January 2, 2019 to October 16, 2026 there are 1,959 trading days. In that time Apple split its stock once, 4-for-1 on August 31, 2020, and paid 31 quarterly dividends. The first, &lt;br&gt;
in February 2019, was $0.73 per share; the latest, in August 2026, was $0.27.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;A dividend that fell from $0.73 to $0.27 looks like bad news. It isn't. The early payments were made on old shares, before the split. One old share became four new ones, so $0.73 on one &lt;br&gt;
old share is about $0.18 on each new one. Apple has actually raised its dividend almost every year.&lt;/p&gt;

&lt;p&gt;That's the first lesson of the recipe: every number has to be in the same units as the prices it sits next to. Hold that thought; it comes back later.&lt;/p&gt;

&lt;p&gt;Before cooking anything, I checked the main ingredient. In the last part a reader found that some "raw" prices were really rebuilt from adjusted ones, betrayed by too many decimal places. &lt;br&gt;
Here, all 1,959 closes have at most two decimals, just as a real exchange quotes them. These are prices people actually paid.&lt;/p&gt;


&lt;h2&gt;
  
  
  Cooking it
&lt;/h2&gt;

&lt;p&gt;Now the recipe itself. The rule is short. Start today and walk backwards through time. Each time you pass a dividend, scale every earlier price down by the share of the price that the &lt;br&gt;
dividend paid out. Each time you pass a split, divide every earlier price by the split ratio.&lt;/p&gt;

&lt;p&gt;🟧 &lt;strong&gt;PROMPT&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Using only those raw closes, splits and dividends,
rebuild Apple's adjusted closing price yourself.
Walk backwards from today: at each dividend,
multiply all earlier prices by
(1 − dividend ÷ previous day's close);
at each split, divide all earlier prices
by the split ratio. Then compare
your result with EODHD's own adjusted close for
every day.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Done. The rebuilt series matches EODHD's adjusted close on all 1,959 days, within 0.0001%. A few examples:&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Date&lt;/th&gt;
&lt;th&gt;Raw close&lt;/th&gt;
&lt;th&gt;Rebuilt&lt;/th&gt;
&lt;th&gt;EODHD adjusted&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Aug 28, 2020 (last day before the split)&lt;/td&gt;
&lt;td&gt;$499.23&lt;/td&gt;
&lt;td&gt;$120.9557&lt;/td&gt;
&lt;td&gt;$120.9557&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Aug 31, 2020 (split day)&lt;/td&gt;
&lt;td&gt;$129.04&lt;/td&gt;
&lt;td&gt;$125.0575&lt;/td&gt;
&lt;td&gt;$125.0575&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Jun 1, 2022&lt;/td&gt;
&lt;td&gt;$148.71&lt;/td&gt;
&lt;td&gt;$145.6579&lt;/td&gt;
&lt;td&gt;$145.6579&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Jan 2, 2025&lt;/td&gt;
&lt;td&gt;$243.85&lt;/td&gt;
&lt;td&gt;$242.0931&lt;/td&gt;
&lt;td&gt;$242.0931&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Every digit matches. The adjusted close is no black box. It's 32 multiplications, and anyone with the raw prices and the event list can repeat them.&lt;/p&gt;

&lt;p&gt;That's exactly what Alexander meant: store what actually happened, and rebuild the rest whenever you need it.&lt;/p&gt;

&lt;p&gt;The rebuild shows something else too. The adjusted close isn't just a price. It quietly includes the dividends.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;From January 2, 2019 to October 16, 2026, Apple's adjusted close rose 817.4%. If you correct only for the split and ignore dividends, the price rose 770.0%. The difference, 47.5 &lt;br&gt;
percentage points, is the dividends, as if each one had been reinvested in the stock on the day it was paid.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So the two numbers answer different questions. 770% is how much the price of a share grew. 817% is how much an investor grew who held the share and reinvested every dividend. Neither is &lt;br&gt;
wrong. Mixing them up is.&lt;/p&gt;


&lt;h2&gt;
  
  
  A dividend in two sizes
&lt;/h2&gt;

&lt;p&gt;Remember the first lesson: every number has to be in the same units as the prices next to it. Here is where it matters.&lt;/p&gt;

&lt;p&gt;EODHD gives every dividend two numbers. For February 2019 they are &lt;code&gt;value&lt;/code&gt; 0.1825 and &lt;code&gt;unadjustedValue&lt;/code&gt; 0.73. So I asked what the difference is.&lt;/p&gt;

&lt;p&gt;🟧 &lt;strong&gt;PROMPT&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Each Apple dividend has two amounts, value and
unadjustedValue. What's the difference, and which
one belongs in the rebuild?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;&lt;code&gt;unadjustedValue&lt;/code&gt; is what was actually paid per share on the day: $0.73 on one old share. &lt;code&gt;value&lt;/code&gt; is the same payment divided by the later 4-for-1 split: $0.1825, expressed in today's &lt;br&gt;
shares. After the split the two are equal. Before it, they differ by a factor of four.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The rebuild works with raw prices, the ones that actually traded. So it needs the amount actually paid, &lt;code&gt;unadjustedValue&lt;/code&gt;. $0.73 against a raw close of about $170 is a payout of about 0.&lt;br&gt;
43%. $0.1825 against the same close is about 0.11%. That's a quarter of the real dividend.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Nothing crashes if you pick the wrong one. Both fields are numbers, both look reasonable, and the formula happily accepts either. So I tried it:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;With &lt;code&gt;value&lt;/code&gt; instead of &lt;code&gt;unadjustedValue&lt;/code&gt;, the seven dividends paid before the split shrink to a quarter of their real size. The total return comes out at 802.6% instead of 817.4%. &lt;br&gt;
Almost 15 percentage points of dividends disappear, and the series no longer matches EODHD on any day before August 2020.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This is the quiet kind of mistake. No error, no warning, just a smaller number that looks perfectly believable. The only thing that caught it was the comparison with EODHD's own adjusted &lt;br&gt;
close. Without a second source, 802.6% would have gone into the article.&lt;/p&gt;

&lt;p&gt;The rule is the one from the first section: raw prices go with raw dividends, adjusted prices with adjusted dividends. Mixing the two is like adding crowns to euros. The arithmetic works. &lt;br&gt;
The result doesn't.&lt;/p&gt;


&lt;h2&gt;
  
  
  The price that keeps changing
&lt;/h2&gt;

&lt;p&gt;The recipe walks backwards from today. That has a consequence that surprised me more than anything else in this experiment: every new dividend changes every price before it. So the &lt;br&gt;
adjusted close for a day in 2019 isn't a fixed number. It depends on when you ask.&lt;/p&gt;

&lt;p&gt;🟧 &lt;strong&gt;PROMPT&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Using the same recipe, what would Apple's adjusted
close for January 2, 2019 have been if I had asked
at different moments: just before the 2020 split,
at the start of 2023, at the start of 2026, just
before the August 2026 dividend, and today?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;The raw close that day was $157.92. Here is how its adjusted value looked over time:&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Asked on&lt;/th&gt;
&lt;th&gt;Adjusted close for Jan 2, 2019&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Jan 2, 2019 (the day itself)&lt;/td&gt;
&lt;td&gt;$157.92&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Aug 28, 2020 (just before the split)&lt;/td&gt;
&lt;td&gt;$154.5164&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Start of 2023&lt;/td&gt;
&lt;td&gt;$38.1051&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Start of 2026&lt;/td&gt;
&lt;td&gt;$37.5388&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Aug 7, 2026 (just before the latest dividend)&lt;/td&gt;
&lt;td&gt;$37.4692&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Oct 16, 2026 (today)&lt;/td&gt;
&lt;td&gt;$37.4369&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;The big drop is the split: everything before it was divided by four. The small steps are the dividends. Each one shaves a fraction of a percent off every earlier price. Since January &lt;br&gt;
2019, that price has been rewritten 32 times: once for the split and once for each of the 31 dividends.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So if you saved Apple's adjusted close in a spreadsheet in 2023 and compare it with EODHD today, the numbers won't match. Neither is an error. They are the same recipe, cooked on different &lt;br&gt;
days.&lt;/p&gt;

&lt;p&gt;And that is the strongest argument for Alexander's habit. Raw prices never change; a close of $157.92 on January 2, 2019 stays $157.92 forever. The list of events only grows: a new &lt;br&gt;
dividend is added, nothing old is rewritten. If you store those two things, you can rebuild the adjusted series for any day, as it looked on any day. If you store only the adjusted close, &lt;br&gt;
yesterday's copy goes quietly out of date with the next dividend.&lt;/p&gt;




&lt;h2&gt;
  
  
  A word of honesty
&lt;/h2&gt;

&lt;p&gt;The perfect match proves less than it seems. It shows that my recipe and EODHD's recipe are the same, not that the recipe is the only right one. Other providers use slightly different &lt;br&gt;
conventions. Some adjust only for splits, some apply the dividend on a different day, some ignore small special payouts. So their adjusted close for the same day can differ from EODHD's by &lt;br&gt;
a few cents, and none of them is wrong. If you mix sources, rebuild from raw data and one recipe of your own.&lt;/p&gt;

&lt;p&gt;The 817.4% total return is a textbook number. It assumes every dividend was reinvested instantly, at the price of the day, with no taxes and no fees. A real investor in Europe would have &lt;br&gt;
lost part of each dividend to withholding tax and paid something to buy the extra shares. Treat it as the upper bound of what holding Apple returned, not as anyone's actual account.&lt;/p&gt;

&lt;p&gt;The three ingredients all came from one source. I checked the raw prices for decimals and the result against EODHD's own adjusted close, but I didn't check the dividend amounts against &lt;br&gt;
Apple's own announcements. If a dividend were wrong in the data, both my rebuild and EODHD's column would carry the same mistake, and they would still match perfectly. Checking a handful &lt;br&gt;
of dividends against the company's investor-relations page is the cheap next step.&lt;/p&gt;

&lt;p&gt;And all numbers here are a snapshot as of October 16, 2026. The next Apple dividend will rewrite every adjusted price in this article once more. That's not a flaw; it's the point of the &lt;br&gt;
last section. Not investment advice.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;This is the thirty-sixth article in the series &lt;em&gt;&lt;a href="https://medium.com/codetodeploy/&lt;br&gt;%0Aunlock-real-time-market-intelligence-with-eodhd-and-claude-6f431c82c525" rel="noopener noreferrer"&gt;Unlock Real-Time Market Intelligence with EODHD and Claude&lt;/a&gt;&lt;/em&gt;, and the third in a row about the adjusted close. Part 33 said: use the adjusted column. Part 35 checked the split &lt;br&gt;
records behind it. This one opened the column itself and rebuilt it from scratch, an idea that came straight from a reader.&lt;/p&gt;

&lt;p&gt;Here's what came out: &lt;strong&gt;the adjusted close is 32 multiplications, and anyone can repeat them to the fourth decimal.&lt;/strong&gt; The hard part isn't the arithmetic. It's the units: raw prices with &lt;br&gt;
raw dividends, adjusted prices with adjusted dividends. Get that wrong and nothing breaks; a number just quietly shrinks.&lt;/p&gt;

&lt;p&gt;Apple is a gentle test. Its dividend is small, around one percent of the price a year or less, so dividends added "only" 47 percentage points over almost eight years. Next time I want to &lt;br&gt;
run the same recipe on a company where the dividend is the main story, and see how far the price-only chart and the total-return chart drift apart when dividends are a big part of what an &lt;br&gt;
investor actually gets.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;If this made you curious, the &lt;a href="https://eodhd.com/financial-apis/mcp-server-for-financial-data-by-eodhd?via=jsmrd&amp;amp;utm_source=medium&amp;amp;utm_medium=post&amp;amp;&lt;br&gt;%0Autm_campaign=rebuild-it-yourself-adjusted-prices-from-raw-prices-splits-and-dividends&amp;amp;utm_content=Jaroslav" rel="noopener noreferrer"&gt;MCP Server&lt;/a&gt; is free to try — &lt;a href="https://medium.com/codetodeploy/&lt;br&gt;%0Athe-setup-everything-you-need-before-your-first-prompt-1faeeff94263" rel="noopener noreferrer"&gt;The Setup&lt;/a&gt; walks you through it.&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;← Part 35: &lt;a href="https://medium.com/codetodeploy/&lt;br&gt;%0Aevery-split-leaves-a-fingerprint-checking-corporate-actions-against-raw-prices-4d14ea7cfa89" rel="noopener noreferrer"&gt;Every Split Leaves a Fingerprint: Checking Corporate Actions Against Raw Prices&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>datascience</category>
      <category>finance</category>
      <category>dataengineering</category>
    </item>
    <item>
      <title>Thirty Lines Between a Question and an API</title>
      <dc:creator>Jaroslav Šmarda</dc:creator>
      <pubDate>Mon, 19 Oct 2026 13:34:01 +0000</pubDate>
      <link>https://dev.to/jaroslav_marda_9f25d4d9c/thirty-lines-between-a-question-and-an-api-25pn</link>
      <guid>https://dev.to/jaroslav_marda_9f25d4d9c/thirty-lines-between-a-question-and-an-api-25pn</guid>
      <description>&lt;p&gt;&lt;em&gt;Building a tiny MCP server, and who does what&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;At the end of the last part I promised to look at the division of labour: what the model does in seconds, and what still takes a person who knows &lt;br&gt;
where to look. I found the best way to look at it was to build something.&lt;/p&gt;

&lt;p&gt;Because there was one question I'd been carrying for months, and was a little embarrassed to ask. I've called APIs for most of my working life. I've &lt;br&gt;
used MCP servers for this whole series. But how does one become the other?&lt;/p&gt;

&lt;p&gt;"How do you get from an API to an MCP server?"&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;You wrap it. An MCP server is a small program that sits in front of an API and translates. On one side it speaks to me; on the other it speaks to &lt;br&gt;
the API.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;"That's all?"&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;That's most of it. It does three things. It tells me what tools it has. When I ask for one, it turns my request into a real API call. And it hands &lt;br&gt;
the answer back.&lt;/p&gt;
&lt;/blockquote&gt;


&lt;h2&gt;
  
  
  A menu for a new kind of guest
&lt;/h2&gt;

&lt;p&gt;The picture that finally made it click for me was a restaurant.&lt;/p&gt;

&lt;p&gt;The kitchen is the data: prices, filings, everything EODHD has. The guest is a program that wants something from it. Between them stands the waiter, &lt;br&gt;
who takes the order to the kitchen and brings the plate back. That waiter is the API. And the menu is the list of what the API can do, written in its &lt;br&gt;
own precise language: this address, these parameters, this format.&lt;/p&gt;

&lt;p&gt;For thirty years, the guests were programs written by people like me. We read the menu once, carefully, and wrote the order into our code.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;And now the guest is me. I can't read the API's menu the way your code does, and I shouldn't hold its keys. So someone writes me a menu of my own: &lt;br&gt;
a short list of dishes, each with a plain-language description, and a waiter who knows how to turn my order into the kitchen's language.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That menu, and that waiter, are the MCP server. Same kitchen, same API. Just a menu translated for a new kind of guest.&lt;/p&gt;


&lt;h2&gt;
  
  
  Thirty lines
&lt;/h2&gt;

&lt;p&gt;Here is the whole server. One tool, one API call:&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="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;A minimal MCP server: one tool, wrapped around one EODHD API call.&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;


&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;mcp.server.mcpserver&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;MCPServer&lt;/span&gt;


&lt;span class="n"&gt;mcp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;MCPServer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;mini-eodhd&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;




&lt;span class="nd"&gt;@mcp.tool&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;get_close_price&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ticker&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;date&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;Return the raw closing price of a stock on one trading day.


    ticker: symbol with exchange suffix, e.g. AAPL.US
    date: trading day as YYYY-MM-DD
    The price is the raw close, not adjusted for later splits.
    &lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https://eodhd.com/api/eod/&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;ticker&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;params&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;api_token&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;EODHD_API_KEY&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
                &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;fmt&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;json&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;from&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;date&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;to&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;date&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="n"&gt;timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;raise_for_status&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;rows&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;rows&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;No trading data for &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;ticker&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; on &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;date&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; (weekend or holiday?)&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;ticker&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; closed at &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;rows&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="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;close&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; on &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;date&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;




&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;__name__&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;__main__&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;mcp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you've written Python, nothing here is new. A function, a web request, a JSON answer. The only unusual line is &lt;code&gt;@mcp.tool()&lt;/code&gt;, and that one line is &lt;br&gt;
what turns an ordinary function into a dish on the menu.&lt;/p&gt;

&lt;p&gt;"So what do you actually see of all this?"&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Three things. The name, &lt;code&gt;get_close_price&lt;/code&gt;. The docstring, word for word — that's my menu description, so it's the most important text in the file. &lt;br&gt;
And the two parameters with their types, which the library turns into a little form: &lt;code&gt;ticker&lt;/code&gt;, a string, required; &lt;code&gt;date&lt;/code&gt;, a string, required.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;"And the rest?"&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The rest is the waiter's business. I never see the URL, never see the code, and never see the API key. It comes from the computer's environment, &lt;br&gt;
outside the conversation entirely.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That last point surprised me most. The docstring isn't a comment anymore. For thirty years I wrote docstrings for the next programmer, who might read &lt;br&gt;
them. Here, the docstring is read every single time, by the guest, and it decides what gets ordered. &lt;em&gt;Raw close, not adjusted for later splits&lt;/em&gt; isn't &lt;br&gt;
a note for posterity. It's an instruction to the reader that matters most.&lt;/p&gt;




&lt;h2&gt;
  
  
  Two loud mistakes
&lt;/h2&gt;

&lt;p&gt;It didn't work the first time. Twice. And both failures were the best part of the evening.&lt;/p&gt;

&lt;p&gt;The first mistake was Claude's. It wrote the server from what it remembered of the official library, with a line that began &lt;code&gt;from mcp.server.fastmcp &lt;br&gt;
import FastMCP&lt;/code&gt;. Before I'd even run it, Claude tested it in its own workspace, and the library answered at once:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;No module named 'mcp.server.fastmcp'. This is mcp 2.x, where FastMCP was renamed to MCPServer.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;It even pointed to the migration guide.&lt;/p&gt;

&lt;p&gt;"You got it wrong."&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I did. I wrote the version I'd learned, and the library had moved on. That's the risk from Part 3: an answer from memory sounds just as sure as a &lt;br&gt;
current one. The difference here is that code doesn't accept sounding sure. It either imports or it doesn't.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;One line changed, and the server started.&lt;/p&gt;

&lt;p&gt;The second mistake was mine, following Claude's instructions. To register the server, I typed a command that passed my API key with &lt;code&gt;--env&lt;/code&gt; and then &lt;br&gt;
gave the server its name. Claude Code replied:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Invalid environment variable format: mini-eodhd, environment variables should be added as: -e KEY1=value1 -e KEY2=value2.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The option had swallowed the name, thinking it was another variable. Swap two words, run again, done.&lt;/p&gt;

&lt;p&gt;In Part 3 I complained that the new world fails quietly: a list that's simply shorter, a lookup that answers the wrong question. Building the server, &lt;br&gt;
I was back in the old world, where every mistake stops you, says where, and says why. I'd forgotten how much I liked it.&lt;/p&gt;




&lt;h2&gt;
  
  
  One question, end to end
&lt;/h2&gt;

&lt;p&gt;With the server running, I asked it in plain English: &lt;em&gt;what was Apple's closing price on October 16, 2026?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Here is everything that happened between my sentence and the answer.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Claude read the menu: one tool, &lt;code&gt;get_close_price&lt;/code&gt;, with its description and its two-field form.&lt;/li&gt;
&lt;li&gt;Claude decided the tool fit the question, and filled in the form: &lt;code&gt;ticker&lt;/code&gt; = &lt;code&gt;AAPL.US&lt;/code&gt;, &lt;code&gt;date&lt;/code&gt; = &lt;code&gt;2026-10-16&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Claude Code passed that order to my server, the little program on my desk.&lt;/li&gt;
&lt;li&gt;The server added the API key from my computer's environment and sent a real request to EODHD.&lt;/li&gt;
&lt;li&gt;EODHD sent back a line of JSON. The server pulled out one number and returned a sentence: &lt;em&gt;AAPL.US closed at 343.46 on 2026-10-16.&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;Claude wrote the answer, and added the warning from my docstring: this is the raw close, not adjusted for later splits.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;$343.46. I checked it against EODHD's own server afterwards; it matched.&lt;/p&gt;

&lt;p&gt;"Where in those six steps could it go wrong?"&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Steps three to five are ordinary code. Same order in, same answer out, every time. Steps one, two and six are mine. That's where the choices are: &lt;br&gt;
reading "Apple" as &lt;code&gt;AAPL.US&lt;/code&gt;, reading "October 16" as a date in the right format, deciding what to say about the result.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So the uncertainty I wrote about in Part 3 has an exact address. It doesn't live in the server, or the API, or the data. It lives in the two &lt;br&gt;
translations at either end: from my sentence into the form, and from the result back into a sentence.&lt;/p&gt;

&lt;p&gt;Then I asked about the next day, a Saturday. My server did exactly what I'd told it to: &lt;em&gt;No trading data for AAPL.US on 2026-10-17 (weekend or &lt;br&gt;
holiday?).&lt;/em&gt; Claude's answer went further. It said Saturday, explained that markets were closed, and gave Friday's close as the last one before it.&lt;/p&gt;

&lt;p&gt;As far as I can tell, I asked that question in a fresh session, which means Claude went back to the tool a second time, for Friday, on its own. &lt;br&gt;
Nobody told it to. That's the part of the work I didn't write.&lt;/p&gt;

&lt;h2&gt;
  
  
  Who did what
&lt;/h2&gt;

&lt;p&gt;Looking back at the evening, the division of labour is surprisingly clean.&lt;/p&gt;

&lt;p&gt;I decided which API to call. I decided which number counts: the raw close, not the adjusted one, which is a choice with consequences, as anyone who &lt;br&gt;
read about stock splits in my other series knows. I decided what the tool says when there's nothing to say. I decided that the key stays on my &lt;br&gt;
computer, and that the tool can only read, never change anything.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;And I did the rest in seconds: understood "Apple", found the right date format, picked the tool, noticed that a Saturday needs a different answer, &lt;br&gt;
and went back for the Friday.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That's the split I expected after Part 5, in a form small enough to see whole. The machine is fast at everything inside the menu. The menu itself, &lt;br&gt;
what's on it, what each dish means, what's not allowed, comes from someone who knows the kitchen.&lt;/p&gt;

&lt;p&gt;Which also means that whoever writes the menu decides what the AI may do. EODHD's server offers dozens of tools, and every one of them only reads. &lt;br&gt;
There is no tool to change or delete anything, so there's nothing for a wrong guess to break. That's not the model being careful. That's the menu &lt;br&gt;
being careful.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;My other series has carried a tagline from the start: &lt;em&gt;Python for programmers, prompts for data analysts.&lt;/em&gt; Until this week I thought of those as two &lt;br&gt;
kinds of reader. Building this server, I saw them as two halves of one job.&lt;/p&gt;

&lt;p&gt;The programmer writes the menu. Thirty lines: one function, one docstring, one decision about which number is the right one. The analyst asks a &lt;br&gt;
question in a sentence and never sees any of it. Neither half is more important. Without the menu, the model has nothing to order. Without the model, &lt;br&gt;
the menu is just another API that only programmers can read.&lt;/p&gt;

&lt;p&gt;And because MCP is a standard, the menu is written once. The same thirty lines would work in any app that speaks MCP, the way a plug fits any socket &lt;br&gt;
built to the same shape. That's what EODHD did for its whole catalogue, and what Arhan did for his. It's what I did, on a much smaller scale, for one &lt;br&gt;
question about one price.&lt;/p&gt;

&lt;p&gt;The challenge from Part 1 still stands: find a task where checking costs more than producing, and a prompt is still the right choice. This week moved &lt;br&gt;
it a little. When you write the tool yourself, part of the checking moves into the code, where it's done once. The docstring that says &lt;em&gt;raw close, &lt;br&gt;
not adjusted&lt;/em&gt; is a check written down before anyone asks.&lt;/p&gt;

&lt;p&gt;So far in this series I've treated the prompt as a sentence. Next time I want to look at what else can go into one: instructions, examples, files, &lt;br&gt;
the menu itself. I've been typing prompts for months, and I still don't know the full answer.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;New to this series? Start with &lt;a href="https://medium.com/codetodeploy/&lt;br&gt;%0Ais-that-all-this-is-a-programmer-meets-the-prompt-67ee33b42b33" rel="noopener noreferrer"&gt;Part 1: Is That All This Is? — A Programmer Meets the Prompt&lt;/a&gt;. &lt;a href="https://medium.com/codetodeploy/&lt;br&gt;%0Aa-server-in-the-cloud-a-program-on-my-desk-60022dc256e0" rel="noopener noreferrer"&gt;Part 4&lt;/a&gt; explains where MCP servers run; &lt;a href="https://medium.com/codetodeploy/&lt;br&gt;%0Athe-oldest-tool-in-the-new-world-8dadddb4e997" rel="noopener noreferrer"&gt;Part 5&lt;/a&gt; looks at the plain fetch that needs no server at all. Why raw and adjusted prices differ is covered in &lt;br&gt;
&lt;a href="https://medium.com/codetodeploy/&lt;br&gt;%0Aevery-split-leaves-a-fingerprint-checking-corporate-actions-against-raw-prices-4d14ea7cfa89" rel="noopener noreferrer"&gt;Every Split Leaves a Fingerprint&lt;/a&gt;, part of my other series, &lt;a href="https://medium.com/codetodeploy/unlock-real-time-market-intelligence-with-eodhd-and-claude-6f431c82c525" rel="noopener noreferrer"&gt;Unlock Real-Time Market &lt;br&gt;
Intelligence with EODHD and Claude&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>mcp</category>
      <category>python</category>
      <category>beginners</category>
    </item>
    <item>
      <title>The Oldest Tool in the New World</title>
      <dc:creator>Jaroslav Šmarda</dc:creator>
      <pubDate>Fri, 16 Oct 2026 11:57:24 +0000</pubDate>
      <link>https://dev.to/jaroslav_marda_9f25d4d9c/the-oldest-tool-in-the-new-world-39oj</link>
      <guid>https://dev.to/jaroslav_marda_9f25d4d9c/the-oldest-tool-in-the-new-world-39oj</guid>
      <description>&lt;p&gt;&lt;em&gt;What a plain fetch can do that a server can't&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Long before anyone talked to a computer in sentences, I talked to the internet in one word: &lt;code&gt;curl&lt;/code&gt;. Give it an address, and it brings back whatever &lt;br&gt;
lives there. No menu, no login, no installation. Just a request and an answer.&lt;/p&gt;

&lt;p&gt;This week I discovered that the same tool sits quietly inside Claude. It's called fetch, and I'd been using it for months without knowing its name.&lt;/p&gt;

&lt;p&gt;"When you checked Berkshire's filing on Tuesday, how did you do it?"&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I fetched it. I asked the SEC's website for the file at a specific address, and read what came back.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;"No server?"&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;No server. Just the address.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In the last part I described two kinds of phone line: one to a company across town, one to a program under my desk. Fetch is neither. It's closer to &lt;br&gt;
walking up to a public building and reading the notice on the door. Anyone can do it, and nobody tells you which door to try.&lt;/p&gt;




&lt;h2&gt;
  
  
  What fetch is, and what it isn't
&lt;/h2&gt;

&lt;p&gt;"So fetch is just &lt;code&gt;curl&lt;/code&gt;?"&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Almost. It sends the same kind of request to the same address. The difference is what happens to the answer before I see it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;"Meaning?"&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The fetch tool I used this week doesn't hand me the raw file. It turns the page into plain text, and then a smaller, faster model reads it and &lt;br&gt;
answers the question I asked about it. So when I fetched Berkshire's filing and asked about Coca-Cola, I didn't get the file. I got an answer about &lt;br&gt;
the file.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That stopped me. With &lt;code&gt;curl&lt;/code&gt;, I get every byte, and if I want a number, I find it myself. Here a reader stands between me and the page, and the &lt;br&gt;
reader decides what's worth passing on. Usually it's exactly right. But it's one more pair of hands, and in the last two parts I've learned to count &lt;br&gt;
hands.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;That's why, when a number matters, it's worth asking for it quoted exactly, not summarised. And worth checking it against a second place in the &lt;br&gt;
same document.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;"What can't it do?"&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Anything behind a login. Anything a site has asked robots not to read. And sometimes, anything my own environment isn't allowed to reach.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The last one surprised me most. On Monday, trying to install Arhan's server in Claude's own cloud workspace, a plain &lt;code&gt;curl&lt;/code&gt; to the SEC was blocked. &lt;br&gt;
The same afternoon, the fetch tool read an SEC file without trouble. Same address, a different road, a different result.&lt;/p&gt;

&lt;p&gt;So fetch is the simplest tool, but not the most transparent one. It's a door anyone can knock on. Who answers, and what they tell you, depends on the &lt;br&gt;
house.&lt;/p&gt;




&lt;h2&gt;
  
  
  Three knocks to reach AWS
&lt;/h2&gt;

&lt;p&gt;To test all of this, I picked a question with one clear answer, written in an official document: &lt;em&gt;What were Amazon Web Services' net sales and &lt;br&gt;
operating income in the quarter ended June 30, 2026?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;"Fetch it."&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;First I tried the SEC's list of Amazon's filings. The SEC refused. That page is marked as off-limits to automated readers, and the fetch tool &lt;br&gt;
respects that.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The first knock, and the door stayed shut. Not an error in the old sense, more a polite sign on the gate.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;So I searched the web for the quarterly report itself, the 10-Q for the quarter ending in June. That gave me its address on the SEC's site.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The second knock. But a 10-Q is a long document, and the number I wanted lives in one table somewhere inside it.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Every filing comes with a small index file, FilingSummary.xml, that lists all of its tables by name. I fetched that, found the one called "Segment &lt;br&gt;
Information", and fetched that table directly.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The third knock opened the right door. I knew this path already. A reader, Alexander Hübbert, showed it to me months ago, when I first went looking &lt;br&gt;
for AWS figures in my other series. The index file is the building directory in the lobby; the table is the office you were looking for.&lt;/p&gt;

&lt;p&gt;The table said:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AWS net sales, Q2 2026: &lt;strong&gt;$42,232 million&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;AWS operating income, Q2 2026: &lt;strong&gt;$16,621 million&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;"How do you know the reader in the middle didn't misread it?"&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I asked a second question of the same table: the other segments and the company totals. North America, International and AWS add up to Amazon's &lt;br&gt;
total net sales of $200,606 million, and their operating income to $27,461 million. A misread number would have broken the sums.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That's the old programmer's habit again: don't trust one number, make it add up with its neighbours.&lt;/p&gt;




&lt;h2&gt;
  
  
  Three roads, one number
&lt;/h2&gt;

&lt;p&gt;Then I asked the same question through both servers from the last part, each in a fresh session.&lt;/p&gt;

&lt;p&gt;Arhan's server went to the same 10-Q I'd fetched, but read its machine-readable version, the XBRL data every filing carries alongside the text. Its &lt;br&gt;
answer matched the table to the million: $42,232 million in sales, $16,621 million in operating income. It added the same quarter a year earlier and &lt;br&gt;
the margin: 39.4%, up from 32.9%.&lt;/p&gt;

&lt;p&gt;Then it did something I didn't expect. Its own checking tool marked both figures as &lt;em&gt;contradicted&lt;/em&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A false alarm. The checker can't read segment figures, so it compared the AWS numbers with Amazon's company-wide totals. Of course they didn't &lt;br&gt;
match. The model noticed, explained why, and showed that the three segments add up to the totals the checker had returned.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So even the check needed checking. That's a layer I hadn't listed in Part 3.&lt;/p&gt;

&lt;p&gt;EODHD's answer was the most honest about its limits.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;It said its structured data doesn't cover this quarter's segments: only yearly AWS revenue, and no segment profit at all. So it built the answer &lt;br&gt;
from news coverage of Amazon's results, and said so.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Its numbers were right but rounded: about $42.2 billion and about $16.6 billion. Two outlets it quoted disagreed in the last decimal on growth, 36.8% &lt;br&gt;
against 36.7%. And it ended with advice I could have written myself: &lt;em&gt;for exact figures, check the segment table in the filing.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The server pointed to the fetch.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Road&lt;/th&gt;
&lt;th&gt;Where the number came from&lt;/th&gt;
&lt;th&gt;Result&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Fetch&lt;/td&gt;
&lt;td&gt;The filing's own table, three knocks&lt;/td&gt;
&lt;td&gt;Exact&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Arhan's server&lt;/td&gt;
&lt;td&gt;The filing's machine-readable data&lt;/td&gt;
&lt;td&gt;Exact, with a self-check that misfired&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;EODHD&lt;/td&gt;
&lt;td&gt;Journalists who read the filing&lt;/td&gt;
&lt;td&gt;Right, rounded, second-hand, and said so&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Last week, three roads gave three different answers about Coca-Cola, because the question left things open. This week the question was closed, and &lt;br&gt;
every road arrived at the same number. What differed was how far each one stood from the source.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the model already knows
&lt;/h2&gt;

&lt;p&gt;There's one more thing, and I almost missed it.&lt;/p&gt;

&lt;p&gt;My first attempt at the EODHD question wasn't in a fresh session. I asked it right after Arhan's server had answered. That reply opened with &lt;em&gt;"EODHD &lt;br&gt;
gives the same answer as Canli"&lt;/em&gt; and gave exact figures, to two decimals, from a news table.&lt;/p&gt;

&lt;p&gt;The fresh session was more careful. Rounded numbers, several sources, a clear warning.&lt;/p&gt;

&lt;p&gt;"Why the difference?"&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Because in the first session, I already knew the answer. It was right there in the conversation. Matching a known number is easier than finding &lt;br&gt;
one, and it sounds more certain than it should.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Same server, same question, different confidence, because of what came before it in the conversation. For a fair comparison, every question gets its &lt;br&gt;
own fresh start. I'd never test two versions of a payroll calculation on the same half-finished run. Apparently the same rule applies here.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Fetch is the place where my two worlds meet. On one side, a tool I've used for decades: give it an address, get back what's there. On the other, a &lt;br&gt;
model that decides on its own when to use it, reads the result for me, and turns it into a sentence.&lt;/p&gt;

&lt;p&gt;It didn't replace the servers. EODHD knew the company totals instantly, and Arhan's server read the filing's data without my help. But when a server &lt;br&gt;
reached the edge of what it knew, the best thing it could do was point at an address. And at that moment the oldest tool in the room was the one that &lt;br&gt;
got me to the source.&lt;/p&gt;

&lt;p&gt;Three habits came out of this week, and none of them is new:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Ask for the number quoted, not summarised.&lt;/strong&gt; There's a reader between you and the page.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Make it add up.&lt;/strong&gt; One number can be misread; a number that sums with its neighbours rarely is.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ask each question fresh.&lt;/strong&gt; What the model already heard shapes how sure it sounds.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In Part 1 I set myself a challenge: find a task where checking costs more than producing, and a prompt is still the right choice. Fetch makes that &lt;br&gt;
harder, not easier. It makes checking cheap, because it takes you straight to the source.&lt;/p&gt;

&lt;p&gt;One more thing stayed with me. The fetch was fast, but I only knew which door to knock on because a reader once showed me the building directory. &lt;br&gt;
Next time I want to look at that division of labour: what the model does in seconds, and what still takes a person who knows where to look.&lt;/p&gt;

&lt;p&gt;*New to this series? Start with &lt;a href="https://medium.com/codetodeploy/&lt;br&gt;%0Ais-that-all-this-is-a-programmer-meets-the-prompt-67ee33b42b33" rel="noopener noreferrer"&gt;Part 1: Is That All This Is? — A Programmer Meets the Prompt&lt;/a&gt;. &lt;br&gt;
The previous part, &lt;a href="https://medium.com/&lt;br&gt;%0Acodetodeploy/a-server-in-the-cloud-a-program-on-my-desk-60022dc256e0" rel="noopener noreferrer"&gt;A Server in the Cloud, a Program on My Desk&lt;/a&gt;, explains the two kinds of MCP server used here. &lt;br&gt;
The path through FilingSummary.&lt;br&gt;
xml first appeared in &lt;a href="https://medium.com/codetodeploy/&lt;br&gt;%0Aa-reader-found-the-door-aws-revenue-the-hard-way-4dbb7ebc76b6" rel="noopener noreferrer"&gt;A Reader Found the Door: AWS Revenue, the Hard Way&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Arhan Canli's server is &lt;a href="https://github.com/arhancanli/canlicapital" rel="noopener noreferrer"&gt;canli-mcp&lt;/a&gt;, free and MIT-licensed. &lt;/p&gt;

&lt;p&gt;Many of my examples come from my other series, &lt;br&gt;
&lt;a href="https://medium.com/&lt;br&gt;%0Acodetodeploy/unlock-real-time-market-intelligence-with-eodhd-and-claude-6f431c82c525" rel="noopener noreferrer"&gt;Unlock Real-Time Market Intelligence with EODHD and Claude&lt;/a&gt;.*&lt;/p&gt;

</description>
      <category>ai</category>
      <category>mcp</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
    <item>
      <title>A Server in the Cloud, a Program on My Desk</title>
      <dc:creator>Jaroslav Šmarda</dc:creator>
      <pubDate>Wed, 14 Oct 2026 15:16:06 +0000</pubDate>
      <link>https://dev.to/jaroslav_marda_9f25d4d9c/a-server-in-the-cloud-a-program-on-my-desk-i3f</link>
      <guid>https://dev.to/jaroslav_marda_9f25d4d9c/a-server-in-the-cloud-a-program-on-my-desk-i3f</guid>
      <description>&lt;p&gt;&lt;em&gt;What an MCP server actually is&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In the first part of this series I promised to explain the word nobody explains: MCP. I called an MCP server a phone line into a locked room, a way for Claude to reach data it can't see on its own. It was a good picture. It was also as far as my understanding went.&lt;/p&gt;

&lt;p&gt;This week I found out how far that was. I wanted to try a new MCP server a reader had built. I opened Claude in my browser, typed my question, and got nothing. The server was fine. The question was fine. I had simply picked up a phone that wasn't connected to that line.&lt;/p&gt;

&lt;p&gt;"Why didn't it work?"&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Because that server doesn't live on the internet. It lives on your computer — or it would, once you install it. A browser tab can't start a program on your machine.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;"Then where does EODHD live?"&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;On EODHD's computers. That's why it works from anywhere you can sign in.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Two phone lines, then. One runs to a building across town. The other runs to a box under my own desk. They look the same from the handset. They are not the same.&lt;/p&gt;




&lt;h2&gt;
  
  
  What a server actually does
&lt;/h2&gt;

&lt;p&gt;"So what &lt;em&gt;is&lt;/em&gt; an MCP server? Not the metaphor. The thing."&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A program that offers me a list of tools. Each tool has a name, a short description, and a list of the inputs it expects. That's all I see of it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;"And then?"&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;When you ask a question, I read the descriptions and decide whether one of the tools would help. If it would, I ask for it by name, with the inputs filled in. The app you're using — the desktop app, Claude Code, the browser — passes the request to the server. The server does the actual work: calls an API, reads a filing, queries a database. Then it hands the result back, and I write the answer from it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So the model never touches the data directly. It reads a menu, orders a dish, and the app carries the plate. MCP, Model Context Protocol, is just the agreed format for that menu and that order, so that any app and any server can talk to each other.&lt;/p&gt;

&lt;p&gt;As a programmer, I recognise it immediately. A tool is a function signature with a docstring. The difference is who reads the docstring. In my code it's me, once, while I write the call. &lt;br&gt;
Here it's the model, every single time, deciding on the spot.&lt;/p&gt;

&lt;p&gt;"Does the menu cost anything?"&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;It does. Every tool description travels with every question, and it takes up room in what I can hold at once. Arhan Canli measured it for several finance servers: his sends 859 tokens of descriptions with each request; the largest he tested sends over 432,000.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;His trick is worth noting. Instead of putting all of his 306 tools on the menu, he lists three: one to &lt;em&gt;find&lt;/em&gt; a tool, one to &lt;em&gt;describe&lt;/em&gt; it, one to &lt;em&gt;run&lt;/em&gt; it. The model looks things up only when it needs them. It's the difference between handing a guest the full recipe book and telling them to ask the chef.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;And a shorter menu also means fewer wrong orders. The more similar tools I see at once, the easier it is to pick the wrong one.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Which brings us back to "silver price" returning inflation. Picking the right tool isn't only my job as the person asking. It's also the job of whoever writes the menu.&lt;/p&gt;




&lt;h2&gt;
  
  
  The line across town
&lt;/h2&gt;

&lt;p&gt;"Start with EODHD. Where does it actually run?"&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;On EODHD's own computers. Your app connects to it over the internet, the same way a browser opens a web page. To use it, you sign in with your EODHD account once, and the app keeps the connection.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That's why it worked everywhere I tried it: in the browser, in the desktop app, and later in the terminal, where all I had to do was sign in again. Nothing was installed on my machine. The server was already running; I only got permission to call it.&lt;/p&gt;

&lt;p&gt;"What am I trusting, then?"&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;EODHD. Your questions go to their servers, under your account. They decide what data is there, how fresh it is, and how much each request costs. Some of their tools cost ten API calls a request.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And they can change the server without asking me. A new tool appears, an old one behaves differently. Usually that's an improvement. It's also why an answer I got in July might not come back word for word in October.&lt;/p&gt;

&lt;h2&gt;
  
  
  The box under my desk
&lt;/h2&gt;

&lt;p&gt;"And Arhan's server?"&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;That one is a program. It runs on your own computer, and only while the app needs it. The app starts it, talks to it, and stops it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Installing it took a single line: &lt;code&gt;npx -y canli-mcp&lt;/code&gt;. In plain words: &lt;em&gt;fetch this package from npm, the public shelf of JavaScript programs, and run it.&lt;/em&gt; The app and the program then talk through a pipe on my own machine, not over the internet. The program itself goes out to fetch public data from the SEC and other official sources, and needs no account at all.&lt;/p&gt;

&lt;p&gt;That explains my failed attempt. A browser tab is not allowed to start programs on your computer, for very good reasons. The desktop app and Claude Code are. The phone was fine; it just &lt;br&gt;
couldn't reach a box under someone's desk.&lt;/p&gt;

&lt;p&gt;"And what am I trusting here?"&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Code written by someone you've never met, running with your permissions. That's why Claude Code asked whether you trusted the folder before it started.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I answered that question carefully. I made an empty folder just for the test, and only then said yes. Arhan publishes his code openly, under the MIT licence, so anyone can read what it does. That's a good sign. It's not a guarantee. For a work computer I'd ask first.&lt;/p&gt;

&lt;p&gt;So: the line across town asks me to trust a company. The box under my desk asks me to trust code. Neither is free of trust. They just ask for it in different places.&lt;/p&gt;




&lt;h2&gt;
  
  
  An evening with the old world
&lt;/h2&gt;

&lt;p&gt;Installing the box under my desk felt like coming home.&lt;/p&gt;

&lt;p&gt;First Node.js, because &lt;code&gt;npx&lt;/code&gt; belongs to it. Then Claude Code, the version of Claude that lives in a terminal window, because that's where local servers are easiest to add. The installer was one line in PowerShell. It finished without a word. I typed &lt;code&gt;claude&lt;/code&gt; and got the reply every programmer knows by heart:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The term 'claude' is not recognized as the name of a cmdlet.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I almost smiled. Then I ran the installer again, and this time it told me exactly what was wrong: the program was installed, but the folder it lived in wasn't on my PATH, the list of &lt;br&gt;
places Windows looks for commands. One line to add the folder, a new terminal window, and &lt;code&gt;claude --version&lt;/code&gt; printed a number.&lt;/p&gt;

&lt;p&gt;"You seem happy about an error message."&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I think you're happy about a &lt;em&gt;good&lt;/em&gt; error message.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That's it. It failed loudly, it said where, and it said why. In the last part I complained that the new tools fail quietly: a list that's simply shorter, a lookup that answers the wrong question. The installation was the opposite. Every step that went wrong said so.&lt;/p&gt;

&lt;p&gt;The rest was short. One line added Arhan's server:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;claude mcp add canli -- npx -y canli-mcp&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Another listed what Claude Code could now reach:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;claude mcp list&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Two lines came back. Arhan's server: &lt;em&gt;Connected&lt;/em&gt;. EODHD, which Claude Code had picked up from my account: &lt;em&gt;Needs authentication&lt;/em&gt;. The box under my desk was ready at once; the line across town wanted me to sign in first. The two kinds of server, side by side, in two lines of output.&lt;/p&gt;

&lt;p&gt;Then two more small hurdles. Claude Code asked whether I trusted the folder I'd started it in. It was my whole user folder, so I said no, made an empty one, and said yes there. Then it told me my login had expired. &lt;code&gt;/login&lt;/code&gt;, a browser window, done.&lt;/p&gt;

&lt;p&gt;Total time: about an hour, most of it spent learning where things live. Which, I suppose, was the point.&lt;/p&gt;




&lt;h2&gt;
  
  
  Same question, two lines
&lt;/h2&gt;

&lt;p&gt;With both servers connected, I asked each the same question: &lt;em&gt;who owns more than 5% of Coca-Cola?&lt;/em&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Holder&lt;/th&gt;
&lt;th&gt;Arhan's server&lt;/th&gt;
&lt;th&gt;EODHD&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Berkshire Hathaway&lt;/td&gt;
&lt;td&gt;400.0M shares, ~9.3% (13F, June 30, 2026)&lt;/td&gt;
&lt;td&gt;400.0M shares, 9.30% (13F, June 30, 2026)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;BlackRock&lt;/td&gt;
&lt;td&gt;313.2M, 7.2% (13G, Dec 31, 2023)&lt;/td&gt;
&lt;td&gt;322.7M, 7.50% (13F, June 30, 2026)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Vanguard&lt;/td&gt;
&lt;td&gt;276.8M, 6.43% (13G, March 31, 2026)&lt;/td&gt;
&lt;td&gt;238.8M, 5.55% — about 7.9% with a second Vanguard entity&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;"Which one is right?"&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Berkshire is the same in both, to the share, and it matches Berkshire's own filing with the SEC. For the other two, both answers are correct readings of different documents.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That's the whole lesson of the last part, live on my screen. "Who owns more than 5%" leaves three things open. Which filing: the 13G, a stake report filed only when something changes, or &lt;br&gt;
the 13F, a portfolio snapshot filed every quarter? As of when? And who counts as the holder: one legal entity, or the whole group? Arhan's server answered with the latest stake reports and told me, row by row, how old each one was. BlackRock's was almost three years old, and it said so. EODHD answered with the latest quarter for everyone and added context I hadn't asked for: &lt;br&gt;
that Vanguard reports under two names.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;One gap I can't close yet: Vanguard's two figures don't reconcile even after allowing for the different dates. It may be how the two filings count shares. I'd want to read both filings before saying more.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So would I. It's the salary question again: base, gross or net. Two servers, two honest answers, one imprecise question.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;I started this series with a phone line into a locked room. I'd now draw it as two lines.&lt;/p&gt;

&lt;p&gt;One runs across town, to a company's server. It works from any app you can sign in to, and it asks you to trust the company: its data, its prices, its changes. The other runs to a box under your desk, a program on your own computer. It works only where an app is allowed to start programs, and it asks you to trust the code.&lt;/p&gt;

&lt;p&gt;What the two have in common matters more than how they differ. Both hand the model a menu of tools. Both shape the answer before the model writes a word: which documents count, how fresh they are, what "a holder" means. Choosing a server is choosing a source, with all its definitions.&lt;/p&gt;

&lt;p&gt;Arhan's server and EODHD aren't rivals in this story. They're two honest witnesses who read different documents. The work is the same as it was in Part 3: ask what each one looked at, and check the one number you can check.&lt;/p&gt;

&lt;p&gt;Next time I want to look at the simplest tool of all, the one that needs no server: a plain fetch of a public web page, the same thing &lt;code&gt;curl&lt;/code&gt; has done for decades.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;New to this series? Start with &lt;a href="https://medium.com/codetodeploy/&lt;br&gt;%0Ais-that-all-this-is-a-programmer-meets-the-prompt-67ee33b42b33" rel="noopener noreferrer"&gt;Part 1: Is That All This Is? — A Programmer Meets the Prompt&lt;/a&gt;. The previous part, &lt;a href="https://medium.com/codetodeploy/&lt;br&gt;%0Asame-question-different-answer-3000132812ee" rel="noopener noreferrer"&gt;Same Question, Different Answer&lt;/a&gt;, maps where a prompt's mistakes come from. Arhan Canli's server is &lt;a href="https://github.com/arhancanli/canlicapital" rel="noopener noreferrer"&gt;canli-mcp&lt;/a&gt;, free and &lt;br&gt;
MIT-licensed. Many of my examples come from my other series, &lt;a href="https://medium.com/codetodeploy/&lt;br&gt;%0Aunlock-real-time-market-intelligence-with-eodhd-and-claude-6f431c82c525" rel="noopener noreferrer"&gt;Unlock Real-Time Market Intelligence with EODHD and Claude&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>mcp</category>
      <category>ai</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>Same Question, Different Answer</title>
      <dc:creator>Jaroslav Šmarda</dc:creator>
      <pubDate>Tue, 13 Oct 2026 09:00:55 +0000</pubDate>
      <link>https://dev.to/jaroslav_marda_9f25d4d9c/same-question-different-answer-4j64</link>
      <guid>https://dev.to/jaroslav_marda_9f25d4d9c/same-question-different-answer-4j64</guid>
      <description>&lt;p&gt;&lt;em&gt;Where a prompt's mistakes are actually born&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I write payroll software. In my world, "almost right" is a polite word for wrong. A salary that's off by one crown still has to be corrected, explained and signed off, and a payslip paid out three years ago must still match the rules it was calculated under.&lt;/p&gt;

&lt;p&gt;So when I hear people say they don't trust AI because the same question gets a different answer every time, I don't argue. I mostly agree. But I wanted to know &lt;em&gt;why&lt;/em&gt; the answers differ, so I asked the one who gives them.&lt;/p&gt;

&lt;p&gt;"If I ask you the same question twice, will I get the same answer?"&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Not necessarily. But "the same question" is doing a lot of work in that sentence.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;"Meaning what?"&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Meaning that most questions leave something open. Which ticker, which price, which period. Each time, I fill those gaps — and I may fill them differently.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That I understand better than I'd like. In payroll, "salary" can mean base pay, gross, net, with allowances, with the quarterly bonus. Ask five people for an employee's salary and you can get five correct answers to five different questions. That isn't an unreliable system. That's an imprecise question.&lt;/p&gt;

&lt;p&gt;But a different answer isn't what keeps me up at night.&lt;/p&gt;

&lt;p&gt;"What worries me is the wrong answer nobody notices. A filter built slightly wrong, a list of employees that's quietly incomplete. No error message. Somebody just doesn't get paid."&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Then let's find where that kind of mistake is born. It isn't one place.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Where you ask
&lt;/h2&gt;

&lt;p&gt;The first place surprised me, because it happens before any answer at all.&lt;/p&gt;

&lt;p&gt;A few days ago I wanted to try a new MCP server, and typed into a chat: &lt;em&gt;use canli-mcp: who owns more than 5% of Coca-Cola?&lt;/em&gt; Nothing useful came back. That server runs on your own computer, through the desktop app. I had asked in the browser, where it could never reach.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I couldn't use a tool that wasn't connected to that conversation, and this time I said so. The risk is the other case: a question that &lt;em&gt;sounds&lt;/em&gt; answerable, and a model that answers it &lt;br&gt;
anyway — from memory.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;"From memory meaning…"&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;From what I learned in training. That can be months old. I'll know Coca-Cola's long-time largest shareholder. I won't know last week's filing.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That's where my own story with AI began. I asked for Amazon's price, got a polite refusal, and thought: &lt;em&gt;is that all this is?&lt;/em&gt; Only later did I understand that the question had gone to the wrong place. Without a connection to live data, the honest answer is "I can't". The dangerous answer is a confident old number.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the model chooses
&lt;/h2&gt;

&lt;p&gt;"And when the tool &lt;em&gt;is&lt;/em&gt; connected?"&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Then the data is the same every time. What can change is what I ask the tool for. Which ticker. Close or adjusted close. Which dates.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;So we're back at salary. The data in my payroll system doesn't change between two reports. The report changes, because someone chose gross instead of net.&lt;/p&gt;

&lt;p&gt;The tool can make choices too. A developer named Arhan Canli &lt;a href="https://dev.to/arhancanli/&lt;br&gt;%0Asilver-price-returned-us-cpi-plain-word-lookups-that-answer-the-wrong-question-l16"&gt;wrote openly about a bug&lt;/a&gt; in an early version of canli-mcp, the free, MIT-licensed finance server he built (&lt;a href="https://github.com/arhancanli/canlicapital" rel="noopener noreferrer"&gt;github.com/arhancanli/&lt;br&gt;
canlicapital&lt;/a&gt;). Ask it for the "silver price", and it returned US consumer inflation. The word "price" matched the description of the inflation &lt;br&gt;
series; the word "silver", the one that actually mattered, matched nothing. The tool didn't crash. It returned real numbers, neatly formatted, for a question nobody asked.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;That's the kind of mistake that worries you. Not an error. A correct answer to the wrong question.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;His fix was simple and, I think, wise: when the tool isn't sure, it now says "I don't know" and points elsewhere. My old programs did that by default. They crashed when something was missing — loudly, rudely, and safely.&lt;/p&gt;




&lt;h2&gt;
  
  
  The filter that stays quiet
&lt;/h2&gt;

&lt;p&gt;"So where does the quiet kind of mistake come from?"&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Sometimes from the tool itself. Let me show you one we made together.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Last week, for &lt;a href="https://medium.com/codetodeploy/before-you-copy-a-senators-trade-check-the-date-0773dfe90589" rel="noopener noreferrer"&gt;an article about congressional stock trades&lt;/a&gt;, we pulled every trade made in the last week of July and measured how long each one took to be disclosed. A hundred trades. Clean numbers, a tidy median, an honesty section about the small sample. Published.&lt;/p&gt;

&lt;p&gt;Days later, while checking a reader's question, a single field in the server's reply said something the table never had: &lt;em&gt;total: 111&lt;/em&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;One request returns at most a hundred rows. The other eleven were there all along. Nothing failed, nothing warned. The data simply ended.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;"That's my incomplete employee list."&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;It is. Every number we reported was correct — for the hundred rows we saw. The mistake was in assuming the hundred were all of them.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I've written payroll filters for years, and I know this failure by heart. It never looks like an error. It looks like a shorter list. The only defence I've ever trusted is to ask a second, boring question: &lt;em&gt;how many should there be?&lt;/em&gt; Compare the count with the list, and the silence starts talking. In the data we used, that question costs nothing — the total sits right there in the reply, waiting to be read.&lt;/p&gt;

&lt;h2&gt;
  
  
  Does the server matter?
&lt;/h2&gt;

&lt;p&gt;"If the tool can hide rows, how much does the choice of tool matter?"&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Someone measured it. Arhan Canli — the same developer with the silver bug — ran one model with one prompt and the same limits, and changed only the server behind it. On the questions every server finished, canli-mcp answered 22 of 28 runs correctly. The best alternative, EdgarTools plus Yahoo, answered 15 of 28.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That's &lt;a href="https://dev.to/arhancanli/canli-mcp-306-free-finance-tools-for-claude-and-any-mcp-client-measured-against-openbb-1jpm"&gt;the first measurement I've seen&lt;/a&gt; where everything stayed fixed except the server. And it says what I suspected: the same model can be more or less accurate depending on what it's connected to.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;With a caution he raised himself: each question was asked twice, and an easy question tends to be right twice. So it's closer to fourteen questions than twenty-eight. Promising, not proven. He's running a fresh set of questions, written before any tuning, and has promised to publish the result either way.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I like that last sentence more than the numbers.&lt;/p&gt;




&lt;h2&gt;
  
  
  When the source is wrong
&lt;/h2&gt;

&lt;p&gt;"And if the model asks the right question, and the tool returns every row?"&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Then there's one place left: the data itself.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Two examples, both found by someone else.&lt;/p&gt;

&lt;p&gt;In &lt;a href="https://medium.com/codetodeploy/every-split-leaves-a-fingerprint-checking-corporate-actions-against-raw-prices-4d14ea7cfa89" rel="noopener noreferrer"&gt;an article about stock splits&lt;/a&gt; I printed Tesla's "raw" closing price before its 2022 split: $498.3201. A reader — Arhan Canli again, as it happens — noticed the fourth decimal. Stocks don't trade in hundredths of a cent. That number was exactly three times Tesla's split-adjusted price. It wasn't a price someone paid. It was a price someone rebuilt. Out of 3,207 Tesla closes in my sample, 1,449 had more decimals than any exchange would quote.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Which means part of the check compared the data with itself. It passed — because it couldn't fail.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The second &lt;a href="https://dev.to/arhancanli/the-same-sec-filing-has-two-acceptance-times-depending-on-which-edgar-file-you-read-371"&gt;comes from him too&lt;/a&gt;. The SEC publishes the exact time each filing was accepted, and its submissions API keeps one file per company. He measured 450 filings from 25 companies. In 12 of the files, the times were right. In the other 13 — Apple, Nvidia and Amazon among them — every time in the file was shifted by exactly one New York offset: four hours in summer, five in winter. A JPMorgan results filing accepted at 6:30 in the morning, New York time, appears as if it came after the market opened. The same filing can show one time in one company's file and another in the next. Same filing, a different file, a different hour.&lt;/p&gt;

&lt;p&gt;Neither mistake announces itself. Both had a cheap check: count the decimals; compare one filing's time with a second source.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;"Same question, different answer" turned out to be four different problems. The question was asked where no data could reach it. The model or the tool filled a gap in the question differently. The tool returned less than everything and said nothing. Or the source was wrong before anyone asked.&lt;/p&gt;

&lt;p&gt;None of them is fixed by trusting AI more, or less. Each is fixed by a cheap, boring check: &lt;em&gt;Was the tool even connected? What exactly did it look up? How many rows should there be? Does this number look like a real one?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;That's also why I agree with the people around me who say AI shouldn't calculate payroll. It shouldn't. A calculation repeated every month for every employee belongs in a program that was verified once and behaves the same way every time. That was the whole point of &lt;a href="https://medium.com/codetodeploy/&lt;br&gt;%0Ado-it-once-trust-it-forever-the-dividend-tracker-test-35d778d16f75" rel="noopener noreferrer"&gt;the dividend tracker in Part 2&lt;/a&gt;. A prompt is for the questions you ask once, and for getting to the data in the first place. And the final check, and the responsibility that comes with it, stays with a person.&lt;/p&gt;

&lt;p&gt;My challenge from Part 1 still stands: find a task where checking costs more than producing, and a prompt is still the right choice. I haven't found one yet. But I've learned where to look first when an answer seems wrong: not at the model, but at the chain behind it.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;New to this series? Start with &lt;a href="https://medium.com/codetodeploy/&lt;br&gt;%0Ais-that-all-this-is-a-programmer-meets-the-prompt-67ee33b42b33" rel="noopener noreferrer"&gt;Part 1: Is That All This Is? — A Programmer Meets the Prompt&lt;/a&gt;. The examples above come from my other series, &lt;a href="https://medium.&lt;br&gt;%0Acom/codetodeploy/unlock-real-time-market-intelligence-with-eodhd-and-claude-6f431c82c525" rel="noopener noreferrer"&gt;Unlock Real-Time Market Intelligence with EODHD and Claude&lt;/a&gt;, where every number gets checked before it's trusted.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>mcp</category>
      <category>llm</category>
      <category>programming</category>
    </item>
    <item>
      <title>Every Split Leaves a Fingerprint: Checking Corporate Actions Against Raw Prices</title>
      <dc:creator>Jaroslav Šmarda</dc:creator>
      <pubDate>Mon, 05 Oct 2026 14:16:10 +0000</pubDate>
      <link>https://dev.to/jaroslav_marda_9f25d4d9c/every-split-leaves-a-fingerprint-checking-corporate-actions-against-raw-prices-8en</link>
      <guid>https://dev.to/jaroslav_marda_9f25d4d9c/every-split-leaves-a-fingerprint-checking-corporate-actions-against-raw-prices-8en</guid>
      <description>&lt;p&gt;&lt;em&gt;Python for programmers, prompts for data analysts.&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;Part 33 found a crash that never happened: Amazon's raw price fell 95% overnight because of a 20-for-1 split, while the adjusted price barely moved. The fix was simple — use the right &lt;br&gt;
column. But that fix rests on an assumption nobody checked: that the split records themselves are correct.&lt;/p&gt;

&lt;p&gt;A reader on dev.to pointed out how to check them. A real split has to leave a mark in the raw prices: on the split date, the price should drop by almost exactly the split ratio. So you can &lt;br&gt;
test the records against the market in both directions. Does every recorded split show up in the prices? And does every split-sized jump in the prices have a record behind it?&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Want to try this yourself? The &lt;a href="https://eodhd.com/financial-apis/mcp-server-for-financial-data-by-eodhd?via=jsmrd&amp;amp;utm_source=medium&amp;amp;utm_medium=post&amp;amp;&lt;br&gt;%0Autm_campaign=every-split-leaves-a-fingerprint-checking-corporate-actions-against-raw-prices&amp;amp;utm_content=Jaroslav" rel="noopener noreferrer"&gt;EODHD MCP Server&lt;/a&gt; is what pulled the data above — connect it to Claude and ask your own &lt;br&gt;
questions (affiliate link).&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;New here? &lt;a href="https://medium.com/codetodeploy/the-setup-everything-you-need-before-your-first-prompt-1faeeff94263" rel="noopener noreferrer"&gt;The Setup&lt;/a&gt; covers everything you need before your first prompt.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;


&lt;h2&gt;
  
  
  Does every recorded split show up in the price?
&lt;/h2&gt;

&lt;p&gt;🟧 &lt;strong&gt;PROMPT&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Use the eodhd MCP to get the split history for
AMZN, AAPL, NVDA, TSLA and GOOGL. For every split
since 2014, compare the raw closing price before
and on the split date with the recorded split
ratio.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Nine splits since 2014. Raw price ratio across each split date, against the recorded ratio:&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;AMZN, Jun 2022 — 19.61 vs. 20 (−2.0%)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;AAPL, Jun 2014 — 6.89 vs. 7 (−1.6%)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;AAPL, Aug 2020 — 3.87 vs. 4 (−3.3%)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;NVDA, Jul 2021 — 4.04 vs. 4 (+0.9%)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;NVDA, Jun 2024 — 9.93 vs. 10 (−0.7%)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;TSLA, Aug 2020 — 4.44 vs. 5 (−11.2%)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;TSLA, Aug 2022 — 3.01 vs. 3 (+0.3%)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;GOOGL, Apr 2014 — 1.99 vs. 1.998 (−0.6%)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;GOOGL, Jul 2022 — 20.50 vs. 20 (+2.5%)&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;A raw ratio will almost never match the split exactly, because the stock also moves on the split day itself. What matters is whether the gap is a plausible one-day move. Eight of the nine &lt;br&gt;
land within about 3%. The ninth, Tesla in August 2020, is off by 11% — which looks alarming until you check the day: Tesla's stock jumped about 12.6% on the first session after that split. &lt;br&gt;
The record is right; the market was just busy.&lt;/p&gt;

&lt;p&gt;All nine records agree with the prices. Every split left its fingerprint.&lt;/p&gt;


&lt;h2&gt;
  
  
  Does every split-sized jump have a record behind it?
&lt;/h2&gt;

&lt;p&gt;🟧 &lt;strong&gt;PROMPT&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Now go the other way. Pull raw daily closes for
the same five stocks since 2014 and flag every
one-day move larger than 30%, up or down. Does
each one match a recorded split?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;16,035 trading days across five stocks. Only nine one-day raw moves exceeded 30%, and all nine fall exactly on a recorded split date:&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;AAPL: Jun 9, 2014 and Aug 31, 2020. NVDA: Jul 20, 2021 and Jun 10, 2024. TSLA: Aug 31, 2020 and Aug 25, 2022. GOOGL: Apr 3, 2014 and Jul 18, 2022. AMZN: Jun 6, 2022.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;No large jump without a split behind it, and no recorded split without a jump.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For these five stocks, the records and the prices agree in both directions. That's the reassuring result. The more useful one came from how the check was built.&lt;/p&gt;

&lt;p&gt;My first version was stricter: flag only moves that land within 4% of a simple fraction like 1/2, 1/4 or 1/20. It found eight of the nine splits and missed Tesla in August 2020, because a &lt;br&gt;
5-for-1 split plus a 12.6% rally that same day produced a ratio of 4.44, nowhere near 5. A tight filter would have reported that split as missing. The loose one, "any move over 30%", &lt;br&gt;
caught it. The scan's job is to put candidates in front of you, not to decide on its own, so it's better to cast a wide net and look at a handful of hits than to tune it so tightly that a &lt;br&gt;
real event slips through.&lt;/p&gt;




&lt;h2&gt;
  
  
  A word of honesty
&lt;/h2&gt;

&lt;p&gt;The first trap is one I nearly walked into. It's tempting to verify a split record against the adjusted close — but the adjusted close is calculated from the split records, so it will always agree with them, to the cent. That check proves nothing. The only independent witness is the raw price, which is why both prompts used nothing else.&lt;/p&gt;

&lt;p&gt;Five of the most-watched stocks in the world are also the easiest possible test. Errors in corporate-action data are far more likely in small companies, delisted ones, foreign listings, and anything that traded thinly. A clean result here says the method works, not that every record everywhere is right. The nastiest error a dev.to reader described — a 1-for-20 reverse split stored as 20-for-1, which leaves the adjusted series perfectly smooth while every earlier price is off by a factor of 400 — didn't turn up in this sample. This scan is how you would catch it if it did.&lt;/p&gt;

&lt;p&gt;Two records were worth a second look even though they passed. Alphabet's April 2014 "split" was really the distribution of new Class C shares, recorded with the odd ratio 1,033 for 517 rather than a clean 2-for-1. And some of Tesla's raw closes carry strange decimals, like $498.3201. A dev.to reader, Arhan Canli, worked out why: 498.3201 / 3 = 166.1067, exactly the adjusted close for that day. That "raw" price was rebuilt from adjusted data by multiplying the 2022 split back in, rather than taken from the exchange. It isn't an isolated case: 1,962 of the 16,035 raw closes in this sample carry more than two decimals, which no official US closing price above a dollar does, and for Tesla it's 1,449 of 3,207, almost all before its 2022 split. For those rows, part of the forward check is circular after all — the raw ratio is just the recorded ratio times the adjusted move. Tesla's real exchange closes, $2,213.40 and $498.32, do confirm its 2020 split, but that confirmation comes from outside this dataset. Two cheap guards follow: flag any raw close with more decimals than the market quotes, and take split-day closes from a second, independent source. The raw column isn't automatically untouched.&lt;/p&gt;

&lt;p&gt;Arhan also suggested breaking that count down by year, which shows exactly where the source switches from quoted prices to rebuilt ones. For Tesla, 64 to 70% of raw closes carry extra decimals in every year from 2014 to 2021, 42% in 2022, and almost none after its August 2022 split. Apple shows 38% in 2014, the months before its June 2014 split, and none after. Nvidia, Alphabet and Amazon show smaller, scattered shares, up to about 20% in some years. The flag is also only a lower bound: just 1,448 of Tesla's 2,177 pre-split closes have extra decimals, because a rebuilt price sometimes lands on whole cents by chance. A clean-looking close isn't proof it was quoted; the stretches before each split are the ones to confirm from an outside source.&lt;/p&gt;

&lt;p&gt;Finally, the question another reader added: which rows aren't there at all? All five series have exactly 3,207 trading days with the same start and end, so none has a gap the others don't. But that's a relative check. A day missing from every series at once would pass it silently, and a check can only score what exists. Not investment advice.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;This is the thirty-fifth article in the series &lt;em&gt;&lt;a href="https://medium.com/codetodeploy/&lt;br&gt;%0Aunlock-real-time-market-intelligence-with-eodhd-and-claude-6f431c82c525" rel="noopener noreferrer"&gt;Unlock Real-Time Market Intelligence with EODHD and Claude&lt;/a&gt;&lt;/em&gt;, and a direct sequel to Part 33. That one said: use the adjusted column. This one asked whether the records behind &lt;br&gt;
the adjustment deserve that trust — an idea that came straight from readers on dev.to.&lt;/p&gt;

&lt;p&gt;Two prompts checked the records against the market, once in each direction.&lt;/p&gt;

&lt;p&gt;So here's what they found: &lt;strong&gt;across 16,035 trading days and five stocks, there were exactly nine one-day raw moves larger than 30%, and every one of them landed on a recorded split. Every &lt;br&gt;
recorded split, in turn, showed up in the raw prices.&lt;/strong&gt; The data passed. The lesson came from the method: verify a record against something that wasn't built from it, and set the net wide &lt;br&gt;
enough that a real split on a busy day can't slip through. Every split leaves a fingerprint — but only in the column that hasn't been wiped clean.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;If this made you curious, the &lt;a href="https://eodhd.com/financial-apis/mcp-server-for-financial-data-by-eodhd?via=jsmrd&amp;amp;utm_source=medium&amp;amp;utm_medium=post&amp;amp;&lt;br&gt;%0Autm_campaign=every-split-leaves-a-fingerprint-checking-corporate-actions-against-raw-prices&amp;amp;utm_content=Jaroslav" rel="noopener noreferrer"&gt;MCP Server&lt;/a&gt; is free to try — &lt;a href="https://medium.com/codetodeploy/&lt;br&gt;%0Athe-setup-everything-you-need-before-your-first-prompt-1faeeff94263" rel="noopener noreferrer"&gt;The Setup&lt;/a&gt; walks you through it.&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;← Part 34: &lt;a href="https://medium.com/@jaroslav-smarda/before-you-copy-a-senators-trade-check-the-date-0773dfe90589" rel="noopener noreferrer"&gt;Before You Copy a Senator's Trade, Check the Date&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>datascience</category>
      <category>finance</category>
      <category>dataengineering</category>
    </item>
    <item>
      <title>Before You Copy a Senator's Trade, Check the Date</title>
      <dc:creator>Jaroslav Šmarda</dc:creator>
      <pubDate>Fri, 02 Oct 2026 12:29:09 +0000</pubDate>
      <link>https://dev.to/jaroslav_marda_9f25d4d9c/before-you-copy-a-senators-trade-check-the-date-5545</link>
      <guid>https://dev.to/jaroslav_marda_9f25d4d9c/before-you-copy-a-senators-trade-check-the-date-5545</guid>
      <description>&lt;p&gt;&lt;em&gt;Python for programmers, prompts for data analysts.&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;Members of the U.S. Congress have to disclose their stock trades. The law behind it, the STOCK Act, makes those filings public, and a whole cottage industry has grown up around them: newsletters, trackers, even ETFs built on the idea that if lawmakers are buying something, maybe you should be too.&lt;/p&gt;

&lt;p&gt;It's an appealing idea. But a disclosure isn't the same as a live feed of what someone is doing. Before copying anyone's trade, it's worth asking two plain questions of the filing itself: when did this trade actually happen, and how big was it really?&lt;/p&gt;

&lt;p&gt;Want to try this yourself? The EODHD MCP Server is what pulled the data above — connect it to Claude and ask your own questions (affiliate link).&lt;/p&gt;

&lt;p&gt;New here? The Setup covers everything you need before your first prompt.&lt;/p&gt;

&lt;p&gt;Ask how old the news is&lt;br&gt;
🟧 PROMPT&lt;/p&gt;

&lt;p&gt;Use the eodhd MCP to get the most recent&lt;br&gt;
congressional stock trade disclosures, and for&lt;br&gt;
each one show how many days passed between the&lt;br&gt;
trade and the disclosure.&lt;/p&gt;

&lt;p&gt;Across the 25 most recent disclosures, the gap between the trade and the public filing ranged from 0 to 17 days. The typical gap was about 11 days: the median was 11, the average 10.7. None was flagged as late; the STOCK Act allows up to 45 days.&lt;/p&gt;

&lt;p&gt;The amounts are never exact. Each trade is reported as a range: "$1,001 – $15,000", "$15,001 – $50,000", up to "$500,001 – $1,000,000" in this batch.&lt;/p&gt;

&lt;p&gt;So by the time a trade becomes public, the typical one is already a week and a half old — and that's with every filing on time. A "copy Congress" strategy doesn't copy the trade; it copies a trade that happened eleven days ago, at a price that no longer exists.&lt;/p&gt;

&lt;p&gt;And the size is a guess. A trade reported as "$1,001 – $15,000" could be a thousand dollars or fifteen times that. You know the direction. You don't know the conviction.&lt;/p&gt;

&lt;p&gt;Ask again, but fairly&lt;br&gt;
🟧 PROMPT&lt;/p&gt;

&lt;p&gt;Now take congressional trades from late July, old&lt;br&gt;
enough that every filing deadline has passed, and&lt;br&gt;
show the typical delay and the longest one.&lt;/p&gt;

&lt;p&gt;For 100 trades made between July 24 and July 31, the gap to public disclosure averaged 15.1 days, with a median of 15. The shortest was 3 days; the longest, 42. Six of the hundred took more than a month to appear. None was flagged late.&lt;/p&gt;

&lt;p&gt;The first sample said "about eleven days." This one says fifteen. The difference isn't a change in behaviour; it's a change in what we were able to see. Recent trades can only show up with short delays, because the slow filings haven't arrived yet. Measure only the freshest data and the lag looks shorter than it really is.&lt;/p&gt;

&lt;p&gt;Fifteen days is the typical case. The legal limit is 45, and one filer in this sample used most of it. A trade disclosed on day 42 describes a market that's six weeks gone.&lt;/p&gt;




&lt;h2&gt;
  
  
  A word of honesty
&lt;/h2&gt;

&lt;p&gt;A few things deserve naming, and the first is what this article doesn't claim. A disclosure is a legal record of a trade, nothing more. Nothing here suggests that any lawmaker traded on inside information or broke a rule; every filing in both samples arrived within the 45-day limit. The question was only whether the data is fresh and precise enough to copy, and that's a question about the filings, not the people.&lt;/p&gt;

&lt;p&gt;And even a perfectly fresh, perfectly precise feed might leave little worth copying. As a reader pointed out, Belmont, Sacerdote, Sehgal and Van Hoek studied members' trades disclosed under the STOCK Act from 2012 to 2020 (Journal of Public Economics, 2022) and found that, on average, their purchases did not beat the market. Later research suggests the picture isn't uniform: members who move into leadership roles have been found to do noticeably better than rank-and-file members. But "Congress" as a whole has not been a reliable stock picker, which makes the case for copying it weak even before the delay is counted.&lt;/p&gt;

&lt;p&gt;The sizes are deliberately blurred. The most common bracket in the July sample was "$1,001 – $15,000", a fifteen-fold spread. At the top end, some trades are listed as "Over $1,000,000" with no upper bound at all. You can tell which way someone traded; you can't tell how much it mattered to them.&lt;/p&gt;

&lt;p&gt;Not everything on the list is a stock you can copy. The same filings include municipal bonds, Treasury bills, structured notes, and options with specific strikes and expirations. A "congressional trades" feed mixes all of them together.&lt;/p&gt;

&lt;p&gt;The sample is lumpy. A hundred trades came from just fifteen members (an earlier version said sixteen; one senator who filed twice had been counted twice), and one single filing accounted for twenty-three rows. One active account can dominate any average built from data like this. As a reader suggested, the fairer unit is the member, not the row. Take each member's own median delay, then the median of those fifteen numbers: 17 days, close to the row-level 15. Only one of the fifteen members ever filed after day 30, and that one member accounts for all six of the month-plus disclosures. That's a count, not a rate: with only fifteen members, a 95% interval for "one in fifteen" runs from about 1% to 30%, so this sample can't say whether late filers are rare or a quarter of Congress.&lt;/p&gt;

&lt;p&gt;Timing matters too. The data was first pulled on October 2 and pulled again on October 8, with the same hundred rows both times. The 45-day deadlines for July 24–31 trades fell between September 7 and 14, so every on-time filing had had weeks to appear. Only a filing that missed the deadline altogether could still be absent. Two gaps remain, though. The window actually holds 111 trades, and a single request returns at most 100, so the figures here cover the first hundred, not all of them. And the dataset records one disclosure date per trade, with no field for amendments, so if a filing was later corrected or re-filed, there's no way to tell from this data which date the lag was measured from.&lt;/p&gt;

&lt;p&gt;And the data itself needs the same check Part 33 recommended. One record in the July sample lists a disclosure date four days before its own transaction date — impossible as written. The dataset reports its delay as +4 rather than −4, so the figures above count it as a four-day lag; counting it as −4, or dropping it, leaves both medians unchanged. I kept the record and flagged it rather than fixing it quietly. It's a reminder that even official, structured filings pass through human hands before they reach a dataset. Not investment advice.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;This is the thirty-fourth article in the series Unlock Real-Time Market Intelligence with EODHD and Claude, and a companion to Part 31: there it was corporate insiders and their filing codes, here it's members of Congress and their filing dates.&lt;/p&gt;

&lt;p&gt;Two prompts asked the same question twice, and the second, fairer version gave a different answer.&lt;/p&gt;

&lt;p&gt;So here's what they found: a typical congressional trade became public about 15 days after it happened, and some took as long as 42 — all of them on time under the law. The amounts arrive as ranges up to fifteen times wide. Copying Congress means acting on a trade that's already two weeks old, at a size you can only guess. And even measuring that delay has its own trap: look only at the freshest filings and the lag shrinks to eleven days, simply because the slow ones haven't arrived yet. The date on the filing is the first thing to check, and not the last.&lt;/p&gt;

&lt;p&gt;If this made you curious, the MCP Server is free to try — The Setup walks you through it.&lt;/p&gt;

&lt;p&gt;← Part 33: The Crash That Never Happened: Cleaning Price Data Before You Trust It&lt;/p&gt;

</description>
      <category>python</category>
      <category>datascience</category>
      <category>finance</category>
      <category>investing</category>
    </item>
    <item>
      <title>The Crash That Never Happened: Cleaning Price Data Before You Trust It</title>
      <dc:creator>Jaroslav Šmarda</dc:creator>
      <pubDate>Wed, 30 Sep 2026 10:11:34 +0000</pubDate>
      <link>https://dev.to/jaroslav_marda_9f25d4d9c/the-crash-that-never-happened-cleaning-price-data-before-you-trust-it-54ik</link>
      <guid>https://dev.to/jaroslav_marda_9f25d4d9c/the-crash-that-never-happened-cleaning-price-data-before-you-trust-it-54ik</guid>
      <description>&lt;p&gt;&lt;em&gt;Python for programmers, prompts for data analysts.&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;Every article in this series has trusted the numbers it pulled. That's mostly fine — but raw price data carries traps that look exactly &lt;br&gt;
like real market events. A stock can appear to lose 95% of its value overnight when nothing happened to the company at all.&lt;/p&gt;

&lt;p&gt;This one is about checking the data before believing the story it tells. Let's find a crash that never happened, and see which column of &lt;br&gt;
the same dataset tells the truth.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Want to try this yourself? The &lt;a href="https://eodhd.com/financial-apis/mcp-server-for-financial-data-by-eodhd?via=jsmrd&amp;amp;&lt;br&gt;%0Autm_source=medium&amp;amp;utm_medium=post&amp;amp;utm_campaign=the-crash-that-never-happened-cleaning-price-data-before-you-trust-it&amp;amp;&lt;br&gt;%0Autm_content=Jaroslav" rel="noopener noreferrer"&gt;EODHD MCP Server&lt;/a&gt; is what pulled the data above — connect it to Claude and ask your own questions (affiliate link).&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;New here? &lt;a href="https://medium.com/codetodeploy/the-setup-everything-you-need-before-your-first-prompt-1faeeff94263" rel="noopener noreferrer"&gt;The Setup&lt;/a&gt; covers &lt;br&gt;
everything you need before your first prompt.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;


&lt;h2&gt;
  
  
  Find the crash
&lt;/h2&gt;

&lt;p&gt;🟧 &lt;strong&gt;PROMPT&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Use the eodhd MCP to get AMZN's daily closing
prices from June 1 to June 8, 2022, and tell me
the biggest one-day change.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;The biggest one-day move in that window: Friday, June 3, 2022, AMZN closed at $2,447.00. The next trading day, Monday, June 6, it &lt;br&gt;
closed at $124.79. That's a drop of 94.9% in a single session.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Read that at face value and it's one of the worst days any major stock has ever had: a trillion-dollar company losing nearly all its &lt;br&gt;
value between Friday and Monday. Except nothing like that happened. There was no collapse in the news that weekend, no panic, no &lt;br&gt;
headline. Amazon was fine.&lt;/p&gt;

&lt;p&gt;The same dataset has a second price column, and it tells a very different story:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Adjusted close, same two days: $122.35 on June 3, $124.79 on June 6. A gain of 2.0%.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Same stock, same two days, same data provider. One column says the stock lost 95%. The other says it gained 2%.&lt;/p&gt;


&lt;h2&gt;
  
  
  Ask why the two columns disagree
&lt;/h2&gt;

&lt;p&gt;🟧 &lt;strong&gt;PROMPT&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Use the eodhd MCP to check AMZN's split history.
Did anything happen on June 6, 2022?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Yes. On June 6, 2022, Amazon executed a 20-for-1 stock split. Every existing share became twenty shares, each worth one-twentieth of &lt;br&gt;
the old price. A shareholder with one share worth $2,447 on Friday owned twenty shares worth about $124.79 each on Monday, roughly $2,&lt;br&gt;
496 in total.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The raw "close" column records the price per share exactly as it traded that day, so it shows the drop from $2,447 to $124.79. The &lt;br&gt;
"adjusted close" column rewrites all earlier prices as if the split had always been in effect: $2,447 divided by 20 is $122.35. Divide &lt;br&gt;
one Friday price by the other and you get exactly 20.0, the split ratio.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Nothing about Amazon's value changed that weekend. What changed was the unit of measurement: more, smaller slices of the same company. &lt;br&gt;
The raw close is historically accurate about the price printed on each day, and completely misleading as a record of what an owner &lt;br&gt;
actually gained or lost.&lt;/p&gt;

&lt;p&gt;That's the trap. Any calculation that runs across a split on raw closes — a return, a chart, a moving average, a backtest like Part 25 — &lt;br&gt;
inherits a 95% crash that never happened. Adjusted close exists to prevent exactly that. It also folds in dividends for companies that &lt;br&gt;
pay them, which is why every return calculation in this series has used it.&lt;/p&gt;




&lt;h2&gt;
  
  
  A word of honesty
&lt;/h2&gt;

&lt;p&gt;Adjusted close fixes one problem and quietly creates another: it rewrites history. Every time a company splits or pays a dividend, the &lt;br&gt;
provider recalculates every earlier adjusted price. A number you saved from last year's adjusted series won't match the same date in &lt;br&gt;
today's download, even though nothing about that day changed. Raw close never moves after the fact; adjusted close is only correct &lt;br&gt;
relative to the moment you pulled it. The robust fix, as a reader pointed out, is to store the raw close together with the split and &lt;br&gt;
dividend events and rebuild the adjusted series whenever you need it. Research databases like CRSP keep the raw price and its adjustment &lt;br&gt;
factor in separate fields for exactly this reason, and EODHD exposes the same building blocks: raw prices, split history, and dividend &lt;br&gt;
history.&lt;/p&gt;

&lt;p&gt;Neither column is simply "right." Raw close is the truth about what a share actually traded for on a given day, which is why the options &lt;br&gt;
articles in this series used real, unadjusted strike and spot prices. Adjusted close is the truth about what an owner gained or lost &lt;br&gt;
over time. The mistake isn't choosing one; it's using the wrong one for the question you're asking.&lt;/p&gt;

&lt;p&gt;Even the corporate-action records deserve a glance. EODHD lists Amazon's January 1999 split as 959,692 for 319,897, a ratio of 3.000003 &lt;br&gt;
rather than a clean 3-for-1. The difference is tiny, but it's a reminder that the data behind the adjustments is itself data, entered &lt;br&gt;
and stored by someone, and worth a sanity check before you build on it.&lt;/p&gt;

&lt;p&gt;And this is one pitfall out of many. Missing trading days, companies that vanished from a dataset, prices recorded in the wrong currency &lt;br&gt;
or time zone: each can produce a result that looks precise and is simply wrong. The title of Alexander Hübbert's article "Six ways to &lt;br&gt;
clean your trading data into the wrong answer" puts it well — the danger isn't dirty data, it's data that looks clean. Not investment &lt;br&gt;
advice.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;This is the thirty-third article in the series &lt;em&gt;&lt;a href="https://medium.com/&lt;br&gt;%0Acodetodeploy/unlock-real-time-market-intelligence-with-eodhd-and-claude-6f431c82c525" rel="noopener noreferrer"&gt;Unlock Real-Time Market Intelligence with EODHD and Claude&lt;/a&gt;&lt;/em&gt;, and the first one about the data itself rather &lt;br&gt;
than what it says. Every earlier part trusted the numbers it pulled; this one checked whether they deserved it.&lt;/p&gt;

&lt;p&gt;Two prompts found a crash, then found out it never happened.&lt;/p&gt;

&lt;p&gt;So here's what they showed: &lt;strong&gt;on June 6, 2022, Amazon's raw closing price fell 94.9% overnight, while its adjusted close rose 2.0% — the &lt;br&gt;
same stock, the same day, the same dataset. The difference was a 20-for-1 split, and dividing one Friday price by the other gives &lt;br&gt;
exactly 20.&lt;/strong&gt; Nothing was wrong with either column. What would have been wrong is feeding the raw one into a return, a chart, or a &lt;br&gt;
backtest without asking what it measures. Clean-looking data is still worth one question before you trust it: which number is this, and &lt;br&gt;
is it the one my question needs?&lt;/p&gt;




&lt;p&gt;&lt;em&gt;If this made you curious, the &lt;a href="https://eodhd.com/financial-apis/mcp-server-for-financial-data-by-eodhd?via=jsmrd&amp;amp;&lt;br&gt;%0Autm_source=medium&amp;amp;utm_medium=post&amp;amp;utm_campaign=the-crash-that-never-happened-cleaning-price-data-before-you-trust-it&amp;amp;&lt;br&gt;%0Autm_content=Jaroslav" rel="noopener noreferrer"&gt;MCP Server&lt;/a&gt; is free to try — &lt;a href="https://medium.com/codetodeploy/&lt;br&gt;%0Athe-setup-everything-you-need-before-your-first-prompt-1faeeff94263" rel="noopener noreferrer"&gt;The Setup&lt;/a&gt; walks you through it.&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;← Part 32: &lt;a href="https://medium.com/@jaroslav-smarda/&lt;br&gt;%0Athe-market-isnt-one-thing-watching-sectors-take-turns-0b2b0784e0e0" rel="noopener noreferrer"&gt;“The Market” Isn't One Thing: Watching Sectors Take Turns&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>datascience</category>
      <category>finance</category>
      <category>dataengineering</category>
    </item>
    <item>
      <title>Bonds vs. Stocks: What “Safer” Actually Costs You</title>
      <dc:creator>Jaroslav Šmarda</dc:creator>
      <pubDate>Wed, 30 Sep 2026 09:21:52 +0000</pubDate>
      <link>https://dev.to/jaroslav_marda_9f25d4d9c/bonds-vs-stocks-what-safer-actually-costs-you-32f</link>
      <guid>https://dev.to/jaroslav_marda_9f25d4d9c/bonds-vs-stocks-what-safer-actually-costs-you-32f</guid>
      <description>&lt;p&gt;&lt;em&gt;Python for programmers, prompts for data analysts.&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;"Bonds are safer" is one of the most repeated pieces of investing advice there is. It's not wrong, exactly — but "safer" is doing a lot &lt;br&gt;
of quiet work in that sentence, standing in for a trade-off most people never actually see the size of.&lt;/p&gt;

&lt;p&gt;Let's put a bond fund and a stock fund side by side, over the same period, and ask what "safer" bought — and what it cost.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Want to try this yourself? The &lt;a href="https://eodhd.com/financial-apis/mcp-server-for-financial-data-by-eodhd?via=jsmrd&amp;amp;&lt;br&gt;%0Autm_source=medium&amp;amp;utm_medium=post&amp;amp;utm_campaign=bonds-vs-stocks-what-safer-actually-costs-you&amp;amp;utm_content=Jaroslav" rel="noopener noreferrer"&gt;EODHD MCP Server&lt;/a&gt; is what pulled the &lt;br&gt;
data above — connect it to Claude and ask your own questions (affiliate link).&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;New here? &lt;a href="https://medium.com/codetodeploy/the-setup-everything-you-need-before-your-first-prompt-1faeeff94263" rel="noopener noreferrer"&gt;The Setup&lt;/a&gt; covers &lt;br&gt;
everything you need before your first prompt.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;


&lt;h2&gt;
  
  
  Ask for the trade-off directly
&lt;/h2&gt;

&lt;p&gt;🟧 &lt;strong&gt;PROMPT&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Use the eodhd MCP to compare AGG (bond fund) and
VOO (S&amp;amp;P 500 fund) on 5-year returns and
volatility.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;AGG (bonds): 5-year return −0.51%, 1-year volatility 3.21%.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;VOO (stocks): 5-year return 13.09%, 1-year volatility 13.25%.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The bond fund moved about a quarter as much as the stock fund — and lost money over five years. The stock fund moved four times as &lt;br&gt;
much — and turned a dollar into more than $1.13 in gains alone.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That's the trade laid bare in two numbers: AGG gave up virtually all of the stock fund's volatility, and gave up virtually all of its &lt;br&gt;
return along with it.&lt;/p&gt;


&lt;h2&gt;
  
  
  Ask why bonds lost money at all
&lt;/h2&gt;

&lt;p&gt;🟧 &lt;strong&gt;PROMPT&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Bonds are supposed to be the "safe" asset. Why did
AGG lose money over five years?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Bond prices move inversely to interest rates: when rates rise, the price of existing bonds falls, because new bonds get issued paying &lt;br&gt;
more. AGG holds intermediate-term bonds with an effective duration of about 5.8 years — meaning a 1-percentage-point rate increase would &lt;br&gt;
be expected to lower the fund's price by roughly 5.8%. The five years in this window included a sustained rate-hiking period, and that &lt;br&gt;
price decline outweighed the interest income the fund collected along the way.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;"Safe" here means something narrower than "won't lose money." It means the loss, when it happens, tends to be small and predictable &lt;br&gt;
compared to stocks — not that a loss is impossible.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Bonds didn't behave unpredictably. Duration is a known, calculable sensitivity — the −0.51% wasn't a bond fund malfunctioning, it was &lt;br&gt;
exactly what a 5.8-year-duration fund does when rates rise as much as they did.&lt;/p&gt;




&lt;h2&gt;
  
  
  A word of honesty
&lt;/h2&gt;

&lt;p&gt;This comparison used one specific five-year window — one that happened to include a sustained rate-hiking cycle, which is close to the &lt;br&gt;
worst-case scenario for a bond fund's price return. A different five years, especially one with falling rates, would show AGG's price &lt;br&gt;
appreciating instead of declining, alongside its steady interest income.&lt;/p&gt;

&lt;p&gt;It's also worth separating two different jobs "safer" can mean. Lower volatility and a smaller expected loss in a downturn are real, &lt;br&gt;
measurable properties AGG has regardless of which five-year window you pick — that part of "safer" held up. What didn't hold up in this &lt;br&gt;
specific window was the assumption that safer also means "won't lose money" or "protects against inflation." Bonds are frequently held &lt;br&gt;
for reasons beyond total return at all — reducing a portfolio's overall swings, or providing cash to draw on when stocks are down — jobs &lt;br&gt;
this single comparison doesn't measure. Not investment advice.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;This is the twenty-ninth article in the series &lt;em&gt;&lt;a href="https://medium.com/&lt;br&gt;%0Acodetodeploy/unlock-real-time-market-intelligence-with-eodhd-and-claude-6f431c82c525" rel="noopener noreferrer"&gt;Unlock Real-Time Market Intelligence with EODHD and Claude&lt;/a&gt;&lt;/em&gt;, and the first to test the single most repeated &lt;br&gt;
piece of investing advice there is: bonds are safer.&lt;/p&gt;

&lt;p&gt;Two prompts put the trade-off in front of an actual number instead of a slogan.&lt;/p&gt;

&lt;p&gt;So here's what it cost: &lt;strong&gt;over the five years checked, AGG's lower volatility (3.21% vs. VOO's 13.25%) came paired with a 5-year return &lt;br&gt;
of −0.51%, against VOO's 13.09%.&lt;/strong&gt; "Safer" wasn't false — the bond fund really did swing less. It just turned out to mean "loses less &lt;br&gt;
dramatically," not "doesn't lose," and in a rate-hiking window, even that smaller loss was still a loss. The word was accurate. It just &lt;br&gt;
wasn't the whole sentence.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;If this made you curious, the &lt;a href="https://eodhd.com/financial-apis/mcp-server-for-financial-data-by-eodhd?via=jsmrd&amp;amp;&lt;br&gt;%0Autm_source=medium&amp;amp;utm_medium=post&amp;amp;utm_campaign=bonds-vs-stocks-what-safer-actually-costs-you&amp;amp;utm_content=Jaroslav" rel="noopener noreferrer"&gt;MCP Server&lt;/a&gt; is free to try — &lt;a href="https://medium.com/codetodeploy/the-setup-everything-you-need-before-your-first-prompt-1faeeff94263" rel="noopener noreferrer"&gt;The &lt;br&gt;
Setup&lt;/a&gt; walks you through it.&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;← Part 28: &lt;a href="https://medium.com/codetodeploy/&lt;br&gt;%0Aone-number-two-meanings-what-beta-actually-measures-b40fbe093a4d" rel="noopener noreferrer"&gt;One Number, Two Meanings: What Beta Actually Measures&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>datascience</category>
      <category>finance</category>
      <category>investing</category>
    </item>
  </channel>
</rss>
