Asset API Reference

Detailed Reference

class zipline.assets.Asset

Base class for entities that can be owned by a trading algorithm.

sid

Persistent unique identifier assigned to the asset.

Type:int
symbol

Most recent ticker under which the asset traded. This field can change without warning if the asset changes tickers. Use sid if you need a persistent identifier.

Type:str
asset_name

Full name of the asset.

Type:str
exchange

Canonical short name of the exchange on which the asset trades (e.g., 'NYSE').

Type:str
exchange_full

Full name of the exchange on which the asset trades (e.g., 'NEW YORK STOCK EXCHANGE').

Type:str
country_code

Two character code indicating the country in which the asset trades.

Type:str
start_date

Date on which the asset first traded.

Type:pd.Timestamp
end_date

Last date on which the asset traded. On Quantopian, this value is set to the current (real time) date for assets that are still trading.

Type:pd.Timestamp
tick_size

Minimum amount that the price can change for this asset.

Type:float
auto_close_date

Date on which positions in this asset will be automatically liquidated to cash during a simulation. By default, this is three days after end_date.

Type:pd.Timestamp
to_dict()

Convert to a python dict containing all attributes of the asset.

This is often useful for debugging.

Returns:as_dict
Return type:dict
class zipline.assets.Equity

Asset subclass representing partial ownership of a company, trust, or partnership.

class zipline.assets.ContinuousFuture

ContinuousFuture(long_t sid, root_symbol, int offset, roll_style, start_date, end_date, exchange_info, adjustment=None)

Represents a specifier for a chain of future contracts, where the coordinates for the chain are: root_symbol : str

The root symbol of the contracts.
offset : int
The distance from the primary chain. e.g. 0 specifies the primary chain, 1 the secondary, etc.
roll_style : str
How rolls from contract to contract should be calculated. Currently supports 'calendar'.

Instances of this class are exposed to the algorithm.

class zipline.assets.Future

Asset subclass representing ownership of a futures contract.