OPEN-SOURCE SCRIPT

Coppock Multi Time Frame Regimes

255
CMTF is a multi-timeframe momentum classifier built on a forward-weighted Rate of Change (ROC) composite — a structural improvement over the classic Coppock Curve. Rather than summing two fixed ROC periods equally, CMTF sweeps every lookback period between ROC Min and ROC Max, assigning higher weights to shorter (more recent) periods. The result is normalized by its own rolling standard deviation so the curve is amplitude-comparable across different instruments and volatility regimes.

The indicator evaluates three timeframes simultaneously — Daily, Weekly, and Monthly — each running the full calculation pipeline independently. This architecture ensures the table values are consistent regardless of what chart timeframe is displayed, though the note row recommends viewing on a Daily chart for closest alignment with Pine Screener output.

How It Works
Step 1 — Forward-Weighted ROC Composite
For each lookback period i between ROC Min and ROC Max, a weight is assigned as (ROC Max - i + 1), meaning shorter periods receive higher weight. All weighted ROC values are summed and divided by the total weight to produce a normalized average. This gives the raw momentum reading more sensitivity to recent price action than the original Coppock formulation.

Step 2 — Smoothing and Normalization
The raw composite is smoothed with a Weighted Moving Average (WMA Smoothing bars) and then divided by its own rolling standard deviation (Std Dev Length bars). This normalization step is critical — it means the curve oscillates on a consistent scale across all instruments and timeframes, so readings are directly comparable.

Step 3 — Signal Line
An EMA of the normalized curve (Signal EMA Length bars) acts as the signal line. The relationship between the curve and its signal is one of the three scoring dimensions.

Step 4 — Linear Regression Slope
Rather than a simple bar-to-bar difference, the slope is calculated as the difference between the current and previous linear regression values over Slope LinReg Length bars. This produces a more stable directional read that is less susceptible to single-bar noise flipping the slope classification — important for weekly and monthly timeframes.

Scoring System
Each timeframe is scored on three independent binary dimensions. Each dimension contributes +1 (bullish) or -1 (bearish) to the per-timeframe Dir Score, giving a range of -3 to +3 per timeframe.

Condition Score Notes
Curve above signal line +1 The normalized Coppock is above its EMA signal. Indicates short-term momentum is positive relative to its own recent average.
Curve below signal line -1 Momentum is running below its own signal — a caution or negative read.
Lin Reg slope positive +1 The linear regression of the curve over lrLen bars is rising. The curve is trending upward regardless of its absolute level.
Lin Reg slope negative -1 The curve is trending downward over the regression window.
Curve above zero +1 The normalized Coppock is in positive territory. Zero-line crossings confirm that momentum has turned structurally positive, not just relatively.
Curve below zero -1 Momentum remains in negative structural territory even if recovering.

The per-timeframe Dir Score is then multiplied by a timeframe weight and summed into the Weighted Directional Score shown in the table.

Timeframe Weight Score Range Notes
Daily ×1 -3 to +3 Most sensitive to recent price action. Updates every bar.
Weekly ×2 -6 to +6 Intermediate trend signal. Uses last closed + current week.
Monthly ×3 -9 to +9 Structural momentum. Always uses last fully closed month via [1] indexing to match Pine Screener evaluation.
TOTAL -18 to +18 Sum of all three weighted scores. Sort descending in Pine Screener to rank by multi-timeframe alignment.

Parameters and Adjustment Consequences
All parameters are accessible via the indicator settings panel in TradingView. Changes apply immediately to all three timeframe calculations simultaneously.

Parameter Default Range Effect of Changing
ROC Min Period 8 2–30 Sets the shortest lookback in the forward-weighted ROC sweep. Lower values make the indicator more responsive to recent price changes but increase noise. Raising it slows the response and smooths the raw momentum reading.
ROC Max Period 20 3–60 Sets the longest lookback in the sweep. The spread between Min and Max determines how wide the weighting range is. A wider spread gives more weight diversity; too wide and distant history dominates.
WMA Smoothing 10 2–50 Controls how many bars of the raw weighted-ROC are smoothed before normalization. Higher values produce a smoother, slower curve with fewer whipsaws but more lag at turns. Lower values are more reactive.
Signal EMA Length 5 2–20 The EMA of the normalized curve used as the signal line. This is one of the three scoring dimensions (curve above/below signal). Shorter lengths make the signal line track closely; longer lengths create more separation and fewer crossovers.
Std Dev Length 20 5–50 The rolling window used to normalize the curve by its own standard deviation. This makes amplitude comparable across different volatility regimes and instruments. Shorter windows make normalization more reactive; longer windows produce a more stable scale.
Slope Lin Reg Length 3 2–10 The number of bars used in the linear regression slope calculation. This is one of the three scoring dimensions. 3 bars catches turns quickly but can flip on single-bar noise. 4-5 bars is more stable; anything above 6 starts lagging meaningful turns.
Slope Flat Threshold 0.10 0.01–0.5 Controls the deadband for the slope label display only (cosmetic — does not affect scoring). Values within this range show as ~0 flat in the table. Does not change any scoring dimension.
Slope Strong Threshold 0.20 0.05–1.0 Controls the label threshold between mild rise/fall and rising/falling in the slope column (cosmetic — does not affect scoring). Does not change any scoring dimension.
Table Position Middle Right 6 options Moves the table to any corner or middle position on the chart pane. No analytical effect.

Pine Screener Output Columns
The following named outputs are available in the Pine Screener for filtering and sorting:

Weighted Dir Score — primary sort column, -18 to +18, sort descending for strongest bull alignment


Known Limitations
• Monthly values use the last fully closed monthly bar ([1] indexing). This is intentional and matches Pine Screener evaluation, but means the monthly score updates once per month at month-end rather than intramonth.
• Weekly values are live (current incomplete week). A small mismatch between the chart and screener is possible mid-week as the current week's bar builds. The Daily chart view is the most accurate reference.
• The slope label (rising / mild rise / flat / mild fall / falling) is cosmetic and driven by the Slope Flat and Slope Strong thresholds. These thresholds do not affect the scoring — slope scoring uses the simple positive/negative sign of the linear regression.
• The indicator uses 3 of the Pine Screener's 5 allowed request.security calls, leaving 2 in reserve for future additions.

Recommended Workflow
This indicator is designed as a two-step process in combination with a relative strength indicator such as Mansfield RS:

Step 1 — Run Pine Screener on SP500 or Russell 1000 watchlist. Sort by Weighted Dir Score descending. Focus on scores ≥ 12 (Strong Bull)
Step 2 — For screener candidates, open the daily chart and confirm Mansfield RS is positive and trending up. CMTF measures absolute momentum alignment; Mansfield RS confirms the stock is outperforming the market.

Thông báo miễn trừ trách nhiệm

Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.