I'm using a sample from you, which define stop and profit the following way:
if (entryOrder != null && entryOrder == execution.Order)
{
// This second if-statement is meant to only let fills and cancellations filter through.
if (execution.Order.OrderState == OrderState.Filled || execution.Order.OrderState == OrderState.PartFilled || (execution.Order.OrderState == OrderState.Cancelled && execution.Order.Filled > 0))
{
// Simple stop and target
stopOrder = ExitLongStopMarket(0, true, 1, execution.Price - 10 * TickSize, "stop", "long limit entry");
targetOrder = ExitLongLimit(0, true, 1, execution.Price + 20 * TickSize, "target", "long limit entry");
// Resets the entryOrder object to null after the order has been filled
if (execution.Order.OrderState != OrderState.PartFilled)
{
entryOrder = null;
}
}
}
Once one of these 2 prices are reached, filled the exit order and then exit the position, I would like to get the resultant real exit price for this position and assign this to a variable. Could I see some example?
Thanks,
Federico

Comment