(Sell1, Sell2, & Sell3 are declared as private bools earlier in the code)
if(Position.MarketPosition == MarketPosition.Short
&& CONDITIONS
&& Sell1)
{
SetProfitTarget(".......);
SetStopLoss("..", CalculationMode.Price,Position.AveragePrice - 2*TickSize,true);
Sell1=false;
Sell2=true;
}
if(Position.MarketPosition == MarketPosition.Short
&& CONDITIONS
&& Sell2)
{
SetProfitTarget(".......);
SetStopLoss("...", CalculationMode.Price,High[1]+1*TickSize,true);
Sell2=false;
Sell3=true;
}
The problem I am having is the final stop, which is High[1]+1*TickSize, doesn't continue to reset itself, although the conditions are true for it to continue to move down as the market moves down (vice-versa for longs).
For example, in the attached pic, the conditions for the stop to trail to the prior high +1 tick occurred where the dotted line is. So the stop was set on that bar. However, the condition continued to be true for the next bar...SO...the stop should have moved to the high +1 tick of that next bar and gotten stopped out where the checkmark is.Why did it not work that way?
Comment