OPEN-SOURCE SCRIPT
업데이트됨 COT Index

Reference:
Trade Stocks and Commodities with the Insiders
Secrets of the COT Report by Larry Williams pg34
The equation is as below:
Current week's value- Lowest value of last three years
---------------------------------------------------------------------------- X 100%
Highest high of last three years-Lowest low of last three years
According to Larry Williams, traders should follow commercials direction. When the commercial index line (yellow line) is above 80, this indicates commercials are bullish. Hence, traders can look for potential buy setup. Conversely, when commercials index line (yellow line) is below 20, this indicates commercials are bearish, we can look for sell setup.
Do note that this is only applicable on Weekly chart as COT reports come out on weekly basis.
Modification from the original COT index from Larry Williams:
1) I've added 1year and 6months period, so traders maybe can look for pullback using shorter period. By default, Larry Williams uses 3 years Commercial index.
2) I've added non-commercials and retail traders index, they basically trade opposite way of commercials.
This indicator should not be used as a timing tool or entry tool, you can use it as your weekly or monthly bias tool. For more information, please read the books. Feel free to modify the code, if u have a better version of this, you may share to me if you want, I will be very grateful!
Trade Stocks and Commodities with the Insiders
Secrets of the COT Report by Larry Williams pg34
The equation is as below:
Current week's value- Lowest value of last three years
---------------------------------------------------------------------------- X 100%
Highest high of last three years-Lowest low of last three years
According to Larry Williams, traders should follow commercials direction. When the commercial index line (yellow line) is above 80, this indicates commercials are bullish. Hence, traders can look for potential buy setup. Conversely, when commercials index line (yellow line) is below 20, this indicates commercials are bearish, we can look for sell setup.
Do note that this is only applicable on Weekly chart as COT reports come out on weekly basis.
Modification from the original COT index from Larry Williams:
1) I've added 1year and 6months period, so traders maybe can look for pullback using shorter period. By default, Larry Williams uses 3 years Commercial index.
2) I've added non-commercials and retail traders index, they basically trade opposite way of commercials.
This indicator should not be used as a timing tool or entry tool, you can use it as your weekly or monthly bias tool. For more information, please read the books. Feel free to modify the code, if u have a better version of this, you may share to me if you want, I will be very grateful!
릴리즈 노트
Now available more futures chart릴리즈 노트
# COT Index Indicator - Update Notes## Version 2.0 - Bug Fixes & Data Consistency Improvements
### Bug Fixes
- Fixed syntax error: "end of line without line continuation" in multi-line string concatenation
- Resolved indentation issues with Pine Script line continuation rules
- Corrected data inconsistencies from automatic CFTC code detection
### Major Changes
- **Manual CFTC Code Mapping**: Switched from automatic detection to manual mapping to ensure data accuracy and consistency
- **Verification Table**: Added optional data table showing current week's Commercial Long, Short, and Net Position values
- **CFTC Code Display**: Table now shows which CFTC code is being used for transparency
### Supported Symbols
Please use **ONLY** the official CME/COMEX/CBOT/NYMEX futures symbols listed below:
#### **Metals** (COMEX)
- `GC` - Gold
- `SI` - Silver
- `HG` - Copper
- `PL` - Platinum
- `PA` - Palladium
#### **Energy** (NYMEX)
- `CL` - Crude Oil WTI
- `NG` - Natural Gas
- `RB` - RBOB Gasoline
- `HO` - Heating Oil
#### **Equity Indices** (CME)
- `ES` - E-mini S&P 500
- `NQ` - E-mini NASDAQ-100
- `YM` - E-mini Dow Jones
- `RTY` - E-mini Russell 2000
- `NIY` / `NKD` - Nikkei 225
#### **Currencies** (CME)
- `6E` - Euro FX
- `6B` - British Pound
- `6J` - Japanese Yen
- `6A` - Australian Dollar
- `6C` - Canadian Dollar
- `6S` - Swiss Franc
- `6N` - New Zealand Dollar
- `6M` - Mexican Peso
- `DX` - U.S. Dollar Index
*Note: Spot forex pairs (EURUSD, GBPUSD, etc.) are supported and will automatically map to their futures equivalents*
#### **Grains** (CBOT)
- `ZC` - Corn
- `ZS` - Soybeans
- `ZW` - Wheat
- `ZL` - Soybean Oil
- `ZM` - Soybean Meal
#### **Softs** (ICE/CME)
- `KC` - Coffee
- `SB` - Sugar #11
- `CT` - Cotton
- `CC` - Cocoa
- `LBR` - Lumber
#### **Livestock** (CME)
- `LE` - Live Cattle
- `HE` - Lean Hogs
- `GF` - Feeder Cattle
#### **Treasuries** (CBOT)
- `ZB` - 30-Year T-Bond
- `ZN` - 10-Year T-Note
- `ZF` - 5-Year T-Note
- `ZT` - 2-Year T-Note
#### **Crypto** (CME)
- `BTC` - Bitcoin Futures
- `ETH` - Ethereum Futures
### 📡 Data Provider
**CFTC (Commodity Futures Trading Commission)** via TradingView's LibraryCOT/4
- Data updates: Weekly (Fridays after market close)
- Report type: Legacy COT Reports
- Coverage: Futures Only or Futures + Options (user selectable)
### New Settings
- `Show Verification Table` - Toggle to display current week data summary
### Important Notes
1. **Use official futures symbols only** - Using other symbol formats may result in errors
2. COT data is updated weekly and reflects positions as of Tuesday, published Friday
3. If you encounter "Symbol not supported" error, please verify you're using the correct futures symbol from the list above
4. The verification table shows the CFTC code being used - helpful for troubleshooting
---
**Data Source**: U.S. Commodity Futures Trading Commission (CFTC)
**Powered by**: TradingView LibraryCOT/4
**Inspiration**: Larry Williams' COT methodology
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.