I am trying to understand how to properly modify a stop order to execute on a trailing stop value. I am using the following code.
case MarketPosition.Short: // === OPEN SHORT POSITION
// ... retrieve the current value of the trailing stop
trailValue = TrailDown.TrailStop[0];
// ... we have an open short position; modify the stop loss value as per the trailing stop
if (High[0] < trailValue)
{
// ... check to see if the stop order for the open short position has been submitted already
if (stopOrder != null && stopOrder.StopPrice > trailValue)
{
// ... modify the stop loss to the new value of the trailing stop
stopOrder = ExitShortStop(0, true, stopOrder.Quantity, trailValue, "ShortStop", "ShortEntry");
}
}
break;
7/27/2014 7:05:00 PM Entered internal PlaceOrder() method at 7/27/2014 7:05:00 PM: BarsInProgress=0 Action=BuyToCover OrderType=Stop Quantity=1 LimitPrice=0 StopPrice=1138.0 SignalName='ShortStop' FromEntrySignal='ShortEntry'
7/27/2014 7:05:00 PM Amended open order: Action=BuyToCover OrderType=Stop Quantity=1 LimitPrice=0 StopPrice=1138.0 SignalName=ShortStop' FromEntrySignal='ShortEntry'
Can someone please explain whether this is "normal"? I would think the first statement - the place order - would be sufficient so why the amend when there is no amendment of the stop price taking place?
Thank you for any clarification/explanation you provide.

Comment