A test is only as good as the prices you feed it. By the end of this lesson, you'll know where traders get price data, and what you're allowed to do with it. You'll also know the limits every data file has, and how one bad number can turn into a false result.
1 of 9
What you'll learn
- Find price data. Get price history from your platform, your broker, or a data seller.
- Read the terms. Market data is licensed. Terms say what you may download and share.
- Note each file's limits. Bars hide price order. Joined futures contracts leave seams.
- Check the data first. Look for repeats, highs below lows, gaps and huge moves.
- Catch a bad price. One typo can show a gain that never happened, so check odd moves.
Exercise
- Find out whether your charting platform or broker lets you export bars, and read what its terms say you may do with them.
- Then run the four checks from this lesson on any file you have.
Quick check
1. A bar touched both your stop and your target. What can the bar alone tell you?
2. Why read your data provider's terms?
3. A close in your file is ten times too small for one day. What happens to the test?
0 of 3 answered.
Finished this lesson?
Tick it off and keep your place
Read the full notes
Test data comes from your platform, your broker, or companies and exchanges that sell history, under terms you need to read. Every file has limits, and one bad number can make a false result, so check it first.
- Sources: your charting platform's download (on TradingView, Download chart data saves what the chart shows; plan limits apply); your broker or trading platform; exchanges and data companies that sell history; free files online, where you need to know who made them. Prices start at the exchange and reach you through a The stream of prices that fills your charts. The prices start at the exchange, and live ones often cost a monthly fee.More in the glossary (Broker, platform and data feed).
- What you may do: market data is owned and licensed. Your provider's terms say what you may download and use it for. Sharing or posting files is usually limited. Read the terms; they differ by provider.
- Limits: a bar hides the order of prices inside it; futures Moving from a futures contract that’s about to expire to the next contract month.More in the glossary, so a A chart made by joining one futures contract month to the next at each roll, so years of history show as one line. It isn’t a contract you can trade.More in the glossary has seams, sometimes closed up by a A continuous futures chart where older prices are moved by the gap at each roll, so the line joins up smoothly. Those older prices never really traded.More in the glossary file (Continuous charts and their gaps); time zone and A stretch of the trading day with a set start and end, such as the hours a big stock exchange is open.More in the glossary; how much history, and in what detail.
- Checks: bad.index.duplicated().sum(), (bad["high"] < bad["low"]).sum(), bad.isna().sum().sum(), and the biggest bad["close"].pct_change().abs(). More: Historical data for testing.
- One typo (4,040.50 saved as 404.05) made two impossible moves: about −90% and about +911%. A test that traded it would show a gain that never existed.
Worked example
Made-up numbersWhat one typo does to a test
Made-up numbers · close before 3,984.50 · typo close 404.05 · next close 4,086.75 · A small futures contract on the S&P 500, traded at CME Group. Each point is worth $5, and its smallest step of 0.25 is worth $1.25.More in the glossary $5 a One whole unit of a price. On the S&P 500, a move from 5,000 to 5,001 is one point, and each futures contract sets what a point is worth in dollars.More in the glossary
- (404.05 − 3,984.50) ÷ 3,984.50 = about −90%
- (4,086.75 − 404.05) ÷ 404.05 = about +911%
- Short at 3,984.50, out at 404.05: 3,580.45 points.
- 3,580.45 × $5 = a fake $17,902.25 on one contract.
A price that never traded can make a whole test look good.
Your turn
DrillMade-up numbers · close before 5,000 · typo close 500
Trading is risky. You can lose money. Test results are hypothetical, and a test can't tell you what will happen next. This lesson explains how testing works. It isn't advice.