OPEN-SOURCE SCRIPT

Order Block

Overview:
The Order Block Indicator is designed to help traders identify key bullish and bearish order blocks on their charts. Order blocks are significant price zones where institutional activity may have occurred, often leading to strong reversals or continuations. This indicator visually highlights these blocks and provides alerts for potential trade opportunities.
Key Features

Bullish Order Blocks (Yellow):
Identifies bullish structures where price signals a potential upward movement.
Highlighted in bright yellow to stand out on your chart.

Bearish Order Blocks (Pink):
Detects bearish structures where price suggests a possible downward movement.
Highlighted in pink for easy identification.

Alerts for Order Blocks:
Sends a notification whenever a bullish or bearish order block is detected.
Keeps you informed of key market zones even when you’re away from the screen.

How It Works

Bullish Order Block Criteria

The last candle (close[1]) is bullish (close > open).
The second last candle (close[2]) is bearish (close < open).
The bullish candle’s close is above the high of the bearish candle.
The bearish candle’s close is above the low of the third last candle.
The bearish candle’s low is below the low of the third last candle.
The current candle’s low is above the bearish candle’s high.

These conditions combine to identify strong bullish zones.

Bearish Order Block Criteria

The last candle (close[1]) is bearish (close < open).
The second last candle (close[2]) is bullish (close > open).
The bearish candle’s close is below the low of the bullish candle.
The third last candle’s high is above the bullish candle’s close.
The bullish candle’s high is above the high of the third last candle.
The current candle’s high is below the bullish candle’s low.

This logic highlights potential bearish zones.

How to Use It

Add the Indicator to Your Chart:
Use it on any timeframe to spot bullish or bearish order blocks.

Visual Assistance:
Yellow bars indicate bullish order blocks.
Pink bars represent bearish order blocks.

Set Alerts:
Configure alerts to notify you when a bullish or bearish order block appears.

Customization

Colors: Easily change the colors for bullish and bearish order blocks.
Alerts: Adjust alert messages to suit your trading preferences.

Disclaimer:
This indicator is a technical analysis tool and should be used alongside other strategies and market analysis. It does not guarantee profits and carries trading risks. Always trade responsibly.
Candlestick analysisChart patternsSupport and Resistance

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?

Disclaimer