# Crypto Session Box Levels & Liquidity Sweep Detector (`cryptoretirement/crypto-session-box-liquidity-sweep-detector`) Actor

Prior-day and Asia/London/New York session high, low and midline for any Bybit USDT perp, where price sits in the box, wick setups at the box edge, and liquidity sweeps of prior highs and lows. No API keys.

- **URL**: https://apify.com/cryptoretirement/crypto-session-box-liquidity-sweep-detector.md
- **Developed by:** [Craig Armstrong](https://apify.com/cryptoretirement) (community)
- **Categories:** Developer tools
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 symbol analyseds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## Crypto Session Box Levels & Liquidity Sweep Detector

One run takes a list of **Bybit USDT perpetuals** and returns, per symbol: the **prior session's box** (high, low, midline, top and bottom zones) with where price sits in it, **today's wick setup** at the box edge with a reference entry, stop and target, and every **liquidity sweep** of the prior day and session extremes in the last hours. Built on 5-minute bars from Bybit's public market data. No API keys, no login.

Session-range traders redraw the same boxes every morning: yesterday's high and low, the Asia range, the London range. This Actor is that chart work as JSON, for alerts, dashboards, bots and AI agents that need the levels and the "did price just sweep a level and reclaim it" answer without a charting platform.

### What you get

One row per symbol.

| Field | Example |
|---|---|
| `symbol`, `exchange`, `price` | `BTCUSDT`, `bybit`, `73796.1` |
| `position` | Where price sits against the box: `above_box`, `upper_zone`, `middle`, `lower_zone`, `below_box` |
| `setupState` | Today's wick setup: `watching`, `trigger_forming`, `active`, `target_hit`, `stopped`, `invalid_setup`, `no_setup_today` |
| `sweepCount` | Number of levels swept in the lookback window |
| `box` | The chosen session's box: `boxFrom`, `boxTo`, `high`, `low`, `mid`, `width`, `widthPct`, `upperZone`, `lowerZone` (top and bottom 20%), `position`, `distanceToMidPct` |
| `wickSetup` | Against the prior UTC day's box: `open`, `openType` (`inside`, `gap_up`, `gap_down`), `entryWindowCloses`, `state`, and once a wick has printed `side`, `triggerAt`, `entry`, `stop`, `target`, `rewardRisk` |
| `sweeps` | `count`, `latest` and `list`; each sweep has `level` (`prior_day_high`, `prior_day_low`, `asia_high`, `asia_low`, `london_high`, `london_low`, `newyork_high`, `newyork_low`), `price`, `direction` (`bullish` or `bearish`), `wick`, `at`, `minutesAgo` |
| `snapshotTime` | When the run looked |

The key-value store record `SUMMARY` lists the setup state per symbol and which symbols had sweeps.

#### How the three parts are defined

- **Box:** the high and low of the most recent completed session. `day` is the prior UTC day. `asia` is 00:00 to 09:00 UTC, `london` 07:00 to 16:00 UTC, `newyork` 12:00 to 21:00 UTC.
- **Wick setup:** in the first 8 hours of the UTC day, the first 5-minute bar that trades through the prior day's high or low and closes back inside the box. The reference entry is the next bar's open, the stop is the wick extreme and the target is the box midline. One setup per day. `active` means neither stop nor target has been touched yet.
- **Liquidity sweep:** a 5-minute bar that trades through a level and closes back on the other side. A sweep of a high is `bearish`, a sweep of a low is `bullish`. Only the first sweep of each level is reported.

### Input

| Field | Default | Notes |
|---|---|---|
| `symbols` | `BTCUSDT`, `ETHUSDT`, `SOLUSDT` | Up to 50 Bybit USDT perpetuals. A bare coin name like `BTC` is read as `BTCUSDT` |
| `session` | `day` | Which box the `box` field describes: `day`, `asia`, `london` or `newyork` |
| `sweepHours` | `24` | Sweep lookback, 1 to 48 hours |
| `proxy` | Apify residential, AU | Bybit refuses US datacenter IPs, so the bars are fetched through this proxy |

### Typical uses

- **Morning levels:** schedule once after 00:00 UTC to get the day's box, midline and zones for a watchlist.
- **Sweep alerts:** schedule every 5 to 15 minutes and alert when `sweepCount` rises or `setupState` changes; connect the dataset to Slack, Telegram or a webhook with an Apify integration.
- **Agents and bots:** call it from an AI agent or MCP client; the output is JSON with stable field names.

### Notes and limits

- Prices are Bybit linear-perpetual prices. Levels on other exchanges differ slightly.
- The last 5-minute bar is still forming when the run looks, so a `trigger_forming` state or a sweep on the latest bar can change before that bar closes.
- History per run is 1,000 five-minute bars, about 3.5 days. That is enough for the prior day and all three sessions; this is a live tool, not a backtester.
- The wick setup describes a chart pattern with reference levels. It is not a trade recommendation and comes with no performance claim.
- Data and analytics only, not financial advice.

### Cost

Pay per event, no subscription. You pay only for the symbols a run returns.

| Event | Price |
|---|---|
| Run start, once per run | $0.002 |
| Symbol analysed | $0.005 |

The default run of BTC, ETH and SOL costs $0.017. A 20-symbol watchlist costs about 10 cents.

### Run it from code

```bash
curl -X POST "https://api.apify.com/v2/acts/cryptoretirement~crypto-session-box-liquidity-sweep-detector/run-sync-get-dataset-items" \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"symbols":["BTCUSDT","ETHUSDT"],"session":"day","sweepHours":24}'
```

The response is the dataset as a JSON array. The API menu on this page has ready-made snippets for JavaScript, Python and MCP clients.

### More Actors for traders and bots

- [Crypto Signal Scanner](https://apify.com/cryptoretirement/crypto-perp-technical-signal-scanner): Donchian breakouts, golden and death crosses and Supertrend flips on the top Bybit perpetuals.
- [Forex News Filter & Economic Calendar](https://apify.com/cryptoretirement/forex-news-filter-economic-calendar): this week's economic events and a high-impact news window check for bots.
- [Crypto Perp Funding Rate Scanner](https://apify.com/cryptoretirement/crypto-perp-funding-rate-scanner): funding rates, annualised yield and cross-exchange spreads on 5 exchanges.
- [Crypto Exchange New Listing Announcements](https://apify.com/cryptoretirement/crypto-exchange-new-listings): new coin and perpetual listings from 6 exchanges, with an alert flag.
- [Solana Token Rug Check + Coin Score](https://apify.com/cryptoretirement/solana-token-rug-check-and-score): rug gates, a honeypot sell test and a 0-100 score for any Solana token.
- [DEX Pool Health Score](https://apify.com/cryptoretirement/dex-pool-health-score): health and rug-risk score for any liquidity pool on 100+ networks.
- [YouTube Most Replayed Clip Finder](https://apify.com/cryptoretirement/youtube-most-replayed-clip-finder): the most replayed moments of any video as ready-to-cut clips.

# Actor input Schema

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

Bybit USDT perpetuals, e.g. BTCUSDT. A bare coin name (BTC) is read as BTCUSDT. Up to 50 per run.

## `session` (type: `string`):

Which completed session forms the box in the `box` field. Day = the prior UTC day. Asia 00:00–09:00, London 07:00–16:00, New York 12:00–21:00 UTC. The wick setup always uses the prior UTC day.

## `sweepHours` (type: `integer`):

How far back to look for liquidity sweeps of the prior day's and each session's high and low.

## `proxy` (type: `object`):

Bybit refuses US datacenter IPs (where Apify runs), so the price data is fetched through this proxy. Tested working: Apify residential proxy, country AU.

## Actor input object example

```json
{
  "symbols": [
    "BTCUSDT",
    "ETHUSDT",
    "SOLUSDT"
  ],
  "session": "day",
  "sweepHours": 24,
  "proxy": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "AU"
  }
}
```

# Actor output Schema

## `results` (type: `string`):

One item per symbol: price, position in the box, the box (high, low, mid, zones), today's wick setup state and levels, and the liquidity sweeps found.

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

snapshotTime, session, symbols analysed, failed symbols, symbols with sweeps and the setup state per symbol.

# 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 = {
    "symbols": [
        "BTCUSDT",
        "ETHUSDT",
        "SOLUSDT"
    ],
    "proxy": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ],
        "apifyProxyCountry": "AU"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("cryptoretirement/crypto-session-box-liquidity-sweep-detector").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 = {
    "symbols": [
        "BTCUSDT",
        "ETHUSDT",
        "SOLUSDT",
    ],
    "proxy": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
        "apifyProxyCountry": "AU",
    },
}

# Run the Actor and wait for it to finish
run = client.actor("cryptoretirement/crypto-session-box-liquidity-sweep-detector").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 '{
  "symbols": [
    "BTCUSDT",
    "ETHUSDT",
    "SOLUSDT"
  ],
  "proxy": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "AU"
  }
}' |
apify call cryptoretirement/crypto-session-box-liquidity-sweep-detector --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,cryptoretirement/crypto-session-box-liquidity-sweep-detector"
        }
    }
}
```

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/TZonxsn3pPUQsdrid/builds/BcOIEEN6AMJfpnfI8/openapi.json
