Lean
$LEAN_TAG$
|
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... | |
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.
|
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.
futureOptionTicker | Future option ticker |
market | Market of the Future Option |
futureOptionExpiration | Expiration date of the future option |
date | Date to search the future chain provider with. Optional, but required for CBOT based contracts |
Definition at line 90 of file FuturesOptionsUnderlyingMapper.cs.