Skip to content

Pattern Library

Reusable PineScript v6 patterns. Use /pine-patterns [name] for full code.

Available Patterns

Structure Detection

Pattern Description
pivot Pivot high/low detection
bos Break of Structure
mss Market Structure Shift
choch Change of Character
swing Swing tracking

Liquidity & Zones

Pattern Description
eqhl Equal Highs/Lows
ob Order Block detection
fvg Fair Value Gap
breaker Breaker Block
fib Fibonacci levels

State Machines

Pattern Description
state-basic Simple 3-state
state-rqf Full RQF sequence
state-trade Trade management

Drawing

Pattern Description
draw-line Safe line creation
draw-box Box with extend
draw-label Positioned labels
draw-table Info table
plot-safe Conditional plotting

Time & Sessions

Pattern Description
session Session detection
killzone Kill zone boxes
htf Higher timeframe (no repaint)

Alerts

Pattern Description
alert-json Webhook JSON
alert-entry Entry alerts
alert-exit Exit alerts

Usage

# In Claude Code
/pine-patterns pivot
/pine-patterns state-rqf
/pine-patterns ob

Example: pivot

pivotLen = input.int(5, "Pivot Length")

pivotHigh = ta.pivothigh(high, pivotLen, pivotLen)
pivotLow = ta.pivotlow(low, pivotLen, pivotLen)

if not na(pivotHigh)
    int phBar = bar_index - pivotLen
    float phPrice = pivotHigh
    // Use phBar, phPrice

if not na(pivotLow)
    int plBar = bar_index - pivotLen
    float plPrice = pivotLow
    // Use plBar, plPrice

See /pine-patterns skill for complete code snippets.