COT Week BoxCOT Week Box — visualize weekly positioning shifts from the CFTC Commitments of Traders report directly on your price chart.
═══════════════════════════════════════
WHAT IT DOES
═══════════════════════════════════════
Every week on Friday, the CFTC publishes updated positioning data reflecting what traders did between the previous Wednesday and Tuesday. This indicator takes that weekly change in net positioning and draws a colored rectangle spanning exactly that Wed→Tue price window on your chart.
The result: you can instantly see which weeks had unusually large positioning shifts, what the price did during those weeks, and which side of the market was driving the flow.
═══════════════════════════════════════
HOW TO READ THE COLORS
═══════════════════════════════════════
GREEN — Net positioning increased. Traders added more longs than shorts on balance.
RED — Net positioning decreased. Traders added more shorts than longs on balance.
YELLOW — Net positioning increased, but the move was driven mostly by shorts covering (closing losing positions) rather than fresh buying. Often a sign of short squeeze dynamics.
BLUE — Net positioning decreased, but the move was driven mostly by longs liquidating (closing winning or losing positions) rather than fresh shorting. Often a sign of profit-taking or capitulation.
The opacity of each box scales with how extreme the week was: faint boxes are borderline, bold boxes are true outliers.
═══════════════════════════════════════
INPUTS
═══════════════════════════════════════
Group — choose which participant group to analyze: Commercials (hedgers), Non-Commercials (large speculators / funds), Non-Reportables (small traders), or All (sum of all groups).
Weekly move threshold (%) — only draw boxes for weeks where the absolute change in net positioning ranks above this percentile. Default 85 shows the top 15% of weeks. Increase to 95 or 99 to isolate only the most extreme weeks.
Reduction dominance threshold (%) — controls when BLUE/YELLOW colors trigger instead of RED/GREEN. Higher values require cleaner one-sided flow to flag a reduction-dominated week.
Lookback (weeks) — historical window for percentile calculation. Default 156 weeks (≈ 3 years).
═══════════════════════════════════════
SUPPORTED INSTRUMENTS
═══════════════════════════════════════
The indicator automatically maps the chart symbol to the correct CFTC report code. Supported markets include:
Metals: Gold, Silver, Copper, Platinum, Palladium
Energy: WTI Crude, Brent, Natural Gas, RBOB Gasoline, Heating Oil
FX: DXY, EUR, GBP, JPY, CAD, AUD, NZD, CHF, MXN
Indices: S&P 500, Nasdaq 100, Dow, Russell 2000, VIX
Softs: Coffee, Cocoa, Sugar, Cotton, Orange Juice
Grains: Corn, Wheat, Soybeans, Soybean Meal, Soybean Oil, Oats, Rough Rice
Meats: Live Cattle, Feeder Cattle, Lean Hogs
Works on the daily (D1) timeframe only.
═══════════════════════════════════════
USAGE TIPS
═══════════════════════════════════════
Settings -> pin to scale -> pin to right scale (may be needed if rectangles aren't bind to candles)
Start with Group = "Commercial" on commodity charts — commercial hedgers often signal turning points when their positioning reaches extremes.
On index futures and FX, try Group = "Non-Commercial" to follow large speculator flow.
A cluster of BLUE boxes near a price high, or YELLOW boxes near a price low, can indicate exhaustion of the dominant side.
Combine with your existing technical analysis — COT data works best as a confirmation tool, not a standalone signal.
═══════════════════════════════════════
NOTES
═══════════════════════════════════════
Data source: CFTC Legacy report, futures-only.
Boxes are drawn after the Friday release, covering the prior Wed→Tue reporting week.
The indicator requires a full week of bars (Wed through Tue) to draw a box.
If your instrument isn't in the supported list, the indicator will display "Instrument not mapped" — a premium version with manual CFTC code override is available separately.
مؤشر Pine Script®






















