So for example when the trade is executed, the Fixed stop is initially set at -30pts, as the price moves up to +32pts the stop amends to +10, and when the price moves to +62 the stop amends to +45pts and so on.
The problem with the code I have is that when the price moves up to +62 and the stop amends to +45 which is fine, but if the price then drops below +62 again the stop amends back to +10, but strangely if the price falls below 32 the stop still remains at +10???!!! So in effect I only have a stop at +10.
I have also tried putting a price range in the code (as below)but this also doesn't work.
How can prevent SetStopLoss from amending downwards?
Thanks in advance
if (Position.MarketPosition == MarketPosition.Flat)
{
SetStopLoss("", CalculationMode.Ticks, FixedStop, true);
}
elseif (Position.MarketPosition == MarketPosition.Long)
{
if (GetCurrentAsk() > Position.AvgPrice + 32 * TickSize && GetCurrentAsk() < Position.AvgPrice + 42)
{
SetStopLoss("", CalculationMode.Price, (Position.AvgPrice + 10), true);
}
if (GetCurrentAsk() > Position.AvgPrice + 62 * TickSize && GetCurrentAsk() < Position.AvgPrice + 77)
{
SetStopLoss("", CalculationMode.Price, (Position.AvgPrice + 45), true);

Comment