OPEN-SOURCE SCRIPT
[TradersPost] Futures Contract Rollover Example

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.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
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.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
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.