# Does Trailing Profit exists?

745

Hello forum, good day.

Is there a way to move the Take Profit just like a trailing stop would move the Stop Loss? I would like to move both values, lets say 30 pips for Stop Loss and Take Profit.

Best regards and thank you in advance,

Gerardo

19282

sure thing, it's almost the same
5851
Anderson Hupp
Gerardo Bustos:

Hello forum, good day.

Is there a way to move the Take Profit just like a trailing stop would move the Stop Loss? I would like to move both values, lets say 30 pips for Stop Loss and Take Profit.

Best regards and thank you in advance,

Gerardo

I just don't see the point of moving the take profit. It would never be reach!

The stop loss on the other hand does make sense.

745

Anderson Hupp:

I just don't see the point of moving the take profit. It would never be reach!

The stop loss on the other hand does make sense.

The idea of this would be just in case the price goes higher/lower than the established Take Profit level. But I guess setting a really high Take Profit would do it, and then just moving the Stop Loss up/down to lock the profit.

Best regards and thank you,

Gerardo

Moderator
29908

Anderson Hupp:

I just don't see the point of moving the take profit. It would never be reach!

You can move your takeprofit according to the market volatility. It's not necessarily always moved in the same direction.
5851
Anderson Hupp
Alain Verleyen:
You can move your takeprofit according to the market volatility. It's not necessarily always moved in the same direction.

You're right Alain, that could be really useful!

Thank you!

745

Alain Verleyen:
You can move your takeprofit according to the market volatility. It's not necessarily always moved in the same direction.

Hello Alain.

What would be the best or most recommended way to count orders in this case?

A:

```for ( int i = total - 1; i >= 0; i-- )
{
...
}```

or

B:

```for ( int i = 0; i < total; i++ )
{
...
}```

Best regards and thank you in advance,

Gerardo

18644

C

```int i = total;
while(i-- > 0) { ... }
```

Actually it does not matter

745

Alexander Puzanov:

C

Actually it does not matter

Thanks everyone for your reply! I need a bit of help though with my code.

I'm trying to move the Stop Loss with the following function, but instead of giving a better result than what my EA already gives, it is worst:

```void Trail( int trailing_stop )
{
int  total = OrdersTotal();
bool result;

RefreshRates();

if ( total > 0 )
{
for ( int cnt = 0; cnt < total; cnt++ )
{
if ( !OrderSelect( cnt, SELECT_BY_POS, MODE_TRADES ) ) continue;
if ( OrderSymbol() != Symbol() || OrderMagicNumber() != MagicNumber ) continue;

if ( OrderType() == OP_BUY )
{
if ( ( Bid - OrderOpenPrice() > trailing_stop * Point ) && ( OrderStopLoss() < Bid - trailing_stop * Point ) )
{
double New_SL = Bid - trailing_stop * Point;
result        = OrderModify( OrderTicket(), OrderOpenPrice(), New_SL, OrderTakeProfit(), 0, clrBlue);

if ( result )
{
Print( "Trailing Stop for: ", OrderSymbol(), ". Stop Loss: ", New_SL, ". Bid: ", Bid );
return;
}
}
}

if ( OrderType() == OP_SELL )
{
if ( ( OrderOpenPrice() - Ask > trailing_stop * Point ) && ( OrderStopLoss() > Ask + trailing_stop * Point || OrderStopLoss() == 0 ) )
{
double New_SL = Ask + trailing_stop * Point;
result        = OrderModify( OrderTicket(), OrderOpenPrice(), New_SL, OrderTakeProfit(), 0, clrRed);

if ( result )
{
Print( "Trailing Stop for: ", OrderSymbol(), ". Stop Loss: ", New_SL, ". Ask: ", Ask );
return;
}
}
}
}
}
} ```

I'm invoking the previous code inside the OnTick() function at the very top. I have a Stop Loss of 30, the Take Profit is 200 and the Trailing Stop is 50. It seems to me that the Stop Loss is not moving correctly and it is not locking the profit/reducing loss. Once I can make this work correclty, I would like to apply it to move the Take Profit depending on the volatility.

Your help will be much appreciated.

Best regards and thank you in advance,

Gerardo