OPEN-SOURCE SCRIPT

comm_idx

By taylor_o
Updated
This script displays information about the components of the Goldman Sachs Commodity Index. The index is based on futures contracts in the categories of agricultural products, softs commodities, livestock, energies, industrial metals, and precious metals. The statistics displayed in the table are:

change: 1-day % change
from ma: the % change from a moving average
corr idx: correlation of the contract to the GSCI

The lengths for the moving average and correlation statistic can be set using the inputs.

See the script source for the symbols used for each commodity. Although most of the symbols correspond to the actual futures contract used to compute the index, LME contracts are not available on tradingview. Hence, corresponding HKEX contracts are used for the industrial metals.
Release Notes
cosmetic fix
Release Notes
accidentally missed rbob gasoline -- added
AGScommoditycomponentsenergiesgsciindexlivestockMetalssoftsstatistics

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?

Disclaimer