result package - fastlob

Hide navigation sidebar
Hide table of contents sidebar
Skip to content
Back to top
Toggle table of contents sidebar

# result package

## Submodules

## result.result module

The result object is returned by the LOB after the client executes an operation.

class fastlob.result.result.ExecutionResult(result)

  Bases: `object`

  The object returned to the client.

  execprices()

    Getter for execprices dict. This dictionary contains the quantity matched at each price level.

    Return type:

      `Optional`[`defaultdict`[`Decimal`, `Decimal`]]

  kind()

    Getter for the result kind, one of LIMIT, CANCEL, MARKET or ERROR.

    Return type:

      `ResultType`

  messages()

    Getter for info messages.

    Return type:

      `list`[`str`]

  n_orders_matched()

    Getter for number of orders matched during execution.

    Return type:

      `int`

  orderid()

    Getter for identifier of order executed or canceled.

    Return type:

      `str`

  success()

    Getter for success attribute, true if the operation was executed succesfully.

    Return type:

      `bool`

class fastlob.result.result.ResultBuilder(kind, orderid)

  Bases: `object`

  The object constructed by the lob during execution.

  add_message(message)

    Add an information message destined to the user.

  build()

    Build the ExecutionResult object destined to the client.

  inc_execprices(price, qty)

    Increment the number of orders matched at a certain price.

  inc_orders_matched(orders_matched)

    Increment the total number of orders matched.

  static market_to_partial(result_market)

    Change the kind of a MARKET result to PARTIAL_MARKET.

  static new_cancel(orderid)

    Instantiate a new CANCEL result.

  static new_error()

    Instantiate a new ERROR result.

  static new_limit(orderid)

    Instantiate a new LIMIT result.

  static new_market(orderid)

    Instantiate a new MARKET result.

  set_success(success)

    Setter for success attribute, this attribute should be true if the operation was properly executed.

  success()

    Getter for success attribute, this attribute should be true if the operation was properly executed.

    Return type:

      `bool`

## Module contents

The result object is returned by the LOB after the client executes an operation.