OPEN-SOURCE SCRIPT

[TradersPost] Futures Contract Rollover Example

78
This indicator detects and labels the current front futures contract on a TradingView chart. It constructs contract symbols by combining the underlying asset’s root with a month code (e.g., F for January, G for February) and the year—either the current year or one specified by the user. The script then scans through possible contracts, comparing open and volume data to determine which contract is active, and displays a label when a rollover occurs.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.