FXN1 COT Net Positions + OscillatorThe FXN1 COT Net Positions Oscillator is a versatile tool designed for traders to analyze Commitment of Traders (COT) data with both raw net positions and oscillator-style visualization. This script allows users to visualize the net positions of Commercials, Large Speculators, and Retailers Small Speculators to identify potential market turning points or trends based on the positioning of different market participants.
Key Features:
1. Customizable Time Frame:
The script allows users to select the number of months (6 months, 12 months, 18 months, or 24 months) for calculating the COT net positions. This flexibility helps in analyzing longer or shorter-term trends in the market.
2. Oscillator and Raw Net Positions View:
- Users can choose to view the net positions as a normalized oscillator (scaled between 0 and 100) or as raw net positions. The oscillator view helps to identify overbought and oversold conditions, while the raw view provides direct insights into the net positioning of each group.
- The oscillator is created using a stochastic-like normalization, where the net position is plotted relative to its high/low over the selected time period.
3. Toggle Between Oscillator and Raw Data:
- A simple input toggle allows users to switch between the oscillator and raw net positions view with ease.
- In oscillator mode, overbought and oversold levels are displayed to help identify potential reversal points in the market.
4. Clear Visualization:
- Commercials Net: Shown in blue, representing the positions of commercial traders (hedgers).
- Large Speculators Net: Shown in red, indicating the positions of large institutional traders (fund managers).
- Retailers Small Speculators Net: Shown in yellow, representing the positions of small retail traders.
- Overbought and oversold levels in oscillator mode are customizable, allowing for more flexible trading signals.
5. Overbought and Oversold Levels:
- In oscillator mode, the script includes customizable overbought and oversold levels, making it easier to spot extreme conditions that may signal a market reversal.
- These levels are hidden when the raw net position view is active, offering a clean and clear visualization.
6. Works Across Multiple Markets:
The script is designed to work with a wide variety of futures markets, adapting to different symbols with automatic COT data adjustments based on the root symbol.
How It Works:
COT Data Sources: The script pulls commercial, large speculator, and small speculator data from the Legacy COT report.
Net Positions: It calculates the net long positions by subtracting the short positions from the long positions for each group.
Oscillator Mode: The net positions are normalized to oscillate between 0 and 100, where 100 represents the most extreme net long position and 0 represents the most extreme net short position over the selected time period.
Raw Mode: The net positions are plotted directly, providing the actual number of net positions held by each group without normalization.
Use Cases:
Trend Identification: Analyze the positioning of commercial traders (hedgers) vs. large speculators (fund managers) and retail traders to identify potential trend reversals or continuations.
Reversal Signals: In oscillator mode, overbought and oversold conditions can provide potential signals for market reversals.
Sentiment Analysis: Gauge market sentiment by comparing the positions of different market participants and using the insights to build contrarian strategies or confirm trend-following strategies.
Parameters:
Number of Months: Choose between 6, 12, 18, and 24 months for the calculation period.
Overbought Level: Customizable level to define when the market may be considered overbought in oscillator mode (default: 80).
Oversold Level: Customizable level to define when the market may be considered oversold in oscillator mode (default: 20).
Show Net Positions as Oscillator: Toggle to switch between raw net positions and oscillator view.
This script is a powerful tool for traders who want to incorporate COT data into their analysis in a more flexible and customizable way. Whether you're a swing trader looking for reversal points or a trend follower analyzing market sentiment, the FXN1 COT Net Positions Oscillator provides deep insights into the behavior of different market participants.
Commitmentsoftraders
CoT artificial by Oster and Freundl (CoF)Overview:
CoF , short for "CoT artificial by Oster and Freundl", presents a novel approach to market analysis, inspired by the traditional Commitments of Traders (CoT) Index . Based on the artificial CoT calculation according to Freundl and Oster (explained below), this indicator provides traders with a versatile tool applicable across various markets, including individual stocks. Unlike its predecessor, CoF offers flexibility in its application, accommodating traders with different investment horizons, whether they operate on weekly, daily, hourly, or even minute candlesticks. By adjusting the period length in the settings, users can fine-tune the sensitivity of CoF to capture buy or sell signals, albeit with differing signal qualities. Additionally, CoF is equipped with alert functionalities, enhancing its usability for traders seeking timely market insights.
Sophisticated Calculation Methodology:
CoF derives its insights from a sophisticated calculation methodology, leveraging price range and price movement metrics to assess market dynamics. The indicator computes the ratio between the moving averages of price movement and price range over a specified period. This ratio, once normalized and scaled to a 0-100 range , provides traders with a quantifiable measure of market sentiment. Notably, CoF's calculation method, while nuanced, ensures accessibility and usability for traders seeking actionable insights without delving into complex mathematical formulations.
Interpretation:
CoF-Index, represented on the chart, offers traders insights into market sentiment dynamics . Values below the sell threshold indicate potential selling pressure, triggering sell alerts to alert traders to potential downturns. Conversely, values exceeding the buy threshold signal buying opportunities, prompting buy alerts for traders to capitalize on potential market upswings. By aligning these interpretations with the trader's investment strategy, CoF aids in decision-making processes, offering nuanced perspectives on market movements.
Dynamic Color Coding for Visual Clarity:
To enhance user experience and facilitate quick decision-making, CoF incorporates dynamic color coding . Market conditions favoring selling are denoted by red hues, while those conducive to buying are highlighted in green. Neutral conditions, indicative of balanced market sentiment, are represented in neutral colors. This intuitive visual feedback enables traders to swiftly identify market opportunities and risks, empowering them to make informed trading decisions.
Customizable Parameters for Tailored Analysis:
Acknowledging the diverse trading preferences and strategies of its users, CoF offers customizable parameters . Traders can adjust the period length to fine-tune the indicator's sensitivity to their desired level, balancing the frequency and quality of signals according to their trading objectives. Additionally, CoF's alert functionalities allow traders to set personalized thresholds, aligning with their risk tolerance and market outlook.
Conclusion:
In conclusion, CoF emerges as a valuable addition to the trader's toolkit, offering a versatile and accessible approach to market analysis. Built upon a foundation of sophisticated calculation methodologies, CoF provides traders with actionable insights into market sentiment across various timeframes and asset classes . Its intuitive visualizations, coupled with customizable parameters and alert functionalities, empower traders to navigate dynamic market conditions with confidence. Importantly, the CoF index offers traders the flexibility to employ a synthetically calculated method, inspired by the classic CoT-Index, regardless of market or investment horizon . Whether you're a seasoned investor or a novice trader, CoF equips you with the tools needed to stay ahead in today's competitive markets.
Commitments of Traders Report [Advanced]This indicator displays the Commitment of Traders (COT) report data in a clear, table format similar to an Excel spreadsheet, with additional functionalities to analyze open interest and position changes. The COT report, published weekly by the Commodity Futures Trading Commission (CFTC), provides valuable insights into market sentiment by revealing the positioning of various trader categories.
Display:
Release Date: When the data was released.
Open Interest: Shows the total number of open contracts for the underlying instrument held by selected trader category.
Net Contracts: Shows the difference between long and short positions for selected trader category.
Long/Short OI: Displays the long and short positions held by selected trader category.
Change in Long/Short OI: Displays the change in long and short positions since the previous reporting period. This can highlight buying or selling pressure.
Long & Short Percentage: Displays the percentage of total long and short positions held by each category.
Trader Categories (Configurable)
Commercials: Hedgers who use futures contracts to manage risk associated with their underlying business (e.g., producers, consumers).
Non-Commercials (Large Speculators): Speculative traders with large positions who aim to profit from price movements (e.g., hedge funds, investment banks).
Non-Reportable (Small Speculators/Retail Traders): Smaller traders with positions below the CFTC reporting thresholds.
CFTC Code: If the indicator fails to retrieve data, you can manually enter the CFTC code for the specific instrument. The code for instrument can be found on CFTC's website.
Using the Indicator Effectively
Market Sentiment Gauge: Analyze the positioning of each trader category to gauge overall market sentiment.
High net longs by commercials might indicate a bullish outlook, while high net shorts could suggest bearish sentiment.
Changes in open interest and long/short positions can provide additional insights into buying and selling pressure.
Trend Confirmation: Don't rely solely on COT data for trade signals. Use it alongside price action and other technical indicators for confirmation.
Identify Potential Turning Points: Extreme readings in COT data, combined with significant changes in open interest or positioning, might precede trend reversals, but exercise caution and combine with other analysis tools.
Disclaimer
Remember, the COT report is just one piece of the puzzle. It should not be used for making isolated trading decisions. Consider incorporating it into a comprehensive trading strategy that factors in other technical and fundamental analysis.
Credit
A big shoutout to Nick from Transparent FX ! His expertise and thoughtful analysis have been a major inspiration in developing this COT Report indicator. To know more about this indicator and how to use it, be sure to check out his work.
SFC True COT ReportsThe Commodity Futures Trading Commission (Commission or CFTC) publishes the Commitments of Traders ( COT ) reports to help the public understand market dynamics. Specifically, the COT reports provide a breakdown of each Tuesday’s open interest for futures and options on futures markets in which 20 or more traders hold positions equal to or above the reporting levels established by the CFTC.
This indicator can display three similar, but also very different calculations:
- Net positions of the leveraged/managed Money
- COT Index
- COT True Index
Net Positions
The COT report is not a timing instrument. It shows us markets in which the trend remains stable OR where there could be a change in trend. But it does not give us clear information as to *WHEN* an entry into the market should take place.
Net positions are showing if the professional traders have bullish or bearish bias.
COT Index
After calculating the net positions, we are already one step further, but have not yet reached our goal. The net position itself does not tell us anything about how the commercials have actually positioned themselves. If we only know that the commercials are 15,782 contracts short this week, that does not help us much.
We need an indicator that lets us evaluate this figure. And we get it by relating the current position to the positions over a certain period. So, an index is calculated, that allows us to evaluate the current position as a percentage.
COT True Index
COT Index can give us very good idea how bullish or bearish are the professional traders, but it is limit to 0% and 100%. In this case an additional calculation is needed in order to remove this limitation and show us the true bias.
How to use the true index:
1) If the curve is below zero line means that the traders officially changed the bias from bullish to bearish . Before that we can consider that they are still bullish and price is retracing or consolidation, and vice versa
2) We can also measure the strength of the bias. For example if the curve is below zero line, but only few precent, we may consider that the bias is changing but it is still weak bearish bias.
3) We can use the chart to see where are the peaks and troughs. They are using as support and resistance and we can expect a general chance at these levels.
Supported pairs:
'XAUUSD' , 'XAGUSD' , 'COPPER' , 'PLATINUM' 'PALLADIUM';
'AUDUSD' ,'USDCAD' , 'GBPUSD' , 'EURUSD' , 'USDJPY' , 'DXY';
'US30USD' ,'SPX500USD' , 'NAS100USD';
'US02Y' , 'US05Y' , 'US10Y'
'BTCUSD'
Note: The curve of the US Yields is inverted, because actually shows the Bond market and not the Yields. This is not a problem, because Yields have perfect negative correlations with Bonds.
The indicator works only on weekly time frame.
COT Report IndicatorA COT Report Indicator that shows the Data for both currencies (base- and quotecurrency). It works in the forex market and on the Bitcoin Chart.
The table shows the Net-Contracts, Long and Short Percentage of the latest report. The line chart shows if the Commercials, Institutionals and Retail Traders are more long biased (value above 50) or more short biased (value below 50).
The COT Report is only published weekly. This should not be used as an entry indicator, but can help to find market bottoms/top and the trend of the market.
Commitment of Traders: Legacy Metrics█ OVERVIEW
This indicator displays the Commitment of Traders (COT) legacy data for futures markets.
█ CONCEPTS
Commitment of Traders (COT) data is tallied by the Commodity Futures Trading Commission (CFTC) , a US federal agency that oversees the trading of derivative markets such as futures in the US. It is weekly data that provides traders with information about open interest for an asset. The CFTC oversees derivative markets traded on different exchanges, so COT data is available for assets that can be traded on CBOT, CME, NYMEX, COMEX, and ICEUS.
A detailed description of the COT report can be found on the CFTC's website .
COT data is separated into three notable reports: Legacy, Disaggregated, and Financial. This indicator presents data from the legacy report, which is broken down by exchange. Legacy reports break down the reportable open interest positions into two classifications: non-commercial and commercial traders.
Our other COT indicators are:
• Commitment of Traders: Disaggregated Metrics
• Commitment of Traders: Financial Metrics
• Commitment of Traders: Total
█ HOW TO USE IT
Load the indicator on an active chart (see here if you don't know how).
By default, the indicator uses the chart's symbol to derive the COT data it displays. You can also specify a CFTC code in the "CFTC code" field of the script's inputs to display COT data from a symbol different than the chart's.
The rest of this section documents the script's input fields.
Metric
Each metric represents a different column of the Commitment of Traders report. Details are available in the explanatory notes on the CFTC's website .
Here is a summary of the metrics:
• "Open Interest" is the total of all futures and/or option contracts entered into and not yet offset by a transaction, by delivery, by exercise, etc.
The aggregate of all long open interest is equal to the aggregate of all short open interest.
• "Traders Total" is the number of all unique reportable traders, regardless of the trading direction.
• "Traders Total Reportable/Traders Noncommercial/Traders Commercial" are the quantities of traders reported to hold any position with the specified direction.
All of a trader's reported futures positions in a commodity are classified as commercial if the trader uses futures contracts in that particular commodity for hedging.
To determine the total number of reportable traders in a market, a trader is counted only once, whether or not the trader appears in more than one category.
• "Total Reportable/Noncommercial/Commercial Positions" are all positions held by all reportable/non-commercial/commercial traders.
• "Non-reportable Positions" is derived by subtracting total long and short "Reportable Positions" from the total open interest.
Accordingly, the number of traders involved and the commercial/non-commercial classification of each trader are unknown.
• "Concentration Gross/Net LT 4/8 TDR" is the percentage of open interest held by 4/8 of the largest traders, by gross/net positions,
without regard to whether they are classified as commercial or non-commercial. The Net position ratios are computed after offsetting each trader’s equal long and short positions.
A reportable trader with relatively large, balanced long and short positions in a single market, therefore,
may be among the four and eight largest traders in both the gross long and gross short categories, but will probably not be included among the four and eight largest traders on a net basis.
Direction
Each metric is available for a particular set of directions. Valid directions for each metric are specified with its name in the "Metric" field's dropdown menu.
Type
Possible values are: All, Old, Other. When commodities have a well-defined marketing season or crop year (e.g. Wheat or Lean Hogs futures), this determines how the data is aggregated. Detailed explanation can be found in the "Old and Other Futures" section of the CTFC Explanatory Notes linked above. The "Major Markets for Which the COT Data Is Shown by Crop Year" table in the Explanatory Notes specifies the commodities that this distinction applies to; selecting "Old" for any of the commodities not in that list will return the same data as in "All", while selecting "Other" will return 0.
COT Selection Mode
This field's value determines how the script determines which COT data to return from the chart's symbol:
- "Root" uses the root of a futures symbol ("ES" for "ESH2020").
- "Base currency" uses the base currency in a forex pair ("EUR" for "EURUSD").
- "Currency" uses the quote currency, i.e., the currency the symbol is traded in ("JPY" for "TSE:9984" or "USDJPY").
- "Auto" tries all modes, in turn.
If no COT data can be found, a runtime error is generated.
Note that if the "CTFC Code" input field contains a code, it will override this input.
Futures/Options
Specifies the type of Commitment of Traders data to display: data concerning only Futures, only Options, or both.
CTFC Code
Instead of letting the script generate the CFTC COT code from the chart and the "COT Selection Mode" input when this field is empty, you can specify an unrelated CFTC COT code here, e.g., 001602 for wheat futures.
Look first. Then leap.
Commitment of Traders: Disaggregated Metrics█ OVERVIEW
This indicator displays the Commitment of Traders (COT) Disaggregated data for futures markets.
█ CONCEPTS
Commitment of Traders (COT) data is tallied by the Commodity Futures Trading Commission (CFTC) , a US federal agency that oversees the trading of derivative markets such as futures in the US. It is weekly data that provides traders with information about open interest for an asset. The CFTC oversees derivative markets traded on different exchanges, so COT data is available for assets that can be traded on CBOT, CME, NYMEX, COMEX, and ICEUS.
A detailed description of the COT report can be found on the CFTC's website .
COT data is separated into three notable reports: Legacy, Disaggregated, and Financial. This indicator presents data from the Disaggregated report. The disaggregated reports are broken down by agriculture, petroleum and products, natural gas and products, electricity and metals and other physical contracts. The Disaggregated reports break down the reportable open interest positions into four classifications: Producer/Merchant/Processor/User, Swap Dealers, Managed Money, and Other Reportables.
Our other COT indicators are:
• Commitment of Traders: Legacy Metrics
• Commitment of Traders: Financial Metrics
• Commitment of Traders: Total
█ HOW TO USE IT
Load the indicator on an active chart (see here if you don't know how).
By default, the indicator uses the chart's symbol to derive the COT data it displays. You can also specify a CFTC code in the "CFTC code" field of the script's inputs to display COT data from a symbol different than the chart's.
The rest of this section documents the script's input fields.
Metric
Each metric represents a different column of the Commitment of Traders report. Details are available in the explanatory notes on the CFTC's website .
Here is a summary of the metrics:
• "Open Interest" is the total of all futures and/or option contracts entered into and not yet offset by a transaction, by delivery, by exercise, etc.
The aggregate of all long open interest is equal to the aggregate of all short open interest.
• "Traders Total" is the quantity of all unique reportable traders, regardless of the trading direction.
• "Traders Producer Merchant" is the number of traders classified as a "producer/merchant/processor/user" reported holding any position with the specified direction.
A "producer/merchant/processor/user" is an entity that predominantly engages in the production, processing, packing or handling of a physical commodity and
uses the futures markets to manage or hedge risks associated with those activities.
• "Traders Swap" is the number of traders classified as "swap dealers" reported holding any position with the specified direction.
A "swap dealer" is an entity that deals primarily in swaps for a commodity and uses the futures markets to manage or hedge the risk associated with those swaps transactions.
The swap dealer’s counterparties may be speculative traders, like hedge funds, or traditional commercial clients that are managing risk arising from their dealings in the physical commodity.
• "Traders Managed Money" is the number of traders classified as "money managers" reported holding any position with the specified direction.
A "money manager" is a registered trader that is engaged in managing and conducting organized futures trading on behalf of clients.
• "Traders Other Reportable" is the number of reportable traders that are not placed in any of the three categories specified above.
• "Traders Total Reportable" is the number of traders reported holding any position with the specified direction.
To determine the total number of reportable traders in a market, a trader is counted only once whether or not the trader appears in more than one category.
As a result, the sum of the numbers of traders in each separate category typically exceeds the total number of reportable traders.
• "Producer Merchant/Swap/Managed Money/Total Reportable/Other Reportable Positions" is all positions held by the traders of the specified category.
• "Nonreportable Positions" is the long and short open interest derived by subtracting the total long and short reportable positions from the total open interest.
Accordingly, the number of traders involved and the classification of each trader are unknown.
• "Concentration Gross/Net LE 4/8 TDR" is the percentage of open interest held by 4/8 of the largest traders (entities), by Gross/Net positions, without regard to how they are classified.
The Net position ratios are computed after offsetting each trader’s equal long and short positions.
A reportable trader with relatively large, balanced long and short positions in a single market,
therefore, may be among the four and eight largest traders in both the gross long and gross short categories,
but will probably not be included among the four and eight largest traders on a net basis.
Direction
Each metric is available for a particular set of directions. Valid directions for each metric are specified with its name in the "Metric" field's dropdown menu.
Type
Possible values are: All, Old, Other. When commodities have a well-defined marketing season or crop year (e.g. Wheat or Lean Hogs futures), this determines how the data is aggregated. Detailed explanation can be found in the "Old and Other Futures" section of the CTFC Explanatory Notes linked above. The "Major Markets for Which the COT Data Is Shown by Crop Year" table in the Explanatory Notes specifies the commodities that this distinction applies to; selecting "Old" for any of the commodities not in that list will return the same data as in "All", while selecting "Other" will return 0.
Futures/Options
Specifies the type of Commitment of Traders data to display: data concerning only Futures, only Options, or both.
CTFC Code
Instead of letting the script generate the CFTC COT code from the chart and the "COT Selection Mode" input when this field is empty, you can specify an unrelated CFTC COT code here, e.g., 001602 for wheat futures.
Look first. Then leap.
Commitment of Traders: Financial Metrics█ OVERVIEW
This indicator displays the Commitment of Traders (COT) financial data for futures markets.
█ CONCEPTS
Commitment of Traders (COT) data is tallied by the Commodity Futures Trading Commission (CFTC) , a US federal agency that oversees the trading of derivative markets such as futures in the US. It is weekly data that provides traders with information about open interest for an asset. The CFTC oversees derivative markets traded on different exchanges, so COT data is available for assets that can be traded on CBOT, CME, NYMEX, COMEX, and ICEUS.
A detailed description of the COT report can be found on the CFTC's website .
COT data is separated into three notable reports: Legacy, Disaggregated, and Financial. This indicator presents data from the COT Financial (Traders in Financial Futures) report. The Financial report includes financial contracts, such as currencies, US Treasury securities, Eurodollars, stocks, VIX and Bloomberg commodity index. As such, the TFF data is limited to financial-related tickers. The TFF report breaks down the reportable open interest positions into four classifications: Dealer/Intermediary, Asset Manager/Institutional, Leveraged Funds, and Other Reportables.
Our other COT indicators are:
• Commitment of Traders: Legacy Metrics
• Commitment of Traders: Disaggregated Metrics
• Commitment of Traders: Total
█ HOW TO USE IT
Load the indicator on an active chart (see here if you don't know how).
By default, the indicator uses the chart's symbol to derive the COT data it displays. You can also specify a CFTC code in the "CFTC code" field of the script's inputs to display COT data from a symbol different than the chart's.
The rest of this section documents the script's input fields.
Metric
Each metric represents a different column of the Commitment of Traders report. Details are available in the explanatory notes on the CFTC's website .
Here is a summary of the metrics:
• "Open Interest" is the total of all futures and/or option contracts entered into and not yet offset by a transaction, by delivery, by exercise, etc.
The aggregate of all long open interest is equal to the aggregate of all short open interest.
• "Traders Total" is the number of all unique reportable traders, regardless of the trading direction.
• "Traders Dealer" is the number of traders classified as a "Dealer/Intermediary" reported holding any position with the specified direction.
A "producer/merchant/processor/user" is an entity typically described as the “sell side” of the market.
Though they may not predominately sell futures, they do design and sell various financial assets to clients.
They tend to have matched books or offset their risk across markets and clients.
Futures contracts are part of the pricing and balancing of risk associated with the products they sell and their activities.
• "Traders Asset Manager" is the number of traders classified as "Asset Manager/Institutional" reported holding any position with the specified direction.
These are institutional investors, including pension funds, endowments, insurance companies,
mutual funds and those portfolio/investment managers whose clients are predominantly institutional.
• "Traders Leveraged Funds" is the number of traders classified as "Leveraged Funds" reported holding any position with the specified direction.
These are typically hedge funds and various types of money managers. The traders may be engaged in managing and
conducting proprietary futures trading and trading on behalf of speculative clients.
• "Traders Other Reportable" is the number of reportable traders that are not placed in any of the three categories specified above.
The traders in this category mostly are using markets to hedge business risk, whether that risk is related to foreign exchange, equities or interest rates.
This category includes corporate treasuries, central banks, smaller banks, mortgage originators, credit unions and any other reportable traders not assigned to the other three categories.
• "Traders Total Reportable" is the number of all traders reported holding any position with the specified direction.
To determine the total number of reportable traders in a market, a trader is counted only once whether or not the trader appears in more than one category.
As a result, the sum of the numbers of traders in each separate category typically exceeds the total number of reportable traders.
• "Dealer/Asset Manager/Leveraged Funds/Total Reportable/Other Reportable Positions -- all positions held by the traders of the specified category.
• "Nonreportable Positions" is the long and short open interest derived by subtracting the total long and short reportable positions from the total open interest.
Accordingly, the number of traders involved and the commercial/non-commercial classification of each trader are unknown.
• "Concentration Gross/Net LT 4/8 TDR" is the percentage of open interest held by 4/8 of the largest traders, by gross/net positions,
without regard to whether they are classified as commercial or non-commercial. The Net position ratios are computed after offsetting each trader’s equal long and short positions.
A reportable trader with relatively large, balanced long and short positions in a single market, therefore,
may be among the four and eight largest traders in both the gross long and gross short categories, but will probably not be included among the four and eight largest traders on a net basis.
Direction
Each metric is available for a particular set of directions. Valid directions for each metric are specified with its name in the "Metric" field's dropdown menu.
COT Selection Mode
This field's value determines how the script determines which COT data to return from the chart's symbol:
- "Root" uses the root of a futures symbol ("ES" for "ESH2020").
- "Base currency" uses the base currency in a forex pair ("EUR" for "EURUSD").
- "Currency" uses the quote currency, i.e., the currency the symbol is traded in ("JPY" for "TSE:9984" or "USDJPY").
- "Auto" tries all modes, in turn.
If no COT data can be found, a runtime error is generated.
Note that if the "CTFC Code" input field contains a code, it will override this input.
Futures/Options
Specifies the type of Commitment of Traders data to display: data concerning only Futures, only Options, or both.
CTFC Code
Instead of letting the script generate the CFTC COT code from the chart and the "COT Selection Mode" input when this field is empty, you can specify an unrelated CFTC COT code here, e.g., 001602 for wheat futures.
Look first. Then leap.
Commitment of Traders: Total█ OVERVIEW
This indicator displays the Commitment of Traders (COT) totals data for futures markets.
█ CONCEPTS
Commitment of Traders (COT) data is tallied by the Commodity Futures Trading Commission (CFTC) , a US federal agency that oversees the trading of derivative markets such as futures in the US. It is weekly data that provides traders with information about open interest for an asset. The CFTC oversees derivative markets traded on different exchanges, so COT data is available for assets that can be traded on CBOT, CME, NYMEX, COMEX, and ICEUS.
A detailed description of the COT report can be found on the CFTC's website .
COT data is separated into three notable reports: Legacy, Disaggregated, and Financial. This indicator presents specific data from the COT Legacy report. The Total data details the positions held by various traders: Commercial Hedgers (traders registered with CFTC that use futures contracts in that particular commodity for hedging), Large Traders (traders registered with CFTC that do not hedge that particular commodity) and Small Traders (not registered with CFTC).
Our other COT indicators are:
• Commitment of Traders: Legacy Metrics
• Commitment of Traders: Disaggregated Metrics
• Commitment of Traders: Financial Metrics
█ HOW TO USE IT
Load the indicator on an active chart (see here if you don't know how).
By default, the indicator uses the chart's symbol to derive the COT data it displays. You can also specify a CFTC code in the "CFTC code" field of the script's inputs to display COT data from a symbol different than the chart's.
The rest of this section documents the script's input fields.
COT Selection Mode
This field's value determines how the script determines which COT data to return from the chart's symbol:
- "Root" uses the root of a futures symbol ("ES" for "ESH2020").
- "Base currency" uses the base currency in a forex pair ("EUR" for "EURUSD").
- "Currency" uses the quote currency, i.e., the currency the symbol is traded in ("JPY" for "TSE:9984" or "USDJPY").
- "Auto" tries all modes, in turn.
If no COT data can be found, a runtime error is generated.
Note that if the "CTFC Code" input field contains a code, it will override this input.
Futures/Options
Specifies the type of Commitment of Traders data to display: data concerning only Futures, only Options, or both.
Display
Determines the direction of the metrics requested from the CTFC report.
CTFC Code
Instead of letting the script generate the CFTC COT code from the chart and the "COT Selection Mode" input when this field is empty, you can specify an unrelated CFTC COT code here, e.g., 001602 for wheat futures.
Look first. Then leap.
LibraryCOT█ OVERVIEW
This library is a Pine programmer's tool that provides functions to access Commitment of Traders (COT) data for futures. Four of our scripts use it:
• Commitment of Traders: Legacy Metrics
• Commitment of Traders: Disaggregated Metrics
• Commitment of Traders: Financial Metrics
• Commitment of Traders: Total
If you do not program in Pine and want to use COT data, please see the indicators linked above.
█ CONCEPTS
Commitment of Traders (COT) data is tallied by the Commodity Futures Trading Commission (CFTC) , a US federal agency that oversees the trading of derivative markets such as futures in the US. It is weekly data that provides traders with information about open interest for an asset. The CFTC oversees derivative markets traded on different exchanges, so COT data is available for assets that can be traded on CBOT, CME, NYMEX, COMEX, and ICEUS.
Accessing COT data from a Pine script requires the generation of a ticker ID string for use with request.security() . The ticker string must be encoded in a special format that includes both CFTC and TradingView-specific content. The format of the ticker IDs is somewhat complex; this library's functions make their generation easier. Note that if you know the COT ticker ID string for specific data, you can enter it from the chart's "Symbol Search" dialog box.
A ticker for COT data in Pine has the following structure:
COT:__<_metricDirection><_metricType>
where an underscore prefixing a component name inside <> is only included if the component is not a null string, and:
Is a digit representing the type of the COT report the data comes from: "" for legacy COT data, "2" for disaggregated data and "3" for financial data.
Is a six digit code that represents a commodity. Example: wheat futures (root "ZW") have the code "001602".
Is either "F" if the report data should exclude Options data, or "FO" if such data is included.
Is the TradingView code of the metric. This library's `metricNameAndDirectionToTicker()` function creates both
the and components of a COT ticker from the metric names and directions listed in the above chart.
The different metrics are explained in the CFTC's Explanatory Notes .
Is the direction of the metric: "Long", "Short", "Spreading" or "No direction".
Not all directions are applicable to all metrics. The valid ones are listed next to each metric in the above chart.
Is the type of the metric, possible values are "All", "Old" and "Other".
The difference between the types is explained in the "Old and Other Futures" section of the CFTC's Explanatory Notes .
As an example, the Legacy report Open Interest data for ZW futures (options included) in the old standard has the ticker "COT:001602_FO_OI_OLD". The same data using the current standard without futures has the ticker "COT:001602_F_OI".
█ USING THE LIBRARY
The first functions in the library are helper functions that generate components of a COT ticker ID. The last function, `COTTickerid()`, is the one that generates the full ticker ID string by calling some of the helper functions. We use it like this in our example:
exampleTicker = COTTickerid(
COTType = "Legacy",
CFTCCode = convertRootToCOTCode("Auto"),
includeOptions = false,
metricName = "Open Interest",
metricDirection = "No direction",
metricType = "All")
This library's chart displays the valid values for the `metricName` and `metricDirection` arguments. They vary for each of the three types of COT data (the `COTType` argument). The chart also displays the COT ticker ID string in the `exampleTicker` variable.
Look first. Then leap.
The library's functions are:
rootToCFTCCode(root)
Accepts a futures root and returns the relevant CFTC code.
Parameters:
root : Root prefix of the future's symbol, e.g. "ZC" for "ZC1!"" or "ZCU2021".
Returns: The part of a COT ticker corresponding to `root`, or "" if no CFTC code exists for the `root`.
currencyToCFTCCode(curr)
Converts a currency string to its corresponding CFTC code.
Parameters:
curr : Currency code, e.g., "USD" for US Dollar.
Returns: The corresponding to the currency, if one exists.
optionsToTicker(includeOptions)
Returns the part of a COT ticker using the `includeOptions` value supplied, which determines whether options data is to be included.
Parameters:
includeOptions : A "bool" value: 'true' if the symbol should include options and 'false' otherwise.
Returns: The part of a COT ticker: "FO" for data that includes options and "F" for data that doesn't.
metricNameAndDirectionToTicker(metricName, metricDirection)
Returns a string corresponding to a metric name and direction, which is one component required to build a valid COT ticker ID.
Parameters:
metricName : One of the metric names listed in this library's chart. Invalid values will cause a runtime error.
metricDirection : Metric direction. Possible values are: "Long", "Short", "Spreading", and "No direction".
Valid values vary with metrics. Invalid values will cause a runtime error.
Returns: The part of a COT ticker ID string, e.g., "OI_OLD" for "Open Interest" and "No direction",
or "TC_L" for "Traders Commercial" and "Long".
typeToTicker(metricType)
Converts a metric type into one component required to build a valid COT ticker ID.
See the "Old and Other Futures" section of the CFTC's Explanatory Notes for details on types.
Parameters:
metricType : Metric type. Accepted values are: "All", "Old", "Other".
Returns: The part of a COT ticker.
convertRootToCOTCode(mode, convertToCOT)
Depending on the `mode`, returns a CFTC code using the chart's symbol or its currency information when `convertToCOT = true`.
Otherwise, returns the symbol's root or currency information. If no COT data exists, a runtime error is generated.
Parameters:
mode : A string determining how the function will work. Valid values are:
"Root": the function extracts the futures symbol root (e.g. "ES" in "ESH2020") and looks for its CFTC code.
"Base currency": the function extracts the first currency in a pair (e.g. "EUR" in "EURUSD") and looks for its CFTC code.
"Currency": the function extracts the quote currency ("JPY" for "TSE:9984" or "USDJPY") and looks for its CFTC code.
"Auto": the function tries the first three modes (Root -> Base Currency -> Currency) until a match is found.
convertToCOT : "bool" value that, when `true`, causes the function to return a CFTC code.
Otherwise, the root or currency information is returned. Optional. The default is `true`.
Returns: If `convertToCOT` is `true`, the part of a COT ticker ID string.
If `convertToCOT` is `false`, the root or currency extracted from the current symbol.
COTTickerid(COTType, CTFCCode, includeOptions, metricName, metricDirection, metricType)
Returns a valid TradingView ticker for the COT symbol with specified parameters.
Parameters:
COTType : A string with the type of the report requested with the ticker, one of the following: "Legacy", "Disaggregated", "Financial".
CTFCCode : The for the asset, e.g., wheat futures (root "ZW") have the code "001602".
includeOptions : A boolean value. 'true' if the symbol should include options and 'false' otherwise.
metricName : One of the metric names listed in this library's chart.
metricDirection : Direction of the metric, one of the following: "Long", "Short", "Spreading", "No direction".
metricType : Type of the metric. Possible values: "All", "Old", and "Other".
Returns: A ticker ID string usable with `request.security()` to fetch the specified Commitment of Traders data.
█ AVAILABLE METRICS
Different COT types provide different metrics. The table of all metrics available for each of the types can be found below.
+------------------------------+------------------------+
| Legacy (COT) Metric Names | Directions |
+------------------------------+------------------------+
| Open Interest | No direction |
| Noncommercial Positions | Long, Short, Spreading |
| Commercial Positions | Long, Short |
| Total Reportable Positions | Long, Short |
| Nonreportable Positions | Long, Short |
| Traders Total | No direction |
| Traders Noncommercial | Long, Short, Spreading |
| Traders Commercial | Long, Short |
| Traders Total Reportable | Long, Short |
| Concentration Gross LT 4 TDR | Long, Short |
| Concentration Gross LT 8 TDR | Long, Short |
| Concentration Net LT 4 TDR | Long, Short |
| Concentration Net LT 8 TDR | Long, Short |
+------------------------------+------------------------+
+-----------------------------------+------------------------+
| Disaggregated (COT2) Metric Names | Directions |
+-----------------------------------+------------------------+
| Open Interest | No Direction |
| Producer Merchant Positions | Long, Short |
| Swap Positions | Long, Short, Spreading |
| Managed Money Positions | Long, Short, Spreading |
| Other Reportable Positions | Long, Short, Spreading |
| Total Reportable Positions | Long, Short |
| Nonreportable Positions | Long, Short |
| Traders Total | No Direction |
| Traders Producer Merchant | Long, Short |
| Traders Swap | Long, Short, Spreading |
| Traders Managed Money | Long, Short, Spreading |
| Traders Other Reportable | Long, Short, Spreading |
| Traders Total Reportable | Long, Short |
| Concentration Gross LE 4 TDR | Long, Short |
| Concentration Gross LE 8 TDR | Long, Short |
| Concentration Net LE 4 TDR | Long, Short |
| Concentration Net LE 8 TDR | Long, Short |
+-----------------------------------+------------------------+
+-------------------------------+------------------------+
| Financial (COT3) Metric Names | Directions |
+-------------------------------+------------------------+
| Open Interest | No Direction |
| Dealer Positions | Long, Short, Spreading |
| Asset Manager Positions | Long, Short, Spreading |
| Leveraged Funds Positions | Long, Short, Spreading |
| Other Reportable Positions | Long, Short, Spreading |
| Total Reportable Positions | Long, Short |
| Nonreportable Positions | Long, Short |
| Traders Total | No Direction |
| Traders Dealer | Long, Short, Spreading |
| Traders Asset Manager | Long, Short, Spreading |
| Traders Leveraged Funds | Long, Short, Spreading |
| Traders Other Reportable | Long, Short, Spreading |
| Traders Total Reportable | Long, Short |
| Concentration Gross LE 4 TDR | Long, Short |
| Concentration Gross LE 8 TDR | Long, Short |
| Concentration Net LE 4 TDR | Long, Short |
| Concentration Net LE 8 TDR | Long, Short |
+-------------------------------+------------------------+
COT Net Positions Index - Currencies Only (Legacy Report)This indicator is based on the Commitment of Traders legacy report and compares the combined net noncommercial positions of the base and quote currency to the combined commercial positions of the base and quote currency.
The indicator currently works on aal the major and minor currency pairs including the inversed charts, and I will be adding exotic currencies and metals shortly. Please request any other instruments in the comments below.
Something to be aware of is that for any pair containing the U.S. Dollar, the U.S. Dollar is represented by the U.S. Dollar Index. For example, if we take the EURUSD the script combines the Euro FX futures contracts and combines the U.S. Dollar Index futures contracts, where as with for example the NZDCAD, the New Zealand Dollar is indexed against the Canadian Dollar. You should keep this in mind, because the Euro positions are 125,000 Euro FX futures contracts, while the U.S. Dollar Index futures contracts are only 1,000 U.S. Dollars.
By default the total open interest and net total of all the positions are showing as well, however, these can be turned off in the indicator settings along with the noncommercial and commercial positions.
You can also turn on the indicator lables on the scale, and it will show the name label for the open interest, noncomercials, commercials, and net total.