Close all trades % of profit EA

 

Is their a script, ea or something that will close all trades when you have a certain % of profit

 
toddanderson:
Is their a script, ea or something that will close all trades when you have a certain % of profit

Not % but just a profit - yes. Many EAs.

 

Misunderstood?

I think the question has been misunderstood.

I too am interested in a script or something that can look at the profit made over a period of time and then close a % of that value out in loosing trades.

Example.

In the last hour the EA made $100.

I want to giveup 75% to close loosing trades.

So the EA must now look for loosing trades to the value of $75 and close them. Leaving $25 profit.

This means that I shall always be 25% safe, terrible English, but I think you know what I mean.

Thanks

 
toddanderson:
Is their a script, ea or something that will close all trades when you have a certain % of profit

Here is what I use on live ea's.

you'll have to define and adapt it to suit your needs. But should give you the basic function.

if ( TargetEquityToClose > 0 &&

((S_Profit+L_Profit >= (AccountBalance() * ((TargetEquityToClose * 0.01) ))) || TestExit==1) )

{

for(Count=OrdersTotal();Count>=0;Count--)

{

OrderSelect(Count, SELECT_BY_POS, MODE_TRADES);

if (OrderSymbol()==Symbol())

{

OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),Slippage,Blue);

}

}

return(0);

}

 

Try one of these....

Hi, Wayne. Long time no see or hear in this case. How are you doing? I hope all is well.

Take a look at one of the EAs found in following posts -

1. https://www.mql5.com/en/forum/176207

2. https://www.mql5.com/en/forum/176461

COTtrader

"Ken"