• Sign up >>

'Close all'/'Open' tools - page 47

f1trader
90
f1trader  

been looking, cant find it.

Guyver
1152
Guyver  
f1trader:
been looking, cant find it.

this? https://www.mql5.com/en/forum/175357

FXMan77
1190
FXMan77  
Guyver:
I just wrote it up see if this helps.. ( EA)

enter currency e.g EURUSD , GBPUSD or USDCHF doesn't matter which chart you attach it will only close the symbol you chose.. should have no issues

-- guyver

Thanks,

I'm looking something like that:

You can attach this EA to pair that you are not using

but he will close your trades by Symbol by Profit.

Have a look.

extern int Profit=5;

int start()

{

int i,type,err,Slippage=3;

double price;

bool result;

//----

for(i=OrdersTotal()-1;i>=0;i--)

{

if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))

{

type=OrderType();

if((type==OP_BUY || type==OP_SELL) && OrderProfit()>=Profit && OrderSymbol()==Symbol())

{

while(true)

{

if(type==OP_BUY) price=MarketInfo(OrderSymbol(),MODE_BID);

else price=MarketInfo(OrderSymbol(),MODE_ASK);

result=OrderClose(OrderTicket(),OrderLots(),price,Slippage,CLR_NONE);

if(result!=true) {err=GetLastError(); Print("LastError = ",err);}

else err=0;

if(err==135) RefreshRates();

else break;

} } }

else Print( "When selecting a trade, error ",GetLastError()," occurred");

}

return(0);

}

Guyver
1152
Guyver  

Try This One

Thanks,

I'm looking something like that:

You can attach this EA to pair that you are not using

but he will close your trades by Symbol by Profit.

Have a look.

Try this one..

1. enter symbol

2. enter profit

it will close the order *only* when the net profit of that symbol is > desired profit entered.

FXMan77
1190
FXMan77  
Guyver:
Try this one..

1. enter symbol

2. enter profit

it will close the order *only* when the net profit of that symbol is > desired profit entered.

You have to add few more symbols.

e.g. I'm trading 5 pairs, with max trades 5 of each...

EA must close only one pair with profit.

Guyver
1152
Guyver  
Bongo:
You have to add few more symbols.

e.g. I'm trading 5 pairs, with max trades 5 of each...

EA must close only one pair with profit.

Write down the symbol you need i'll update the Expert

FXMan77
1190
FXMan77  
Guyver:
Write down the symbol you need i'll update the Expert

EURUSD, GBPUSD, EURGBP,USDJPY,USDCAN,AUDUSD.

Just add more empty windows.

Much easy will be use:

type=OrderType();

if((type==OP_BUY || type==OP_SELL) && OrderSymbol()==Symbol())

you can use any symbol

Bongo

Guyver
1152
Guyver  
Bongo:
EURUSD, GBPUSD, EURGBP,USDJPY,USDCAN,AUDUSD.

Just add more empty windows.

Much easy will be use:

type=OrderType();

if((type==OP_BUY || type==OP_SELL) && OrderSymbol()==Symbol())

you can use any symbol

Bongo

why don't you use your ideas update the code you posted of whatever it does and spare me the pain

-guyver

FXMan77
1190
FXMan77  
Guyver:
why don't you use your ideas update the code you posted of whatever it does and spare me the pain -guyver

Sorry for that.

Many newbies are asking me to share my EA's,

but nobody what to share with me, only you.

Thanks.

Bongo

Guyver
1152
Guyver  
Sorry for that.

Many newbies are asking me to share my EA's,

but nobody what to share with me, only you.

Thanks.

Bongo

No problem , there you go