The price at which your order was filled does not seem to be available via the API, even though it is available to the IDE.
At https://www.quantopian.com/help, scroll the table of contents on the left to "Order object" and click on it. You will see a description of the structure of the order objects returned by the order
function. Fields of this object are updated later, as the order is filled. One field is amount
and holds the number of shares ordered in this order (positive to buy, negative to sell). Another is filled
and holds the number of shares filled (bought or sold, respectively) for this order so far. There is Commission
(why capitalized?). There is nothing that would tell you, or let you calculate, how much money, net of commissions, you have been charged for the shares that have been filled. (Have in mind that, in general, you will be charged a different price than data[sid].price
, the most recent price available to you at the time you placed your order, and that the order, especially if large, may have been filled by different sellers/buyers at different prices.)
In my opinion, the amount
field should be renamed number
, nShares
, or number_of_shares
, since in general the word "amount" refers to uncountables, like water and money, and "number" to countables, like stock shares or people. Then another field, called amount
, should be added, and updated to hold the money amount charged for the filled shares, net of commissions. With that, amount/filled
would yield the volume-weighted average price, net of commissions, at which the order has been filled. After the order has been filled in full, this would equal amount/number
, and amount+commission
the total cost of the order.