OPEN-SOURCE SCRIPT
COT Index - Commercial Positioning (Weekly)

Overview
This indicator helps futures traders identify relative Commercial Trader positioning extremes using weekly Commitment of Traders (COT) data from the CFTC.
How It Works
The script calculates Commercial Net Position each week:
Commercial Net Position = Commercial Long - Commercial Short
It then normalizes this value against its own recent history over a configurable lookback period:
COT Index = 100 * (Net Position - Lowest Net Position) / (Highest Net Position - Lowest Net Position)
This shows where current Commercial positioning stands relative to its own recent range, rather than looking at absolute long/short numbers in isolation.
The script runs its core calculation on a fixed Weekly timeframe internally, regardless of the chart timeframe it's added to — so it stays useful on daily, 4H, 1H and intraday charts while still showing correct weekly positioning context. COT data is requested with lookahead disabled, so the indicator does not repaint.
Default Settings
Lookback period: 26 weeks
Upper threshold: 75
Lower threshold: 25
Neutral midpoint: 50
All adjustable in the script's Settings.
Interpretation
A high COT Index indicates Commercial Traders are positioned relatively bullish compared to their own recent history.
A low COT Index indicates Commercial Traders are positioned relatively bearish compared to their own recent history.
Readings above the upper threshold (default 75) may indicate elevated Commercial positioning.
Readings below the lower threshold (default 25) may indicate depressed Commercial positioning.
Typical Use Cases
Identify relative Commercial positioning extremes
Add COT context to futures swing trades
Compare positioning across different futures markets
Combine COT data with seasonality, price structure, trend and market regime analysis
Support commodity research and trade planning
Limitations
COT data is weekly and delayed: the report reflects positions as of Tuesday and is usually published the following Friday. This indicator is not designed for intraday timing and is not a standalone trading system. Extreme COT readings are not automatic reversal signals. Commercial positioning can remain elevated or depressed for extended periods, especially in strong trending markets. Past positioning patterns do not guarantee future price behavior.
Symbol Support
Designed for futures and continuous futures charts. Some micro contracts, CFDs, broker-specific symbols or otherwise unsupported markets may not return valid COT data.
Originality
COT data retrieval uses the public TradingView "LibraryCOT" community library. The Commercial Net Position calculation, the lookback-based normalization into a 0-100 COT Index, the configurable thresholds, and the visualization are original to this script.
For educational and research purposes only. This is not financial advice.
This indicator helps futures traders identify relative Commercial Trader positioning extremes using weekly Commitment of Traders (COT) data from the CFTC.
How It Works
The script calculates Commercial Net Position each week:
Commercial Net Position = Commercial Long - Commercial Short
It then normalizes this value against its own recent history over a configurable lookback period:
COT Index = 100 * (Net Position - Lowest Net Position) / (Highest Net Position - Lowest Net Position)
This shows where current Commercial positioning stands relative to its own recent range, rather than looking at absolute long/short numbers in isolation.
The script runs its core calculation on a fixed Weekly timeframe internally, regardless of the chart timeframe it's added to — so it stays useful on daily, 4H, 1H and intraday charts while still showing correct weekly positioning context. COT data is requested with lookahead disabled, so the indicator does not repaint.
Default Settings
Lookback period: 26 weeks
Upper threshold: 75
Lower threshold: 25
Neutral midpoint: 50
All adjustable in the script's Settings.
Interpretation
A high COT Index indicates Commercial Traders are positioned relatively bullish compared to their own recent history.
A low COT Index indicates Commercial Traders are positioned relatively bearish compared to their own recent history.
Readings above the upper threshold (default 75) may indicate elevated Commercial positioning.
Readings below the lower threshold (default 25) may indicate depressed Commercial positioning.
Typical Use Cases
Identify relative Commercial positioning extremes
Add COT context to futures swing trades
Compare positioning across different futures markets
Combine COT data with seasonality, price structure, trend and market regime analysis
Support commodity research and trade planning
Limitations
COT data is weekly and delayed: the report reflects positions as of Tuesday and is usually published the following Friday. This indicator is not designed for intraday timing and is not a standalone trading system. Extreme COT readings are not automatic reversal signals. Commercial positioning can remain elevated or depressed for extended periods, especially in strong trending markets. Past positioning patterns do not guarantee future price behavior.
Symbol Support
Designed for futures and continuous futures charts. Some micro contracts, CFDs, broker-specific symbols or otherwise unsupported markets may not return valid COT data.
Originality
COT data retrieval uses the public TradingView "LibraryCOT" community library. The Commercial Net Position calculation, the lookback-based normalization into a 0-100 COT Index, the configurable thresholds, and the visualization are original to this script.
For educational and research purposes only. This is not financial advice.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.