Free Order Block Indicators for TradingView

An order block indicator marks candle ranges selected by a price-pattern rule, often the last opposite-direction candle before a structure break. Choose a free script whose confirmation timing and zone-removal rules you can inspect. A box drawn from OHLC data does not establish who traded there or prove institutional intent.

Compare rules before signals

Two free scripts to inspect

These are documented starting points, not a profitability ranking. The linked TradingView publications identify both scripts as free and open source. We have not run a comparative trading test.

EmreKb: Market Structure Break & Order Block
A candidate for MSB-based analysis: the publication describes zigzag length and a Fib Factor for break confirmation. Inspect the selected swing and the candle used to create each box.
DasanC: Order Block Finder
A candidate for reviewing recent zones: the publication describes support for plotting the last X order blocks. Its description calls multi-timeframe support work in progress; do not assume that feature is available.
Alert and deletion behavior
EmreKb documents an alert for every candle touching a box and an option to delete old or broken boxes. Check whether those behaviors fit your intended first-touch rule.
Access is separate from performance
Free code access does not establish accuracy, include exchange data subscriptions, or remove TradingView account limits. Open source lets you review the calculation; it does not validate a trading edge.

Compare the exact author and publication, not just the script title. Similar names and later forks may use different calculations. Source links appear below.

What an order block detector can establish

Order block is a trading convention, not a single standardized calculation. One script may require a swing break; another may count consecutive directional candles or apply a minimum price move. A body-only zone and a full high-to-low zone can also produce different retests from the same origin candle.

OHLC candles summarize price movement. They do not identify a participant, an unfilled institutional order, or the reason for a subsequent reversal. Volume or ATR filters can describe activity or price expansion, but cannot turn those observations into proof of institutional buying or selling.

A reproducible detection specification

The following is an illustrative rule for a custom detector, not a description of either community script and not a tested trading recommendation. Use standard candles on one symbol and timeframe. Keep these settings fixed while comparing results.

  • Confirm swing highs and lows with three bars on each side. A swing at bar s becomes eligible only at the close of bar s + 3; require its high or low to be strictly beyond all six neighboring bars.
  • At each closed bar, use the latest eligible swing high and low. A bullish break requires the previous close at or below that high and the current close above it; a bearish break reverses those inequalities at the swing low. Consume each swing level on its first break.
  • On the break bar, require a directional candle body of at least 1.0 times the 14-period ATR from the prior closed bar. If ATR is unavailable, skip the event. This threshold is an example, not an optimized value.
  • For a bullish break, search the previous ten completed bars for the most recent bearish candle; for a bearish break, find the most recent bullish candle. Exclude the break bar and doji candles. If none qualifies, create no zone.
  • Freeze the full high-to-low range of the origin candle. Record both its timestamp and the break-confirmation timestamp. If a later bar before creation already closed beyond the far boundary, reject the candidate.
  • Create one zone per qualifying break and evaluate retests only from the next bar. Keep the last 20 zone records; mark older records as expired when removing their drawings.

Confirmation delay and historical backpainting

A pivot with three bars to its right cannot be confirmed on the pivot bar. A later structure break can add further delay. Drawing the eventual box back at its origin candle makes that location visible on history, but the box was not available there in real time. Record the confirmation bar separately.

TradingView distinguishes plotting into the past from ordinary changes on an open bar. Waiting for bar close reduces intrabar changes; it does not make a backdated drawing an earlier signal. Compare live observations with the reloaded chart and keep the script version and settings fixed.

For higher-timeframe calculations, an unfinished higher-timeframe candle can change. TradingView documents requesting the previous confirmed value with a one-bar expression offset and lookahead_on as a way to obtain confirmed higher-timeframe data. That introduces delay. A lower-timeframe bar close alone does not confirm the higher-timeframe candle.

Separate a retest, mitigation, and invalidation

Scripts use mitigation to mean different events, including a first touch, midpoint penetration, or a close inside the range. State the actual price comparison instead of assuming that the label has a universal meaning.

For the illustrative specification above, let the frozen zone boundaries be low L and high U. A later closed bar touches the zone when its low is at or below U and its high is at or above L. Mark the first such bar as tested and allow only one first-touch alert. A bullish zone becomes invalid when a bar closes strictly below L; a bearish zone becomes invalid when a bar closes strictly above U. Equality does not invalidate it.

If a bar both touches and invalidates the zone, invalidation takes priority and no first-touch alert fires. A gap beyond the boundary can invalidate a zone without trading inside it. Keep invalidated records visible or logged during evaluation; deleting failed zones can make a historical chart look more successful than the complete event record.

How to choose the best free script for your rules

Use the same exchange symbol, session, standard candle type, timeframe, and date interval for each candidate. Write the required behavior before inspecting the results. The checks below evaluate transparency and consistency; passing them does not establish profitability.

  • Record the first bar when each zone actually appears, its origin, boundaries, and subsequent state changes. Reject an earlier entry that depends on a box discovered later.
  • Check the first touch, repeated touches, close-through invalidation, gap-through invalidation, and maximum-box limit. Keep failures and expired zones in the record.
  • Compare live alerts with chart state. A once-per-bar alert can still repeat across several bars inside a box; a first-touch rule needs persistent state per zone.
  • Save the author, script version, and all inputs. Reload the chart and note any shifted, missing, or newly backdated zones rather than silently treating them as live signals.
  • If converting the rule to a strategy, specify entry, stop, exit, position size, fees, slippage, and fills. Evaluate a separate period that was not used to select parameters. Report trade count and losses alongside any win rate.

Build a custom order block detector with Pineify

Use the detection specification as a brief for Pineify Pine Script AI Coding Agent. Ask for inputs for swing confirmation, displacement, candle search, and zone lifetime, plus separate origin and confirmation labels. Request an event log or visible state changes so that a deleted box does not erase its history from your review.

Review the generated source, run a Pine syntax check, and compare chart behavior against the written rules before relying on alerts. Compilation checks syntax; it does not prove correct trading logic or future returns. Custom code generation is separate from the free community scripts listed here.

How Pineify helps

Describe your order block rules to Pineify Pine Script AI Coding Agent, then review the generated Pine Script and test the zone lifecycle on TradingView.

This page is for educational purposes and is not investment advice. The example rules have not been performance-tested. Order block patterns and historical results do not guarantee future price movements or returns.

Frequently asked questions