Home › Guides › Yahoo Finance API Data Checks

TESTING TRAPFREENO ACCOUNTAUTOMATED TRADE BOTSYahoo Finance APIData ChecksWhy a good backtest can lieEDUCATION ONLY | NO SIGNALSEXAMPLE NUMBERS ARE LABELLEDAUTOMATED TRADE BOTSautomatedtradebots.com
A free page on yahoo finance api data checks. Education only, with example numbers labelled.
TESTING TRAP

Yahoo Finance API Data Checks

Short answer

We have not checked any yahoo finance api or similar free source today, so this page says nothing about how any named service behaves.

Free price data in code is tempting for a backtest. Whatever the source, the data has to pass the same checks before you trust a result built on it.

The page explains the idea in plain words, works through the arithmetic with a table, and shows how it hits grid, martingale and DCA bots, then tells you what to check before you run one.

  • A worked example with real arithmetic
  • How it hits grid, martingale and DCA bots
  • How to check for it before you run a bot
  • No advice, no signals, no profit promises

Last reviewed 28 October 2026. Education only, not advice.

Free, no account Runs in your browser Worked numbers shown Not advice Examples labelled

Ready to go further

Next: pick your testing tools

Data is one part of a backtest. See what the test software itself has to do: fills, costs, and a trade list you can check.

Reading time8 minutes
Worked exampleExact arithmetic
Tools linked1 on this page
Reviewed28 Oct 2026

What is included

  • What it is, in plain words
  • The formula or mechanism, with exact arithmetic
  • How it hits grid, martingale and DCA bots
  • A check you can run before you switch a bot on

Who it is for

  • People who run or plan to run a trading bot
  • Anyone reading a backtest or a bot sales page
  • Readers who want the numbers, not the pitch
  • Not advice, and not a signal service
Same 10 made-up days: unadjusted close against split-adjusted close501001510DayMade-up prices. Blue is adjusted, the other line is unadjusted. Calculated by us on 30 Oct 2026, exact.
The picture for this page. Example numbers are made up unless the page says they were calculated.

Key facts

  • We have not checked any yahoo finance api or similar free source today, so this page says nothing about how any named service behaves.
  • Free price sources are commonly unofficial, can change without notice, and carry terms of use. Read the provider's current terms and test the data yourself.
  • A split that is not adjusted looks like a crash. In the made-up 10 day table below, a 2 for 1 split shows a -50.00 percent return in one day, when the adjusted return is +0.00 percent (calculated by us on 30 Oct 2026, exact).
  • The same 10 days read -46.00 percent unadjusted and +8.00 percent adjusted. A strategy tested on the first would be reacting to a number that never happened.
  • Save a local copy of the data you test on, so the test can be repeated and the result does not move when the source does.

What this page is, and what it is not

People search for a "yahoo finance api" because they want free price history they can pull into code and run a backtest on. That is a reasonable goal. This page does not describe any named service. We have not checked any of them today, and facts such as limits, endpoints, whether something is official, whether it is still free, how delayed it is and how it adjusts prices change, sometimes without notice.

What we can say in general is this. Free sources are commonly unofficial. They can stop working, change their format or add limits with no warning. They carry terms of use that may restrict what you do with the data. So the right question is not "does this source work today". It is "would I trust a test built on this data, and can I show why". The checklist below answers that for any source, free or paid.

Read the provider's current terms before you use their data, especially if you plan to store it, share it or use it in anything you sell. Terms differ by provider and change. We have not checked them for you.

For where data fits in the whole process, see backtest software and backtesting. If you are writing the code yourself, Python trading bot covers the shape of a bot, and TA-Lib covers indicator calculations that will run on whatever data you load.

The checklist for any free price source

1. Bar size and time zone

Know exactly what one bar is: a minute, an hour, a day. Know the time zone of its timestamp and whether the timestamp marks the start or the end of the bar. A daily bar for a market in one country may be stamped in another zone. If your rule says "buy at the next open", a mistake of one bar here is a mistake in every trade. It can also create look-ahead bias.

2. Adjusted or unadjusted prices

A split changes the share price without changing what an owner holds. A dividend pays cash out and the price usually drops by about that amount. Data can be unadjusted (the price printed that day), adjusted for splits only, or adjusted for splits and dividends. Each is right for some uses and wrong for others. Find out which one your source gives, which one your code asks for, and whether the close and the "adjusted close" are separate fields. The worked example below shows what goes wrong.

3. Missing bars and gaps

Count the bars. Compare the count with the number of trading days or sessions you expect. Holidays are not gaps, but a missing week is. A gap can make an indicator such as a moving average span a much longer time than you think. Decide in advance whether you drop, fill or reject a series with gaps.

4. Bad ticks

Look for prices that no one could have traded: a low above the high, a close outside its own high and low, a zero or negative price, or a one bar spike of 30 percent that reverses the next bar. A stop loss can be triggered by a spike that was only a data error. Flag these and look at them one by one.

5. Delisted symbols and survivorship

Many free sources only list instruments that still trade. The ones that were delisted, merged or went bankrupt are often absent. A test over today's list of symbols leaves out the failures and looks better than the real past. See survivorship bias. Ask whether the source can return a symbol that no longer trades. If you cannot find out, treat the result as flattering.

6. What volume means

Volume may be shares, contracts, units of a coin or a value in money. It may cover one venue or all of them. It may be revised later. A rule that filters on volume needs a volume you understand.

7. Delay

Data can be real time, delayed by some minutes, or end of day only. A delayed feed is fine for a slow daily test and useless for a bot that acts on the last minute. Check the delay against the speed of your rules.

8. Rate limits and how a script should back off

Sources limit how fast you can ask. A script that ignores the limit may be blocked. A careful script follows this pattern, written as generic pseudo-code:

for each symbol in the list:
    if a saved copy exists and is recent enough:
        use the saved copy
    else:
        wait a short, fixed pause
        ask the source for the symbol
        if the answer is an error or a refusal:
            wait twice as long as last time (up to a cap)
            try again, up to a small number of tries
            if it still fails: record the symbol as failed and move on
        else:
            check the data (steps below), then save it

The ideas are a pause between requests, doubling the wait after a refusal, a cap on tries, and never asking twice for what you already hold. The exact limits are the provider's to state. We have not checked them.

9. Licence for your use

Personal research, a paid product and a service to clients are three different uses. Terms often treat them differently. Read what the provider currently says about storing, redistributing and commercial use. If it is unclear, ask them or use a source whose terms are clear.

10. Save a local copy

Download once, check, and save the file with the date you pulled it and the source. Run all tests on the saved file. Then the test is repeatable, the numbers do not shift between runs, and if the source later changes or revises a price you still know what you tested on.

A worked data check: the split that looks like a crash

The table below is made up. It shows 10 days for an imaginary stock. Between day 5 and day 6 there is a 2 for 1 split: each share becomes two, and the price halves. Nobody lost anything. Every figure was calculated by us on 30 Oct 2026 and is exact.

The check, step by step:

  • Compute the one day return for every bar: today's price divided by yesterday's, minus 1.
  • Flag any day whose move is bigger than a limit you choose in advance, for example 25 percent in either direction.
  • For each flag, ask what happened: a split, a dividend, a real event, or a bad tick. Compare with a second source if you can.
  • If it is a split, use prices adjusted for it. Multiply every price before the split by 2, or divide every price after it by 2 (the returns are the same either way). Recompute the returns.
DayUnadjusted closeAdjusted closeUnadjusted return %Adjusted return %
1100.00100.00--
2101.00101.00+1.00+1.00
3102.00102.00+0.99+0.99
4103.00103.00+0.98+0.98
5104.00104.00+0.97+0.97
652.00104.00-50.00+0.00
752.50105.00+0.96+0.96
853.00106.00+0.95+0.95
953.50107.00+0.94+0.94
1054.00108.00+0.93+0.93

On day 6 the unadjusted close is 52.00 against 104.00 the day before: 52 divided by 104, minus 1, is -50.00 percent. The adjusted close for day 6 is 104.00, so the adjusted return is +0.00 percent. Over the whole 10 days, the unadjusted data gives -46.00 percent (54 divided by 100, minus 1) and the adjusted data gives +8.00 percent (108 divided by 100, minus 1).

Now see what that does to a bot. A rule that goes short after a fall of more than 10 percent would open a trade on day 6 and think it was riding a crash. A stop loss would fire. A volatility measure would jump. A test with a -50.00 percent day inside it has measured the split, not the strategy.

Total return over the 10 days, same data read two ways (made-up)-46.00%Unadjustedday 1 to day 10+8.00%Adjustedday 1 to day 10Made-up numbers. The only difference is whether the 2 for 1 split was handled. Calculated by us on 30 Oct 2026, exact.
Same prices, same days. The only difference is whether the split was handled.

How this hits bots

A bot that trades one instrument for years meets several splits and dividends in its history. If the data is not adjusted the same way as the way you will trade, the backtest signals fire on events that were not market moves. Moving averages, RSI and breakout levels all read a split as a huge move. Dividends matter too, in a quieter way: a long term test on unadjusted prices leaves out the cash paid out, and a test on fully adjusted prices uses past prices that were never printed. Neither is wrong, but you must know which one you used.

Grid and martingale bots add a second problem. Their worst case is rare and large, so a bad tick or a gap in the data can decide the result. Check the extremes of your data first. Then add slippage and costs on top, because even perfect data does not tell you what a real order would have got.

What clean data still does not tell you

Passing every check above means the data is not obviously wrong. It does not show that a strategy works, that it will work later, or that live fills will match the test. It is one input. Keep the saved file, keep a note of every check you ran, and move on to forward testing or paper trading before real money is involved.

FAQ

Frequently Asked Questions

Is there a free yahoo finance api I can use for backtests?

We have not checked any such service today and do not describe how it behaves. Free sources are commonly unofficial, can change without notice and have terms of use. Read the current terms and test the data yourself.

Should I use adjusted or unadjusted prices?

It depends on the question. Prices adjusted for splits are needed for returns and indicators. Know what your source returns and use the same basis throughout one test.

How do I know if my data has gaps?

Count the bars and compare with the sessions you expect. Then list any step between timestamps that is longer than normal and check each against holidays and known closures.

Why save a local copy of the data?

So the test is repeatable. If the source changes, revises a price or goes away, your saved file still shows exactly what you tested on.

Can free data cause survivorship bias?

It can, if delisted instruments are missing. A test over only today's survivors looks better than the real past, so ask whether failed symbols are included.

Are the numbers on this page real?

Example numbers are made up to show how the maths works, and the page says so. A figure only counts as exact when the page says it was calculated on a stated date. Nothing you enter in a calculator leaves your browser.

Can I use this to decide whether to run a bot?

It can show whether a bot's numbers hold together and how much an account can lose. It cannot say what the market will do, and it is not advice. Use it to ask better questions, then read the terms of your own broker or exchange.

Is this financial advice?

No. It is general education about checking data before testing. The example numbers are made up, and no data source is recommended or endorsed.

Know the Risk Before You Run It

Free calculators and guides, added every week. Leave your details and we will email you when new ones go up.

Trading carries a risk of loss