OPEN-SOURCE SCRIPT

OB + Big Trades Signal

1 741
# OB + Big Trades Signal Indicator

## Overview

The **OB + Big Trades Signal** indicator combines three powerful concepts into a single, clean signal layer: **Volume-based Order Blocks**, a **Big Trades (Whale) Detector**, and a **Daily VWAP filter**. A signal is only generated when all three conditions align — significantly reducing noise and increasing the quality of each entry.

---

## How It Works

### 1. Order Blocks with Volume
Order Blocks are price zones where a consolidation phase was followed by a strong breakout candle with above-average volume. These zones represent areas where institutional participants placed significant orders, and price tends to react when revisiting them.

- **Bullish Order Block** — forms when a consolidation is broken to the upside with high volume. Marks potential support / demand zones.
- **Bearish Order Block** — forms when a consolidation is broken to the downside with high volume. Marks potential resistance / supply zones.

Order Blocks are automatically removed ("mitigated") when price trades through them, keeping the chart clean and relevant.

### 2. Big Trades Detector
The Big Trades component analyzes intrabar volume intensity using a statistical model. It splits each candle's volume into estimated **buy pressure** and **sell pressure** based on the candle's close position within its range. A trade is classified as a "Big Trade" when its volume deviates significantly from the recent average — specifically beyond a configurable multiple of the standard deviation (sigma).

- **Big Buy** — abnormally high buying pressure on the current bar
- **Big Sell** — abnormally high selling pressure on the current bar

Three tiers of intensity are detected (T1, T2, T3), with T3 representing the most extreme whale activity.

### 3. Daily VWAP Filter
The Volume Weighted Average Price (VWAP) resets every day at 00:00 UTC. It acts as a directional bias filter:

- Price **above** VWAP → bullish bias → only Long signals are allowed
- Price **below** VWAP → bearish bias → only Short signals are allowed

---

## Signal Logic

| Signal | Conditions Required |
|--------|-------------------|
| **LONG** | Big Buy detected + Price near/inside a Bullish Order Block + Price above Daily VWAP |
| **SHORT** | Big Sell detected + Price near/inside a Bearish Order Block + Price below Daily VWAP |

All three conditions must be true simultaneously for a signal to appear.

---

## Settings

### Order Blocks
| Parameter | Description |
|-----------|-------------|
| Consolidation Lookback | Number of bars to evaluate for consolidation detection |
| Breakout Threshold % | Minimum breakout strength required to form an Order Block |
| Maximum Order Blocks | Maximum number of active Order Blocks shown on the chart |
| OB Proximity % | How close (in %) price must be to an Order Block to trigger a signal |

### Volume (Order Blocks)
| Parameter | Description |
|-----------|-------------|
| Volume Calculation Method | Simple, Relative, or Weighted volume comparison |
| Volume Lookback Period | Lookback for average volume calculation |
| Volume Threshold Multiplier | Minimum volume multiple required to confirm an Order Block |

### Big Trades Detector
| Parameter | Description |
|-----------|-------------|
| Lookback Period | Baseline period for statistical volume analysis |
| Sensitivity (Sigma) | Standard deviation multiplier — higher = fewer but more extreme signals |

### VWAP & Display
| Parameter | Description |
|-----------|-------------|
| Show Daily VWAP | Toggle VWAP line visibility |
| VWAP Color | Color of the VWAP line |
| Show Order Blocks | Toggle Order Block boxes on/off |

### Signal Labels
| Parameter | Description |
|-----------|-------------|
| Long / Short Label Color | Background color of the signal label |
| Long / Short Text Color | Text color of the signal label |
| Label Size | Tiny / Small / Normal / Large / Huge |
| Background Highlight | Tints the bar background when a signal fires |

### Alert Options
| Parameter | Description |
|-----------|-------------|
| Signal Direction | Filter alerts to Long + Short, Only Long, or Only Short |
| Push Notification | Sends a push alert via `alert()` directly — no manual alert setup needed |
| Enable Time Window | Restricts alerts to a defined time range |
| From / To Hour & Minute (UTC) | Start and end of the active alert window in UTC |

> **Time zone note:** The time window runs in UTC. Adjust for your local time zone when setting the hours (e.g. CET = UTC+1, so subtract 1 hour).

---

## Alerts Available

The indicator provides **9 alert conditions** selectable in the TradingView alert dialog:

1. `LONG – OB + Big Buy + VWAP` — Full Long signal (all filters active)
2. `SHORT – OB + Big Sell + VWAP` — Full Short signal (all filters active)
3. `Signal (Long or Short)` — Either direction
4. `Big Buy detected (unfiltered)` — Big Buy only, no OB/VWAP filter
5. `Big Sell detected (unfiltered)` — Big Sell only, no OB/VWAP filter
6. `Price in Bullish OB Zone (above VWAP)` — Price enters demand zone
7. `Price in Bearish OB Zone (below VWAP)` — Price enters supply zone
8. `Price crosses VWAP upward` — Bullish VWAP crossover
9. `Price crosses VWAP downward` — Bearish VWAP crossover

All signal alerts include an **anti-spam filter** — each alert fires only once per bar regardless of how many ticks meet the condition.

---

## Tips & Recommendations

- **Timeframe:** Works best on 5m–1h charts. Lower timeframes produce more signals; higher timeframes produce fewer but more significant ones.
- **Sensitivity tuning:** Start with Sigma = 3.0. Increase to 3.5–4.0 for stricter, less frequent signals. Decrease to 2.0–2.5 for more activity.
- **OB Proximity:** Set tighter (0.05–0.10%) for precise entries, wider (0.20–0.30%) if you want signals slightly ahead of the zone.
- **Push alerts:** Enable the Push Notification toggle and set your time window to only receive alerts during your active trading hours — no noise outside your session.
- **Combine with trend context:** For best results, trade Long signals during uptrends and Short signals during downtrends on a higher timeframe.

---

## Disclaimer

This indicator is a tool to assist analysis and does not constitute financial advice. Past signal performance is not indicative of future results. Always use proper risk management.

免責事項

これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。