com.dxfeed.ipf.option
Class OptionSerie<T>

java.lang.Object
  extended by com.dxfeed.ipf.option.OptionSerie<T>
Type Parameters:
T - The type of option instrument instances.
All Implemented Interfaces:
Cloneable, Comparable<OptionSerie<T>>

public final class OptionSerie<T>
extends Object
implements Cloneable, Comparable<OptionSerie<T>>

Series of call and put options with different strike sharing the same attributes of expiration, last trading day, spc, multiplies, etc.

Threads and clocks

This class is NOT thread-safe and cannot be used from multiple threads without external synchronization.


Method Summary
 OptionSerie<T> clone()
          Returns a shall copy of this option serie.
 int compareTo(OptionSerie<T> o)
          Compares this option serie to another one by its attributes.
 boolean equals(Object o)
          Indicates whether some other object is equal to this option series by its attributes.
 String getAdditionalUnderlyings()
          Returns additional underlyings for options, including additional cash.
 SortedMap<Double,T> getCalls()
          Returns a sorted map of all calls from strike to a corresponding option instrument.
 String getCFI()
          Returns Classification of Financial Instruments code of this option serie.
 int getExpiration()
          Returns day id of expiration.
 String getExpirationStyle()
          Returns expiration cycle style, such as “Weeklys”, “Quarterlys”.
 int getLastTrade()
          Returns day id of last trading day.
 String getMMY()
          Returns maturity month-year as provided for corresponding FIX tag (200).
 double getMultiplier()
          Returns market value multiplier.
 List<Double> getNStrikesAround(int n, double strike)
          Returns n strikes the are centered around a specified strike value.
 String getOptionType()
          Returns type of option.
 SortedMap<Double,T> getPuts()
          Returns a sorted map of all puts from strike to a corresponding option instrument.
 String getSettlementStyle()
          Returns settlement price determination style, such as “Open”, “Close”.
 double getSPC()
          Returns shares per contract for options.
 List<Double> getStrikes()
          Returns a list of all strikes in ascending order.
 int hashCode()
          Returns a hash code value for this option serie.
 String toString()
          Returns a string representation of this serie.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

clone

public OptionSerie<T> clone()
Returns a shall copy of this option serie. Collections of calls and puts are copied, but option instrument instances are shared with original.

Overrides:
clone in class Object
Returns:
a shall copy of this option serie.

getExpiration

public int getExpiration()
Returns day id of expiration. Example: DayUtil.getDayIdByYearMonthDay(20090117).

Returns:
day id of expiration.

getLastTrade

public int getLastTrade()
Returns day id of last trading day. Example: DayUtil.getDayIdByYearMonthDay(20090116).

Returns:
day id of last trading day.

getMultiplier

public double getMultiplier()
Returns market value multiplier. Example: 100, 33.2.

Returns:
market value multiplier.

getSPC

public double getSPC()
Returns shares per contract for options. Example: 1, 100.

Returns:
shares per contract for options.

getAdditionalUnderlyings

public String getAdditionalUnderlyings()
Returns additional underlyings for options, including additional cash. It shall use following format:
     <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”.

Returns:
additional underlyings for options, including additional cash.

getMMY

public String getMMY()
Returns maturity month-year as provided for corresponding FIX tag (200). It can use several different formats depending on data source:

Returns:
maturity month-year as provided for corresponding FIX tag (200).

getOptionType

public String getOptionType()
Returns type of option. It shall use one of following values:

Returns:
type of option.

getExpirationStyle

public String getExpirationStyle()
Returns expiration cycle style, such as “Weeklys”, “Quarterlys”.

Returns:
expiration cycle style.

getSettlementStyle

public String getSettlementStyle()
Returns settlement price determination style, such as “Open”, “Close”.

Returns:
settlement price determination style.

getCFI

public String getCFI()
Returns Classification of Financial Instruments code of this option serie. 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. It starts with "OX" as both calls and getPuts() puts} are stored in a serie.

Returns:
CFI code.

getCalls

public SortedMap<Double,T> getCalls()
Returns a sorted map of all calls from strike to a corresponding option instrument.

Returns:
a sorted map of all calls from strike to a corresponding option instrument.

getPuts

public SortedMap<Double,T> getPuts()
Returns a sorted map of all puts from strike to a corresponding option instrument.

Returns:
a sorted map of all puts from strike to a corresponding option instrument.

getStrikes

public List<Double> getStrikes()
Returns a list of all strikes in ascending order.

Returns:
list of all strikes in ascending order.

getNStrikesAround

public List<Double> getNStrikesAround(int n,
                                      double strike)
Returns n strikes the are centered around a specified strike value.

Parameters:
n - the maximal number of strikes to return.
strike - the center strike.
Returns:
n strikes the are centered around a specified strike value.
Throws:
IllegalArgumentException - when n < 0.

compareTo

public int compareTo(OptionSerie<T> o)
Compares this option serie to another one by its attributes. Expiration takes precedence in comparison.

Specified by:
compareTo in interface Comparable<OptionSerie<T>>
Parameters:
o - another option serie to compare with.
Returns:
result of comparison.

equals

public boolean equals(Object o)
Indicates whether some other object is equal to this option series by its attributes.

Overrides:
equals in class Object
Parameters:
o - another object to compare with.

hashCode

public int hashCode()
Returns a hash code value for this option serie.

Overrides:
hashCode in class Object
Returns:
a hash code value.

toString

public String toString()
Returns a string representation of this serie.

Overrides:
toString in class Object
Returns:
a string representation of this serie.


Copyright © 2013 Devexperts. All Rights Reserved.