Definition
Amends an Unmanaged order.
Syntax
ChangeOrder(IOrder iOrder, int quantity, double limitPrice, double stopPrice)
Parameters
iOrder
|
IOrder object of the order you wish to amend
|
quantity
|
Order quantity
|
limitPrice
|
Order limit price. Use "0" should this parameter be irrelevant for the OrderType being submitted.
|
stopPrice
|
Order stop price. Use "0" should this parameter be irrelevant for the OrderType being submitted.
|
Examples
private IOrder stopOrder = null;
protected override void OnBarUpdate()
{
if (stopOrder != null && stopOrder.StopPrice < Position.AvgPrice && Close[0] >= Position.AvgPrice + 4 * TickSize)
ChangeOrder(stopOrder, stopOrder.Quantity, stopOrder.LimitPrice, Position.AvgPrice);
}
|
|
|