# Stock Signals Scanner — Daily SMA, RSI & ATR (`apivault_labs/stock-signals-scanner`) Actor

Scan US stock and ETF watchlists using closed daily prices, moving-average crosses, RSI, ATR and range breakouts. Split-aware history, dividend context and repeat monitoring. No source API key. End-of-day research signals, not live quotes.

- **URL**: https://apify.com/apivault_labs/stock-signals-scanner.md
- **Developed by:** [Apivault Labs](https://apify.com/apivault_labs) (community)
- **Categories:** Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 96.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 instrument analysis delivereds

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Stock Signals Scanner — Daily SMA, RSI & ATR

Turn a stock watchlist into daily, structured analyses. Get moving-average crosses, RSI extremes, ATR volatility, prior-range breakouts and the values behind each rule. Use the results in a spreadsheet, dashboard or your own alert workflow.

**No source account or API key is required.** The scanner uses closed daily data for supported US-listed stocks and ETFs. It excludes the current New York date. It does not provide live quotes, trade execution or a probability that a stock will rise.

### Start with a watchlist

Choose `analysisProfile: "dossier"` for an explainable daily setup dossier. The default `classic` profile preserves the original analysis and monitoring behavior. Both profiles use the same price source and charge one result per delivered instrument row.

```json
{
  "symbols": ["AAPL", "MSFT", "NVDA", "AMZN", "GOOGL"],
  "mode": "snapshot",
  "historySessions": 80,
  "smaFast": 10,
  "smaSlow": 20,
  "maxResults": 5
}
```

Open the Dataset after the run. Each row is **one instrument analysis**, containing its closed-session date, price, indicators, matching rules, corporate-action context and data-quality notes. No matching rule means an empty `signals` list; it is not a buy, sell or hold recommendation. Set `signalsOnly` to `true` to return only instruments matching a rule.

The default watchlist is a starting example. Submit up to 20 supported symbols per run. Unknown symbols, stale instruments and insufficient history appear in `ERRORS`; they do not become result rows. A partial run can return valid analyses for the other instruments. Check `SUMMARY` and `ERRORS` before relying on coverage.

### What the rules mean

| Field or rule | Definition |
|---|---|
| `smaFast`, `smaSlow` | Simple averages of the selected number of split-adjusted closes. Defaults: 10 and 20 sessions. |
| `SMA_BULLISH_CROSS` | Fast average was at or below slow on the preceding session and is above it on the latest session. |
| `SMA_BEARISH_CROSS` | Fast average was at or above slow and is now below it. |
| `rsi14` | Wilder RSI over 14 close-to-close changes. A flat series is 50; all gains is 100; all losses is 0. |
| `RSI_OVERSOLD`, `RSI_OVERBOUGHT` | Latest RSI is strictly below 30 or above 70. These describe an extreme, not a guaranteed reversal. |
| `atr14`, `atrPct` | Wilder ATR, including gaps from the previous close; percentage is ATR divided by latest close × 100. The first true range is the first bar's high minus low. |
| `CLOSE_ABOVE_PRIOR_20_HIGH` | Latest close is strictly above the highest high of the preceding 20 sessions; today's bar is excluded from that threshold. |
| `CLOSE_BELOW_PRIOR_20_LOW` | Latest close is strictly below the lowest low of the preceding 20 sessions. |
| `return1dPct` | Latest split-adjusted close versus preceding close, in percent. Cash dividends are not added. |
| `volumeRatio20` | Source volume divided by the mean of the preceding 20 split-normalized volumes. Descriptive only; independent volume accuracy is unverified. |

Indicators use the selected `historySessions` window, between 60 and 120. Wilder indicators depend on their starting window, so keep this setting fixed for comparable repeat runs. `smaFast` must be smaller than `smaSlow`. Rule definitions are identified by `ruleVersion`.

### Compare strength and explain a setup

```json
{
  "symbols": ["AAPL", "MSFT", "NVDA"],
  "analysisProfile": "dossier",
  "benchmark": "SPY",
  "historySessions": 80,
  "includeSecContext": true,
  "includeDiscussion": false,
  "maxResults": 3
}
```

The dossier combines these observations in one instrument row:

| Result | How to read it |
|---|---|
| Benchmark strength | Five- and twenty-session stock and SPY/QQQ price returns; excess return is stock return minus benchmark return, in percentage points. Dates must align. This is not risk-adjusted alpha. |
| Watchlist rank | Rank among successfully analyzed instruments in this request by twenty-session excess return; not a market-wide ranking. |
| Benchmark regime | `above20above50` requires close > SMA20 > SMA50; `below20below50` requires close < SMA20 < SMA50; otherwise `mixed`. Descriptive context, not an entry condition. |
| Setup conditions | Latest close above the prior twenty-session high, fast SMA above slow SMA, and positive twenty-session benchmark excess return. All three must pass for `qualified`. Each condition exposes its threshold, actual value and pass/fail result. |
| Trigger distance | (Prior twenty-session high / close − 1) × 100; also (high − close) / ATR14. Negative means price is already above the trigger. Zero ATR produces a missing ATR distance with a reason. |
| Additional indicators | EMA12/26, MACD12−26, nine-period MACD signal/histogram, and twenty-close Bollinger bands at two population standard deviations. EMAs start from the first period's SMA in the selected window. |
| Annual financial context | Revenue, net income, operating cash flow, capital spending, derived free cash flow, revenue growth and net margin, with financial period, filing and source links. Same filing, comparable annual USD periods. Unsupported facts remain unavailable. |
| Filing context | Up to ten recent 10-K/10-Q/8-K/Form 4 filings, including amendments, within thirty calendar days of retrieval. Limited to the source's recent-submissions table. |
| Insider context | Non-derivative purchase/sale lines from **one newest eligible Form 4/4-A**, up to twenty lines. It may contain no P/S lines. Not complete insider coverage or proof of no trading. Reported prices may be missing or explained by footnotes; currency is not assumed. |

SEC context is optional and limited to five requested instruments per run; operating-company facts do not apply to ETFs. It uses [public SEC data](https://www.sec.gov/edgar/sec-api-documentation) without user accounts or keys. Annual figures are **not the latest quarter, forecasts, analyst estimates or earnings surprises**. Current filings can become available after the price session: `availabilityAsOf`, `filedDate`, `acceptedAt`, `financialPeriodEnd` and `asOfDate` serve different purposes. This is not a historical knowledge snapshot.

Optional discussion context is attributed to [Tradestie](https://tradestie.com/apps/reddit/api/) and adds only a categorical observation for selected instruments. Its returned top-fifty list has no embedded observation timestamp. A missing ticker is **not neutral sentiment or zero discussion**; the requested date is not verified observation time. This supplementary context is not an independent forecast or a standalone raw-feed resale. If optional context fails, a useful technical analysis can still be returned, with an unavailable status and an `ERRORS` entry.

### Follow setup episodes

```json
{
  "symbols": ["AAPL", "MSFT", "NVDA"],
  "analysisProfile": "dossier",
  "mode": "setups",
  "stateStoreName": "stock-watch-dossier-episodes",
  "benchmark": "SPY",
  "historySessions": 80,
  "maxResults": 3
}
```

The first observation creates an **unbilled baseline**, including already qualified setups. Later observations can produce `setupEvent.type` of `entered`, `invalidated` or `expired`. An entered episode freezes a scenario invalidation price at that observed close minus 2 × ATR14, floored at zero and adjusted for subsequent splits. This scenario is not a broker order, a target, or a return forecast.

An active episode is invalidated when the close falls below that frozen level, the fast SMA is no longer above the slow SMA, or benchmark outperformance is no longer positive. The breakout condition need not remain true every day. Otherwise the episode expires after five sessions found in the selected history since entry, or when an observation gap extends beyond that history. After invalidation/expiry, a non-qualified observation must re-arm the setup before a later entry. Same-session revisions may change conditions; skipped intermediate transitions are not reconstructed. Invalidation has precedence over expiry.

Still-active episodes appear in `SUMMARY.activeSetups` and do not create paid rows. Events held back by a result limit retain their captured, dated content and are delivered before that instrument advances on a later run. Run sequentially with a dedicated history name; deduplicate `eventId` downstream because a crash between output and history commit can repeat a delivery. No exactly-once guarantee or automatic schedule is supplied. `signalsOnly` is not supported in setups mode. When settings/profile/context options change, use a new history name.

### Monitor changed daily observations

```json
{
  "symbols": ["AAPL", "MSFT", "NVDA"],
  "mode": "watch",
  "stateStoreName": "stock-watch-us-core",
  "historySessions": 80,
  "maxResults": 3
}
```

The first successful observation of each instrument establishes a baseline and returns no historical result for it. Later runs return a changed latest observation: a new session or a revision of an already observed session. Unchanged observations return no rows. The same unchanged analysis keeps the same `eventId`, even when the retrieval time changes.

Run **one execution at a time per history name**. Use a new history name when changing the watchlist, window, average periods, history inclusion or signals-only filter. Undelivered matching observations remain eligible on the next run while they are still the latest observation. This is a latest-observation monitor: it does not replay every session skipped between runs. A stopped run after output but before saving history can repeat rows; deduplicate by `eventId` downstream. This Actor does not create a schedule or send messages.

### Output and export

The Dataset supports JSON, CSV and Excel export. Nested fields such as `signals`, corporate actions and optional `history` are easiest to use in JSON. For a flat spreadsheet, export the overview columns.

- Identity: `eventId`, `symbol`, `securityName`, `listingExchange`, `isEtf`.
- Timing: `asOfDate` is the observed trading date; `dataFetchedAt` is retrieval time. These are different.
- Analysis: exact `closeDecimal`, `rawOhlcv`, averages, RSI, ATR, return, range thresholds, source-volume ratio and `signals`.
- Context: `historyBars`, `firstHistoryDate`, `splitsInWindow`, `dividendsInWindow`, optional split-adjusted `history`.
- Provenance: `source`, `sourceUrl`, `sourceCommit`, `ruleVersion`, `priceType`, `priceBasis`, `sourceLicense`, `licenseUrl`, `sourceAttribution`, `qualityFlags`.

`SUMMARY` reports coverage, collection status, row limits and watch baselines. `ERRORS` contains input/source/instrument failures. `DATA_LICENSE` preserves the data license. Diagnostic records and errors are not instrument results.

### Prices, adjustments and limits

Prices are source-defined daily OHLCV, shown in USD for this US-listed dataset. The underlying vendor and exact venue/session composition are not disclosed. Do not treat them as exchange-certified consolidated quotes or an executable bid/ask. A source observation older than seven calendar days is rejected; an instrument missing the source's latest closed date is skipped. This age check does not certify exchange-calendar completeness.

Historical prices are normalized for splits effective on or before the analysis date. Volume is normalized inversely. **Cash dividends are reported but not subtracted from prices**: indicators and returns describe split-adjusted prices, not dividend-reinvested total returns. Ex-dividend moves can therefore affect the rules.

The source may revise history. A present-day history is not proof of what was available to a trader in the past, and current symbols do not constitute a historical investable universe. Indicators are rule-based observations; predictive performance has not been established. No growth probability or profit guarantee is supplied.

`qualityFlags` always identifies source-defined sessions, undisclosed upstream, unverified independent volume and unknown revision history. Cash dividends in the window add a dividend-adjustment note. Source-volume differences observed during validation remain unresolved, so no rule uses volume as independent confirmation. Sample coverage and the source's total instrument count do not guarantee every ticker or a complete global market.

### Pricing and spending limits

**$1 per 1,000 delivered instrument analyses**, plus Apify resource usage. There is **no Actor start fee**. One analysis costs $0.001, whether or not you include its daily history. A snapshot of 10 instruments costs $0.01 in Actor result fees when all 10 produce analyses; compute, storage and transfer are additional.

`maxResults` caps delivered instrument-analysis rows. `maxCostUsd`, when set, caps Actor result fees using the active rate; it excludes Apify compute, storage and transfer. A zero result limit or zero fee cap skips collection and does not change watch history. Baselines, unchanged observations, errors and empty matches do not create result rows. Including history adds data inside the same analysis row, rather than one charged result per bar.

### Data attribution and reuse

Data: **[post-no-preference/stocks on DoltHub](https://www.dolthub.com/repositories/post-no-preference/stocks)**, provided under **[CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/)**. Selection, formatting, split normalization and indicators are changes made by ApiVault Labs. The provider does not endorse this Actor.

Preserve attribution, the license link and change notices when sharing covered data or adaptations, and comply with ShareAlike and the license's other terms. Payment for collection or processing does not remove the reuse rights granted by that license. The publisher's license carries no warranty about third-party rights; the underlying vendor's rights chain has not been independently verified. The complete data license is included with the Actor and in the run's `DATA_LICENSE` record.

# Changelog

This Actor's version history is a separate document: https://apify.com/apivault_labs/stock-signals-scanner/changelog.md

# Actor input Schema

## `symbols` (type: `array`):

One to twenty US-listed symbols supported by the daily source. Duplicates are removed. Test issues are excluded.

## `analysisProfile` (type: `string`):

Classic preserves the original daily analysis. Dossier adds benchmark strength, transparent entry conditions, distances, EMA/MACD/Bollinger and optional context. One delivered instrument row remains one billable result.

## `mode` (type: `string`):

Snapshot: current analyses. Watch: unbilled baseline, then changed latest observations. Setups: dossier profile only; unbilled baseline, then entered/invalidated/expired episodes, not every active day. Sequential runs; no skipped-session reconstruction.

## `historySessions` (type: `integer`):

Same-length window for indicators. An instrument without enough history is reported in ERRORS, not filled with invented bars.

## `smaFast` (type: `integer`):

Sessions in the fast simple moving average. Must be smaller than the slow average.

## `smaSlow` (type: `integer`):

Sessions in the slow simple moving average.

## `signalsOnly` (type: `boolean`):

Return rows with at least one SMA-cross, RSI-extreme or prior-range rule. False also returns useful analyses without a matching rule.

## `includeHistory` (type: `boolean`):

Include the selected split-adjusted history inside each analysis row. Cash dividends are not subtracted from prices.

## `maxResults` (type: `integer`):

One result is one instrument analysis, not one history bar. Zero skips collection and does not update watch history.

## `maxCostUsd` (type: `number`):

Caps Actor result fees at $0.001 per delivered instrument analysis. Excludes Apify resources. Zero skips collection.

## `stateStoreName` (type: `string`):

Required for watch/setups. Use a separate stock-watch-\* name for each watchlist, profile and settings; run sequentially. Example: stock-watch-dossier-us.

## `benchmark` (type: `string`):

Dossier only; defaults to SPY. Comparison uses aligned split-adjusted daily price returns, excluding distributions. The benchmark is not a separate paid row unless selected in symbols.

## `includeSecContext` (type: `boolean`):

Dossier only, maximum five requested symbols. Comparable annual USD facts, recent filings and purchases/sales in one newest Form 4. ETFs are not applicable. Public access without source account/key. Optional unavailable context does not cancel a useful price analysis.

## `includeDiscussion` (type: `boolean`):

Dossier only. Attributed Tradestie categorical discussion context; source time is unverified. Absence from its returned list is not neutral sentiment or zero activity. No standalone raw feed.

## Actor input object example

```json
{
  "symbols": [
    "AAPL",
    "MSFT",
    "NVDA",
    "AMZN",
    "GOOGL"
  ],
  "analysisProfile": "classic",
  "mode": "snapshot",
  "historySessions": 80,
  "smaFast": 10,
  "smaSlow": 20,
  "signalsOnly": false,
  "includeHistory": false,
  "maxResults": 20,
  "includeSecContext": false,
  "includeDiscussion": false
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

## `summary` (type: `string`):

No description

## `errors` (type: `string`):

No description

## `license` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("apivault_labs/stock-signals-scanner").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("apivault_labs/stock-signals-scanner").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call apivault_labs/stock-signals-scanner --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,apivault_labs/stock-signals-scanner"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/vF8iYeTmTYQQfou4i/builds/oNr7K0ifpN9TpeSGa/openapi.json
