Adding a "BREAKEVEN" function into this EA

 

Can somebody help me to add a Breakeven function into this EA?

The idea is that if the price moves in favour for a number of pips set by the Breakeven function, then the stop loss will automatically be adjusted to breakeven.

Thanks a million!!

Files:
 
Plenty of example code: Traing SL
 

So this is beggarware code presented above ...

   int    cmd,error,TP,SL,StopMultd;
   

if(StopMult==true){StopMultd=10;} else{StopMultd=1;}

TP=NormalizeDouble(TakeProfit*StopMultd,Digits);
SL=NormalizeDouble(StopLoss*StopMultd,Digits);

We take an int, multiply by an int, convert into a double with the NormalizeDouble function and turn it back into an int.

How flaming clueless can you get?


 

Sorry, maybe I didn't say this.

I wish to move the stoploss only ONCE when price is in favour for a number of pips.

How can I do this with the Trailing Stop function?

 
william.teo:

Sorry, maybe I didn't say this.

I wish to move the stoploss only ONCE when price is in favour for a number of pips.

How can I do this with the Trailing Stop function?

Let's see if I have this straight. You have posted some code you found on the web. Now you want to get somebody else to make code changes in it?

Where is your contribution to this effort?

Perhaps you could say what you have tried that hasn't worked to show that you are actually interested in learning something. Otherwise you are just being lazy, which is not appreciated here.

What you are asking about is pretty trivial. It's just an OrderModify.

Reason: