IExecution
Previous Topic  Next Topic 

Definition
Represents a read only interface that exposes information regarding an execution (fill) resulting from an order and is passed as a parameter in the OnExecution() method.


* The "Price" property may return a value that is not aligned to the underlying instruments tick size. This can happen if the original order price was submitted not aligned to tick size or if the period in time being backtested contains split/dividend back adjusted data that is also not aligned to tick size. However, most if not all execution grid displays will display a rounded to tick size value. You can also use the method Round2Ticksize().


Methods and Properties

Commission

A double value representing the commission of an execution

ExecutionId

A string value representing the exchange generated execution id

Instrument

An Instrument value representing the instrument of an order

MarketPosition

Possible values are:


MarketPosition.Long

MarketPosition.Short

Name


Order

An IOrder value representing an order associated to the execution

Price

A double value representing the price of an execution

Quantity

An int value representing quantity of an execution

Time

A DateTime structure representing the time the execution occured

Token

A string representing the unique id of an execution

ToString()

A string representation of an execution


Examples

private IOrder entryOrder = null;

protected override void OnBarUpdate()
{
    if (entryOrder == null && Close[0] > Open[0])
        entryOrder = EnterLong();
}

protected override void OnExecution(IExecution execution)
{
    if (entryOrder != null && entryOrder.Token == execution.Order.Token)
        Print(execution.ToString());
}