New

11 tools. $557.98 if bought one by one. 5 new Premium desks inside.$557.98 one by one

$97 once$97See all 11See it
Pine Pro Library · Pine v6

SMC Basics order block & FVG indicator for TradingView

It draws the order blocks and fair value gaps a move leaves behind, fades them when price comes back, and removes them when a close goes through.

On the chart06:45
READ
4 zones on the chart
WHY
2 touched · 2 fresh
RULE
Zones mark where price moved, not where it goes
Three per kind and sideSMC Basics · simplified rules

Window 1 · an order block's whole life

Simulated 15-minute gold bars, not a real market, run through SMC Basics' rules, simplified for the browser. Quiet bars run as a time-lapse; the moments that matter slow down. Window 1 is the first simulated window whose order block is drawn, touched and then closed through, so every step shows; Another window plays the next simulated windows in order, whatever they draw.

Read as text
Times are bar opens on the simulated New York clock. The words are the card's.
TimeEventPrices
00:00Window opens5 zones on the chart
00:30Bearish gap · FVG · drawn fadedZone 4,299.29 – 4,307.74
02:30Swing high · confirmed 10 bars lateSwing 4,311.29
03:30Swing low · confirmed 10 bars lateSwing 4,280.51
07:00Bullish order blockZone 4,309.57 – 4,311.00
07:45Order block touched · it fadesZone 4,336.59 – 4,341.65
08:45Order block touched · it fadesZone 4,309.57 – 4,311.00
10:15Swing high · confirmed 10 bars lateSwing 4,338.22
10:45Order block closed through · goneZone 4,309.57 – 4,311.00
14:00Bearish order blockZone 4,294.29 – 4,297.63
17:30Order block closed through · goneZone 4,294.29 – 4,297.63
19:00Order block closed through · goneZone 4,336.59 – 4,341.65
19:00Bullish order blockZone 4,329.52 – 4,329.77
19:15Swing low · confirmed 10 bars lateSwing 4,266.61
19:45Order block closed through · goneZone 4,329.52 – 4,329.77
21:45Swing high · confirmed 10 bars lateSwing 4,347.56
02:00Swing high · confirmed 10 bars lateSwing 4,335.43
05:00Swing high · confirmed 10 bars lateSwing 4,333.51

Full Pine v6 source in Pine Pro Library. It draws on your chart; it never says what price does next.

The last opposite candle.

When a close breaks a swing, the script looks back for the last candle of the other colour and draws its body as the order block.

ORDER BLOCK

Its body, 4,294.29 to 4,297.63, is the bearish order block; the wick is left out.

  • Swing confirmed: passes
  • First close through: passes
  • Scan back: passes
  • Its body: passes

Only this swing and its order block are drawn here; the replay above draws everything.

Simulated 15-minute gold bars, simplified rules; a bullish order block mirrors this bearish one. The order block is the first simulated order block whose scan skips at least one candle, so every step shows.

01 · The swing

Ten bars each side

A swing confirms ten bars after its own bar, so it never repaints.

02 · The break

Once per swing

The first close through a swing picks an order block; later closes do not.

03 · The scan

Up to 20 bars

From the bar before the break, back to the last candle of the other colour.

04 · The body

Body, not wick

The box spans the candle's open and close; one setting switches it to the wick.

A touch fades it.

Drag the return candle into the order block: a touch fades it, and only a close past its far edge removes it.

Touched · it fades Price reached the zone without closing through it: it stays, fainter.
Inside the zone · wick inside it
Zone from the candle's

01 · Fresh

Full colour

Until price comes back, the zone keeps its first fill.

02 · Touch

It fades

A low into a bullish zone, or a high into a bearish one, fades it.

03 · Gone

Closes only

A close past the far edge removes it; a wick through it does not.

04 · Edges

Body by default

One setting draws the zone from the candle's whole wick instead.

Touched stays. Closed goes.

A touch only fades an order block; a close through it, or a fourth on the same side, takes it off the chart.

Price came back and touched it, then left: the zone stays on the chart, faded, until a close goes through it.

Drawn paths, not a market: each shows the script's rules on one order block, and draws only the order blocks it is about.

Paste it. Run it.

One file, the complete script, ready for TradingView's Pine Editor.

On a phone? Send this page to your desktop.

  1. Copy the scriptThe button copies the whole file.
  2. Paste it in the Pine EditorOpen a new indicator, replace the sample, save.
  3. Add it to a chartIt draws order blocks and gaps as candles close.

Version 1.1.0 · 2026-10-03: a zone is no longer checked for a touch on the bar that draws it, so a new gap starts in full colour.

smc-basics.pine · 229 linesDownload smc-basics.pine
//@version=6// ============================================================================//  SMC Basics — ProEA Lab// ----------------------------------------------------------------------------//  Free, open-source Smart-Money-Concepts starter: auto-detected Order Blocks//  and Fair Value Gaps with honest, non-repainting mechanics.////  What it draws//    · Order Blocks  — on a confirmed swing break (BOS), the last opposite//      candle before the impulse. Geometry frozen at creation.//    · Fair Value Gaps — 3-candle imbalances larger than an ATR-scaled minimum.//    · Basic mitigation — zones fade once price trades into them and are//      removed (or ghosted) once price CLOSES through the far edge.////  Honest notes//    · Swing points confirm `pivotLen` bars late by construction — that is what//      makes them non-repainting. Nothing here predicts anything.//    · This is the free sibling of the SMC AI-Scored Toolkit (scoring, sweeps,//      regime, verdict, trade-plan ticket live there). This one stays simple//      on purpose: the freshest zones only, drawn cleanly.////  Version 1.1.0 · 2026-10-03//    1.1.0  A zone is no longer checked for a touch on the bar that draws it.//           Before, every new gap started faded: its third candle IS its edge.//    1.0.0  First release (that file carried no version line).// ============================================================================indicator("SMC Basics — ProEA Lab", "SMC Basics", overlay = true, max_boxes_count = 60, max_labels_count = 30, max_lines_count = 40) // ===== 1 · INPUTS ===========================================================G1 = "Structure"pivotLen  = input.int(10, "Swing pivot length", minval = 3, maxval = 50, group = G1, tooltip = "Swing highs/lows confirm this many bars after they form — later, but honest.", display = display.none) 

No coding needed.

View the full code

01 · Library

Full source

The full Pine v6 source, in Pine Pro Library: read it, change it, keep it.

02 · Pine v6

One file

It draws on any market and timeframe your chart shows.

03 · Defaults

Pivot 10, three each

Three zones per kind and side; gaps of 0.3 ATR or more.

04 · Drawing only

No alerts

It draws zones and fades them; it sends no alerts or signals.

Every zone. Scored.

Its rules, ported, on simulated gold: it scores every zone, waits for price, then draws the ticket.

SMC AI-Scored Toolkit14:30
  1. STAND-ASIDE
  2. SCAN
  3. ARMED
  4. ENTER
  5. MANAGE
Co-Pilot

standing aside — no qualified, aligned setup near price

No aligned setup near price

Zone score73OB · long · TREND
  • Volume 0.30
  • Displacement 1.00
  • Liquidity sweep 0.10
  • Higher-timeframe bias 1.00
  • Session time 0.25
TicketBUYClosed
ENTRY
4,129.14
STOP
4,124.43
−1.00R
TP1
4,150.59
+4.55R
TP2
4,153.86
+5.25R
TP3
4,157.14
+5.94R

Setup 1 · every step of a plan

Simulated 15-minute gold bars, not a real market, run through the SMC AI-Scored Toolkit's rules, ported to the browser. Setup 1 is the first simulated setup whose plan is entered and reaches TP1, so every step shows; Another setup plays the next eleven setups in order, whatever they do. The Toolkit draws each ticket; the film plays it by one rule: entered at the close of the bar where the Toolkit says ENTER, a third off at each of TP1, TP2 and TP3, the stop where its ticket puts it, the stop first when a bar touches both. R is before costs.

This replay uses the Toolkit's v1.4.1 rules, in which fair value gaps were not drawn. v1.4.2 draws them; an updated replay is coming.

Read as text
Times are bar opens on the simulated New York clock. The words are the Toolkit's.
TimeEventPrices
18:30Window opens3 scored zones on the chart
04:30ARMED · OB 73 ptsZone 4,126.07 – 4,126.44 · stop 4,124.43 · R:R 12.0
07:00ENTER long at the closeEntry 4,129.14 · stop 4,124.43 · TP1 4,150.59 · TP2 4,153.86 · TP3 4,157.14
08:00TP1 · a third off +4.55RExit 4,150.59
08:00TP2 · a third off +5.25RExit 4,153.86
08:15TP3 · the last third +5.94RExit 4,157.14

SMC AI-Scored Toolkit Everything here, plus:

  • A 0–100 score on every order block and gap
  • A verdict: ARMED · MANAGE · STAND-ASIDE
  • A Co-Pilot panel that explains the read in words
  • Liquidity sweeps, regime and higher-timeframe bias
  • A trade ticket drawn from the zone
$39, one payment.
Get SMC Toolkit $39

Full Pine source No subscription 7-day refund before download

It draws, scores and plans on your chart; it does not trade for you, and a score describes a zone, not what price does next.

Or all 11 Pine tools, one payment, nothing renews $46

Straight answers.

How do I get the code?

The page, the films and the manual are open to everyone. The script is in Pine Pro Library: $49 once for every desk and every update, or included in the Complete Suite. Sign in to copy or download; it draws on your own TradingView chart.

Does a zone predict anything?

No. A zone marks where price moved, never what price will do next; treat it as a place to study, with your own plan for entries, exits and losses.

Does the Toolkit's score predict?

Not as a whole. In our own study on gold futures, the composite score failed a shuffle test, while two of its five parts, displacement and volume, showed exploratory associations; it was one market and one timeframe, and the study has every number.

Why did gaps use to start faded?

Up to version 1.0 the script checked for a touch on the bar that draws a zone, and a new gap's third candle already reaches its edge, so every gap started faded. Version 1.1.0 (2026-10-03) skips that bar: a gap now fades only when a later bar comes back to it.

We, ProEA Lab, build SMC Basics and the SMC AI-Scored Toolkit. The films run on simulated candles, not market data: SMC Basics' rules, simplified, and the Toolkit's rules, ported. Not financial advice.

Full manual.

Every rule, setting and check, one topic at a time.

Open the full manualClose the full manual

SMC Basics · Pine Pro Library

Understand the boxes on your chart.

See why a price area gets marked, what happens when price returns, and when the box disappears.

Automatic chart zones. No buy/sell signals.

Pastel clay illustration of a confirmed structure break and three-candle gap forming fixed zones, marking the gap's midpoint, then tracking a zone's life.
Workflow illustration
  1. Spot the structure

    A confirmed swing break or three-candle gap.

  2. Mark the zones

    Fixed order blocks; gaps with their midpoint.

  3. Track their life

    Fresh, touched, then removed when invalidated.

See the real chart

What is SMC Basics?

SMC Basics is a TradingView indicator in Pine Pro Library for order blocks, fair value gaps and gap midpoints. It draws zones from defined candle and swing rules, fades touched zones, and removes them after a confirmed close beyond the far edge. The visual guide explains when each box becomes known and what its boundaries mean.

Why does an order block appear after its origin candle?

The script first waits for a confirmed swing and a close beyond it, then selects an earlier opposite candle. The default swing needs ten later bars to confirm. The older box origin is not its detection time. Open How an Order Block is chosen

Why did a new fair value gap use to look faded?

Up to version 1.0 the script checked its touch rule on the creation candle, which a new gap always meets, so every gap started faded. Since version 1.1.0 (2026-10-03) the creation candle is skipped and a gap fades only on a later visit. Removal still requires a confirmed close strictly beyond the zone's far edge. Open Why a box fades or disappears

Does SMC Basics include alerts or automatic higher-timeframe zones?

This version draws zones on the chart timeframe and has no alert conditions or automatic higher-timeframe zone feed. To compare timeframes, use the manual two-chart routine. It does not provide an entry ticket or setup grade. Open What this tool does not do

Why these boxes exist.

Price sometimes moves sharply, then returns to an earlier area. These ideas give you places to watch.

Candles: up ↑ · down ↓
How a price gap becomes a box: 1 closed candleStart with one candle. Its thin wick reaches $101. That is the highest price during this candle. There is no box yet.
Made-up prices · completed candles. Same default gap filter as the indicator, with 14 earlier candles supplying its volatility measure (ATR).

1 / 4

Start with one candle.

Its thin wick reaches $101. That is the highest price during this candle. There is no box yet.

SMC Basics finds these patterns for you. It also marks earlier candles as Order Blocks, explained next. “Smart Money Concepts” names these chart ideas; the boxes cannot tell you who traded or why.

New to candles? Start here.

A candle summarizes price during one time period. Its thick body joins the opening and closing prices. Its thin wicks reach the highest and lowest prices. Once the period ends, the candle closes. This tool checks its patterns at that point.

How does this help a trading plan?

Use a box to choose an area to study. Watch price there, decide what would make your idea wrong, and plan your entry and exit. Across trades, gains must cover losses and costs. A box alone does not make a trade profitable.

Watch a box form.

Start with one pattern. Follow its story one candle at a time.

Watch an Order Block form.

Press Play, or move one candle at a time.

Candles: up ↑ · down ↓Green box · upward pattern
Fictional candles · pivot length 3 to keep the lesson short (default: 10). Circle and break line are teaching guides.

Let a turning point form. Follow the candles. The tool needs a confirmed high before it can mark this upward pattern.

Latest close
$100.00
Box state
Not created
Confirmed high
Waiting
Quick check: price crosses a gap’s halfway line. Is the box removed?

No. The halfway line helps you describe price’s location. Removal requires a confirmed close beyond the far edge: below an upward zone or above a downward zone.

Find the same boxes on a real chart.

Gold · 15-minute candles · OANDA. Look for the labels first, then the box edges.

Real TradingView Gold 15-minute chart with SMC Basics: pink and green OB and FVG boxes, with dashed halfway lines inside the FVGs.
TradingView snapshot · . Guide labels 1–2 added.Open full-size chart in a new tab ↗
  1. Order Block · OB

    The upper pink box marks an earlier candle. Its top and bottom define the area. It has no halfway line.

  2. Fair Value Gap · FVG

    The green box near the current price has a dashed halfway line. The indicator calls this the CE midline.

Color describes direction. Green marks an upward pattern; pink marks a downward pattern. Both OB and FVG can use either color. Read the label to tell them apart.

Add it to your chart.

The full Pine v6 source, in Pine Pro Library. Copy, paste, and keep it.

  1. Open the editor

    On a TradingView chart, use the Pine icon to open Pine Editor.

  2. Copy and paste

    Copy the full code below. Paste it in place of the sample code.

  3. Add to chart

    Choose Add to chart, then save the script to keep it.

Indicator code

Copy the code as it is. No coding needed.

View the full code
First time? Keep the default settings.

Pivot length 10 · 3 zones of each type per direction · halfway lines on. Give the chart enough candles to confirm its turning points.

Explore more when you need it.

Open the topic that answers your next question.

How an Order Block is chosen

A swing high or low is a turning point with enough candles on both sides. With the default pivot length of 10, it is only confirmed 10 candles later.

The first closed candle beyond that confirmed high or low is the break. For an upward break, the tool searches the previous 20 candles for the nearest down candle. For a downward break, it looks for the nearest up candle. If none exists, it draws no Order Block.

The box uses that candle’s body by default; you can include its wicks. It appears after the break, even though its left edge points to an older candle. A doji, with equal open and close, does not count as an opposite candle.

This is a chart pattern rule. It does not prove institutional orders or that buying or selling was absorbed there. The simulator’s circle and break line are teaching guides; the indicator draws the zone and tag.

How a gap and its halfway line are chosen

For an upward gap, candle 3’s low is above candle 1’s high. For a downward gap, candle 3’s high is below candle 1’s low. The space between those prices becomes the box. No swing break is required.

Candle 2 can trade through that space. A gap between the first and third wicks does not mean no trades happened there.

The default size filter is 0.3 × ATR(14). ATR measures recent price movement; this filter leaves out gaps smaller than that threshold. The lesson includes 14 earlier candles for this calculation.

CE means consequent encroachment. It is simply the halfway price: (top + bottom) ÷ 2. Crossing it does not automatically break a zone, change its state, or produce an alert.

Why a box fades or disappears

Fresh: a new zone has not met the script’s touch rule. Touched: price reaches its near edge and the fill fades. Its price boundaries stay fixed.

Removed: a confirmed close passes the far edge—below the bottom of an upward zone, or above the top of a downward zone. A wick beyond that edge, or a close exactly on it, does not trigger removal.

The script does not check touching on the candle that creates a box (since version 1.1.0, 2026-10-03). A new FVG’s third candle already reaches its edge, so up to version 1.0 every gap started faded; now a gap fades only when a later candle comes back to it.

With ghost outlines enabled, a removed zone leaves a gray outline ending at that candle. Its label and halfway line disappear. Older active zones can also be removed by the per-side cap. A total pool limit of 36 includes ghosts, so this is not permanent history.

Five ways to study zones in a trading plan

These are observation exercises. Use your own rules for entry, exit, trade size, and loss limits.

1. The OB retest

Mark a confirmed Order Block, then watch whether price returns. Describe what happens inside it and whether a close passes the far edge. A visit alone is not an entry.

2. A gap’s halfway line

Compare price with the middle and the edges. Record whether price moves away or continues through. The middle helps describe the move; it does not decide whether it will succeed.

3. Overlapping boxes · the stack

An OB and FVG may overlap. That gives two pattern references near the same price, but does not establish a higher chance of profit.

4. Read the surrounding trend

Compare recent confirmed highs and lows with the zone. A box is only one part of the chart. Decide in advance what would make your trade idea wrong.

5. Wait for a useful location

Let your plan decide which areas matter. An empty chart may reflect settings, confirmation delay, or the zone cap. It does not tell you to trade or stay out.

Choose what the indicator shows

Start with the defaults. Change one setting at a time and compare the result.

Swing pivot length
Default: 10 · range 3–50
How many candles are needed on each side of a turning point. A larger number increases the confirmation delay.
Show Order Blocks
Default: On
Show or hide the Order Block patterns.
Use full wick
Default: Off · candle body
Include the chosen candle’s full high–low range instead of only its body.
Keep last OBs per side
Default: 3 · range 1–5
Keep this many active upward OBs and this many downward OBs.
Show Fair Value Gaps
Default: On
Show or hide the three-candle gap patterns.
Min gap size (× ATR)
Default: 0.3 · range 0–2, steps of 0.1
Raise it to leave out smaller gaps relative to recent price movement.
Keep last FVGs per side
Default: 3 · range 1–5
A separate cap for upward and downward FVGs.
CE midline (50% of the gap)
Default: On
Show a dashed halfway line inside each active FVG.
Zone tags (OB / FVG)
Default: On
Keep these labels visible while learning to tell the boxes apart.
Keep mitigated zones as ghost outlines
Default: Off
Keep a temporary gray outline after a close breaks a zone.
Header chip
Default: On
Show the small SMC Basics name on the chart.

The default caps allow up to 12 active zones: 3 in each type-and-direction group. More boxes or a larger pivot setting do not automatically mean better trades. There is no session filter.

A simple routine with two timeframes
  1. Look at your wider timeframe first. Note recent highs, lows and nearby zones.
  2. Open your trading timeframe. Each chart calculates its own zones from its own candles.
  3. Choose an area to observe and wait for price to reach it.
  4. Compare the touch, the close, and the far edge with your entry and exit rules.
  5. Record the result, including losses and costs. Review several trades before changing your plan.

Comparing timeframes is a manual workflow. This tool does not automatically combine their zones or provide an entry plan.

What this tool does not do

It marks chart patterns—never what price will do next. There is no zone score, liquidity sweep detector, regime filter, trade ticket, or alert.

New zones and state changes are committed when candles close. Pivot confirmation takes time. Once a zone exists, its price boundaries stay fixed, but it may fade or be removed.

This is a chart-reading tool, not financial advice. Practise with virtual money and check whether your complete plan works after losses and costs.

05 · THE LOG

Every change, dated

What shipped and what changed in SMC Basics, newest first. Ask for the next change below; what gets built lands here with a date, and on the lab queue on the front page.

  1. New gaps no longer start faded v1.1.0 Updated SMC Basics

    A zone is no longer checked for a touch on the candle that draws it, so a new gap starts in full colour.

    • Up to 1.0 a new gap's third candle, which is its own edge, counted as a touch, so every gap started faded
    • A zone now fades only when a later candle comes back to it
    • An order block whose breakout candle overlapped it no longer starts faded either
    • Removal is unchanged: a confirmed close strictly beyond the far edge
  2. SMC Basics Shipped

    Tracks price zones left by a move until they break.

BUILT WITH TRADERS

Something to change in SMC Basics?

A small friction or a big idea. Tell us what would make this tool work better for you.

What would help?

Describe your rules and what you want the tool to help you see.

Add chart details Optional

For a question about your idea or an update if it ships.

Guides & new tools Optional

Add an email above to choose this.

Show us on your chart Optional

Crop out any account details you don't want to share.

No account needed. Sent privately to the lab.
  1. We read it
  2. We choose what to build
  3. Shipped changes get a date

Requests for a new tool go on the same queue: see what is asked for and what is being built.

  • IFVG Desk

    Continue from identifying a fair value gap to studying an inversion-based entry setup.

  • Supply & Demand Desk

    Compare these candle-defined zones with a separate departure-and-return zone model.

Built by ProEA Lab. Compare every desk in Pine Pro Library.