OPEN-SOURCE SCRIPT
COT Pulse Cloud Trend

COT Pulse Cloud Trend — Script Description
What it does
COT Cloud plots a translucent price cloud whose color and intensity reflect CFTC Commitment of Traders positioning for the chart's own market — large speculators (Non-Commercial) and/or hedgers (Commercial). It auto-detects the market from the chart symbol and pulls the matching weekly CFTC data automatically; no per-chart setup needed for covered markets.
Data source
Pulls straight from TradingView's own CFTC feed via request.security() — the Legacy report's Non-Commercial/Commercial Long and Short symbols (<code>_F_NCP_L/S, <code>_F_CP_L/S), no exchange prefix. This is the same report definition (noncomm_positions_long_all, comm_positions_long_all, etc.) used by CFTC's own Socrata dataset, so it lines up with the official weekly COT report.
Auto-detection
Reads syminfo.basecurrency/syminfo.currency/syminfo.root to identify the market and looks up its CFTC contract code. Covered: EUR, GBP, JPY, AUD, NZD, CAD, CHF; Gold, Silver, Copper, Palladium, Platinum; Wheat, Cotton, Corn, Soybeans, Sugar, Coffee, Cocoa, Live Cattle; WTI Crude Oil, Natural Gas; 2-Year and 10-Year Treasury Notes; Nikkei 225, S&P 500, Nasdaq-100, Dow, Russell 2000, VIX, US Dollar Index, Bitcoin. For USDCAD/USDCHF/USDJPY-style charts (USD as the base currency) and the corresponding CAD/CHF/JPY futures, long and short are swapped so a positive net always means "bullish USD" — CFTC quotes those three the other way round.
If the chart's market isn't in this table, the script does not silently fall back to whatever is in the manual-symbol fields (that would plot a different market's COT data without warning) — it shows a gray "no COT match" label instead. Turn auto-detect off and enter symbols manually to use it on an uncovered market.
Position (what feeds the cloud)
Non-Commercial — large speculators' net (Long − Short)
Commercial — hedgers' net
Difference — Non-Commercial net minus Commercial net
Color by (how it's colored)
Auto (default) — picks the mode a backtest found works best per market: Absolute for Gold, Trend everywhere else, Excel for Difference.
Excel — a 3-point color scale anchored at [min, 50th percentile, max] of the value over a configurable history window: red at the low anchor, white at the median, green at the high anchor, plus a sign-colored border.
Trend — white at the position's own 13-week average, fading to green (more long than usual) or red (more short than usual) with distance from it; blue when both legs are below their own 13-week average ("cooling" interest on both sides).
Absolute — %Long of the current week's total (Long + Short).
Relative — where net positioning sits within its own trailing lookback window (0–100 percentile).
Extreme-reading marker
A small orange triangle appears below the cloud, plus an alert condition, whenever the active reading is in the top or bottom 20% of its scale. A backtest (COT signal vs. forward price return, 1/4/13/26 weeks ahead, across five markets back to 2007) found this is where the spread between the best- and worst-performing readings was consistently widest — i.e. where whatever edge COT positioning carries actually concentrates. It flags "pay attention," not a direction: the same extreme reading preceded further trend continuation in Gold/EUR but reversals in GBP/S&P 500, so read it in the context of the specific market, not as a universal buy/sell signal.
Honest limitations
The backtest behind Auto mode and the extreme marker covered 5 of the many markets this script auto-detects (EUR, GBP, USDJPY, Gold, S&P 500), not all of them — treat the defaults as a reasonable starting point, not a validated rule for every market.
Even where tested, the edge was weak (correlation ~0.1–0.25, hit rate ~50–62%) and only showed up at 13–26 week horizons; a single week's change in positioning carried essentially no signal.
CFTC codes beyond EUR and Gold's Non-Commercial/Commercial symbols were cross-checked across public sources but not individually re-verified live on TradingView — if a market's cloud looks off, search <code>_F_N in TradingView's symbol search to confirm.
This is a slow, structural positioning indicator meant to add context to other analysis — not a standalone timing signal.
What it does
COT Cloud plots a translucent price cloud whose color and intensity reflect CFTC Commitment of Traders positioning for the chart's own market — large speculators (Non-Commercial) and/or hedgers (Commercial). It auto-detects the market from the chart symbol and pulls the matching weekly CFTC data automatically; no per-chart setup needed for covered markets.
Data source
Pulls straight from TradingView's own CFTC feed via request.security() — the Legacy report's Non-Commercial/Commercial Long and Short symbols (<code>_F_NCP_L/S, <code>_F_CP_L/S), no exchange prefix. This is the same report definition (noncomm_positions_long_all, comm_positions_long_all, etc.) used by CFTC's own Socrata dataset, so it lines up with the official weekly COT report.
Auto-detection
Reads syminfo.basecurrency/syminfo.currency/syminfo.root to identify the market and looks up its CFTC contract code. Covered: EUR, GBP, JPY, AUD, NZD, CAD, CHF; Gold, Silver, Copper, Palladium, Platinum; Wheat, Cotton, Corn, Soybeans, Sugar, Coffee, Cocoa, Live Cattle; WTI Crude Oil, Natural Gas; 2-Year and 10-Year Treasury Notes; Nikkei 225, S&P 500, Nasdaq-100, Dow, Russell 2000, VIX, US Dollar Index, Bitcoin. For USDCAD/USDCHF/USDJPY-style charts (USD as the base currency) and the corresponding CAD/CHF/JPY futures, long and short are swapped so a positive net always means "bullish USD" — CFTC quotes those three the other way round.
If the chart's market isn't in this table, the script does not silently fall back to whatever is in the manual-symbol fields (that would plot a different market's COT data without warning) — it shows a gray "no COT match" label instead. Turn auto-detect off and enter symbols manually to use it on an uncovered market.
Position (what feeds the cloud)
Non-Commercial — large speculators' net (Long − Short)
Commercial — hedgers' net
Difference — Non-Commercial net minus Commercial net
Color by (how it's colored)
Auto (default) — picks the mode a backtest found works best per market: Absolute for Gold, Trend everywhere else, Excel for Difference.
Excel — a 3-point color scale anchored at [min, 50th percentile, max] of the value over a configurable history window: red at the low anchor, white at the median, green at the high anchor, plus a sign-colored border.
Trend — white at the position's own 13-week average, fading to green (more long than usual) or red (more short than usual) with distance from it; blue when both legs are below their own 13-week average ("cooling" interest on both sides).
Absolute — %Long of the current week's total (Long + Short).
Relative — where net positioning sits within its own trailing lookback window (0–100 percentile).
Extreme-reading marker
A small orange triangle appears below the cloud, plus an alert condition, whenever the active reading is in the top or bottom 20% of its scale. A backtest (COT signal vs. forward price return, 1/4/13/26 weeks ahead, across five markets back to 2007) found this is where the spread between the best- and worst-performing readings was consistently widest — i.e. where whatever edge COT positioning carries actually concentrates. It flags "pay attention," not a direction: the same extreme reading preceded further trend continuation in Gold/EUR but reversals in GBP/S&P 500, so read it in the context of the specific market, not as a universal buy/sell signal.
Honest limitations
The backtest behind Auto mode and the extreme marker covered 5 of the many markets this script auto-detects (EUR, GBP, USDJPY, Gold, S&P 500), not all of them — treat the defaults as a reasonable starting point, not a validated rule for every market.
Even where tested, the edge was weak (correlation ~0.1–0.25, hit rate ~50–62%) and only showed up at 13–26 week horizons; a single week's change in positioning carried essentially no signal.
CFTC codes beyond EUR and Gold's Non-Commercial/Commercial symbols were cross-checked across public sources but not individually re-verified live on TradingView — if a market's cloud looks off, search <code>_F_N in TradingView's symbol search to confirm.
This is a slow, structural positioning indicator meant to add context to other analysis — not a standalone timing signal.
Скрипт с открытым кодом
В истинном духе TradingView, создатель этого скрипта сделал его открытым исходным кодом, чтобы трейдеры могли проверить и убедиться в его функциональности. Браво автору! Вы можете использовать его бесплатно, но помните, что перепубликация кода подчиняется нашим Правилам поведения.
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.
Скрипт с открытым кодом
В истинном духе TradingView, создатель этого скрипта сделал его открытым исходным кодом, чтобы трейдеры могли проверить и убедиться в его функциональности. Браво автору! Вы можете использовать его бесплатно, но помните, что перепубликация кода подчиняется нашим Правилам поведения.
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.