public class Greeks extends MarketEvent implements TimeSeriesEvent<String>, LastingEvent<String>
Greeks
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
;
price
- option market price;
volatility
- Black-Scholes implied volatility of the option;
delta
- option delta;
gamma
- option gamma;
theta
- option theta;
rho
- option rho;
vega
- option vega.
eventFlags
property.
The logic behind this property is detailed in IndexedEvent
class documentation.
Multiple event sources for the same symbol are not supported for greeks, 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.
Greeks
.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 |
---|
Greeks()
Creates new greeks event with default values.
|
Greeks(String eventSymbol)
Creates new greeks event with the specified event symbol.
|
Modifier and Type | Method and Description |
---|---|
double |
getDelta()
Return option delta.
|
int |
getEventFlags()
Returns transactional event flags.
|
double |
getGamma()
Returns option gamma.
|
long |
getIndex()
Returns unique per-symbol index of this event.
|
double |
getPrice()
Returns option market price.
|
double |
getRho()
Returns option rho.
|
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. |
double |
getTheta()
Returns option theta.
|
long |
getTime()
Returns timestamp of the event in milliseconds.
|
double |
getVega()
Returns option vega.
|
double |
getVolatility()
Returns Black-Scholes implied volatility of the option.
|
void |
setDelta(double delta)
Changes option delta.
|
void |
setEventFlags(int eventFlags)
Changes transactional event flags.
|
void |
setGamma(double gamma)
Changes option gamma.
|
void |
setIndex(long index)
Changes unique per-symbol index of this event.
|
void |
setPrice(double price)
Changes option market price.
|
void |
setRho(double rho)
Changes option rho.
|
void |
setSequence(int sequence)
Changes
getSequence() sequence number} of this event. |
void |
setTheta(double theta)
Changes option theta.
|
void |
setTime(long time)
Changes timestamp of the event in milliseconds.
|
void |
setVega(double vega)
Changes option vega.
|
void |
setVolatility(double volatility)
Changes Black-Scholes implied volatility of the option.
|
String |
toString()
Returns string representation of this greeks 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 Greeks()
public Greeks(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 getPrice()
public void setPrice(double price)
price
- option market price.public double getVolatility()
public void setVolatility(double volatility)
volatility
- Black-Scholes implied volatility of the option.public double getDelta()
public void setDelta(double delta)
delta
- option delta.public double getGamma()
public void setGamma(double gamma)
gamma
- option gamma.public double getTheta()
public void setTheta(double theta)
theta
- option theta.public double getRho()
public void setRho(double rho)
rho
- option rho.public double getVega()
public void setVega(double vega)
vega
- option vega.Copyright © 2002–2023 Devexperts LLC. All rights reserved.