Home › Documentation › US stocks
US Stocks

📈 Stocks: your own survivorship-free universe

AniQuant stops looking at a single symbol and starts scanning thousands of US stocks with an actual strategy, AmiBroker style. You bring your own data (the BYOD model: you supply your API key and the program downloads for you), and you work with a universe that includes the delisted ones — the companies that went bust or were taken over. That is where a strategy proves whether it really survives, not just among the survivors.

The Stocks menu, with two windows — Data Manager (downloading and maintaining the data) and Backtest (scanning a strategy with real money management) — plus a third one, Quotes, which opens from either. Inside Backtest there also lives the 💼 Portfolio Backtest with limited capital, which deserves a chapter of its own.

🗔️

Data Manager — downloading and maintaining

The API keys all live together in Settings → 🔑 API Keys (each with its Test connection button); the Manager only shows a 🔑 EODHD ✓ indicator and an ⚙️ Keys… shortcut. With the EODHD key in place, you choose what to download. Two modes:

⬇️ Download (rebuild)

Downloads the whole universe from scratch (by market, with or without the delisted ones). It rebuilds the catalog.

🔄 Update (only what is new)

It keeps what you already have and downloads only what is missing. Ideal for adding the delisted ones without repeating the live ones.

The download runs in parallel (10 at a time) with retries, so thousands of symbols take minutes, not hours. The Catalog below is a sortable, searchable explorer of everything you hold. Right-click any row → View Chart or View Quotes for that stock, without leaving the window.

🧺

Point-in-time fundamentals (Sharadar) — the «E» of the growth methods

Prices tell half the story. The other half —earnings, sales, margins— is the «E» of the growth methods (O'Neil's CAN SLIM, Minervini's full SEPA). AniQuant gets it from Sharadar (Nasdaq): quarterly as-reported fundamentals for US stocks from 1994, delisted ones included. BYOD model, like the prices: you put your key in Settings → 🔑 API Keys (with a connection test). The Data Manager tells you how many companies you already hold in datos\fundamentales\ — one file per company.

🕰️ The golden rule: the FILING date, not the quarter-end date

This is where the honesty of any fundamental backtest is decided. The quarter that ended in March is not published until May — and a backtest that used that figure in April would be looking into the future (lookahead), inflating results that would never exist in real life. AniQuant indexes every figure by the date it was filed with the SEC (the filing), not by the accounting period's. When a strategy asks «was this company growing on 12 April 2003?», the answer uses only what was known that day. Which is why we use the as-reported dimension (what the company published, with no later restatements) and not the corrected one.

Each file is tiny (a company reports 4 times a year, not 252 bars) but dense: those few kilobytes hold what moves the stock on earnings day. From every quarter it stores basic and diluted EPS, sales, net income, assets, operating cash flow, shares outstanding, debt/equity, liquidity and margins. ROE is not included: Sharadar only computes it over twelve months, never for a single quarter. This data feeds the 🧺 AQ Legends fundamental filter — O'Neil's C and A, SEPA's E.

What you can already demand, and what still has no data

The labels that said «coming with the fundamentals» had stayed anchored in the Dow 30 era — someone would open AQ Legends and read that they only had thirty companies when there were 17,032 on disk, going back to 1994, including 11,583 delisted companies. The interface now counts the local data instead of hard-coding a number: next to the Data Manager button and under the AQ Legends filter it states how many companies you hold, in amber if it is empty — because then the filter would leave the duel with no signals at all.

  • ✓Already available: SEPA's E, Darvas's rising earnings and O'Neil's C and A. They were marked «data pending» and the data arrived.
  • ·Still without data: CAN SLIM's I (institutional sponsorship) and the float in the S — we have shares outstanding, which is not the same as the free float.
  • ·Out: Piotroski's original universe (high book-to-market companies), because we do not have book value. His nine signals are complete, though.
🧮

The company record: the fundamentals, in plain sight

The fundamentals are not merely a gate inside the strategies: there is little point filtering by «EPS YoY ≥ 25%» if you cannot then see what that EPS is. With a right-click on any company in the catalog → Company record you have them in front of you. And the window follows the selection: if it is already open it switches company instead of opening another, just like the Chart and the Quotes — and it comes up first of the three, because it does not need to open the price file.

What no free website shows you

Yahoo gives you today's numbers. Here each quarter carries its SEC filing date beside the accounting period's, and the lag between the two. Lehman Brothers closed its last quarter on 31 May 2008 and filed it on 10 July: 40 days. For those 40 days that figure did not exist, and a backtest using it would be reading the future. That column is the reason point-in-time is not a whim.

What is inside

A header with the sector, market, series range and the company's final status (red went bust, blue was acquired, amber no known reason). The latest quarter in cards, a chart of EPS and revenue placed at its publication date, Piotroski's F-Score signal by signal —all nine, with ✓ or ✗, so you can see which one fails— and the table of every quarter, sortable and keyboard-navigable.

What is NOT drawn, and is said so

ROE does not exist in this data and the record does not fake it. A margin on negative revenue is not published: Lehman reported −$2.87B on −$668M, and that ratio comes to +430%, which shown in green would read as an extraordinarily profitable company two months before it went bankrupt. And when the F-Score cannot be computed it says which figure is missing — not being able to score is not the same as scoring zero.

🕰️ «Why did it get in here?» — the record, frozen on the day of entry

In AQ Legends, right-click any trade and that company's record opens exactly as it was known on the day the strategy entered. Not today's fundamentals: the ones filed with the SEC that morning. An amber band says so at the top, the cards show the quarter that was current at the time, the chart stops there and later quarters appear dimmed — they exist, but not yet on that day.

With that day's valuation: price, trailing twelve-month P/E and P/Sales, computed with the price of the time and not today's. The P/E is not published when earnings are negative — a P/E of −12 is not «cheap», it is a loss-making company and the number reads exactly backwards. Example: Apple, on 14 March 2009, at $3.16 with a P/E of 16 — and a 3 out of 9 on the F-Score.

🔄

Updating quotes, and the right provider

The button does not download from a fixed provider: it checks which provider your quotes came from and uses that same provider. If the catalog is mixed it stops and says so, because updating all of it with just one would corrupt the other half. And if the API answers with an error, the error is displayed, with its code and right next to the button. It matters: a failure treated as a market holiday would have the summary calmly saying «it is up to date» when it is not.

Why splits force a full re-download

When a company splits its stock, the provider rescales its entire history. If only the new bar were appended, the series would have the old bars on one scale and the new one on another — without raising any error, and with the prices already meaningless. Stocks with a split are re-downloaded in full. For the same reason, mixing a source adjusted for splits and dividends with one adjusted only for splits breaks the chart silently.

🩺 Test connection (2 calls)

Next to «Update quotes», with the result right there in three lines. It exists because the API Keys test tests a different API from the one that downloads the prices: it could say «Connection OK · PAID key» while the download was being rejected.

It makes two calls four seconds apart, asking each platform for one row of AAPL. It is the minimum spend: it downloads nothing, writes nothing to disk and does not touch the catalog. The pause is deliberate — two requests back to back are exactly what a rate limit punishes, and this button exists to diagnose, not to provoke. It says what each one answers and gives a verdict: if both accept the key the problem is one of pacing; if only one does, the updater is knocking on the wrong door.

There are two channels for the same data, with different accounts and keys, for a historical reason: Sharadar used to be distributed through Quandl, Nasdaq bought it in 2018 and turned it into Nasdaq Data Link, and afterwards Sharadar set up its own shop and its own API. The personal subscription lives at sharadar.com; the commercial channel, at data.nasdaq.com. Calling the second with the first one's key does not give a key error: it treats you as anonymous, and the anonymous quota runs out in a few requests — hence a «429 · you have exceeded the limit» with no block visible in the panel, because there was no account to block.

⚠️

Data quality: the silent problem

The raw data of delisted stocks carries traps that ruin a backtest without warning. AniQuant detects them and flags them with ⚠️ (the 🔎 Analyze quality button, or automatically on download):

  • ·Recycled ticker — a symbol reused by another company years later (one that went bust in 2000 whose ticker was reborn in 2010). The series is a stitched-together Frankenstein.
  • ·Junk bar (fat finger) — a price shot up into the tens of thousands by a one-off error, even in live stocks. A single bad bar falsifies the whole scan.
  • ·Extreme reverse split — the adjusted price shoots up to hundreds of thousands going backwards (a nano-cap with brutal reverse splits). It is not a bug, it is the arithmetic of the adjustment, but useless at 1 share.

The 🧹 Clean up button removes preferreds, warrants, units and ghost symbols; the import filter stops them coming back. Whatever is left with a ⚠️ is doubtful data: you can hide it from the scan or look into it before trusting it (right-click → View that row's Performance).

🔎

Backtest — an AmiBroker-style scan

An AmiBroker-style left panel: the markets at the top, the stocks with a checkbox below. Tick a whole market (NYSE) or individual stocks — the selection accumulates from wherever you like. Clicking the name = select (highlight); clicking the checkbox = tick for scanning. The scan runs in parallel (several cores at once) without blocking the window.

You pick a strategy from a Portfolio and press Scan ticked: it runs over every stock with the money management set below and returns a ranking (Net, Return %, hit rate, PF, Max DD and Ret/DD), with the ⚠️ column for the ones with doubtful data. Right-click a row → View Performance opens that stock's full analysis (equity, trades —with MAE/MFE per trade—, drawdown, Monte Carlo…).

💰

Money Management — the REAL Position Size engine

The scan does not trade 1 share: it simulates real, compounding capital per stock, and each position's size is decided by the same Position Size engine as in futures — trade by trade, on the capital of the moment. You pick the Method from a dropdown, with its parameters:

Exposure: % of capital · Fixed number · Fixed amount · 1 share per every $X

The classics. % of capital (25% by default) is the standard model: it invests that percentage of the available capital on each signal, compounding.

Risk: Risk % (stop) · Fixed $ risk

They risk a % or an amount per trade using each trade's REAL stop. If the strategy has no stop, the reference is that stock's largest historical loss.

Volatility: % Volatility (ATR) · Target volatility

They size using the entry bar's ATR: fewer shares when the stock is agitated. They equalize the risk across very different stocks — key when scanning thousands.

Kelly / optimal fraction

The Kelly fraction is computed from EACH stock's own history (its hit rate and its ratio). Use ½ or ¼: full Kelly brings brutal drawdowns.

The panel is completed by: Initial capital, Leverage (1 = cash; 2-4 = a margin account — the exposure cap is capital × leverage), Positions (Long / Short / Both) and the position's Min. / max. value (if it does not reach the minimum, the signal is skipped and the capital stays intact).

⚠️ Always set a Maximum value

With no cap, reinvesting 100% of the capital over hundreds of consecutive trades compounds exponentially up to absurd figures (billions) — mathematically correct, but operationally impossible: nobody executes that many shares without moving the market. A realistic maximum value (e.g. $100,000-500,000) keeps the results believable.

A design note: Fixed Ratio (Ryan Jones) is deliberately left out — its "one contract at a time" step makes no sense with stocks.

📊

Scan statistics — the snapshot of the universe

When a scan finishes, a panel appears with the overall picture — because with 6,000 rows, the table does not tell you whether the edge is broad or a mirage built on 10 stocks:

Summary cards

Winners and losers (with their %), the average gain of the winners and average loss of the losers, W/L ratio, aggregate net and median return.

Winners/losers donut

The breadth of the edge at a glance: 80% winners is a market edge; 52% is a coin flip with commissions.

Return distribution

The histogram shows the shape: a bell shifted to the right (a healthy edge) or two humps (two regimes)? It trims the extremes (p2–p98) so that one crazy +2000% does not flatten the rest.

Best and worst

The 6 best and 6 worst stocks by Return %, as bars from the central axis. If the best ones are unreal (+7,000%), suspect the data rather than celebrating the edge.

Everything is computed over the visible rows: if you turn on «Hide suspicious data ⚠️», the statistics are recomputed without them.

🔗

Windows that follow you (Chart, Quotes, Performance)

Open a stock's Chart, Quotes or Performance and leave them open: they stay on top, and when you pick another row —with a click or with the arrow keys, in the Catalog or in the scan Results— they refresh by themselves with the new stock, without covering each other or stealing your keyboard focus. Performance also stays on the tab you were on (Equity, Trades…) instead of always jumping back to Summary. That way you can walk a long list of results just like in AmiBroker, without reopening windows.

💡
Why the delisted ones matter

Most traders backtest only with the stocks that are still alive and fool themselves (survivorship bias). With the delisted ones in, your strategy also faces the ones that went to zero — Lehman, Bear Stearns, Countrywide and company. That is where you see whether an edge is real or was just the luck of the survivors.

Try it yourself

AniQuant can be tried free for 30 days, with every module and no card.

← Previous
Edge health monitor
Next →
Portfolio backtest with limited capital
More in US stocks