- First step
- Intro to Alta5
- Guides
- Using the $data API
- Capital & risk controls
- Bot control panels
New - Interactions & prompts
New - Managing opportunities
- Charts & indicators
- Date utilities
- Math & decimal numbers
- Opportunities
- Equity
- Call option
- Put option
- Bear call spread
- Bull put spread
- Iron condor spread
- APIs
- $a5
- $data
- $$
- Bot
- Collection
- OptionRange
- OptionSeries
- Security
- Snapshot
- Tutorials on Blog
- Tasty Condor
- Stronghold

# Security API

A Security object represents a stock, option, index or ETF with properties containing real-time market pricing, greeks and other analytics.

## Usage

Security objects are automatically loaded for each variable in the bot's Watchlist. They can also be loaded in the wake event script using $data.security:

```
// Load $spx variable
$data.security({id: 'spx', symbol: 'SPX'}).then($done);
```

### Inspecting a security

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 half way between the bid and ask price.

Number A calculated mid price 75% of the way towards the 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.

## Equities and indices

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

## Call & put 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 if this is the first (lowest) available strike price of the option series.

Boolean True if this is the last (highest) available strike price of the option series.

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.