Lean  $LEAN_TAG$
QuantConnect.Securities.FutureOption.FuturesOptionsUnderlyingMapper Class Reference

Creates the underlying Symbol that corresponds to a futures options contract More...

Static Public Member Functions

static Symbol GetUnderlyingFutureFromFutureOption (string futureOptionTicker, string market, DateTime futureOptionExpiration, DateTime? date=null)
 Gets the FOP's underlying Future. The underlying Future's contract month might not match the contract month of the Future Option when providing CBOT or COMEX based FOPs contracts to this method. More...
 

Detailed Description

Creates the underlying Symbol that corresponds to a futures options contract

Because there can exist futures options (FOP) contracts that have an underlying Future that does not have the same contract month as FOPs contract month, we need a way to resolve the underlying Symbol of the FOP to the specific future contract it belongs to.

Luckily, these FOPs all follow a pattern as to how the underlying is determined. The method GetUnderlyingFutureFromFutureOption will automatically resolve the FOP contract's underlying Future, and will ensure that the rules of the underlying are being followed.

An example of a contract that this happens to is Gold Futures (FUT=GC, FOP=OG). OG FOPs underlying Symbols are not determined by the contract month of the FOP itself, but rather by the closest contract to it in an even month.

Examples: OGH21 would have an underlying of GCJ21 OGJ21 would have an underlying of GCJ21 OGK21 would have an underlying of GCM21 OGM21 would have an underlying of GCM21...

Definition at line 45 of file FuturesOptionsUnderlyingMapper.cs.

Member Function Documentation

◆ GetUnderlyingFutureFromFutureOption()

static Symbol QuantConnect.Securities.FutureOption.FuturesOptionsUnderlyingMapper.GetUnderlyingFutureFromFutureOption ( string  futureOptionTicker,
string  market,
DateTime  futureOptionExpiration,
DateTime?  date = null 
)
static

Gets the FOP's underlying Future. The underlying Future's contract month might not match the contract month of the Future Option when providing CBOT or COMEX based FOPs contracts to this method.

Parameters
futureOptionTickerFuture option ticker
marketMarket of the Future Option
futureOptionExpirationExpiration date of the future option
dateDate to search the future chain provider with. Optional, but required for CBOT based contracts
Returns
Symbol if there is an underlying for the FOP, null if there's no underlying found for the Future Option

Definition at line 90 of file FuturesOptionsUnderlyingMapper.cs.

Here is the call graph for this function:

The documentation for this class was generated from the following file: