OPEN-SOURCE SCRIPT
Aktualisiert

Megacap Tech Channel & Index [Scott Master v4.9]

772
High-conviction signals for mega-cap technology leaders. Entries and exits are governed by the Canon Elite Sniper standard, using sector trend confirmation via NDXT/SOX macro guards. Designed for velocity and vertical capture on the largest names in tech.
Versionshinweise
Bug Fix for TradersPost JSON Output
Versionshinweise
Switched the trailing stop to an ATR-based trail, it's good for another 50 bps or so of performance on the symbols I retested on.

As-built, this will do a 3x profit multiplier on stocks like AAPL or AMD under current market conditions (4/1/2026) when using NDXT as a pointer index.
Versionshinweise
Megacap Tech Channel & Index [Scott Master v4.91]

This is an open-source version of the types of script coding I use for my own purposes, I don't release everything - rather - I have customized versions for every market sector, but I'm putting out this MegaCap Tech one as an example of what can be done with PINE.

This is a channel mean-reversion strategy engineered for mega-cap technology equities (AAPL, MSFT, NVDA, AMZN, META, GOOGL, TSLA, AMD, and similar). Entries are triggered when price pulls back to the lower ATR channel band during a confirmed oversold RSI reading, with momentum confirmation on the entry bar. Exits are governed by an adaptive ATR trailing stop, a climax harvest at overbought exhaustion, and a broker-side hard stop injected at entry. I recommend setting 'cold-start' entries for RSI OS/OB and then the script will tune itself as it accumulates data, but initial trades use the warm-up numbers. After setting those, tweak the ATR settings and backtest, one at a time, until you see the maximum profit factoring. On some, I've hit at least 7x profit factors ($7.00 in profit for every $1.00 in loss), to even infinite factors.

Strategy Architecture
The engine is built on a layered pillar system. Pillar 8 & 9 (Quarterly Self-Tuning) dynamically calculates oversold and overbought RSI gates using 90-day rolling percentiles, eliminating the need to manually re-tune as market regimes shift, but black swan events, such as the current US/Iran war, can muddy it up, so be aware of that. A 15-day warm-start stage activates before the full 90-day window is available, preventing cold-start misfires on new charts. There are lots of indicators in the TV marketplace that will calculate TV OS/OB, just use one of those, and something like an RSI length of 12 and 2-4 hr charting should work for this, or go a little shorter on the length if you are playing with 15m-1h settings. Pillar 10 (Portfolio Percentage Sizing) allocates a configurable percentage of account equity per trade, with a regime-aware multiplier that increases size during high-confidence low-VIX environments and scales back during elevated volatility, this prevents resizing the dollar amount for trades all the time, it just uses a percentage of your account size, it defaults to $115k if you don't have it wired for trading (easily configurable), I use $100k as a standard account and the one I dev with has a little extra in it. Pillar 11 (Execution Buffer) uses a percentage-based limit order above the signal price to guarantee fill without naked market exposure.

Regime & Macro Guards
All buy entries require the NDXT sector index (requires real-time Nasdaq) to be trading above its 12-period EMA, confirming broad tech sector health. A VIX hard buy block (default 27.0) suspends all new entries during panic regimes regardless of signal quality. A global macro pause toggle allows manual override during war, tariff escalation, or Fed shock events. You can change the index to best-fit different stocks, for big tech, NDXT is a good catch-all, but feel free to dial it in, or pick some similar ETF if you don't have real-time Nasdaq in your subscription, but lags + lags + lags will alter performance.

Pillar 13 — Earnings Blackout
The strategy estimates the next earnings date by projecting 90 calendar days forward from the last confirmed earnings bar. A 4-day blackout window before and after the projected date suppresses new entries while allowing exits to fire normally. The post-earnings blackout is automatically cleared when the reported EPS surprise falls between 1% and 4% (goldilocks beat), allowing re-entry on moderate positive surprises without waiting out the full settlement window. You can remove this part if you don't like it, but as a risk profile, I'm not a fan of earnings weeks. It tends to hurt more than help.

Stop & Trail System
The initial hard stop is selectable: ATR-based (entry price minus ATR-20 × multiplier, recommended for high-volatility names like NVDA and TSLA) or a fixed percentage floor. Once a position reaches 2% profit, the trail ratchets to a minimum of breakeven plus a buffer. A minimum hold bar requirement (default 3 bars) prevents premature exits on normal intrabar noise. All orders inject a broker-side stop loss via the TradersPost webhook payload for capital protection if the alert pipeline is interrupted.

TradersPost Webhook Ready
Entry and exit alerts include fully structured JSON payloads compatible with TradersPost automated order routing. Entry signals carry a fixed share quantity, limit price, and stop loss price. Exit signals fire on Climax Harvest or Stop/Trail conditions with full position close instructions.

To use the TradersPost logic, just put the following in your Webhook/JSON Payload message block:

{{strategy.order.alert_message}}


.. That's it... PINE builds the whole JSON payload from that message. This ONLY WORKS for strategy-enabled trading logic, not the old buy & sell indicator script stuff, but I'm sure Google Gemini or ChatGPT Codex or something can easily adapt to your needs, or just give yourself manual buy & sell signals.

Dashboard
A live overlay table displays Engine ROIC, active loss limit, portfolio allocation, quarterly RSI gates, tuning stage (Cold Start / Warm 15D / Auto 90D), earnings blackout status, broker stop injection confirmation, and net P&L.

Required Settings for Backtesting
Properties → Recalculate → On every tick: ON | Properties → Recalculate → After order is filled: ON | Backtesting → Use Bar Magnifier: ON
Versionshinweise
**Megacap Tech Channel & Index** is a quantitative long-equity strategy within Scott's Canon fleet targeting large-cap and mega-cap technology names and broad tech index instruments. It is a channel-touch mean-reversion strategy — unlike the RSI-crossover entry used in most fleet scripts, entry requires price to physically touch the lower ATR channel band before the RSI oversold signal is considered valid. This dual confirmation (channel touch + RSI compression) is specifically calibrated for mega-cap names whose high absolute ATR makes pure RSI entries prone to premature firing before a genuine pullback has reached a tradeable level.

---

## Guard Architecture

The primary sector guard is the Nasdaq-100 Technology Sector Index (`NASDAQ:NDXT`) on a daily timeframe, above its 12-period EMA. NDXT is sourced via Nasdaq real-time feed per Canon Data Feed Standard. VIX operates on the standard two-tier fleet architecture: confidence ceiling at 21.0 (full accel multiplier) and panic threshold at 25.0 (skeptic multiplier, no new entries). The VIX hard block is 27.0. NYSE session filter (09:30–16:00) is active, with a 15:58 `strategy.cancel_all()` before the close.

---

## Entry Architecture

Four conditions must simultaneously be true: the NDXT index is above its 12-period EMA, the low of the current bar has touched or broken the lower channel band (`basis − 1.7× ATR`), the close is above the open (momentum confirmation), and RSI is at or below the autotuned oversold gate. The `hasReset` gate is set to 1.025× basis — slightly looser than the fleet standard of 1.01× to accommodate mega-cap names whose larger price ranges mean EMA touches occur less frequently. The `notChasing` guard still applies (close < basis × 1.015) to prevent entries on recovering momentum without a genuine pullback.

The channel touch requirement is the key distinction. For NVDA at $900, a 1.7× ATR channel band might be $50–70 wide — requiring a meaningful intraday move into the lower band before the entry is valid, filtering out the shallow RSI dips that occur mid-trend without a real pullback.

The three-stage Autotuner cascade (Cold → Warm 15D → Full Auto 90D) and Pillar 13 Earnings Blackout Guard (±4 bars, Goldilocks exception) are both implemented.

---

## Selectable Stop Architecture

A notable feature distinct from the rest of the fleet: the initial hard stop can be set as either a **fixed percentage** (default 4.0% — wider than the fleet standard of 2.0–2.5% to accommodate mega-cap ATR) or an **ATR-based stop** (`entry price − ATR × multiplier`, default 1.0× ATR). The ATR stop is recommended for high-volatility names like NVDA where a fixed 4% stop may fire on normal intraday volatility, while the fixed stop is appropriate for lower-volatility mega-cap names. Both modes inject the stop price into the TradersPost JSON for broker-side execution.

---

## Exit Architecture

**Climax Harvest** fires when RSI reaches the autotuned overbought ceiling or price reaches EMA basis + 2.5× ATR, subject to the 3-bar minimum hold. **Canon Protection** maintains the selectable hard stop plus a 2.5× ATR trailing stop, with the breakeven floor engaging at 2.0% profit. The skeptic multiplier (0.5×) is more aggressive than the fleet standard (0.6×) — mega-cap tech names are highly correlated to VIX and the sizing reduction during panic regimes is deliberately sharp.

---

## Target Universe

**Individual mega-cap names:** AAPL, MSFT, NVDA, GOOGL, AMZN, AVGO, AMD — names with sufficient ATR to justify the channel-touch requirement and enough volume for reliable limit fills.

**Tech index instruments:** QQQ, TQQQ (note: leveraged ETF daily decay applies — short holds only), XLK, XNTK — the channel-touch architecture works well on index instruments whose lower volatility produces cleaner channel-band entries than individual high-beta names.

**Deployment note:** For NVDA and other names with ATR exceeding $50, the ATR-based stop is strongly preferred. The fixed 4% stop on a $900 stock represents $36 of stop distance — the ATR stop at 1.0× dynamically adjusts to current volatility rather than fixing a percentage that may be too tight in high-ATR regimes and too wide in low-ATR regimes.

Haftungsausschluss

Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.