dxFeed Graal CXX API v4.2.0
|
Builder class for a set of option chains grouped by product or underlying symbol. More...
#include <OptionChainsBuilder.hpp>
Public Member Functions | |
OptionChainsBuilder ()=default | |
Creates new option chains builder. | |
void | setProduct (const std::string &product) |
Changes product for futures and options on futures (underlying asset name). | |
void | setUnderlying (const std::string &underlying) |
Changes primary underlying symbol for options. | |
void | setExpiration (std::int32_t expiration) |
Changes day id of expiration. | |
void | setLastTrade (std::int32_t lastTrade) |
Changes day id of last trading day. | |
void | setMultiplier (double multiplier) |
Changes market value multiplier. | |
void | setSPC (double spc) |
Changes shares per contract for options. | |
void | setAdditionalUnderlyings (const std::string &additionalUnderlyings) |
Changes additional underlyings for options, including additional cash. | |
void | setMMY (const std::string &mmy) |
Changes maturity month-year as provided for corresponding FIX tag (200). | |
void | setOptionType (const std::string &optionType) |
Changes type of option. | |
void | setExpirationStyle (const std::string &expirationStyle) |
Changes the expiration cycle style, such as "Weeklys", "Quarterlys". | |
void | setSettlementStyle (const std::string &settlementStyle) |
Changes settlement price determination style, such as "Open", "Close". | |
void | setCFI (const std::string &cfi) |
Changes Classification of Financial Instruments code. | |
void | setStrike (double strike) |
Changes strike price for options. | |
void | addOption (std::shared_ptr< T > option) |
Adds an option instrument to this builder. | |
const std::unordered_map< std::string, OptionChain< T > > & | getChains () |
Returns a view of chains created by this builder. | |
Static Public Member Functions | |
template<typename Collection, typename Element = std::decay_t<decltype(std::begin(Collection()))>, typename Profile = std::decay_t<decltype(*Element())>> | |
static OptionChainsBuilder< InstrumentProfile > | build (const Collection &instruments) |
Builds options chains for all options from the given collections of instrument profiles. | |
Builder class for a set of option chains grouped by product or underlying symbol.
This class is NOT thread-safe and cannot be used from multiple threads without external synchronization.
T | The type of option instrument instances. |
|
inline |
Adds an option instrument to this builder.
Option is added to chains for the currently set product and/or underlying to the series that corresponding to all other currently set attributes. This method is safe in the sense that is ignores illegal state of the builder. It only adds an option when all the following conditions are met:
All the attributes remain set as before after the call to this method, but chains are updated correspondingly.
option | The option to add. |
|
inlinestatic |
Builds options chains for all options from the given collections of instrument profiles.
Collection | The collection type. |
instruments | The collection of instrument profiles. |
|
inline |
Returns a view of chains created by this builder.
It updates as new options are added with addOption method.
|
inline |
Changes additional underlyings for options, including additional cash.
It shall use following format:
Example: "SE 50", "FIS 53; US$ 45.46".
additionalUnderlyings | The additional underlyings for options, including additional cash. |
|
inline |
Changes Classification of Financial Instruments code.
It is a mandatory field as it is the only way to distinguish Call/Put option type, American/European exercise, Cash/Physical delivery. It shall use six-letter CFI code from ISO 10962 standard. It is allowed to use 'X' extensively and to omit trailing letters (assumed to be 'X'). See ISO 10962 on Wikipedia.
Example: "OC" for generic call, "OP" for generic put.
cfi | CFI code. |
|
inline |
Changes day id of expiration.
Example: day_util::#getDayIdByYearMonthDay() "dxfcpp::day_util::getDayIdByYearMonthDay"(20090117).
expiration | The day id of expiration. |
|
inline |
Changes the expiration cycle style, such as "Weeklys", "Quarterlys".
expirationStyle | The expiration cycle style. |
|
inline |
Changes day id of last trading day.
Example: day_util::#getDayIdByYearMonthDay() "dxfcpp::day_util::getDayIdByYearMonthDay"(20090116).
lastTrade | The day id of last trading day. |
|
inline |
Changes maturity month-year as provided for corresponding FIX tag (200).
It can use several different formats depending on data source:
mmy | The maturity month-year as provided for corresponding FIX tag (200). |
|
inline |
Changes market value multiplier.
Example: 100, 33.2.
multiplier | The market value multiplier. |
|
inline |
Changes type of option.
It shall use one of following values:
optionType | The type of option. |
|
inline |
Changes product for futures and options on futures (underlying asset name).
Example: "/YG".
product | The product for futures and options on futures (underlying asset name). |
|
inline |
Changes settlement price determination style, such as "Open", "Close".
settlementStyle | The settlement price determination style. |
|
inline |
Changes shares per contract for options.
Example: 1, 100.
spc | The shares per contract for options. |
|
inline |
Changes strike price for options.
Example: 80, 22.5.
strike | The strike price for options. |
|
inline |
Changes primary underlying symbol for options.
Example: "C", "/YGM9"
underlying | The primary underlying symbol for options. |