Break Even EA + pips

 

I have this Move StopLoss to Beakeven EA that I would like to add a variable to. I played around with it but I cant get to work right. I just want to add a variable to move into profit at breakeven.

I changed this:

extern string EnterBEPips = "Enter profit pips to move SL to BE.";

extern double BE_Pips = 5;

To this:

extern string EnterBEPips = "Enter profit pips to move SL to BE.";

extern double BE_Pips = 5;

extern string EnterBE_Plus_Pips = "Enter pips to move in to Positive.";

extern double BE_Plus_Pips = 1;

I then changed this:

if(type == OP_SELL && stopPrice > openPrice && Ask<= (openPrice-BE_Pips*0.0001) && OrderSymbol()==Symbol())

OrderModify(ticket,OrderOpenPrice(),OrderOpenPrice(),OrderTakeProfit(),0,Red);

else if(type == OP_BUY && stopPrice = (openPrice+BE_Pips*0.0001)&& OrderSymbol()==Symbol() )

OrderModify(ticket,OrderOpenPrice(),OrderOpenPrice(),OrderTakeProfit(),0,Blue);

To this:

if(type == OP_SELL && stopPrice > openPrice && Ask<= (openPrice-BE_Pips*0.0001) && OrderSymbol()==Symbol())

OrderModify(ticket,OrderOpenPrice(),OrderOpenPrice(),OrderTakeProfit(),0,Red);

else if(type == OP_BUY && stopPrice = (openPrice+BE_Pips*BE_Plus_Pips)&& OrderSymbol()==Symbol() )

OrderModify(ticket,OrderOpenPrice(),OrderOpenPrice(),OrderTakeProfit(),0,Blue);

Can somesome help me correct this?

Here is the original ea: sl2be.mq4

Files:
sl2be.mq4  3 kb
 

Nevermind, I think I found one here: https://www.mql5.com/en/forum/173421/page2

Now I just need to figure out how to add a set stop loss to it.

Reason: