I am interested in doing this multiple times (much like a trailing stop) based upon multiple profit target levels for any given position. My question relates to how the existing stoploss is handled. For example, if a stop loss is modified to break-even at a given profit level, and then at a higher level is modified to a new level, does the modification automatically place the new stop loss AND cancel the existing one?
On a related note, I have a question about the StopLoss calculations. The following is an excerpt from your posted example of resetting the stoploss:
// If a long position is open, allow for stop loss modification to breakeven
elseif (Position.MarketPosition == MarketPosition.Long)
{
// Once the price is greater than entry price+50 ticks, set stop loss to breakeven
if (Close[0] > Position.AvgPrice + 50 * TickSize)
{
SetStopLoss(CalculationMode.Price, Position.AvgPrice);
Would this calculate the stoploss at each tick or only at the bar close?
Thanks.

Comment