OPEN-SOURCE SCRIPT
Aggiornato

[Dugan Algos] Trader's Command Center

280
Overview

Trader's Command Center consolidates the routine an active intraday trader repeats on every chart — marking the levels that matter, checking whether the trend actually agrees with itself, confirming that volume is present, and judging whether the move still has fuel — into a single overlay with one readable verdict.
The problem it addresses is fragmentation. Most traders end up running five or six separate scripts: one for previous-day levels, another for premarket, a VWAP, a moving-average package, something for relative volume, and a momentum oscillator in a lower pane. Each is fine alone, but reading them together means your eyes travel across the screen and you assemble the context manually, in real time, under pressure. That assembly step is where hesitation and inconsistency creep in.

TCC performs the assembly for you. Every component feeds one checklist table that resolves to a plain-language state — A+ LONG, A+ SHORT, LONG (low vol), SHORT (fading), or MIXED — so the question shifts from "what do all these indicators say?" to "does this setup meet my standard, yes or no?"

It works on stocks, options underlyings, and futures, and includes dedicated Asia and London session levels for overnight futures traders.

---

Why these components are combined

The individual calculations here are standard and well documented — that is deliberate. The originality is in the scoring architecture, not in inventing a new formula.
Three specific pieces of integration logic do work that no combination of separate scripts performs:

1. Trend agreement is scored, not eyeballed. Six independent context checks (VWAP, EMA alignment, two SMAs, prior-day close, market breadth) are reduced to a single 0–6 score. Five or six agreeing is treated as directional conviction; anything less is explicitly labelled MIXED rather than left for you to interpret. The point is a consistent, repeatable threshold instead of a judgment call that shifts with your mood.

2. Volume and momentum act as gates on that score, not as more rows to weigh. Direction is necessary but not sufficient. A trend everyone agrees on but nobody is trading is a trap, and so is a trend that's already exhausted. Relative volume and momentum acceleration are therefore structurally separate from the directional score — they can only downgrade a verdict, never create one. This is why the header degrades in a defined order: `A+ LONG` → `LONG (low vol)` → `LONG (fading)`. Each tells you something different about why the setup is second-rate.

3. Momentum is measured relative to the prevailing bias. Every momentum reading in the script is sign-flipped to match the direction the checklist is pointing. On a short setup, a falling MACD histogram is momentum building, not fading. Bolting a standard MACD onto your chart requires you to perform that inversion mentally on every short — a small thing that produces real errors when you're managing a position quickly.

---

Features

Automatic key levels

Drawn without any manual charting, and updated as each period completes:
  • Previous day high, low, and close
  • Premarket high and low, accumulated live through the pre-session
  • Opening range high and low, with a configurable duration (default 15 minutes)
  • Prior week high and low
  • Prior month high and low


Each level carries a compact right-edge tag (PDH, PDL, PDC, PM-H, ORB-L, PWH, PMoH and so on) so you can identify a line at a glance without opening the settings panel. Labels can be switched off if you prefer a cleaner chart.

Higher-timeframe values are requested with a one-period offset, meaning the script only ever reads completed periods. These levels do not repaint.

Futures session levels

For overnight and globex traders, optional Asia and London session highs and lows, alongside the standard prior-day and opening-range levels. Both session windows and the reference time zone are user-configurable — the defaults are New York time (Asia 18:00–03:00, London 03:00–09:30), which suit ES, NQ, CL and GC, but the fields accept any session string for other products or time zones.

A+ Trade Checklist

The centrepiece. A compact table scoring six directional checks:

Check Bullish when
Price vs VWAP Price above session VWAP
EMA alignment Fast EMA above slow EMA (default 9/21)
SMA 1 Price above the intermediate SMA (default 50)
SMA 2 Price above the long SMA (default 200)
Prior-day close Price above yesterday's close
Market breadth Advance-decline reading above zero

Five or six bullish gives a long bias; five or six bearish gives a short bias; anything in between reads MIXED. Two quality gates then qualify that bias — day RVOL and momentum — followed by two informational rows (bar RVOL and buy-volume percentage) that assist entry timing without affecting the verdict.

The header cell always states the conclusion outright, so you never need to count rows.

Momentum: accelerating or fading

A dedicated row answering the question most checklists ignore: is this move gaining or losing steam?

The measurement is the slope of the MACD histogram, normalised by ATR. The histogram is already the spread between fast and slow momentum, so its rate of change is effectively acceleration — an expanding histogram means the move is gaining separation, a contracting one means it's decaying even while price still drifts your way.

Dividing by ATR is what makes the reading portable. Raw histogram slope is expressed in price units, so a threshold tuned on SPY would be meaningless on ES or a four-dollar stock. Expressed as a percentage of average true range, a single threshold behaves consistently across every instrument.

The row displays one of three states — `▲ ACCEL`, `■ FLAT`, `▼ FADING` — with the normalised magnitude, plus a small `·adx↑` marker when ADX is simultaneously rising. A configurable flat zone prevents the state from flickering on trivial changes.
A dropdown controls how strictly momentum gates the verdict: Off (display only), Block if fading (default), or Require accelerating (strictest, suited to breakout entries).
Trending Stocks screener

Ranks up to eight watchlist symbols by daily relative volume, showing percent change alongside, sorted live so the most unusually active name sits at the top. Useful for deciding which chart deserves your attention before you commit to one.

Symbols are fully user-defined; the defaults are common large-cap names and index ETFs.

Volume analysis

Day RVOL — cumulative session volume against the 20-day average, the standard measure of whether a name is "in play"
Bar RVOL — current bar volume against its recent average, for spotting individual bursts
Buy/sell volume estimate — volume apportioned by where the bar closes within its range, giving a rough pressure read on each candle

Trade planner

Enter an intended entry, stop, and target in the settings; the script draws all three on the chart with an automatic risk-to-reward calculation, absolute risk, and absolute reward. A fast way to sanity-check a trade's geometry before committing, or to review one afterwards.

Alerts

Thirteen conditions covering breakouts, cross events, volume anomalies, and setup formation:
  • Break above previous day high / below previous day low
  • Break above premarket high / below premarket low
  • Opening range breakout, up and down
  • VWAP cross, up and down
  • Relative volume spike
  • A+ Long setup formed (bias + volume + momentum all confirmed)
  • A+ Short setup formed
  • Momentum fading — fires only while a directional bias is live, making it a genuine position-management trigger rather than background noise
  • Momentum accelerating


Setup instructions

1. Add the indicator to your chart.
2. Enable extended trading hours. Right-click the chart → Settings → Symbol tab → tick Extended trading hours. Premarket high and low cannot be calculated without pre-session data, and the row will stay blank until this is enabled.
3. Use an intraday timeframe. The level suite, opening range, and session VWAP are built for intraday charts — 1 to 60 minutes. On daily and higher, intraday-specific levels are intentionally suppressed.
4. Confirm the breadth symbol. The checklist defaults to `USI:ADD` (NYSE advance-decline). If that row shows "n/a", your data plan may not include it — substitute any breadth symbol you do have access to, or a broad index proxy. The row will read n/a and score as bearish if the symbol is unavailable, so it's worth resolving rather than ignoring.
5. Set your session times if trading futures. Enable the futures group and adjust the Asia and London windows to match your product and time zone.
6. Create alerts. Add alert → Condition → select Trader's Command Center → choose the event from the dropdown. Set Once Per Bar Close if you want confirmed signals only; leaving it on Once Per Bar will fire intrabar and can trigger on moves that reverse before the candle closes.

---

How to read it during a session

A workflow that suits most intraday traders:

Before the open, glance at the screener to see which of your names are running unusual volume. Note where premarket high and low sit relative to the previous day's range — a premarket high above yesterday's high with real volume is a materially different setup from one inside the prior range.

Through the opening drive, let the opening range establish, then watch for a break of ORB high or low. The checklist header tells you whether that break has context behind it. An ORB breakout with an A+ LONG verdict is a fundamentally different proposition from the same breakout printing MIXED.

In a position, the momentum row is your management tool. Direction rows staying green while momentum turns to FADING is the classic signal that a move is maturing — a reasonable trigger to tighten a stop or take partial profit, well before the directional rows themselves flip.
When the verdict reads MIXED, that is information. The context checks disagree, which usually means chop. Most consistent traders lose more money forcing trades in this state than they make from the ones that work.

---

Tuning guidance

Slope lookback (default 3 bars) governs momentum responsiveness. Drop to 2 on a 1-minute chart if the reading feels slow; raise to 5 or more on 15-minute and above.
Flat zone (default ±3% of ATR) controls how much movement is required before the momentum state changes. If the row flickers between states more than you find useful, raise it to 5 or 6. This is the first knob to reach for — if the momentum gate is talking you out of trades that later work, the flat zone is usually too tight rather than the concept being wrong.
Day RVOL threshold (default 1.5x) sets the participation bar. Lower it to 1.2 for large-cap index products where 1.5x is genuinely rare; raise it to 2.0 or beyond if you only want names that are decisively in play.

Opening range duration (default 15 minutes) is a matter of style. Five minutes gives earlier, noisier signals; thirty produces fewer, cleaner breaks.
Momentum requirement should match your entry style. Breakout traders want Require accelerating. Pullback and mean-reversion traders often prefer Off, since entering as momentum decelerates is the entire premise of that approach.

---

Limitations and honest notes

Pine cannot scan the whole market. The screener ranks only the symbols you enter. This is a platform constraint on all Pine scripts, not a design shortcut — TradingView limits the number of external symbol requests a script may make, and eight leaves headroom for the rest of the indicator's higher-timeframe calls.

Momentum measurement lags. MACD-derived acceleration is built on moving averages and inherits their delay. In a range, the histogram slope will whipsaw regardless of tuning. The momentum row is most reliable when the directional rows are already lopsided — it is a quality filter on an existing trend, not a standalone signal.

Buy/sell volume is an estimate. Without tick-level or order-flow data, the split is inferred from where each bar closes within its range. It is a reasonable proxy for pressure, not a substitute for a true delta feed.

Breadth is US-equity oriented. The default advance-decline symbol is meaningful for US stocks and index products. Trading FX, crypto, or non-US equities, the row should be repointed at something relevant or its influence on the score understood as noise.

The score is not a strategy. It describes context, not edge. It contains no backtest, makes no claim of profitability, and will happily print A+ LONG into a reversal. Entry, exit, position sizing, and risk management remain entirely yours.

Repainting: higher-timeframe levels read completed periods only and do not repaint. Live intraday values — the current bar's RVOL, momentum state, and checklist verdict — naturally update while the bar is forming and settle on close, as with any real-time indicator. Use Once Per Bar Close on alerts if you need confirmed-only behaviour.

---

Settings reference

Group Contains
① Key Levels Toggles for previous day, premarket, weekly, monthly levels and labels
② Opening Range ORB on/off and duration in minutes
③ Futures Sessions Asia and London session windows, reference time zone
④ Moving Averages / VWAP VWAP toggle, two EMA lengths, two SMA lengths
⑤ Volume / RVOL Averaging length, day-RVOL threshold, bar-spike multiple
⑥ Momentum MACD lengths, slope lookback, ATR length, flat zone, A+ gate strictness
⑦ A+ Trade Checklist Table on/off, breadth symbol, table position
⑧ Trending Stocks Screener Table on/off, eight symbol slots
⑨ Trade Planner Entry, stop, target prices

---

Disclaimer

This indicator is provided for educational and informational purposes only. It is not financial advice, not a recommendation to buy or sell any security or contract, and not a solicitation of any kind. It contains no strategy, no backtest, and makes no representation about past or future performance.
Trading stocks, options, and futures involves substantial risk of loss and is not suitable for every investor. Levels, scores, and alerts produced by this script describe market context; they do not predict outcomes. All trading decisions, position sizing, and risk management are your own responsibility. Test any tool thoroughly on a simulated account before risking capital.
---
Comments and suggestions are welcome. If you find a calculation that behaves unexpectedly on a particular instrument or session, please describe the symbol, timeframe, and settings so it can be reproduced.
Note di rilascio
Added momentum guidance

Declinazione di responsabilità

Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.