T
- The type of option instrument instances.public class OptionChainsBuilder<T> extends Object
Constructor and Description |
---|
OptionChainsBuilder()
Creates new option chains builder.
|
Modifier and Type | Method and Description |
---|---|
void |
addOption(T option)
Adds an option instrument to this builder.
|
static OptionChainsBuilder<InstrumentProfile> |
build(Collection<InstrumentProfile> instruments)
Builds options chains for all options from the given collections of
instrument profiles . |
Map<String,OptionChain<T>> |
getChains()
Returns a view of chains created by this builder.
|
void |
setAdditionalUnderlyings(String additionalUnderlyings)
Changes additional underlyings for options, including additional cash.
|
void |
setCFI(String cfi)
Changes Classification of Financial Instruments code.
|
void |
setExpiration(int expiration)
Changes day id of expiration.
|
void |
setExpirationStyle(String expirationStyle)
Returns expiration cycle style, such as "Weeklys", "Quarterlys".
|
void |
setLastTrade(int lastTrade)
Changes day id of last trading day.
|
void |
setMMY(String mmy)
Changes maturity month-year as provided for corresponding FIX tag (200).
|
void |
setMultiplier(double multiplier)
Changes market value multiplier.
|
void |
setOptionType(String optionType)
Changes type of option.
|
void |
setProduct(String product)
Changes product for futures and options on futures (underlying asset name).
|
void |
setSettlementStyle(String settlementStyle)
Changes settlement price determination style, such as "Open", "Close".
|
void |
setSPC(double spc)
Changes shares per contract for options.
|
void |
setStrike(double strike)
Changes strike price for options.
|
void |
setUnderlying(String underlying)
Changes primary underlying symbol for options.
|
public OptionChainsBuilder()
public static OptionChainsBuilder<InstrumentProfile> build(Collection<InstrumentProfile> instruments)
instrument profiles
.instruments
- collection of instrument profiles.public void setProduct(String product)
product
- product for futures and options on futures (underlying asset name).public void setUnderlying(String underlying)
underlying
- primary underlying symbol for options.public void setExpiration(int expiration)
DayUtil.getDayIdByYearMonthDay
(20090117).expiration
- day id of expiration.public void setLastTrade(int lastTrade)
DayUtil.getDayIdByYearMonthDay
(20090116).lastTrade
- day id of last trading day.public void setMultiplier(double multiplier)
multiplier
- market value multiplier.public void setSPC(double spc)
spc
- shares per contract for options.public void setAdditionalUnderlyings(String additionalUnderlyings)
<VALUE> ::= <empty> | <LIST> <LIST> ::= <AU> | <AU> <semicolon> <space> <LIST> <AU> ::= <UNDERLYING> <space> <SPC>the list shall be sorted by <UNDERLYING>. Example: "SE 50", "FIS 53; US$ 45.46".
additionalUnderlyings
- additional underlyings for options, including additional cash.public void setMMY(String mmy)
mmy
- maturity month-year as provided for corresponding FIX tag (200).public void setOptionType(String optionType)
optionType
- type of option.public void setExpirationStyle(String expirationStyle)
expirationStyle
- expiration cycle style.public void setSettlementStyle(String settlementStyle)
settlementStyle
- settlement price determination style.public void setCFI(String cfi)
cfi
- CFI code.public void setStrike(double strike)
strike
- strike price for options.public void addOption(T option)
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 of the following conditions are met:
CFI code
is set and starts with either "OC" for call or "OP" for put.
expiration
is set and is not zero;
strike
is set and is not NaN
nor infinite
;
product
or underlying symbol
are set;
chains
are updated correspondingly.option
- option to add.public Map<String,OptionChain<T>> getChains()
addOption
method.Copyright © 2002–2023 Devexperts LLC. All rights reserved.