Position

This object represents a position. Each position belongs to a specific strategy. Position object has the following properties

  • strategy (str): the strategy name that this order belongs to

  • symbol (str): the string representation of the asset e.g. “GOOG” for Google

  • quantity (int): the number of shares held

  • orders (list(order)): a list of orders objects responsible for the current state of the position

Position objects have also the following helper methods

  • get_selling_order(): returns an order for selling all the shares attached to this position.

Documentation

class entities.position.Position(strategy, asset, quantity, orders=None, hold=0, available=0)

Bases: object

add_order(order, quantity)
property available
get_selling_order(quote_asset=None)

Returns an order that can be used to sell this position.

Parameters

None

Returns

order – An order that can be used to sell this position.

Return type

Order

property hold
property quantity
value_type(value)