I attached some screens capture where you can see it:


The strategy code ist simple:
.
.
.
protected override void OnBarUpdate()
{
mylong = "myconditionstolong";
myshort= "myconditionstoshort";
if (ellargo < Close[0]){ExitShort();EnterLong(DefaultQuantity, "");}
if (elcorto > Close[0]){ExitLong();EnterShort(DefaultQuantity, "");}
// Resets the stop loss to the original value when all positions are closed
if (Position.MarketPosition == MarketPosition.Flat){
SetStopLoss(CalculationMode.Ticks, mistop);
}
// If a long position is open, allow for stop loss modification to breakeven
else if (Position.MarketPosition == MarketPosition.Long){
if (Close[0] == Position.AvgPrice + 9 * TickSize){
SetStopLoss(CalculationMode.Price, Position.AvgPrice + 1 * TickSize);
}
if (Close[0] == Position.AvgPrice + 18 * TickSize){
SetStopLoss(CalculationMode.Price, Position.AvgPrice + 9 * TickSize);
}
(etc ................)
}
.
.
.
.
.

Comment