MarketData SDK

Strikes extends ResponseBase
in package

Represents a collection of option strikes with associated data.

Table of Contents

Properties

$_saved_filename  : string|null
$dates  : array<string, array<string|int, int>>
The expiration dates requested for the underlying with the option strikes for each expiration.
$next_time  : Carbon|null
Time of the next quote if there is no data in the requested period, but there is data in a subsequent period.
$prev_time  : Carbon|null
Time of the previous quote if there is no data in the requested period, but there is data in a previous period.
$status  : string
Status of the strikes request. Will always be ok when there is data for the candles requested.
$updated  : Carbon|null
The date and time of this list of options strikes was updated in Unix time.
$csv  : string
$html  : string

Methods

__construct()  : mixed
Constructs a new Strikes instance from the given response object.
__toString()  : string
Returns a string representation of the strikes collection.
getCsv()  : string
Get the CSV content of the response.
getHtml()  : string
Get the HTML content of the response.
isCsv()  : bool
Check if the response is in CSV format.
isHtml()  : bool
Check if the response is in HTML format.
isJson()  : bool
Check if the response is in JSON format.
saveToFile()  : string
Save CSV/HTML content to a file.

Properties

$_saved_filename

public string|null $_saved_filename = null

The filename where the response was saved (if filename parameter was used).

$dates

The expiration dates requested for the underlying with the option strikes for each expiration.

public array<string, array<string|int, int>> $dates = []

$next_time

Time of the next quote if there is no data in the requested period, but there is data in a subsequent period.

public Carbon|null $next_time = null

$prev_time

Time of the previous quote if there is no data in the requested period, but there is data in a previous period.

public Carbon|null $prev_time = null

$status

Status of the strikes request. Will always be ok when there is data for the candles requested.

public string $status = 'no_data'

$updated

The date and time of this list of options strikes was updated in Unix time.

public Carbon|null $updated = null

For historical strikes, this number should match the date parameter.

$csv

protected string $csv

The CSV content of the response.

$html

protected string $html

The HTML content of the response.

Methods

__construct()

Constructs a new Strikes instance from the given response object.

public __construct(object $response) : mixed
Parameters
$response : object

The response object containing strikes data.

__toString()

Returns a string representation of the strikes collection.

public __toString() : string
Return values
string

Human-readable strikes summary.

getCsv()

Get the CSV content of the response.

public getCsv() : string
Tags
throws
InvalidArgumentException

If the response is not in CSV format.

Return values
string

The CSV content.

getHtml()

Get the HTML content of the response.

public getHtml() : string
Tags
throws
InvalidArgumentException

If the response is not in HTML format.

Return values
string

The HTML content.

isCsv()

Check if the response is in CSV format.

public isCsv() : bool
Return values
bool

True if the response is in CSV format, false otherwise.

isHtml()

Check if the response is in HTML format.

public isHtml() : bool
Return values
bool

True if the response is in HTML format, false otherwise.

isJson()

Check if the response is in JSON format.

public isJson() : bool
Return values
bool

True if the response is in JSON format, false otherwise.

saveToFile()

Save CSV/HTML content to a file.

public saveToFile(string $filename) : string
Parameters
$filename : string

The file path to save to.

Tags
throws
InvalidArgumentException

If filename is invalid (wrong extension, etc.).

throws
RuntimeException

If file writing fails.

Return values
string

The absolute path of the saved file.


        
On this page

Search results