An asset object represents securities such as stocks or options in Lumibot. Attributes that are tracked for assets are:

  • symbol(str): Ticker symbol representing the stock or underlying for options. So for example if trading IBM calls the symbol would just be IBM.

  • asset_type(str): Asset type can be either stock, option, future, forex. default: stock

  • name(str): Optional to add in the name of the corporation for logging or printout.

Options Only

  • expiration (str): Expiration of the options contract. Format is

  • strike(float): Contract strike price.

  • right(str): May enter call or put.

  • multiplier(float): Contract multiplier to the underlying. (default: 1)

Futures Only

Set up a futures contract using the following:

  • symbol(str): Ticker symbol for the contract, > eg: ES

  • asset_type(str): “future”

  • nexpiration(str): Expiry added as So June 2021 would be, 6, 18)`

Forex Only

  • symbol(str): Currency base: eg: EUR

  • currency(str): Conversion currency. eg: GBP

  • asset_type(str): “forex”

When creating a new security there are two options.

  1. Security symbol: It is permissible to use the security symbol only when trading stocks. Lumibot will convert the ticker symbol to an asset behind the scenes.

  2. Asset object: Asset objects may be created at anytime for stocks or options. For options, futures, or forex asset objects are mandatory due to the additional details required to identify and trade these securities.

Assets may be created using the Asset() method as follows: Asset(symbol, asset_type=option, **kwargs) * see attributes above.


For stocks:

from lumibot.entities import Asset

asset = Asset('SPY', asset_type="stock")
order = self.create_order(asset, 10, "buy")

For futures:

from lumibot.entities import Asset

asset = Asset(
'ES', asset_type="future",, 6, 18)
order = self.create_order(asset, 10, "buy")


class entities.asset.Asset(symbol: str, asset_type: str = 'stock', expiration: Optional[] = None, strike: float = 0.0, right: Optional[str] = None, multiplier: int = 1, currency: str = 'USD', precision: Optional[str] = None)

Bases: object

This is a base class for Assets including stocks, futures, options, forex, and crypto.

  • symbol (str) – Symbol of the stock or underlying in case of futures/options.

  • asset_type (str) – Type of the asset. Asset types are only ‘stock’, ‘option’, ‘future’, ‘forex’, ‘crypto’ default : ‘stock’

  • expiration ( – Option or futures expiration. The will be converted to broker specific formats. IB Format: for options “YYYYMMDD”, for futures “YYYYMM”

  • strike (str) – Options strike as string.

  • right (str) – ‘CALL’ or ‘PUT’ default : “”

  • multiplier (int) – Price multiplier. default : 1

  • currency (str) – Base currency, (default=None)


The symbol used to retrieve stock quotes if stock. The underlying symbol if option. For Forex: The base currency.


string (required)


One of the following: - ‘stock’ - ‘option’ - ‘future’ - ‘forex’ - ‘crypto’


(string, default: stock)


Contract expiration dates for futures and options.

Type (required if asset_type is ‘option’ or ‘future’)


Contract strike price.


float (required if asset_type is ‘option’)


Option call or put.


str (required if asset_type is ‘option’)


Contract leverage over the underlying.


int (required if asset_type is ‘forex’)


string (required if asset_type is ‘forex’)


Conversion currency.


str (required if asset_type is ‘crypto’)


Acceptable asset types.


list of str


Acceptable values for right.


list of str


validates asset types.


validates rights types.


>>> # Create an Asset object for a stock.
>>> from lumibot.entities import Asset
>>> asset = Asset(symbol="AAPL")
>>> # Create an Asset object for a futures contract.
>>> from lumibot.entities import Asset
>>> asset = Asset(symbol="ES", asset_type='future',, 12, 17))
>>> # Create an Asset object for an options contract.
>>> from lumibot.entities import Asset
>>> asset = Asset(
>>>     symbol="AAPL",
>>>     asset_type='option',
>>>, 11, 26),
>>>     strike=155,
>>>     right= 'CALL',
>>>     currency="USD"
>>> )
>>> # Create an Asset object for a FOREX contract.
>>> from lumibot.entities import Asset
>>> asset = Asset(symbol="USD", asset_type='forex', currency="EUR")
>>> order = self.create_order(asset, 100, 'BUY')
>>> self.submit_order(order)
>>> # Create an Asset object for crypto.
>>> from lumibot.entities import Asset
>>> base = Asset(symbol="BTC", asset_type='crypto')
>>> quote = Asset(symbol="USDT", asset_type='crypto')
>>> order = self.create_order(asset, 100, 'BUY', quote=quote)
>>> self.submit_order(order)
asset_type: str = 'stock'
currency: str = 'USD'
expiration: = None
multiplier: int = 1
precision: str = None
right: str = None
strike: float = 0.0
symbol: str
class entities.asset.AssetsMapping(mapping)

Bases: collections.UserDict