Object: ggOption
Overview
The ggOption
object contains detailed data for a specific options contract at 1-minute and 5-minute intervals. This object provides access to complete pricing information, Greeks, and other market metrics for individual option contracts.
Data Structure
Each ggOption
object represents a single options contract with its associated time-series data. The object includes comprehensive option details such as:
- Contract identifiers
- Pricing information
- Greek values
- Volume and open interest
- Strike price and expiration information
Schema
JSON Schema
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "StockOptionsProfile",
"description": "Describes stock options, including historical data organized by timestamps.",
"type": "object",
"properties": {
"symbol": {
"description": "Underlying stock's ticker symbol.",
"type": "string"
},
"optionType": {
"description": "Type of the option (call or put).",
"type": "string",
"enum": ["call", "put"]
},
"strikePrice": {
"description": "Strike price of the option.",
"type": "number"
},
"expirationDate": {
"description": "Expiration date of the option.",
"type": "string",
"format": "date"
},
"historicalData": {
"description": "Dictionary of historical data for the option, keyed by timestamps.",
"type": "object",
"additionalProperties": {
"type": "object",
"properties": {
"oneMinute": {
"description": "1-minute candle data.",
"type": "object",
"properties": {
"open": { "type": "number" },
"high": { "type": "number" },
"low": { "type": "number" },
"close": { "type": "number" },
"volume": { "type": "integer", "minimum": 0 }
},
"required": ["open", "high", "low", "close", "volume"]
},
"fiveMinute": {
"description": "Optional 5-minute candle data.",
"type": "object",
"properties": {
"open": { "type": "number" },
"high": { "type": "number" },
"low": { "type": "number" },
"close": { "type": "number" },
"volume": { "type": "integer", "minimum": 0 }
},
"required": ["open", "high", "low", "close", "volume"]
}
},
"required": ["oneMinute"]
}
}
},
"required": ["symbol", "optionType", "strikePrice", "expirationDate", "historicalData"]
}
YANG Schema
module stock-options-profile {
namespace "http://example.com/stock-options-profile";
prefix sop;
organization "Example Organization";
description "Describes the options for a stock, including historical data keyed by timestamps.";
container stockOptionsProfile {
leaf symbol {
type string;
description "Underlying stock's ticker symbol.";
}
leaf optionType {
type enumeration {
enum call {
description "Call option.";
}
enum put {
description "Put option.";
}
}
description "Type of the option (call or put).";
}
leaf strikePrice {
type decimal64 {
fraction-digits 2;
}
description "Strike price of the option.";
}
leaf expirationDate {
type string;
description "Expiration date of the option.";
}
container historicalData {
description "Dictionary of historical data for the option, keyed by timestamps.";
list candleData {
key "timestamp";
leaf timestamp {
type string;
description "Timestamp marking the beginning of the historical data point.";
}
container oneMinute {
description "1-minute candle data.";
leaf open {
type decimal64 {
fraction-digits 2;
}
}
leaf high {
type decimal64 {
fraction-digits 2;
}
}
leaf low {
type decimal64 {
fraction-digits 2;
}
}
leaf close {
type decimal64 {
fraction-digits 2;
}
}
leaf volume {
type uint64;
description "Volume of options traded.";
}
}
container fiveMinute {
description "Optional 5-minute candle data.";
leaf open {
type decimal64 {
fraction-digits 2;
}
}
leaf high {
type decimal64 {
fraction-digits 2;
}
}
leaf low {
type decimal64 {
fraction-digits 2;
}
}
leaf close {
type decimal64 {
fraction-digits 2;
}
}
leaf volume {
type uint64;
description "Volume of options traded.";
}
}
}
}
}
}
Key Properties
The ggOption
object includes the following key components:
Property | Description | Example |
---|---|---|
putCall | Type of option (PUT or CALL) | "PUT" |
symbol | Option contract symbol | "AAPL_031023P150" |
description | Human-readable option description | "AAPL Mar 10 2023 150 Put (Weekly)" |
strikePrice | Option strike price | 150.0 |
expirationDate | Unix timestamp of expiration date | 1678482000000 |
daysToExpiration | Number of days until expiration | 3 |
bid | Current bid price | 0.6 |
ask | Current ask price | 0.6 |
last | Price of last trade | 0.6 |
mark | Current mark price | 0.6 |
delta | Option delta value | -0.206 |
gamma | Option gamma value | 0.056 |
theta | Option theta value | -0.145 |
vega | Option vega value | 0.05 |
rho | Option rho value | -0.004 |
openInterest | Open interest for the contract | 32917 |
inTheMoney | Indicates if option is in the money | false |
Example Option Data (AAPL $150 Put)
{
"putCall": "PUT",
"symbol": "AAPL_031023P150",
"description": "AAPL Mar 10 2023 150 Put (Weekly)",
"exchangeName": "OPR",
"bid": 0.6,
"ask": 0.6,
"last": 0.6,
"mark": 0.6,
"bidSize": 1,
"askSize": 5,
"bidAskSize": "1X5",
"lastSize": 0,
"highPrice": 0.62,
"lowPrice": 0.6,
"openPrice": 0.0,
"closePrice": 0.6,
"totalVolume": 42,
"tradeDate": null,
"tradeTimeInLong": 1678199401600,
"quoteTimeInLong": 1678199403152,
"netChange": 0.0,
"volatility": 29.101,
"delta": -0.206,
"gamma": 0.056,
"theta": -0.145,
"vega": 0.05,
"rho": -0.004,
"openInterest": 32917,
"timeValue": 0.6,
"theoreticalOptionValue": 0.595,
"theoreticalVolatility": 29.0,
"strikePrice": 150.0,
"expirationDate": 1678482000000,
"daysToExpiration": 3,
"expirationType": "S",
"lastTradingDay": 1678496400000,
"multiplier": 100.0,
"inTheMoney": false
}
Option Symbol Format
The option symbol follows a standardized format that encodes key contract information:
UNDERLIER_MMDDYYC/PSTRIKE
Where:
UNDERLIER
- The ticker symbol of the underlying asset (e.g., "AAPL")MMDDYY
- Expiration date in month/day/year format (e.g., "031023" for March 10, 2023)C/P
- Contract type, either "C" for call or "P" for putSTRIKE
- Strike price of the option (e.g., "150" for $150.00)
Example: AAPL_031023P150
represents an Apple put option with a strike price of $150 expiring on March 10, 2023.
Accessing Data
Option data can be accessed using the epoch timestamp as an index:
# Access the current data for a specific option
current_epoch = goldengoose.get_current_epoch()
current_option_data = option[current_epoch]
# Access specific properties
current_price = current_option_data.mark
current_delta = current_option_data.delta
Usage Example
import goldengoose
# Get a specific Apple put option with $150 strike expiring March 10, 2023
aapl_put = goldengoose.options.get("AAPL_031023P150")
# Get current epoch
current_epoch = goldengoose.get_current_epoch()
# Access the current option data
current_data = aapl_put[current_epoch]
# Print pricing information
print(f"Current {current_data.description}")
print(f"Bid: ${current_data.bid}, Ask: ${current_data.ask}, Mark: ${current_data.mark}")
# Print the Greeks
print(f"Delta: {current_data.delta}")
print(f"Gamma: {current_data.gamma}")
print(f"Theta: {current_data.theta}")
print(f"Vega: {current_data.vega}")
print(f"Rho: {current_data.rho}")
# Check if option is in the money
if current_data.inTheMoney:
print("Option is in the money")
else:
print("Option is out of the money")
Notes
- The
expirationType
field indicates the option type: "S" for weekly options, "R" for regular options - Greek values might appear as "NaN" when not available or calculable
- The
timeValue
property shows the extrinsic value of the option - The
theoreticalOptionValue
represents the calculated fair value based on the model - The
inTheMoney
boolean indicates whether the option has intrinsic value