Position

class hokohoko.entities.Position(order, future, status, open_time, close_time, open_rate, close_rate, held_value, initial_value, final_value)

Bases: object

A Position is an Order that has been activated. It includes all the relevant information for assessing the effectiveness of the Order, for parsing with an Assessor.

Parameters
  • order (hokohoko.entities.Order) – The Order linked to this Position. Note: the Order may not have been activated, but will still be listed.

  • future (hokohoko.entities.Bar) – The future Bar this Order was active during.

  • status (hokohoko.entities.Status.) – The closing Status of the Order.

  • open_time (numpy.int64) – The UTC timestamp when the Order was opened, if applicable.

  • close_time (numpy.int64) – The UTC timestamp when the Order was closed, if applicable.

  • open_rate (numpy.float32) – The rate at which the Order opened. This may differ from the requested rate, due to slippage.

  • close_rate (numpy.float32) – The rate at which the Order closed. This may differ from the requested rate, due to slippage.

  • held_value (numpy.float64) – An internal value used to calculate minute-by-minute Equity during benchmarking.

  • initial_value (numpy.float64) – An internal value used to calculate Balance changes. This is the initial Equity for the Position.

  • final_value (numpy.float64) – An internal value used to calculate Balance changes. This is the final Equity for the Postion.