I am trying to determine (programmatically) what the current front month contract for a given futures symbol is.
I would guess that all futures contracts expire on a standard time relative to their exchange.
The trivial solution:
- Get current month
- Retrieve symbol for current month
Obviously doesn't work. Some futures don't trade on the current month, and its possible the current month's contract has closed and the next month is now trading actively.
Is there any resource available that has expiration dates for contracts that I can use? Or is there a way to determine with some simple rules what the front month currently is?