OPEN-SOURCE SCRIPT

PA Intraday Setups v0.1.0

520
# PA Intraday Setups — Publication Description

---

## OVERVIEW

PA Intraday Setups is a heuristic execution assistant for discretionary intraday
price-action traders. Instead of generating a single buy/sell arrow, it watches the
chart for eleven of the most common Brooks-style price-action setups and labels each
one as it confirms — so you can keep your eyes on structure and let the indicator
handle the pattern-recognition bookkeeping.

It is built around one idea: **context first, setup second.** The script continuously
classifies the market into trend / range / wide-channel / always-in context, and only
fires a setup when the context that setup requires is actually present. This mirrors
how a discretionary trader thinks — "what is the market doing right now, and is this a
setup I'm allowed to take?"

This is NOT a fully automated strategy and NOT a signal service. It is an
education-and-discipline tool: it shows you where a textbook setup exists, draws
suggested entry / stop / target guide lines, and stays silent everywhere else.

---

## WHAT IT DETECTS

The eleven setups are grouped exactly the way a price-action trader files them — by
order type and market context.

PART 1 — BREAKOUT SETUPS (stop entries beyond a signal bar)

1. TREND PULLBACK H2 / L2 — In a confirmed trend (and only after a strong breakout
or tight channel, not inside a broad channel), a clean two-legged counter-trend
pullback whose signal bar closes in the trend direction.

2. BREAK-FAIL-BREAK — A failed breakout that re-breaks the same level within a few
bars (default 3). Confirms the breakout direction after trapping the first movers.

3. KEY-LEVEL STRUCTURE REVERSAL — A reversal off a key level that coincides with a
recognizable structure: double top/bottom, wedge, head-and-shoulders, or an
inside/outside-bar (OB/IB) signal bar.

PART 2 — LIMIT SETUPS (limit entries at a pre-marked price)

4. RANGE HIGH / LOW LIMIT FADE — Inside a balanced range, fade the prior high/low
back toward the middle with a fixed risk.

5. WIDE-CHANNEL POINT 3 FADE — A counter-channel limit fade at the third touch
("Point 3") of a wide channel.

6. TREND 50% PULLBACK — In a strong trend, a limit entry at the 50% retrace of the
most recent impulse leg, provided the pullback stays weak (no three consecutive
strong counter-trend bars).

7. TRUE-BREAKOUT TRAPPED PULLBACK — After a genuine breakout holds, a with-trend
limit entry on the retest that traps the counter-side. Requires a strong breakout
bar AND a strong follow-through bar; dojis or weak bodies disqualify it.

PART 3 — ALWAYS-IN / STRONG-TREND SETUPS

8. L1 / H1 FAILURE — In an always-in trend, the first counter-trend attempt fails at
the prior with-trend follow-through extreme.

9. THIRD-BAR FAILURE — A counter-trend attempt that fails to print a third
consecutive counter-trend bar, faded in the trend direction.

10. EMA20 PULLBACK — The first pullback to the EMA in an always-in trend, entered
with-trend near the moving average.

11. TREND BREAKOUT SCALP — A with-trend strong-body breakout bar (close beyond the
50% mark) taken as a quick scalp with an ATR-based target.

The script also prints INVALIDATION and FORCED-EXIT labels (e.g. an H2 that turns
into a reversal bar, a 50%/trapped/EMA setup that breaks its premise, or three
consecutive counter-trend bars against an open trend) so you can see when a setup is
voided.

---

## CONTEXT LABELS

When enabled, the indicator drops a small label the moment the market context
changes, so you always know which "regime" you're in:

- CTX Range — balanced, mean-reverting range (use the Limit setups)
- CTX AI Long / CTX AI Short — always-in long/short, a strong directional regime
- CTX Wide Ch Up / CTX Wide Ch Dn — wide channel, where Point 3 fades live

---

## TRADE GUIDES

For each confirmed setup the script can draw three short guide lines projected to the
right:

- Entry (dotted) — the stop-order or limit price
- Stop (solid red) — the protective stop
- Target (dashed green) — a fixed reward based on the configurable RR or an ATR
multiple

These are suggestions for visual reference only — they are not orders and do not
account for slippage, spread, or your own risk rules.

---

## SETTINGS

SESSION
- Optional trading session + timezone. When off, the script treats every bar as
active and resets session stats daily.

GENERAL
- EMA length (default 20), ATR length (14), trend lookback, range/breakout lookback,
pivot strength.

THRESHOLDS (the heart of the tool)
- Strong-bar body %, max entry-side tail %, doji body %, near-key/near-EMA buffers
(in ATR), minimum trend move / closes-on-side / efficiency, range width & overlap,
wide-channel width & overlap, break-fail-break window, trapped-pullback window,
structure confirm window, impulse lookback, ATR scalp target multiple, default RR.
Tighten these for fewer / cleaner signals; loosen for more.

MANUAL KEY LEVELS
- Up to four price levels you type in yourself (e.g. overnight high/low, a daily
pivot). Setups that depend on "key levels" will respect these in addition to the
auto-detected prior-session H/L/C, session open, range extremes, and EMA.

DISPLAY
- Toggle the EMA plot, context labels, trade guides, invalidation labels, range
lines, and manual-level lines; set guide-line length.

SETUPS
- Independent on/off switch for each of the eleven setups, so you can run only the
ones that fit your style.

---

## HOW TO USE

1. Add the indicator and pick your timeframe (designed for intraday — e.g. 1m–15m on
index futures, FX, or liquid stocks).
2. Decide your context. Watch the CTX labels: trend regimes favor the breakout and
always-in setups; range regimes favor the limit fades.
3. Mark your own key levels in the Manual Key Levels group — the quality of the
key-level setups depends heavily on good levels, and no algorithm marks them as
well as you do.
4. Turn off the setups you don't trade. Most traders do better with three or four
setups than with all eleven.
5. Use the guide lines as a starting point, then size and place your real orders by
your own risk plan.
6. Optionally create alerts — there is one alert per setup, plus aggregate "any long
setup / any short setup / forced exit / invalid" alerts.

---

## IMPORTANT NOTES & LIMITATIONS

- This is an APPROXIMATION. Setups that a human reads from key levels, channels,
wedges, head-and-shoulders and channel "Point 3" are estimated here using pivots,
EMA/ATR context, prior ranges and your manual levels. It will sometimes label a
setup you would skip, and skip one you would take.
- Labels confirm on bar close (`barstate.isconfirmed`). They do not repaint after a
bar closes, but live bars can change until close.
- Thresholds are general-purpose defaults. Different instruments and timeframes need
retuning — treat the Thresholds group as your edge, not a fixed recipe.
- No setup is a recommendation. Discretion, context, and risk management remain
entirely yours.

---

## OPEN SOURCE

Published open-source under the Mozilla Public License 2.0. You are free to study,
fork and improve it. If you build on it, a link back is appreciated.

---

## DISCLAIMER

This script is for educational and informational purposes only. It is not financial
advice and not a recommendation to buy or sell any instrument. Trading involves
substantial risk of loss. Past behavior of any setup does not guarantee future
results. Test thoroughly on a demo account and trade your own plan.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.