Importing your data
Rearview tests on your own market data. Nothing is bundled except a synthetic sample, and nothing you import leaves your Mac.
You can bring data in two ways:
- The import format: a folder of CSV files that hold raw prices, corporate actions, delistings and index membership by date. This is the format to aim for. Only with it can a backtest be free of survivorship bias and look-ahead in its universe.
- Per-symbol files: one CSV or text file per ticker, as most tools and data vendors export them. Rearview converts the folder into the import format for you. It's the quickest way to start, with caveats explained below.
Most data vendors license their data for personal use only. Check your vendor's terms before you import, and never share an imported store.
The import format
An import is a folder of UTF-8 CSV files:
| File | Required | What it holds |
|---|---|---|
securities.csv | yes | one row per security, listed or delisted |
tickers.csv | yes | which ticker each security held, and when |
bars.csv | yes | daily open, high, low, close and volume, as traded |
actions.csv | yes | splits, dividends, spinoffs and mergers (it may hold just the header) |
membership.csv | no | index membership over time |
calendar.csv | no | the US exchanges' trading days, if you want to give them explicitly |
calendars.csv | no | any other exchange's trading days, if you want to give them explicitly |
currencies.csv | no | the currency of each security not priced in US dollars |
futures.csv | with futures | each futures chain's point value, tick and first contract |
rolls.csv | no | each futures chain's rolls from one contract to the next |
forex.csv | with pairs | each forex pair's two currencies and tick |
rates.csv | no | each currency's interest rate by date, for forex carry |
series/<name>.csv | no | any extra number per security and day, such as a borrow rate or a score |
manifest.json | no | {"format":"rvw-import","version":1} |
Rules for every file
- CSV: comma-separated, with a header row listing exactly the columns shown below, in that order. Quote a field that contains a comma, quote or line break, and double any quote inside it. Fields are never trimmed, so a stray space makes a number or date invalid.
- Dates are
YYYY-MM-DD. - Prices and cash are plain decimals, such as
12.5or0.0825, with at most six digits after the point. - Ids are whole numbers from 1 up. An id is the security's permanent identity: it never changes, even when the ticker does.
- Empty means missing.
- Row order doesn't matter.
securities.csv
id,name,kind,exchange,sector,industry,delist_date,delist_reasonkindisSTOCK,ETF,INDEX,CRYPTO,FUTUREorFOREX. An index can be used in formulas, but is never traded. A coin (CRYPTO) trades every day; see Coins below. A futures chain (FUTURE) is the contract you'd hold each day; see Futures. A forex pair (FOREX) is one currency priced in another; see Forex pairs. Runs start on the first day a stock or ETF has a bar, so an index with a longer history doesn't stretch them back (the language reference, "When a run starts").exchangeisNYSE,NYSE_AMERICAN,NASDAQ,NYSE_ARCA,CBOE,OTCorOTHER, or the code of any other exchange: 2 to 16 capital letters, digits or_, starting with a letter, such asASX,LSEorTSX. It sets the days the security trades on (see Exchanges and their days) and the default delisting haircut: the US venues their own, every other code the one for other exchanges.sectorandindustryare optional labels. Scripts can select on them withsector("…")andindustry("…"). They hold one current classification, not a history.delist_dateis the last trading day of a delisted security, anddelist_reasonsays why:ACQUISITION: closed at the last price;PERFORMANCE: closed with a haircut;STOCK_MERGERorSPINOFF: closed at the last price and flagged;OTHERorUNKNOWN: treated as a performance delisting, with a warning.
Fill both fields or neither. A security whose bars simply stop, with no delisting row, is never treated as delisted: it stays open at its last price.
tickers.csv
id,ticker,from,toThe security holds the ticker from from until the day before to; an empty to means it still holds it. A ticker is 1 to 15 characters of A-Z, 0-9, . and -. One ticker can pass from one security to another over time, but never to two at once. Scripts and universes always look a ticker up on the date in question, never by its bare name.
bars.csv
id,date,open,high,low,close,volume- As traded, not adjusted. Prices are what the stock actually traded at that day, and volume is the shares actually traded (for a coin, the coins traded). Rearview computes split- and dividend-adjusted series itself from
actions.csv. That way your results don't change when a vendor revises its adjusted history after a new dividend. - Valid bars. Every price is above 0,
lowis at most the lower of open and close, andhighis at least the higher of them. - Missing days. A day without a row means no bar that day, such as a trading halt.
actions.csv
id,ex_date,type,value1,value2,ref_id| type | value1 | value2 | ref_id |
|---|---|---|---|
SPLIT | new shares | old shares | empty |
DIVIDEND | cash per share | empty | empty |
SPINOFF | empty | empty | the new company's id, optional |
MERGER | cash per share, optional | empty | the acquirer's id, optional |
A 2-for-1 split is 2,1, and a 1-for-10 reverse split is 1,10. An action takes effect on the first trading day on or after its ex_date.
membership.csv
index,id,from,toIndex membership by date, with the same [from, to) spans as tickers. index is a label of your choosing, 1 to 32 characters, such as SP500. Scripts select members with members("SP500") and get the members on each date, so a backtest never trades a company before it joined the index or after it left.
calendar.csv
dateOptional. It lists the trading days of the US exchanges, and of OTHER. Without it, they are every date on which one of their stocks, ETFs or indexes has a bar, or, in data with none of these, every date on which one of their futures chains or forex pairs has one. With it, every bar of their stocks, ETFs and indexes must fall on a listed date. A coin's bars may fall on any date, listed or not, and a futures or forex bar off its exchange's days is left out (see Futures). Other exchanges' days go in calendars.csv.
series/<name>.csv
id,date,valueA number per security and date. The file name is the series name: 1 to 32 lowercase letters, digits or _, starting with a letter.
- Borrow costs. The engine reads
borrow_rate(a yearly rate as a fraction, so 0.03 is 3%) for short borrow costs andhtb(1 when hard to borrow) to refuse shorts. - Your own numbers. Scripts read any series with
series("name"). The value on a day is the latest row dated on or before it. - Date rows by when a value became known. Use the filing date, not the end of the quarter it describes. Otherwise a backtest would use numbers before they were published.
Coins
A coin (kind CRYPTO; give it exchange OTHER) trades every day, weekends and holidays included, so its bars may fall on any date. Stocks, ETFs and indexes trade on the exchange's days.
- Prices are in US dollars with at most six decimals, as every price is. Quote a coin worth less than a cent per 1,000 coins, as exchanges list
1000SHIB: a ticker of its own, with the price and volume of 1,000 coins. Pairs priced in another coin, such as ETH/BTC, aren't supported. - Volume is in coins, with up to 8 decimals, and is rounded to whole coins. A source that gives volume in dollars needs converting: see
--dollar-volumebelow. - Coins are long only and bought with cash: a script can't short one, and a Reg T account doesn't lend against one. The language reference explains how they trade beside stocks ("Coins and the exchange's days").
- Coins don't change a stock run. A run whose strategies can't hold a coin keeps to the exchange's days and leaves the coins' other days out, so it gives the same results as on the same data without coins.
Futures
A futures chain (kind FUTURE) is the contract you'd hold each day, rolled from one to the next: ES rather than ESH2024. Its ticker is the root (ES), and its exchange can be any of the list (OTHER will do). Its bars are the held contract's prices as traded, its volume is in contracts, and it takes no rows in actions.csv.
futures.csv: id,point_value,tick,contract
rolls.csv: id,date,contract,pricefutures.csvhas a row for every chain.point_valueis dollars per 1.0 of price (ES:50),tickis the price step (ES:0.25), andcontractis the contract held on the chain's first bar (ESH2000).rolls.csvis optional and lists each roll. Fromdate, the chain's bars arecontract's, andpriceis that contract's close on the chain's last bar beforedate. A roll falls after the chain's first bar and on or before its last, one a day at most.- Adjusted by ratio. Rearview adjusts a chain itself: each roll scales its earlier prices by the roll's ratio, as a split does, so indicators see one continuous series. The prices you trade at stay as traded.
- No back-adjusted series. Don't import a vendor's back-adjusted or continuous front-month series as a chain. Back-adjusting hides the prices you'd have traded at and can push old prices below zero, and a front-month series counts each expiry's gap as a gain or loss. The quality report flags a chain without a roll for over a year.
- Exchange days. A chain trades on the exchange's days. A futures bar on any other day, such as CME's Good Friday session, is left out of every run and counted in the import report. Data with only futures takes its days from the chains' bars.
- Futures don't change a stock run. A run whose strategies can't hold a future gives the same results as on the same data without the futures.
Exchanges and their days
Each security other than a coin trades on the days of one exchange: the US exchanges' days for NYSE, NYSE_AMERICAN, NASDAQ, NYSE_ARCA, CBOE, OTC, OTHER and US, and its own for any other code. So BHP on ASX trades on the ASX's days, closed on Australia Day and open on Thanksgiving.
calendars.csv: exchange,date- An exchange's days are its rows in
calendars.csvwhen it has any, otherwise every date on which one of its stocks, ETFs or indexes has a bar, otherwise every date one of its futures chains or forex pairs has one.calendars.csvnames only exchanges some security trades on, neverUS(that'scalendar.csv). - Bars off an exchange's days. A stock, ETF or index bar off its exchange's listed days is an error. A futures or forex bar off them is left out and counted, as for futures.
- One run, several exchanges. A strategy holds securities of the exchanges in its
exchangessetting (US unless it says otherwise), which Rearview sets from what the script's universe can hold. A run trades on the days of all of them together, and each order waits for its own security's next session. The language reference explains the rest ("Several exchanges' days"). - Another exchange doesn't change a run whose strategies can't hold its securities: it gives the same results as on the same data without them.
Currencies
Every price in the data is in the currency of its security: US dollars unless currencies.csv says otherwise.
currencies.csv: id,currencycurrencyis a three-letter code, such asAUD,EURorJPY. A forex pair takes no row: its currency is its quote's.- Prices stay as traded, in their own currency, and so do levels such as stops and limits. Money (your cash, equity, profits, commissions) is in your account's currency, which is a run setting (Run Settings ▸ Account ▸ Currency,
run.currency). - Rates come from your forex pairs. A security priced in another currency than the account's is converted with a pair between the two, such as
AUDUSD, used as quoted or inverted, or else through US dollars with two pairs (EURUSDandAUDUSDfor a EUR stock in an AUD account). Rearview converts at the pair's open for what happens at the open and at its close for what happens at the close. Without such a pair, or before its first bar, the security can't be bought. The quality report lists a currency no pair links with US dollars.
Forex pairs
A forex pair (kind FOREX) is one currency priced in another: EURUSD is the price of a euro in dollars. Give it exchange FX, so it trades on its own days, every weekday your data has a bar.
forex.csv: id,base,quote,tick
rates.csv: currency,date,rateforex.csvhas a row for every pair:baseandquoteare its two currency codes (EUR,USD), andtickis its price step (0.0001, or0.01for a pair quoted in yen). Quote a pair so that its price is above a cent:USDJPYrather thanJPYUSD.- Volume isn't used and may be 0, as most sources give it.
- No corporate actions. A pair takes no rows in
actions.csv. rates.csvis optional: each currency's yearly interest rate in percent, with up to four decimals (5.33,-0.10), on the dates it changed. Holding a pair earns the base's rate and pays the quote's, day by day (carry). Without a rate, a currency's counts as 0, and the trade says so.- Pairs don't change a stock run: a run whose strategies can't hold a pair, and that converts nothing with it, gives the same results as without it.
Intraday bars
Bars shorter than a day go in bars.csv with a time column:
id,date,time,open,high,low,close,volumetime is the bar's start as HH:MM, in the exchange's local time. Rearview does no time-zone conversion, so export local times.
- Daily or intraday, never both. One data folder holds one or the other.
- What it can hold: stocks, ETFs and indexes on one exchange's days. Coins, futures and forex pairs are refused (
INTRADAY_KIND), and so arecalendar.csvandcalendars.csv:sessions.csvtakes their place. - Bar length: the smallest gap between two of one security's bars on one day, from 1 to 240 minutes. Data in which no security has two bars on a day is refused (
BAR_LENGTH), since the length can't be told. Sessions: optional
sessions.csvlists every trading day with its hours:date,open,close 2026-07-02,09:30,16:00 2026-07-03,09:30,13:00A bar on a date it doesn't list is an error (
BAR_NOT_IN_CALENDAR). A bar outside a day's hours, such as extended hours, is left out and counted in the import report. Without the file, every date with a bar is a trading day, opening at its earliest bar and closing one bar after its latest, so half days come out right if the half day's bars do.- The grid: a day's bars start at its open and every bar length after it. A bar that doesn't is an error (
BAR_OFF_GRID). A missing bar is a halt, as a missing day is in daily data. - The close isn't the closing auction: the official close is the closing auction's price. FirstRate's minute files put the auction's shares in the bar stamped 16:00, which lies outside a 09:30–16:00 session, so the session's last close is the 15:59 bar's.
flat at closesells at that price, and daily figures are worked out from it. In FirstRate's AAPL files for 11 days of October 2026, that close was 0.02% from the official close on average and 0.07% at most, and the 16:00 bar held 10% to 23% of the day's volume. A market-on-close order fills at the auction's price instead. - Daily items keep their dates: a corporate action takes effect at its day's first bar, ticker and index spans hold all day, and a value in
series/dated a day is known from that day's last bar.
The quality report checks the daily bars built from your intraday ones, and adds MISSING_BARS and SHORT_SESSION. Files of the newest days (Daily files) can't be laid over intraday data: update it from a whole new export.
Checking an import
The import checks every file and lists each problem with its file, line and a code such as OHLC or BAD_DATE. Errors stop the import; warnings don't. After an import, the data-quality report lists:
- gaps;
- outliers;
- zero-volume bars;
- price jumps that look like missing splits;
- splits and large dividends the prices don't show, which usually mean prices that are adjusted already, a wrong date or a slipped decimal (a run holding the stock would get free shares or cash, and warns
SUSPECT_ACTION); - long gaps between trading days and days almost nothing traded, which a single mistyped date can cause;
- reused tickers;
- securities whose data ends with no delisting;
- each futures chain's rolls, with their median and largest gap, and chains without a roll for over a year.
These are worth reading before trusting a result.
Converting per-symbol files
If your data is a folder with one file per ticker, Rearview converts it to the import format. In the app, choose Import Per-Symbol Files… in the data library. On the command line:
rvw convert ohlcv <folder> --out <import-folder> [--etf SPY,QQQ] [--never-traded VIX] [--crypto BTC-USD,ETH-USD [--dollar-volume]] [--forex EURUSD,AUDUSD] [--exchange ASX] [--currency AUD] [--with <import-folder>] [--date-format auto|mdy|dmy] [--index NAME=<tickers.txt>]Then import the result with rvw import <import-folder> --store <store>.
What the converter reads:
- Files: every
*.csvand*.txtfile in the folder. The ticker is the file name without its extension, in capitals (aapl.csvbecomesAAPL). - Columns: the date, open, high, low, close and volume columns are found by name, in any order and any case.
Date,<DATE>,Date/Time,Open,High,Low,Close,Last,Volume,Voland<VOL>are recognised. AnAdj Closecolumn is ignored, because the close column is the one used. A file with no header is read as date, open, high, low, close, volume. Separators and dates:
- commas, semicolons or tabs between fields;
- dates as
2024-03-15,20240315,2024/03/15,03/15/2024or15/03/2024; - a time of day, in a
Date/Timecolumn (2024-03-15 09:35, seconds and aTallowed) or aTimecolumn of its own, makes intraday bars, each stamped with its start. Times of midnight only are daily bars. Times with a UTC offset orZare refused (UTC_TIME): export the exchange's local time. Daily and intraday files together are refused (MIXED_BARS); - day-first and month-first dates are told apart from the data itself. When they can't be, for instance when no day in any file is above 12, the converter asks you to choose with
--date-format.
- Kinds: every ticker is a stock unless you list it with
--etf, with--never-tradedfor an index such as VIX, which scripts can read (close("VIX")) but never trade, or with--cryptofor a coin, which trades every day.--dollar-volumereads the coins' volume as dollars and turns it into coins at each day's close; Yahoo Finance's crypto downloads give volume in dollars. In the app, these are the ETFs, Never traded and Coins fields, and Coin volume in dollars. Mark an index this way even when it goes back further than your stocks: runs start on the first day a stock or ETF has a bar, and an index listed as a stock would start them earlier. - Forex pairs:
--forex EURUSD,AUDUSDmarks tickers as pairs, each named by its two currencies, on exchangeFX, with each one's tick (0.01for a pair quoted in yen, else0.0001) inforex.csv. A file named as Yahoo Finance names a pair is one without listing it:EURUSD=XisEURUSD, andJPY=XisUSDJPY. In the app, this is the Forex pairs field. - Another exchange and currency:
--exchange ASXgives every security but the pairs that exchange, so they trade on its days, and--currency AUDthe currency their prices are in (currencies.csv). Convert one exchange's files at a time. In the app, these are the Exchange and Currency fields. - Adding to an import folder:
--with <import-folder>writes the folder's files with the converted securities added, their ids after its last, so you can bring an ASX folder and your pairs into data you already have. A ticker the folder already has is an error. In the app, this is Add to. - Session hours:
--session 09:30-16:00(Session hours in the app) leaves out intraday bars starting outside those hours, such as extended hours, and counts them in the report. - Index lists:
--index SP500=sp500.txtadds an index label whose members are the tickers listed in the file (one per line, or separated by commas).
Rows the converter skips: a row with a missing or unreadable price, a price of 0 or less, or a high or low that doesn't contain the open and close is skipped and counted in the report, and so is a repeated date. An empty volume counts as 0. Prices with more than six decimals are rounded to six.
What converted data can't tell Rearview:
- Adjusted prices. Most per-symbol exports are already adjusted for splits, and often for dividends too. Rearview can't tell, so it treats them as traded prices with no corporate actions. Indicators and returns are fine. But price filters such as
close > $5, per-share commissions and share counts see adjusted prices, and dividends aren't paid separately. - No delistings. A folder of today's tickers leaves out every company that has since disappeared. That survivorship bias makes most strategies look better than they were.
- No membership history. An
--indexlist holds today's members for the whole period, which is another source of survivorship bias. - No rates. Converted pairs come without
rates.csv, so their carry is 0 until you add one (see Forex pairs).
The converter's report repeats these caveats, and the data library shows them with the data. For research you intend to trade, use a vendor that provides delisted securities, actions and membership history, and write the import format directly.
Converting futures contracts
If your vendor gives one file per futures contract, Rearview builds the chains from them. On the command line:
rvw convert futures <folder> --out <import-folder> [--with <import-folder>] [--date-format auto|mdy|dmy]The folder holds:
roots.csv(root,name,point_value,tick,roll_days): a row per chain, such asES,E-mini S&P 500,50,0.25,5;contracts.csv(contract,root,last_trade_date): the contracts you'd trade, and only those months, such asESH2024,ES,2024-03-15;- a file per contract named after it (
ESH2024.csv), its columns found as the per-symbol converter finds them.
How a chain rolls. A chain holds the contract with the nearest last trading day until roll_days sessions before that day, then the next one, provided the next had a bar on the session before. Otherwise the chain waits, and the report says how long. A session is a date on which any of the root's contracts has a bar, and the roll's price is the new contract's close on the session before.
Adding futures to your stocks. --with copies an import folder, such as one from rvw convert ohlcv, and adds the chains to it with the ids after its last. A root that is already a ticker there is an error.
The report lists each chain with its dates, the contracts it held, its rolls and any that waited. A file of a contract that isn't in contracts.csv is left out with a warning.
In the app: in the data library, choose Import ▸ Futures Contracts… and pick the folder. To add the chains to your stocks, set *Add to* to their import folder. Rearview converts the files, imports the result as a new entry and shows the chains it made.
From Norgate
Norgate Data's updater runs only on Windows, so Rearview comes with a script that exports your Norgate data in the import format, on the Windows computer or virtual machine where the updater runs.
- In the data library, choose Import ▸ Norgate Export Script… and save the script where Windows can open it, such as a folder your virtual machine shares with the Mac.
- In Windows, with Norgate Data Updater running, install Norgate's Python package once with
pip install norgatedata, then run the script, as in the example below. - Read
norgate-export-report.txtin the folder it wrote. It lists what it exported and anything worth checking. - On the Mac, choose Import ▸ CSV Folder in the Rearview Format… and pick that folder.
For example, to export from 2005 with the S&P 500's membership by date, into a folder the Mac shares as drive Z:
python norgate_export.py --out Z:\Rearview\Norgate --index "S&P 500=SP500" --from 2005-01-01What it exports:
- Every stock and ETF in Norgate's
US EquitiesandUS Equities Delisteddatabases, from--from(2000-01-01 unless you say).--database,--watchlistand--symbolchoose others;--symbol $SPXadds the S&P 500 index itself, which scripts can read but never trade. In PowerShell, write'$SPX'. - Bars as traded, dividends as paid, and splits from Norgate's capital adjustments.
- With
--index "NAME=LABEL", an index's membership by date, under the label your scripts use, such asmembers("SP500").NAMEis the index as Norgate names it. Historical membership needs a Norgate subscription that includes past index constituents. - Sector and industry from GICS, and each security's exchange, which sets its delisting haircut.
What it can't tell Rearview:
- Why a stock delisted. Norgate's interface doesn't say, so every delisting is exported as
UNKNOWN. Rearview prices it as a performance delisting, with the exchange's haircut and aDELIST_ASSUMEDwarning. That is the cautious side, because an acquisition is priced as a loss too. The haircuts are in the run settings, under Delistings. - Past tickers. Each security keeps the one symbol Norgate gives it now, and a delisted one keeps Norgate's dated suffix, such as
ABC-201503. A script that reads a stock by an old ticker won't find it; universes by index or sector aren't affected. - Spinoffs and reorganisations. They show in Norgate's adjustments the way splits do. The script exports each as a split of the ratio Norgate adjusted by, which keeps a holding's value as Norgate's adjusted prices do, and lists it in the report.
It checks itself. Before writing, it rebuilds each security's total-return prices from the bars, splits and dividends it is about to write, and compares them with Norgate's own. The report lists every security that differs by more than 0.2%, with the day the difference is largest.
To update, run the script again into a new folder, select the data in the data library and choose Update ▸ Update from Folder…. Norgate allows exporting its data for your own use on another computer; never share the exported files.
From Sharadar
Sharadar's Core US Equities tables, sold by Sharadar and through Nasdaq Data Link, hold what survivorship-free research needs: a permanent id for every company, delisted companies with the reason they delisted, splits, dividends and S&P 500 membership by date. You download the tables yourself, under your own subscription, and Rearview converts the files. It never connects to Sharadar.
- Download these tables as CSV files:
TICKERS,SEP(stock prices) andACTIONS, and if you want themSFP(fund and ETF prices, such as SPY) andSP500. From sharadar.com the price tables are calledstocksandfunds, and each comes as a zip to open. Keep the names they download with, or any name that has the table's name in it, such asSHARADAR_SEP_20261027.csvorstocks.csv. The rows can be in any order. Put the files in one folder. In the data library, choose Import ▸ Sharadar Files… and pick it. Rearview converts the files and imports the result as a new entry, showing anything the conversion found.
On the command line, convert the folder into an import folder, read the report, then import that as Checking an import describes:
rvw convert sharadar <folder> --out <import folder>What it makes of the tables:
- Each company's
permatickerbecomes its id, so a ticker that passed from one company to another stays apart. The name, exchange, sector and industry come fromTICKERS, and a company marked delisted is delisted on its last price day. - Prices are rebuilt as traded. Sharadar's
closeis adjusted for splits andcloseunadjis not, so the converter takes the as-traded close fromcloseunadj, keeps the open, high and low in their ratio to the close, and turns the volume (taken as split-adjusted too) back into shares as traded. Rearview then computes its own adjusted series from the splits and dividends, as it does for any import. ACTIONSgive the splits and dividends, and why each company delisted: an acquisition is closed at the last price; a bankruptcy, liquidation or regulatory delisting is a performance delisting, with the haircut; any other isUNKNOWN, priced as a performance delisting with a warning.SP500gives membership by date under the labelSP500, somembers("SP500")is the index on each day.
It checks itself. The step in Sharadar's adjustment between two days must fall on a split of that size in ACTIONS, and a split in ACTIONS must show as a step. The report lists each one that doesn't, with its ticker and date.
What it can't tell Rearview:
- Former tickers. Each company holds the one ticker the tables give it. A script that reads a company by an old ticker won't find it; universes and
members("SP500")aren't affected. - Spinoffs and mergers.
ACTIONSrows for them aren't applied. A spinoff's price drop stays in the prices, and the report counts the rows it left out. - Anything outside the tables. The bundle's fundamentals aren't read.
The converter has been checked against Sharadar's sample tables, not yet a whole download. If yours doesn't convert, the report says which file and column, and support would like to hear about it.
To update, download the tables again into the same folder and choose Update from Source, as Keeping your data up to date describes. Sharadar's tables restate earlier adjusted prices, but Rearview works from the as-traded close, so a restated history doesn't look like changed history.
Sharadar licenses its data for your own use: never share the files or what you make from them.
Keeping your data up to date
Most data sources let you export the whole history again each day. Point that export at the same folder each time, and Rearview updates its copy from there.
In the app: select the data in the data library and choose Update from Source. It reads the folder the data came from again (Update from Folder… reads another), converting per-symbol files the way they were converted before. Nothing changes yet: a sheet says what the new version adds, such as "Adds 1 trading day (Oct 22, 2026) and 3 dividends", and what it means for the runs you made. Update puts it in place, and every project that uses the data opens the new version. Import as New Entry keeps both.
What happens to your runs. Rearview compares the new version with the old up to the old version's last day: every price, corporate action, delisting, ticker, index membership, calendar day, series value, name and sector.
- Nothing changed up to that day, so the update only added days. Every run made on the old version still reproduces on the new one: Check It Reproduces reruns it on the new data cut at the old version's last day, and it comes out byte for byte the same. The run's results say it used the data "as it stood" on that day, and its orders are out of date until you run it again. The data remembers each version it extends this way, so runs made several updates ago still reproduce.
- History changed. The sheet says from which day, and what changed first: a corrected close, a dividend added or removed, a company's sector. Runs made on the old version won't reproduce on the new one. To keep them reproducible, choose Import as New Entry.
Adjusted files rewrite history. Per-symbol files are usually adjusted for splits (and often dividends), so a new split changes every earlier price of that company. The sheet recognises this: "1/4 of what they were, as if adjusted for a 4-for-1 split". It's one more reason to prefer the import format, with prices as traded and the split as an action.
The evening routine for next-day orders: export your data, choose Update from Source, choose Update, select the run your orders come from and choose Run Again, then export the orders, as the next-day orders guide describes.
On the command line:
rvw update <export-folder> --store <store> --out <new-store>It imports the folder into the new store <new-store> (a new or empty folder), compares it with <store>, and prints what changed as JSON. <store> itself isn't touched, so a script can decide what to do: keep the new store when diff.history_changed_from is null, say. The new store holds lineage.json, the versions it extends, and update.json, the report. A store made by rvw import has no lineage, so runs made before an update only reproduce on stores made by rvw update.
Updates read the whole export again, unless the file holds only the newest days: see Daily files.
Daily files
Some data sources give you each day's new rows instead of the whole history. Rearview lays such a file over your data. The file is a folder in the import format with the new days' bars, actions and series values, and the securities, tickers and index membership of the securities it mentions. Nothing else needs to be in it.
In the app: select the data in the data library and choose Update ▸ Update from Folder…, pick the daily folder and tick *It holds only the newest days*. The update sheet says what the file adds and how many of its rows were already in your data. The data remembers that its updates are daily files, so Update from Source reads that folder the same way from then on.
On the command line:
rvw update <daily folder> --store <store> --out <new store> --partialIt writes the new store as an update does, and prints what it added and how many rows it repeated.
What it checks. A bar, action or series value dated on or before your data's last day has to be the one you already have.
- Repeats are fine. A file may repeat the last few days to be safe; the report counts them.
- A difference is refused. A row that differs from yours, or one for a day or security you don't have, would change your history. The update then names the first change and its date, writes nothing, and asks for a full export.
- A new security is added with its tickers and index membership. For one you have, its record and ticker and index spans must be the ones you have, except that a delisting dated after your last day may be added, and a span that is still open may end after it.
- A file that adds nothing is refused.
The result is the data an import of your files and the new rows together would hold. It extends your data as an update that only added days does, so runs made on the earlier data keep reproducing. One difference: an action dated after your data's last day isn't kept until its day comes, so a daily file has to carry it on its own day.
Your broker's file
A live account reads your broker's record of what you traded, and optionally its cash lines, to replay your account. Rearview reads two kinds of file: an Interactive Brokers Flex Query, and its own fills and statement CSVs, which any other broker's export can be converted to.
Interactive Brokers
A Flex Query is a report you set up once in Client Portal and run whenever you like.
- In Client Portal, open Performance & Reports, then Flex Queries, and create an Activity Flex Query.
- Add the Trades section with Executions, and its fields: Symbol, Trade Date, Date/Time, Quantity, Trade Price, IB Commission, Buy/Sell, Asset Class, Currency, Level of Detail and IB Execution ID.
- For the statement check, add Cash Transactions (Date/Time, Amount, Type, Symbol, Description, Currency, Transaction ID). If you trade on margin, add Interest Accruals (Currency, To Date, Interest Accrued). If you short, add Borrow Fee Details (Value Date, Symbol, Quantity, Value, Borrow Fee Rate, Borrow Fee).
- Under Delivery Configuration, choose the CSV format and the period you want, such as Last Business Day or Month to Date. The other options can stay as they are: Rearview reads files with or without header and trailer records, and dates as
yyyyMMdd,yyyy-MM-ddorMM/dd/yyyy. - Each day, run the query and import the file it gives you.
Rearview keeps stocks and ETFs in US dollars, fractional shares included. A quantity finer than the account's steps (whole shares unless its run says otherwise; see Share step in Run settings) isn't imported, and the sheet gives its line. Options, futures, coins and other currencies are skipped, and counted by kind in the import sheet: for coins, use Rearview's fills CSV below. When the file has both order and execution rows, the executions are used. Each fill is matched by IB's execution ID, so importing an overlapping period adds only the new ones. Cash transactions become statement lines: dividends and payments in lieu, withholding tax, interest paid and received, other fees, and deposits and withdrawals, which move your account's cash on their day.
The column names come from Interactive Brokers' Flex Query reference. Rearview hasn't yet been checked against a real export: if yours doesn't import, the import sheet says which line and why, and support would like to hear about it.
Rearview's fills CSV
For any other broker or a coin exchange, convert its trade history to this CSV with a spreadsheet or your AI tool:
date,ticker,side,quantity,price,commission,time,ref
2026-10-21,ABC,BUY,100,52.14,1.00,09:30:02,
2026-10-23,ABC,SELL,100,53.80,1.00,,sideisBUYorSELL;quantityis shares or coins, more than zero, with up to 8 decimals;commissionis a cost in dollars, zero or more.- A quantity finer than its security's step in the account's run (whole shares and 0.00000001 of a coin unless the run says otherwise) isn't imported, and the sheet gives its line.
timeandrefare optional. Fills on the same day apply in time order, then in the file's order.ref, such as the broker's execution ID, tells a fill imported twice from two like fills.- Tickers are as your data spells them on the trade date.
Rearview's statement CSV
date,kind,ticker,amount,ref,description
2026-10-15,DIVIDEND,ABC,12.50,,ABC cash dividend
2026-11-03,MARGIN_INTEREST,,-18.40,,October margin interest
2026-11-05,DEPOSIT,,5000,,kindis one ofDIVIDEND,WITHHOLDING,MARGIN_INTEREST,CASH_INTEREST,INTEREST_ACCRUED,BORROW_FEE,OTHER_FEE,DEPOSIT,WITHDRAWALorOTHER.amountis in dollars, as the statement shows it: money in is positive, money out negative.tickeris blank for lines that aren't about a security.refanddescriptionare optional.
Getting data out
rvw export-bars --store <store> --out <folder> writes one file per security, named after its latest ticker, with as-traded prices:
Date,Open,High,Low,Close,VolumeA ticker that several securities held over time keeps the plain name for the latest holder; the others get -<id> added. Your data is never locked in.