OPEN-SOURCE SCRIPT
Cash-and-Carry Yield (APR)

This indicator calculates and visualizes the annualized rate of return for Cash-and-Carry arbitrage strategies by comparing a specific Futures contract against its underlying Spot price. By automatically projecting the current price spread (basis) based on the exact time remaining until expiration, it allows traders to instantly assess the potential "risk-free" yield available in the market.
The script is engineered to support both continuous 24/7 crypto markets and traditional CME futures. It features a smart "Gap Handling" setting that allows users to choose between a strict view that respects market closes (showing "Market Closed" during weekends) or a filled view that carries over the last known price for a seamless chart experience.
Visually, the indicator displays the annualized yield as a histogram; green columns indicate a Contango market (positive yield), while red columns signal Backwardation. A Simple Moving Average (SMA) is overlaid to help identify the broader yield trend amidst volatility. An integrated dashboard table in the corner provides a real-time summary of the Spot Price, Future Price, absolute spread, and the precise number of days left until expiration. Please ensure the Futures Ticker and the corresponding Expiration Date are correctly entered in the settings for accurate time-weighted calculations.
The script is engineered to support both continuous 24/7 crypto markets and traditional CME futures. It features a smart "Gap Handling" setting that allows users to choose between a strict view that respects market closes (showing "Market Closed" during weekends) or a filled view that carries over the last known price for a seamless chart experience.
Visually, the indicator displays the annualized yield as a histogram; green columns indicate a Contango market (positive yield), while red columns signal Backwardation. A Simple Moving Average (SMA) is overlaid to help identify the broader yield trend amidst volatility. An integrated dashboard table in the corner provides a real-time summary of the Spot Price, Future Price, absolute spread, and the precise number of days left until expiration. Please ensure the Futures Ticker and the corresponding Expiration Date are correctly entered in the settings for accurate time-weighted calculations.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, pembuat skrip ini telah menjadikannya sebagai sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Salut untuk penulisnya! Meskipun Anda dapat menggunakannya secara gratis, perlu diingat bahwa penerbitan ulang kode ini tunduk pada Tata Tertib kami.
Life is long gamma
Pernyataan Penyangkalan
Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, pembuat skrip ini telah menjadikannya sebagai sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Salut untuk penulisnya! Meskipun Anda dapat menggunakannya secara gratis, perlu diingat bahwa penerbitan ulang kode ini tunduk pada Tata Tertib kami.
Life is long gamma
Pernyataan Penyangkalan
Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.