Cantom Chart - CL CTG vs BKDEnglish : This Pine Script indicator, named "Cantom Chart - CL CTG vs BKD," uniquely analyzes the immediate state of oil futures contracts to determine if they are in contango or backwardation. The script uses the price ratio between the nearest (CL1) and the next nearest (CL2) NYMEX crude oil futures contracts. It multiplies this ratio by 100 for clarity and scales fluctuations for enhanced visibility.
Key Features:
Dynamic Ratio Calculation: Computes the ratio (CL1/CL2 * 100) to determine the immediate market state.
Market State Interpretation: A ratio above 100 indicates backwardation, suggesting higher demand than supply, while a ratio below 100 indicates contango, suggesting higher supply than demand.
Volatility Adjustment: Amplifies market state changes by tripling the deviation from the baseline of 100, making it easier to observe subtle shifts.
Anomaly Detection: Caps the adjusted ratio at 125 for highs and 75 for lows, maintaining these limits until the ratio returns to normal levels.
Usage: This indicator is especially useful for traders analyzing supply-demand dynamics and inflationary pressures in the oil market. To apply it, simply add the script to your TradingView chart and adjust the 'Lower Threshold' and 'Upper Threshold' lines as needed based on your trading strategy.
-----
日本語 : この「Cantom Chart - CL CTG vs BKD」Pine Scriptインジケーターは、直近の原油先物契約がコンタンゴまたはバックワーデーションにあるかを特定するための独自の分析を提供します。最近の(CL1)と次の(CL2)NYMEX原油先物契約間の価格比を使用し、この比率に100を掛けて明確性を高め、変動の視認性を向上させます。
主要機能:
動的比率計算: 市場の即時状態を判断するために比率(CL1/CL2 * 100)を計算します。
市場状態の解釈: 比率が100を超える場合はバックワーデーション(需要が供給を上回る)、100未満の場合はコンタンゴ(供給が需要を上回る)を示します。
変動調整: 基準値100からの偏差を3倍にして、微妙な変化を容易に観察できるようにします。
異常値検出: 調整された比率を高値で125、低値で75に制限し、通常のレベルに戻るまでこれらの限界を維持します。
使用方法: このインジケーターは、原油市場における需給ダイナミクスとインフレ圧力を分析するトレーダーにとって特に有用です。使用するには、このスクリプトをTradingViewチャートに追加し、トレーディング戦略に基づいて「Lower Threshold」と「Upper Threshold」のラインを必要に応じて調整します。
Backwardation
Binance Auto Spot-Futures Premium/Discount -CheThis Script is based in the 2020 @Plumptoiletduck script
Special thanks to @tartigradia for the Auto Detect code for the Binance pair.
It tells us the difference in price between Spot and Perpetual Futures.
Now I incorporated the function that automatically detects the pair we are in to show the premium/discount of that pair.
You never need to select the currency you are in the script anymore!
It is specially designed for Binance coins, it includes all perpetuals.
How to use it?
Usually if the Futures are higher than the Spot it indicates that we are in an over exposure zone of longs in futures.
If the spot is cheaper than the futures it means that the futures are more fearful.
You can use this script with an Open Interest script to get an idea of what is going on.
Other examples:
Cash VIX Term StructureLet’s first start with some definitions:
VIX9D: The CBOE S&P 500 9-Day Volatility Index estimates the expected 9-day volatility of S&P 500® stock returns.
www.cboe.com
VIX: The CBOE Volatility Index® (VIX® ) is considered by many to be the world's premier barometer of equity market volatility. The VIX Index is based on real-time prices of options on the S&P 500® Index (SPX) and is designed to reflect investors' consensus view of future (30-day) expected stock market volatility. The VIX Index is often referred to as the market's "fear gauge".
www.cboe.com
VIX3M: The CBOE 3-Month Volatility Index is designed to be a constant measure of 3-month implied volatility of the S&P 500® (SPX) Index options.
www.cboe.com
VIX6M: The CBOE S&P 500 6-Month Volatility Index is an estimate of the expected 6-month volatility of the S&P 500® Index.
www.cboe.com
VIX1Y: The CBOE S&P 500 1-Year Volatility Index is an estimate of the expected 1-Yeaer volatility of the S&P 500® Index.
www.cboe.com
This indicator visually displays the relationship between all the above products (short term vol vs long term vol). It also displays the current value and daily percentage change.
The shape of the term structure can tell us a lot about the market:
When the slope of the term structure is upward sloping (longer term VIX are higher than shorter term VIX), we say the term structure is in contango. This usually means that market is stable.
When the slope of the term structure is downward sloping (longer term VIX are lower than shorter term VIX), we say the term structure is in backwardation. This usually happens in periods of extreme market volatility.
Sometimes VIX9D will be higher than VIX but the rest of the curve is in contango. This means that there might be some event in the next 9 days that we need to pay attention to.
I also added a few ratios that I personally track like VIX9D/VIX, VIX/VIX3M and VIX/VIX6M.
When trading short term, I tend to focus on the front end of the curve. When trading long term, I tend to look at VIX/VIX6M.
In addition to the ratios, I added some historical parameters (lookback date can be set from the indicator’s settings) like Highest Value, Lowest Value, Percentile Rank, Average, Median and Mode.
Percentile ranks are displayed for both individual products and their ratios (that’s how I like to see them).
I hope you guys like this indicator.
Happy trading!
Crude Oil: Backwardation Vs ContangoCrude Oil, CL
Plots Futures Curve: Futures contract prices over the next 3.5 years; to easily visualize Backwardation Vs Contango(carrying charge) markets.
Carrying charge (contract prices increasing into the future) = normal, representing the costs of carrying/storage of a commodity. When this is flipped to Backwardation(As the above; contract prices decreasing into the future): it's a bullish sign: Buyers want this commodity, and they want it NOW.
Note: indicator does not map to time axis in the same way as price; it simply plots the progression of contract months out into the future; left to right; so timeframe DOESN'T MATTER for this plot
TO UPDATE (every year or so): in REQUEST CONTRACTS section, delete old contracts (top) and add new ones (bottom). Then in PLOTTING section, Delete old contract labels (bottom); add new contract labels (top); adjust the X in 'bar_index-(X+_historical)' numbers accordingly
This is one of several similar Futures Curve indicators: Meats | Metals | Grains | VIX | Crude Oil
If you want to build from this; to work on other commodities; be aware that Tradingview limits the number of contract calls to 40 (hence the multiple indicators)
Tips:
-Right click and reset chart if you can't see the plot; or if you have trouble with the scaling.
-Right click and add to new scale if you prefer this not to overlay directly on price. Or move to new pane below.
-If this takes too long to load (due to so many security calls); comment out the more distant future half of the contracts; and their respective labels. Or comment out every other contract and every other label if you prefer.
--Added historical input: input days back in time; to see the historical shape of the Futures curve via selecting 'days back' snapshot
updated 20th June 2022
© twingall
VIX: Backwardation Vs ContangoVIX: Backwardation Vs Contango
Quickly visualize Contango vs Backwardation in the S&P 500 Volatility Index by plotting the prices of the futures contracts over the next 9 months
Note: indicator does not map to time axis in the same way as price; it simply plots the progression of contract months out into the future; left to right; so timeframe DOESN'T MATTER for this plot
TO UPDATE(every few months recommended): in REQUEST CONTRACTS section, delete old contracts (top) and add new ones (bottom). Then in PLOTTING section, Delete old contract labels (bottom); add new contract labels (top); adjust the X in 'bar_index-(X+_historical)' numbers accordingly
This is one of several similar indicators: Meats | Metals | Grains | VIX
Tips:
-Right click and reset chart if you can't see the plot; or if you have trouble with the scaling.
-Right click and pin to Scale A to plot on the same scale as price
--Added historical input: input days back in time; to see the historical shape of the Futures curve via selecting 'days back' snapshot
updated 15th June 2022
© twingall
Metals:Backwardation/ContangoMETALS: Gold , Silver , Copper ( GC , SI, HG)
Quickly visualize carrying charge market vs backwardized market by comparing the price of the next 2 years of futures contracts.
Carrying charge (contract prices increasing into the future) = normal, representing the costs of carrying/storage of a commodity. When this is flipped to Backwardation (contract prices decreasing into the future): its a bullish sign: Buyers want this commodity, and they want it NOW.
Note: indicator does not map to time axis in the same way as price; it simply plots the progression of contract months out into the future; left to right; so timeframe DOESN'T MATTER for this plot
There's likely some more efficient way to write this; e.g. when plotting for Gold ( GC ); 21 of the security requests are redundant; but they are still made; and can make this slower to load
TO UPDATE(once a year will do): in REQUEST CONTRACTS section, delete old contracts (top) and add new ones (bottom). Then in PLOTTING section, Delete old contract labels (bottom); add new contract labels (top); adjust the X in 'bar_index-(X+_historical)' numbers accordingly
This is one of three similar indicators: Meats | Metals | Grains
-If you want to build from this; to work on other commodities ; be aware that Tradingview limits the number of contract calls to 40 (hence the 3 seperate indicators)
Tips:
-Right click and reset chart if you can't see the plot; or if you have trouble with the scaling.
-Right click and add to new scale if you prefer this not to overlay directly on price. Or move to new pane below.
--Added historical input: input days back in time; to see the historical shape of the Futures curve via selecting 'days back' snapshot
updated 15th June 2022
© twingall
Grains:Backwardation/ContangoGRAINS: Wheat , Soybeans , Corn (ZW, ZS, ZC )
Quickly visualize carrying charge market vs backwardized market by comparing the price of the next 2 years of futures contracts.
Carrying charge (contract prices increasing into the future) = normal, representing the costs of carrying/storage of a commodity. When this is flipped to Backwardation (contract prices decreasing into the future): its a bullish sign: Buyers want this commodity, and they want it NOW.
The above chart shows a nice example of backwardation.
Note: indicator does not map to time axis in the same way as price; it simply plots the progression of contract months out into the future; left to right; so timeframe DOESN'T MATTER for this plot
There's likely some more efficient way to write this; e.g. when plotting for Wheat (ZW); 15 of the security requests are redundant; but they are still made; and can make this slower to load
TO UPDATE(once a year will do): in REQUEST CONTRACTS section, delete old contracts (top) and add new ones (bottom). Then in PLOTTING section, Delete old contract labels (bottom); add new contract labels (top); adjust the X in 'bar_index-(X+_historical)' numbers accordingly
This is one of three similar indicators: Meats | Metals | Grains
-If you want to build from this; to work on other commodities ; be aware that Tradingview limits the number of contract calls to 40 (hence the 3 seperate indicators)
Tips:
-Right click and reset chart if you can't see the plot; or if you have trouble with the scaling.
-Right click and add to new scale if you prefer this not to overlay directly on price. Or move to new pane below.
--Added historical input: input days back in time; to see the historical shape of the Futures curve via selecting 'days back' snapshot
updated 15th June 2022
© twingall
Meats: Backwardation/CantangoMEATS: Live Cattle , Feeder Cattle, Lean Hogs (LE, GF , HE)
Quickly visualize carrying charge market vs backwardized market by comparing the price of the next 2 years of futures contracts.
Carrying charge (contract prices increasing into the future) = normal, representing the costs of carrying/storage of a commodity. When this is flipped to Backwardation (contract prices decreasing into the future): its a bullish sign: Buyers want this commodity, and they want it NOW.
Note: indicator does NOT map to time axis in the same way as price; it simply plots the progression of contract months out into the future; left to right; so timeframe DOESN'T MATTER for this plot
There's likely some more efficient way to write this; e.g. when plotting for Live Cattle (LE); 8 of the security requests are redundant; but they are still made; and can make this slower to load
TO UPDATE(once a year will do): in REQUEST CONTRACTS section, delete old contracts (top) and add new ones (bottom). Then in PLOTTING section, Delete old contract labels (bottom); add new contract labels (top); adjust the X in 'bar_index-(X+_historical)' numbers accordingly
This is one of three similar indicators: Meats | Metals | Grains
-If you want to build from this; to work on other commodities ; be aware that Tradingview limits the number of contract calls to 40 (hence the 3 seperate indicators)
Tips:
-Right click and reset chart if you can't see the plot; or if you have trouble with the scaling.
-Right click and add to new scale if you prefer this not to overlay directly on price. Or move to new pane below.
--Added historical input: input days back in time; to see the historical shape of the Futures curve via selecting 'days back' snapshot
updated 15th June 2022
© twingall
BTC Weighted Agg. Basis [Overlay] [Moto]Hello traders,
This script shows the exchange volume-weighted aggregate basis for Bitcoin. This is the accompanying overlay version of the script which shows plotshapes according to the specified levels of aggregate contango or backwardation.
Exchanges have differing significance to the traded price of BTC and so this script calculates the respective volume and price of the major exchanges to more accurately represent the difference between the markets spot price and the markets perpetual future/swap price.
Spot references:
Coinbase
Bitfinex
Binance
Bitstamp
FTX
OKex
Huobi
Bybit
Perp references:
Bitfinex
Binance
FTX
OKex
Huobi
Bybit
Deribit
There are options in the settings to use either basis point scaling or %, though the color bracketing is set to basis points by default.
Users can change the candle close resolution to see a larger/smaller time frame data set.
An important feature is the ability to filter the barcolor on the chart to filter only for basis increase or decrease depending on the influence of spot buying or selling.
As of publishing, the barcoloring is set to only display when you're on a common BTC spot or BTC perp chart. This is to avoid confusion.
Thanks
BTC Weighted Agg. Basis [Osc] [Moto]Hello traders,
This script shows the exchange volume-weighted aggregate basis for Bitcoin.
Exchanges have differing significance to the traded price of BTC and so this script calculates the respective volume and price of the major exchanges to more accurately represent the difference between the markets spot price and the markets perpetual future/swap price.
Spot references:
Coinbase
Bitfinex
Binance
Bitstamp
FTX
OKex
Huobi
Bybit
Perp references:
Bitfinex
Binance
FTX
OKex
Huobi
Bybit
Deribit
There are options in the settings to use either basis point scaling or %, though the color bracketing is set to basis points by default.
Users can change the candle close resolution to see a larger/smaller time frame data set.
An important feature is the ability to filter the barcolor on the chart to filter only for basis increase or decrease depending on the influence of spot buying or selling.
As of publishing, the barcoloring is set to only display when you're on a common BTC spot or BTC perp chart. This is to avoid confusion.
Thanks
BTC Futures BasisShows various basis percentages in a table and plots historical basis. Also has an alert function for backwardation events. Useful for tracking bullish/bearish sentiment in BTC futures markets.
*Currently displays March and June futures for the following exchanges: Bitmex, Binance, Deribit, Okex, and FTX
Also displays CME Continuous Next Contract. All of the symbols are customizable.
-----------
Market-wide backwardation usually occurs during a heavy sell-off (such as a liquidation cascade).
**For getting alerts of backwardation events, I recommend creating an alert on the 1 minute chart with the condition "Any alert() function call". Alert level is customizable as well.
-----------
*NOTE!! : Futures contracts expire (obviously), so the contract symbols will need to be updated periodically. I will try to keep them updated going into the future.
**NOTE2!! : The alert() function does not track the CME contract. This is to avoid false triggers.
Premium [Choice+Osc] [Intromoto]This indicator shows the % premium between spot and index price of any two assets.
There are both a true and false overlay version of this indicator, this is the oscillator version.
IMPORTANT: This oscillator is different from the other related oscillator, because this does not automatically change the assets for premiums, you will have to MANUALLY type in the tickers for the comparison. i.e BINANCE:ETHUSDTPERP/BINANCE:ETHUSDT. This allows you to play potential correlations between assets via premium/funding, regardless of exchange. The underlying asset should to be in the first text field, otherwise the readings will be reversed. Assets with large price differences will not have actionable readings on the oscillator.
The histogram simply plots the percent difference, either positive, "Contango", or negative, "Backwardation" between any two assets. The colors are traditionally self explanatory, green is bullish /buy, red is bearish /sell . These values can be used real time to help in determining the predicted funding rate of the perpetual, which in turn may affect sentiment.
I've included user input capabilities so that the user can change the bracketing of which values the colors appear for the barcolors and plotshapes. These are broken up into uber backwardation, backwardation, low premium, regular premium, medium premium, high premium, and uber high premium.
Tweaks or changes may need to be made if trading altcoins for more actionable settings, as the default are designed for mainly BTC premium, but others will work well enough as is for the most part.
If the derivative is slightly above the spot price, funding is likely to be positive, i.e. "normal", if spot is above the derivative, it's usually bullish , but as always, market structure and confluence should be found for better outcomes.
An important feature I've added is the ability to change the resolution of the candle closes in the premium calculations. For example, if you want to take trades based on 5, 15, 60, etc closes, you can set the indicator to show those specific time frame premium values.
This oscillator will automatically change the candles whichever color is set to each of the relevant premium bracket values. I've also included the Binance funding periods as background colors, which may aid in confluence.
DM for access.
Thanks
Premium [Auto+Overlay] [Intromoto]This indicator shows the premium between spot and index price, specifically on Binance USDT pairs against Binance USDT Perpetual contracts.
There are both a true and false overlay version of this indicator, as seen in the pic.
IMPORTANT: This indicator will automatically change to the appropriate asset, but ONLY if the observed chart is a Binance PERP. For example: If my chart is on BINANCE:ETHUSDTPERP the indicator knows that you want to compare it to the BINANCE:ETHUSDT spot value. No need to manually change anything. Other pairs will be added as they are listed on Binance. I'll also be updating this indicator as I see fit.
The histogram simply plots the percent difference, either positive, "Contango", or negative, "Backwardation". The colors are traditionally self explanatory, green is buy, red is bearish. These values can be used real time to help in determining the predicted funding rate of the perpetual, which in turn may affect the price.
I've included user input capabilities so that the user can change the bracketing of which values the colors appear for the barcolors and plotshapes. These are broken up into backwardation, low premium, regular premium, medium premium, and high premium.
Tweaks or changes will likely need to be made if trading altcoins for more actionable settings, as the default are designed for mainly BTC premium, but others will work well enough as is for the most part.
If the perpetual is above the spot price, funding will be positive, i.e. "normal", if spot is above the perpetual, it's usually bullish, but as always, market structure and confluence should be found for better outcomes.
An important feature I've added is the ability to change the resolution of the candle closes in the premium calculations. For example, if you want to take trades based on 5, 15, 60, etc closes, you can set the indicator to show those specific time frame premium values.
Plotshapes have been included in this true overlay version, which will change color and placement accordingly. I've also included the Binance funding periods as background colors, which may aid in confluence.
I may be making a version for bybit and other exchange soon, including a version that allows the user to manually type in any two assets for premium comparison.
DM for access.
Thanks
BTC Volume Contango IndexBased on my previous script "BTC Contango Index" which was inspired by a Twitter post by Byzantine General:
This is a script that shows the contango between spot and futures volumes of Bitcoin to identify overbought and oversold conditions. When a market is in contango, the volume of a futures contract is higher than the spot volume. Conversely, when a market is in backwardation, the volume of the futures contract is lower than the spot volume.
The aggregate daily volumes on top exchanges are taken to obtain Total Spot Volume and Total Futures Volume. The script then plots (Total Futures Volume/Total Spot Volume) - 1 to illustrate the percent difference (contango) between spot and futures volumes of Bitcoin. This data by itself is useful, but because aggregate futures volumes are so much larger than spot volumes, no negative values are produced. To correct for this, the Z-score of contango is taken. The Z-score (z) of a data item x measures the distance (in standard deviations StdDev) and direction of the item from its mean (U):
Z-score = (x - U) / StDev
A value of zero indicates that the data item x is equal to the mean U, while positive or negative values show that the data item is above or below the mean (x Values of +2 and -2 show that the data item is two standard deviations above or below the chosen mean, respectively, and over 95.5% of all data items are contained within these two horizontal references). We substitute x with volume contango C, the mean U with simple moving average ( SMA ) of n periods (50), and StdDev with the standard deviation of closing contango for n periods (50), so the above formula becomes: Z-score = (C - SMA (50)) / StdDev(C,50).
When in contango, Bitcoin may be overbought.
When in backwardation, Bitcoin may be oversold.
The current bar calculation will always look incorrect due to TV plotting the Z-score before the bar closes.
BTC Contango IndexInspired by a Twitter post by Byzantine General:
This is a script that shows the contango between spot and futures prices of Bitcoin to identify overbought and oversold conditions. Contango and backwardation are terms used to define the structure of the forward curve. When a market is in contango, the forward price of a futures contract is higher than the spot price. Conversely, when a market is in backwardation, the forward price of the futures contract is lower than the spot price.
The aggregate prices on top exchanges are taken and then averaged to obtain a Spot Average and a Futures Average. The script then plots (Futures Average/Spot Average) - 1 to illustrate the percent difference (contango) between spot and futures prices of Bitcoin.
When in contango, Bitcoin may be overbought.
When in backwardation, Bitcoin may be oversold.
Discount/Premium that actually mattersOKEX/HUOBI compared to XBT price, discount and premium indicates reversals in price dependent on market phase.
DM for access.
VIX futures Backwardation/Contango strategyVery basic strategy that goes long on a VIX ETF whenever the futures curve shows signs of backwardation and gets out when it shows signs of contango. Makes no effort whatsoever to avoid getting faked out by monthly futures rollover.
Surprisingly good at not incinerating money while still providing diversification benefits in a long SPY portfolio. Useful for demonstrating the benefits of including VIX futures to hedge an actively managed portfolio.
Can be set to get out if the VIX goes below the lowest value of the last 3 candles, in which case it spends less time in the market but seems to actually make a bit of money over the past decade, though the only intent of this script is to make it not lose money.
Futures/Perpetuals DeltaBackwardation/Contango of OKEX, HUOBI, BITMEX, DERIBIT futures compared to XBTUSD.
Results indicate that backwardation can mark bottoms in price action.
Bitcoin Futures: Premium Discount Backwardation Contango [CR]Bitcoin Futures Premium Discount - Backwardation Contango
Cryptorhythms back at it again with another release for your quarantined pleasure! We've had this one in our back pocket for a few months adding new features and testing it out. Now its time to release it into the wild!
Intro
This indicator is used to capture additional profits by spread trading on futures contracts.
Description
This indicator is for members only and instructions will be given out upon becoming a member. It allows you to select from dozens of perpetual, futures and spot markets to compare, along with providing an info panel of many useful statistics and triggers.
How to get access?
You can get more information on joining by referring to my signature links. Members gain access to an entire suite of proven trading indicators and a supportive community of traders.
XBT % ContangoSimilar to my other indicators, but measures XBTUSD Contango in terms of percent.
Also, built it so you could change the values that give the red and green signals. Default values are 0% or less (backwardation) indicates green. However, i found that a 0.5% setting worked will finding local bottoms for current contract of XBTH20 (March 2020). The upper value default is at 5%, and signals red when the next contract reaches over 5%.
My assumption is as BTC increases in value over time, measuring contango in terms of percent will be a better measure of the XBT futures curve.
Deribit Contango Calculator v3Same as XBT Contango Calc V3, however built specifically for Deribit Futures . See link to XBT Contango Calc V3 for full description.
Above is capture of how this indicator performed on December Futures Contract BTC27Z19, since I assume I will loose this as the main chart when I update to June contract
Current (Dec. 2019) futures contracts are as follows:
Blue = BTC26M20
Orange = BTC27H20
XBT Contango Calculator v3Since creating the first version of the XBT Contango Calculator, I found that the first version is good a calculating contango and backwardation in real time, however does not do a good job of capturing historical data of brief moves. Since backwardation moves are often brief, and since the first version Contango Calc was based on candlestick closes, it did not do a good job of recording the move after it occurred.
It took me a couple versions to try and fix this an eventually settled on version 3 which I have been using on my own for the last few months. You can see in the comparison chart above it does a much better job of capturing backwardation moves and extreme contango. Below is a comparison of how it performed vs. Version 1 during December futures XBTZ19
In addition I have added high/low lines that can be used to understand the amount that futures premium/discount has moved in a specific time frame. For example, the big drop Bitcoin had on September 24th, XBTZ19 went from +$273 contango to -$247 backwardation = $520 move! This move was in addition to the spot price move which was almost -$1,700 from high to low and -$1,100 from open to close. See below:
The high/low lines can also be removed from the chart by unchecking a box in the input tab.
The last update is the ability to lock the spot price to be XBT (index) no matter what chart you pull up. This can be useful if evaluation XBT futures correlation to other bitcoin derivatives such as GBTC or CME futures. You can also disable this feature in the input tab, which will then just calculate based on the current chart you are viewing.
Current Contracts (December 2019)
Blue = XBTM20
Orange = XBTH20
Bitmex BTC Backwardation / ContangoThis indicator calculates difference between price of Bitmex's XBTUSD, and Bitmex's two nearest futures.
If the difference is negative, then it is backwardation.
If the difference is positive, then it is contango.
This script will be updated every about 3 months, when the nearest Bitmex future will be expired.
This is an updated script of , with better description.