Get avg_entry_price for a filled order


#1

I’m using context.blotter.orders[self.catalyst_order_id] to access data for recently completed orders.

I can see the amount_filled field in there to see how much was bought. How do I get the average price the order completed at?

I see in the code there are transactions and orders. Am I using the right approach to examine completed orders? I keep a list of opened order ids which I compare to blotter.open_orders then I get info from context.blotter.orders as orders drop out of the blotter.open_orders list.


#2

I found the answer: call catalyst.api.get_order() with return_price=True.

See: https://enigma.co/catalyst/appendix.html