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 sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Life is long gamma
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Life is long gamma
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.