Skip to content
All library documents

Screening Equities for Nonconsecutive All-Time High Breakouts

Article Quant Q&A · Author: matrix1000

Summary

The document discusses automating a momentum strategy that looks for equities reaching a new all-time high while excluding stocks whose high has been renewed on immediately successive days. The question contrasts retrieving and sorting the full price history for every signal with maintaining a database of prior highs, and asks about direct data sources.

The answer proposes a staged screening pipeline: prepare an instrument watchlist using reference and risk criteria, load each instrument’s all-time-high price and date, remove names with very recent highs, then compare incoming real-time trades against the stored levels. Breaches can trigger alerts accompanied by price and volume context, either immediately or in scheduled batches. The response reports an example alert service using a subset of US symbols and round-lot trade data. It does not provide performance evidence for the trading strategy or detail data costs, corporate-action handling, feed quality, or how the high is validated, so the pipeline is an implementation outline rather than a tested trading system.

Key ideas

  • Treat the all-time-high screen as a momentum strategy with explicit instrument filters.
  • Preload each eligible stock’s high price and date to avoid repeated full-history queries.
  • Exclude instruments whose all-time high occurred too recently.
  • Compare real-time trades with stored highs and send breach alerts with supporting price context.
  • The proposed workflow does not establish profitability or address data-quality details.

Tags

Full text
# The best approach for screening ATH values for equities


# The best approach for screening ATH values for equities












I am trying to automate the trading strategy that I have been previously executing manually. I am having problems with figuring out the most efficient way for a specific step of the strategy.

An essential part of the strategy is identifying stocks that have made a new year-to-date all-time high. Additionally to that, the new all-time high should not be recent to the previous day levels. (E.g. Stock making all-time high values each subsequent trading day). Currently, I have figured out two different approaches with resources that are available to my best knowledge.

- After I get a signal for ATH from a data vendor, I request data for all candles for all available time period, sort them and check if the and date of the second-highest value fits my criteria;

- Create a database on my own for previous ATH values of lots of equities and screen prices against the database values. (seems really inefficient approach)

If you know any better approach or know a data vendor that could provide with the aforementioned data directly I would much appreciate it. Paid data is also an option as long as the price is not astronomical (Keep in mind that I am a retail trader and can not affor to pay 40k yearly for a datastream)

Cheers

## Answer by Sergei Rodionov (score 0)

https://quant.stackexchange.com/a/61228

It's a momentum strategy. I would implement it as a staged pipeline:

- Initialize an instrument watch list prior to trading session. It can be a black/white list based on risk parameters and/or reference data. For example, only US common stocks (no ADRs, ETFs, etc.) with a market cap of over $1B.

- Load all-time-high (ATH) prices and ATH dates for the instruments in the watch list. This step is needed mostly for performance so that the system doesn't fetch historical data on each incoming trade. As part of this step, discard instrument with a recent ATH, e.g. ATH >= today - 1*day.

- Process incoming trades ingested from the real-time feed, compare last trade with preloaded ATH for the short-listed instruments. Initiate a response, such as a notification, whenever the level is breached. Such notification can accompanied with an OHLCV chart and/or OHLCV table for expert analysis. Alternatively, to prevent too many alert, trigger a scheduled notification, for example once an hour, by sending out a list of instruments that breached the level over the last hour.

Update: I setup a public Telegram channel with all-time-high alerts for 1200+ A, B and C symbols which are matched with SQL expression `symbol REGEX 'A.*|B.*|C.*'` on an incoming stream of round-lot trades. Each alert contains brief a price summary, a link to a Bloomberg chart such as `https://www.bloomberg.com/quote/CVNA:US` and a 30-day candlestick chart image.

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.