Skip to content

paper_trading/alpaca.py: submitOrder response list never read after thread joins #1414

Description

@atharvajoshi01

While fixing the threading bug in #1399 (merged in #1410), I noticed that the respSO lists passed to each submitOrder thread are never read after the threads are joined.

respSO = []
tSubmitOrder = threading.Thread(
    target=self.submitOrder,
    args=(qty, self.stockUniverse[index], "sell", respSO),
)
tSubmitOrder.start()
threads.append(tSubmitOrder)

After x.join(), the collected responses in respSO are ignored. If submitOrder is meant to return order status or fill information through this list, it's being silently discarded. If it's not needed, the parameter could be removed to simplify the code.

Spotted during the #1399 fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions