I have looked at Josh's sample strategy price modification but am not good at programming and I am getting compile errors line 68
I want to set it up like my ATM where I hit a target and move the stop to + 3 ticks or use an indicator to set the stop like (SMA76 (-5))
I have 2 positions A + B. I want to set the target as variable perhaps the first target has not been hit and I want them to both come forward static then as the SMA overcomes the point of reference I want the stop to be Equal to the indicator plus or minus a variable. Or perhaps the first Target has been hit and I want to trail the second.
Any help would be appreciated.

Raef
SetProfitTarget("PositionA", CalculationMode.Ticks, TargetA);
SetProfitTarget("positionB", CalculationMode.Ticks, TargetB);
SetStopLoss("PositionA", CalculationMode.Ticks, StopA, false);
SetStopLoss("positionB", CalculationMode.Ticks, StopB, false);
CalculateOnBarClose = true;
}
///<summary>
/// Called on each bar update event (incoming tick)
///</summary>
protectedoverridevoid OnBarUpdate()
{
// Resets the stop loss to the original value when all positions are closed
if (Position.MarketPosition == MarketPosition.Flat)
{
SetStopLoss("PositionA",CalculationMode.Ticks, StopA, false);
SetStopLoss("positionB",CalculationMode.Ticks, StopB, false);
}
// 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+TargetA+2 ticks, set stop loss to breakeven+3
if (Close[0] > Position.AvgPrice + (TargetA + 2) * TickSize)
{
SetStopLoss(CalculationMode.Price, Position.AvgPrice + 3 * TickSize);
}
}

Comment