Breakeven hits my stop immediately

Created at 18 May 2022, 01:45
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
SH

shaahin69

Joined 28.01.2022

Breakeven hits my stop immediately
18 May 2022, 01:45


Hi everyone, 

 

I am wondering what is the correct way of moving the SL to Breakeven without Your stoploss triggers immediately? 

What I am trying to achive is to Close 2/3 of positions when the initial TP(2 pips) is reached and move the SL to the Breakeven and let the rest of the position move. 

 

Here is what I have tried but the issue is that my SL hits instantly. 

 

     if (position.Pips >= TP)
                        {
                            double entryPrice1 = position.EntryPrice;
                            if(position.TradeType == TradeType.Buy)
                            {
                                entryPrice1= position.EntryPrice + 1 / 4;
                            }
                            else
                            {
                                entryPrice1 = position.EntryPrice - 1 / 4;

                            }
                            position.ModifyStopLossPrice(entryPrice1);
                            BreakevenDone[position.Id] = true;
                        }

 


@shaahin69
Replies

amusleh
18 May 2022, 10:10

Hi,

You to check if there is enough room by using Symbol bid/ask price levels, I see you use Position pips property, be sure your TP is large enough.

And use Symbol.PipSize * x instead of 1 / 4.


@amusleh