I´m still working with one problem I can not make clear: I want to move stoplosses referring to certain profits. I can modify ONE TIME the price to breakeven (or to a certain new stop) once the price is greater (lower) certain ticks. BUT I can not move it SEVERAL times eg when the price is eg 9 ticks in profit to breakeven (this first step of course is OK) BUT then when price is eg 20 ticks in profit setstoploss to Entry price +9 (or current price - 11) and when price is eg 40 ticks in profit setstoploss to Entry price +35( or current price -5). I´ve changed several times the IF and ELSEIF conditions but I can´t find the problem. When there are 2 condtions it is always filled the one with the smaller profit - even when I change the position and code the higher price before - but this should only be important with using ELSEIF and not with IF as with IF all condtions are examined even one is filled. (Of course I have read the "SamplePriceModification", but in this sample there is only one time moving the stoploss - and this works here too if I cancel the second condition).

Thanks for your help.

Hereby is the code the stoploss:
if (Position.MarketPosition == MarketPosition.Flat)
{SetStopLoss(CalculationMode.Ticks, 9);}
if ((Position.MarketPosition == MarketPosition.Long)
&&(GetCurrentAsk(0) > Position.AvgPrice + 20 * TickSize))
{SetStopLoss(CalculationMode.Price, Position.AvgPrice + 9 * TickSize);}
if ((Position.MarketPosition == MarketPosition.Long)
&&(GetCurrentAsk(0) > Position.AvgPrice + 40 * TickSize))
{SetStopLoss(CalculationMode.Price, Position.AvgPrice + 35 * TickSize);}
Best regards
Tony

Comment