- Docs Home
- Intro to Alta5
- Guides
- Charts & Indicators
- Date Utilities
- Math & Decimal Numbers
- API Docs
- $a5
- $data
- $$
- Bot
- Chart
- Collection
- Date
- Indicators
- Opportunity
- Security
- Snapshot
- Tutorials on Blog
- Tasty Condor
- Stronghold

# Security API

A Security variable represents a stock, option, index or ETF with properties containing real-time market pricing, greeks and other analytics. Security variables are defined by adding an item to the strategy's Watchlist or can be defined in the wake event with code. See the $data API for details about defining security variables with code.

You can use $log to inspect a security variable in the Alta5 Console:

Properties on a `Security`

variable, such as the `bid`

, `ask`

or `last`

, are
streamed from the market in **real-time** and will always have
the latest up-to-date value.

### All Securities

Number The current ask for the security.

Number The quantity being offered at the ask price for the security.

Number The current bid for the security.

Number The current bid quantity for the security.

Number The difference between the last close price and the last trade price today.

Number The difference between the last close price and the last trade price today as a decimal percentage.

Number The daily close for the security.

String The display name for the security.

String The code for the exchange on which the security is traded.

Number The daily high for the security.

Number The last trade price for the security.

Number The daily low for the security.

Number The daily open for the security.

Number A calculated mid price for the security half way between the bid and ask price.

Number The quantity of the last trade for the security.

String The symbol for the security.

Number The daily volume for the security.

### Equity and Index

Number Annual volatility for this security as a decimal. Calculated as

sd30 * √252 .Number The standard deviation of the price of this security over a period of 30 days.

Number The standard deviation of the price of this security over a period of the last

*N*days.*N*can be 5, 10, 15, 30, 90

### Options

Number The number of days until expiration.

Number The delta greek value for the option.

Date The expiration date for the option.

Number The gamma greek value for the option.

Number The implied volatility value for the option. Also aliased as

`iv`

.Number Total open interest for the option.

Number For call options, this is the difference between the underlying's price and the strike price. For put options, it is the difference between the strike price and the underlying's price.

Boolean True for call options.

Boolean True if the option is expired.

Boolean True for put options.

Boolean True if the option is in the money (ITM).

Boolean Alias for

`impliedVolatility`

.Number The rho greek for the option.

Number The strike price value for the option.

Number The theta greek value for the option.

Number The option price -

`intrinsicValue`

.String `'call'`

or`'put'`

.Security A Security object for the underlying.

Number The vega greek value for the option.