Hey experts,

I'm starting off with Lean in C# and I'm stuck to receive the actual purchase price of my submitted orders.

I place my orders with a StopLimitOrder which works fine.

Every 10 minutes I dumb a log with all my open positions:

foreach (var v in Portfolio.Transactions.GetOpenOrders())
  var orderTicket = Transactions.GetOrderTicket(v.Id);
  var price = orderTicket.AverageFillPrice;
  Log("Text: " + v);
  Log("order: " + v.Id + " " + price + v.Quantity + v.Status);

This creates e.g. following log:

2017-01-03 03:00:00 :Text: OrderId: 1 Submitted StopLimit order for -47785 units of EURUSD at stop 1.04484 limit 1.04784

2017-01-03 03:00:00 :order: 1 0-47785Submitted

Where I just dumb v into the log I get stop and limit values

when I drill down into the fields the price is always 0, same as I I would use v.Value

v.Stop and v.Limit seems to be wrong as the build moans that this is not available for order type.


How can I manually extract the stop and limit value (and perhaps the actual purchase price)?


It's probably something simple/silly but whatever I try it results to 0 or invalid to build.