public class OptionSale extends MarketEvent implements IndexedEvent<String>
Option Sale events have unique index
which can be used for later
correction/cancellation processing.
OptionSale
event has the following properties:
eventSymbol
- symbol of this event;
eventFlags
- transactional event flags;
index
- unique per-symbol index of this option sale event;
time
- time of the original event;
timeNanoPart
- microseconds and nanoseconds time part of event;
sequence
- sequence number of this event to distinguish events that have the same time
exchangeCode
- exchange code of this option sale event;
price
- price of this option sale event;
size
- size of this option sale event;
bidPrice
- the current bid price on the market when this option sale event had occurred;
askPrice
- the current ask price on the market when this option sale event had occurred;
exchangeSaleConditions
- sale conditions provided for this event by data feed;
aggressorSide
- aggressor side of this option sale event;
spreadLeg
- whether this event represents a spread leg;
extendedTradingHours
- whether this event represents an extended trading hours sale;
validTick
- whether this event represents a valid intraday tick;
type
- type of this option sale event;
underlyingPrice
- underlying price at the time when this option sale event had occurred;
volatility
- Black-Scholes implied volatility of the event's option;
delta
- the event's option delta;
getOptionSymbol()
optionSymbol} - option symbol of this event's option.
See the model section for a mathematical background on the values in this event.
eventFlags
property.
The logic behind this property is detailed in IndexedEvent
class documentation.
Multiple event sources for the same symbol are not supported for option sale events, thus
source
property is always DEFAULT
.
IndexedEventModel
class handles all the snapshot and transaction logic and conveniently represents
a list of current events.
It relies on the code of AbstractIndexedEventModel
to handle this logic.
Use the source code of AbstractIndexedEventModel
for clarification on transactions and snapshot logic.
OptionSale
.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 |
---|
OptionSale()
Creates new option sale event with default values.
|
OptionSale(String eventSymbol)
Creates new option sale event with the specified event symbol.
|
Modifier and Type | Method and Description |
---|---|
Side |
getAggressorSide()
Returns aggressor side of this option sale event.
|
double |
getAskPrice()
Returns the current ask price on the market when this option sale event had occurred.
|
double |
getBidPrice()
Returns the current bid price on the market when this option sale event had occurred.
|
double |
getDelta()
Return option delta at the time of this option sale event.
|
int |
getEventFlags()
Returns transactional event flags.
|
char |
getExchangeCode()
Returns exchange code of this option sale event.
|
String |
getExchangeSaleConditions()
Returns sale conditions provided for this event by data feed.
|
long |
getIndex()
Returns unique per-symbol index of this option sale event.
|
String |
getOptionSymbol()
Returns option symbol of this event.
|
double |
getPrice()
Returns price of this option sale event.
|
int |
getSequence()
Returns sequence number of this event to distinguish option sale events that have the same
time . |
double |
getSize()
Returns size of this option sale event.
|
IndexedEventSource |
getSource()
Returns a source for this event.
|
long |
getTime()
Returns time of this option sale event.
|
int |
getTimeNanoPart()
Returns microseconds and nanoseconds time part of this event.
|
long |
getTimeNanos()
Returns timestamp of the original event in nanoseconds.
|
long |
getTimeSequence()
Returns time and sequence of this event packaged into single long value.
|
char |
getTradeThroughExempt()
Returns TradeThroughExempt flag of this option sale event.
|
TimeAndSaleType |
getType()
Returns type of this option sale event.
|
double |
getUnderlyingPrice()
Returns underlying price at the time of this option sale event.
|
double |
getVolatility()
Returns Black-Scholes implied volatility of the option at the time of this option sale event.
|
boolean |
isCancel()
Returns whether this is a cancellation of a previous event.
|
boolean |
isCorrection()
Returns whether this is a correction of a previous event.
|
boolean |
isExtendedTradingHours()
Returns whether this event represents an extended trading hours sale.
|
boolean |
isNew()
Returns whether this is a new event (not cancellation or correction).
|
boolean |
isSpreadLeg()
Returns whether this event represents a spread leg.
|
boolean |
isValidTick()
Returns whether this event represents a valid intraday tick.
|
void |
setAggressorSide(Side side)
Changes aggressor side of this option sale event.
|
void |
setAskPrice(double askPrice)
Changes the current ask price on the market when this option sale event had occurred.
|
void |
setBidPrice(double bidPrice)
Changes the current bid price on the market when this option sale event had occurred.
|
void |
setDelta(double delta)
Changes option delta at the time of this option sale event.
|
void |
setEventFlags(int eventFlags)
Changes transactional event flags.
|
void |
setExchangeCode(char exchangeCode)
Changes exchange code of this option sale event.
|
void |
setExchangeSaleConditions(String exchangeSaleConditions)
Changes sale conditions provided for this event by data feed.
|
void |
setExtendedTradingHours(boolean extendedTradingHours)
Changes whether this event represents an extended trading hours sale.
|
void |
setIndex(long index)
Changes unique per-symbol index of this option sale event.
|
void |
setOptionSymbol(String optionSymbol)
Changes option symbol of this event.
|
void |
setPrice(double price)
Changes price of this option sale event.
|
void |
setSequence(int sequence)
Changes
getSequence() sequence number} of this option sale event. |
void |
setSize(double size)
Changes size of this option sale event.
|
void |
setSpreadLeg(boolean spreadLeg)
Changes whether this event represents a spread leg.
|
void |
setTime(long time)
Changes time of this option sale event.
|
void |
setTimeNanoPart(int timeNanoPart)
Changes microseconds and nanoseconds time part of this event.
|
void |
setTimeNanos(long timeNanos)
Changes timestamp of event.
|
void |
setTimeSequence(long timeSequence)
Changes time and sequence of this event.
|
void |
setTradeThroughExempt(char tradeThroughExempt)
Changes TradeThroughExempt flag of this option sale event.
|
void |
setType(TimeAndSaleType type)
Changes type of this option sale event.
|
void |
setUnderlyingPrice(double underlyingPrice)
Changes underlying price at the time of this option sale event.
|
void |
setValidTick(boolean validTick)
Changes whether this event represents a valid intraday tick.
|
void |
setVolatility(double volatility)
Changes Black-Scholes implied volatility of the option at the time of this option sale event.
|
String |
toString()
Returns string representation of this option sale event.
|
getEventSymbol, getEventTime, setEventSymbol, setEventTime
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getEventSymbol, getEventTime, setEventSymbol, setEventTime
public static final int MAX_SEQUENCE
setSequence(int)
,
Constant Field Valuespublic OptionSale()
public OptionSale(String eventSymbol)
eventSymbol
- event symbolpublic IndexedEventSource getSource()
DEFAULT
.getSource
in interface IndexedEvent<String>
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()
getIndex
in interface IndexedEvent<String>
public void setIndex(long index)
setIndex
in interface IndexedEvent<String>
index
- unique per-symbol index of this option sale event.public long getTimeSequence()
public void setTimeSequence(long timeSequence)
time
and/or sequence
.timeSequence
- the time and sequence.getTimeSequence()
public long getTime()
public void setTime(long time)
time
- time of this option sale event.public long getTimeNanos()
public void setTimeNanos(long timeNanos)
timeNanos
- timestamp in nanoseconds.public int getTimeNanoPart()
public void setTimeNanoPart(int timeNanoPart)
timeNanoPart
- microseconds and nanoseconds time part of this event.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 option sale event.sequence
- the sequence.IllegalArgumentException
- if the sequence is below zero or above MAX_SEQUENCE
.getSequence()
public char getExchangeCode()
public void setExchangeCode(char exchangeCode)
exchangeCode
- exchange code of this option sale event.public double getPrice()
public void setPrice(double price)
price
- price of this option sale event.public double getSize()
public void setSize(double size)
size
- size of this option sale event.public double getBidPrice()
public void setBidPrice(double bidPrice)
bidPrice
- the current bid price on the market when this option sale event had occurred.public double getAskPrice()
public void setAskPrice(double askPrice)
askPrice
- the current ask price on the market when option and sale event had occurred.public String getExchangeSaleConditions()
public void setExchangeSaleConditions(String exchangeSaleConditions)
exchangeSaleConditions
- sale conditions.public char getTradeThroughExempt()
public void setTradeThroughExempt(char tradeThroughExempt)
tradeThroughExempt
- TradeThroughExempt flag of this option sale event.public Side getAggressorSide()
public void setAggressorSide(Side side)
side
- aggressor side of this option sale event.public boolean isSpreadLeg()
true
if this event represents a spread leg.public void setSpreadLeg(boolean spreadLeg)
spreadLeg
- true
if this event represents a spread leg.public boolean isExtendedTradingHours()
true
if this event represents an extended trading hours sale.public void setExtendedTradingHours(boolean extendedTradingHours)
extendedTradingHours
- true
if this event represents an extended trading hours sale.public boolean isValidTick()
true
if this event represents a valid intraday tick.public void setValidTick(boolean validTick)
validTick
- true
if this event represents a valid intraday tick.public TimeAndSaleType getType()
public void setType(TimeAndSaleType type)
type
- type of this option sale event.public boolean isNew()
true
for newly created option sale event.true
if this is a new event (not cancellation or correction).public boolean isCorrection()
false
for newly created option sale event.true
if this is a correction of a previous eventpublic boolean isCancel()
false
for newly created option sale event.true
if this is a cancellation of a previous eventpublic double getUnderlyingPrice()
public void setUnderlyingPrice(double underlyingPrice)
underlyingPrice
- underlying price at the time of this option sale event.public double getVolatility()
public void setVolatility(double volatility)
volatility
- Black-Scholes implied volatility of the option at the time of this option sale event.public double getDelta()
public void setDelta(double delta)
delta
- option delta at the time of this option sale event.public String getOptionSymbol()
public void setOptionSymbol(String optionSymbol)
optionSymbol
- option symbol of this event.Copyright © 2002–2023 Devexperts LLC. All rights reserved.