public class Underlying extends MarketEvent implements TimeSeriesEvent<String>, LastingEvent<String>
Underlying
event has the following properties:
eventSymbol
- symbol of this event;
eventFlags
- transactional event flags;
index
- unique per-symbol index of this event;
time
- timestamp of this event in milliseconds;
sequence
- sequence number of this event to distinguish events that have the same time
;
volatility
- 30-day implied volatility for this underlying based on VIX methodology;
frontVolatility
- front month implied volatility for this underlying based on VIX methodology;
backVolatility
- 3back month implied volatility for this underlying based on VIX methodology;
callVolume
- call options traded volume for a day;
putVolume
- put options traded volume for a day;
optionVolume
- options traded volume for a day;
putCallRatio
- ratio of put options traded volume to call options traded volume for a day.
eventFlags
property.
The logic behind this property is detailed in IndexedEvent
class documentation.
Multiple event sources for the same symbol are not supported for Underlying, thus
source
property is always DEFAULT
.
TimeSeriesEventModel
class handles all the snapshot and transaction logic and conveniently represents
a list current of time-series events order by their time
.
It relies on the code of AbstractIndexedEventModel
to handle this logic.
Use the source code of AbstractIndexedEventModel
for clarification on transactions and snapshot logic.
TimeSeriesEvent
class
documentation.
See the model section for a mathematical background on the values in this event.
Underlying
.Modifier and Type | Field and Description |
---|---|
static int |
MAX_SEQUENCE
Maximum allowed sequence value.
|
REMOVE_EVENT, SNAPSHOT_BEGIN, SNAPSHOT_END, SNAPSHOT_MODE, SNAPSHOT_SNIP, TX_PENDING
Constructor and Description |
---|
Underlying()
Creates new underlying event with default values.
|
Underlying(String eventSymbol)
Creates new underlying event with the specified event symbol.
|
Modifier and Type | Method and Description |
---|---|
protected String |
baseFieldsToString() |
double |
getBackVolatility()
Returns back month implied volatility for this underlying based on VIX methodology.
|
double |
getCallVolume()
Returns call options traded volume for a day.
|
int |
getEventFlags()
Returns transactional event flags.
|
double |
getFrontVolatility()
Returns front month implied volatility for this underlying based on VIX methodology.
|
long |
getIndex()
Returns unique per-symbol index of this event.
|
double |
getOptionVolume()
Returns options traded volume for a day.
|
double |
getPutCallRatio()
Returns ratio of put options traded volume to call options traded volume for a day.
|
double |
getPutVolume()
Returns put options traded volume for a day.
|
int |
getSequence()
Returns sequence number of this event to distinguish events that have the same
time . |
IndexedEventSource |
getSource()
Returns a source identifier for this event, which is always
DEFAULT for time-series events. |
long |
getTime()
Returns timestamp of the event in milliseconds.
|
double |
getVolatility()
Returns 30-day implied volatility for this underlying based on VIX methodology.
|
void |
setBackVolatility(double backVolatility)
Changes back month implied volatility for this underlying based on VIX methodology.
|
void |
setCallVolume(double callVolume)
Changes call options traded volume for a day.
|
void |
setEventFlags(int eventFlags)
Changes transactional event flags.
|
void |
setFrontVolatility(double frontVolatility)
Changes front month implied volatility for this underlying based on VIX methodology.
|
void |
setIndex(long index)
Changes unique per-symbol index of this event.
|
void |
setPutCallRatio(double putCallRatio)
Changes ratio of put options traded volume to call options traded volume for a day.
|
void |
setPutVolume(double putVolume)
Changes put options traded volume for a day.
|
void |
setSequence(int sequence)
Changes
getSequence() sequence number} of this event. |
void |
setTime(long time)
Changes timestamp of the event in milliseconds.
|
void |
setVolatility(double volatility)
Changes 30-day implied volatility for this underlying based on VIX methodology.
|
String |
toString()
Returns string representation of this underlying event.
|
getEventSymbol, getEventTime, setEventSymbol, setEventTime
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getEventId
getEventSymbol, getEventTime, setEventSymbol, setEventTime
public static final int MAX_SEQUENCE
setSequence(int)
,
Constant Field Valuespublic Underlying()
public Underlying(String eventSymbol)
eventSymbol
- event symbol.public IndexedEventSource getSource()
DEFAULT
for time-series events.getSource
in interface IndexedEvent<String>
getSource
in interface TimeSeriesEvent<String>
DEFAULT
for time-series events.public int getEventFlags()
getEventFlags
in interface IndexedEvent<String>
public void setEventFlags(int eventFlags)
setEventFlags
in interface IndexedEvent<String>
eventFlags
- transactional event flags.public long getIndex()
time
and sequence
.
Changing either time or sequence changes event index.getIndex
in interface IndexedEvent<String>
getIndex
in interface TimeSeriesEvent<String>
public void setIndex(long index)
time
and sequence
and
invocation of this method changes time and sequence.
Do not use this method directly.
Change time
and/or sequence
.setIndex
in interface IndexedEvent<String>
index
- the event index.getIndex()
public long getTime()
getTime
in interface TimeSeriesEvent<String>
System.currentTimeMillis()
public void setTime(long time)
time
- timestamp of the event in milliseconds.getTime()
public int getSequence()
time
. This sequence number does not have to be unique and
does not need to be sequential. Sequence can range from 0 to MAX_SEQUENCE
.public void setSequence(int sequence)
getSequence()
sequence number} of this event.sequence
- the sequence.IllegalArgumentException
- if sequence is below zero or above MAX_SEQUENCE
.getSequence()
public double getVolatility()
public void setVolatility(double volatility)
volatility
- 30-day implied volatility for this underlying based on VIX methodology.public double getFrontVolatility()
public void setFrontVolatility(double frontVolatility)
frontVolatility
- front month implied volatility for this underlying based on VIX methodology.public double getBackVolatility()
public void setBackVolatility(double backVolatility)
backVolatility
- back month implied volatility for this underlying based on VIX methodology.public double getCallVolume()
public void setCallVolume(double callVolume)
callVolume
- call options traded volume for a day.public double getPutVolume()
public void setPutVolume(double putVolume)
putVolume
- put options traded volume for a day.public double getOptionVolume()
public double getPutCallRatio()
public void setPutCallRatio(double putCallRatio)
putCallRatio
- ratio of put options traded volume to call options traded volume for a day.public String toString()
protected String baseFieldsToString()
Copyright © 2002–2023 Devexperts LLC. All rights reserved.