MarketData SDK

OptionQuote
in package
uses FormatsForDisplay

Represents a single option quote with associated data.

Table of Contents

Properties

$ask  : float
$ask_size  : int
$bid  : float
$bid_size  : int
$delta  : float|null
$dte  : int
$expiration  : Carbon
$extrinsic_value  : float
$first_traded  : Carbon
$gamma  : float|null
$implied_volatility  : float|null
$in_the_money  : bool
$intrinsic_value  : float
$last  : float|null
$mid  : float
$open_interest  : int
$option_symbol  : string
$side  : Side
$strike  : float
$theta  : float|null
$underlying  : string
$underlying_price  : float
$updated  : Carbon
$vega  : float|null
$volume  : int

Methods

__construct()  : mixed
Constructs a new OptionQuote instance.
__toString()  : string
Returns a string representation of the option quote.
formatChange()  : string
Format a change value with sign and currency (e.g., "+$1.25" or "-$0.50").
formatCurrency()  : string
Format a float as currency (e.g., "$150.25").
formatDate()  : string
Format a Carbon date without time (e.g., "Jan 24, 2026").
formatDateTime()  : string
Format a Carbon date with time (e.g., "Jan 24, 2026 3:45 PM").
formatGreek()  : string
Format a Greek value (4 decimal places, e.g., "0.4520").
formatNumber()  : string
Format a number with commas (e.g., "15,234").
formatPercent()  : string
Format a percentage with sign (e.g., "+3.25%" or "-1.50%").
formatPercentRaw()  : string
Format a percentage that is already in percent form (e.g., "32.50%").
formatVolume()  : string
Format volume with K/M/B suffixes (e.g., "54.9M", "12.3K").

Properties

$implied_volatility

public float|null $implied_volatility

Methods

__construct()

Constructs a new OptionQuote instance.

public __construct(string $option_symbol, string $underlying, Carbon $expiration, Side $side, float $strike, Carbon $first_traded, int $dte, float $ask, int $ask_size, float $bid, int $bid_size, float $mid, float|null $last, int $volume, int $open_interest, float $underlying_price, bool $in_the_money, float $intrinsic_value, float $extrinsic_value, float|null $implied_volatility, float|null $delta, float|null $gamma, float|null $theta, float|null $vega, Carbon $updated) : mixed
Parameters
$option_symbol : string

The option symbol according to OCC symbology.

$underlying : string

The ticker symbol of the underlying security.

$expiration : Carbon

The option's expiration date in Unix time.

$side : Side

The response will be call or put.

$strike : float

The exercise price of the option.

$first_traded : Carbon

The date the option was first traded.

$dte : int

The number of days until the option expires.

$ask : float

The ask price.

$ask_size : int

The number of contracts offered at the ask price.

$bid : float

The bid price.

$bid_size : int

The number of contracts offered at the bid price.

$mid : float

The midpoint price between the ask and the bid, also known as the mark price.

$last : float|null

The last price negotiated for this option contract at the time of this quote.

$volume : int

The number of contracts negotiated during the trading day at the time of this quote.

$open_interest : int

The total number of contracts that have not yet been settled at the time of this quote.

$underlying_price : float

The last price of the underlying security at the time of this quote.

$in_the_money : bool

Specifies whether the option contract was in the money true or false at the time of this quote.

$intrinsic_value : float

The intrinsic value of the option.

$extrinsic_value : float

The extrinsic value of the option.

$implied_volatility : float|null

The implied volatility of the option.

$delta : float|null

The delta of the option.

$gamma : float|null

The gamma of the option.

$theta : float|null

The theta of the option.

$vega : float|null

The vega of the option.

$updated : Carbon

The date/time of the quote.

__toString()

Returns a string representation of the option quote.

public __toString() : string
Return values
string

Human-readable option quote data.

formatChange()

Format a change value with sign and currency (e.g., "+$1.25" or "-$0.50").

protected formatChange(float|null $value) : string
Parameters
$value : float|null

The change value to format.

Return values
string

Formatted change string or "N/A" if null.

formatCurrency()

Format a float as currency (e.g., "$150.25").

protected formatCurrency(float|null $value) : string
Parameters
$value : float|null

The value to format.

Return values
string

Formatted currency string or "N/A" if null.

formatDate()

Format a Carbon date without time (e.g., "Jan 24, 2026").

protected formatDate(Carbon|null $date) : string
Parameters
$date : Carbon|null

The date to format.

Return values
string

Formatted date string or "N/A" if null.

formatDateTime()

Format a Carbon date with time (e.g., "Jan 24, 2026 3:45 PM").

protected formatDateTime(Carbon|null $date) : string
Parameters
$date : Carbon|null

The date to format.

Return values
string

Formatted date string or "N/A" if null.

formatGreek()

Format a Greek value (4 decimal places, e.g., "0.4520").

protected formatGreek(float|null $value) : string
Parameters
$value : float|null

The Greek value to format.

Return values
string

Formatted Greek string or "N/A" if null.

formatNumber()

Format a number with commas (e.g., "15,234").

protected formatNumber(int|null $value) : string
Parameters
$value : int|null

The number to format.

Return values
string

Formatted number string or "N/A" if null.

formatPercent()

Format a percentage with sign (e.g., "+3.25%" or "-1.50%").

protected formatPercent(float|null $value) : string

Assumes input is a decimal (0.30 = 30%).

Parameters
$value : float|null

The decimal value to format as percentage.

Return values
string

Formatted percentage string or "N/A" if null.

formatPercentRaw()

Format a percentage that is already in percent form (e.g., "32.50%").

protected formatPercentRaw(float|null $value) : string

Use this for values like implied volatility that are already percentages.

Parameters
$value : float|null

The percentage value to format.

Return values
string

Formatted percentage string or "N/A" if null.

formatVolume()

Format volume with K/M/B suffixes (e.g., "54.9M", "12.3K").

protected formatVolume(int|null $value) : string
Parameters
$value : int|null

The volume to format.

Return values
string

Formatted volume string or "N/A" if null.


        
On this page

Search results