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

To add comments, please log in or register
helwanif
3
helwanif  

closing all open orders

Hello everyone

I'm trying to create my first EA using Meta Editor.

I need in a certain point of execution to close all the open orders of a certain type. for example when my EA places a sell order it should close all the buy orders that are open.

I wrote something like the following

total=OrdersTotal();

for(int i=total-1; i>=0; i--) {

OrderSelect(i, SELECT_BY_POS, MODE_TRADES);

if(OrderType()== OP_BUY) {

OrderClose(OrderTicket(),OrderLots(),Bid,3,Violet);

}

}

but it didn't do the job since it sometimes close the newest order only, but not all the opened order.

can anyone help me please ?

goldenequity
97
goldenequity  

Close and Reverse all Open Trades script

Here are 3 scripts:close all open trades;close all pendings; close both

My question:
  • Is there an existing .mq4 script that allows/enables the trader to manually Close and Reverse all Open Trades?A single script that offers the trader both option(s)..... to either:
  • Close all Open Trades, OR
  • Close and Reverse all Open Trades
is really what I'm seeking.

This is sorely needed to enhance the standard MT4 trading platform to accommodate manual scalping techniques using 1 and 5 min charting.

Thanks in advance for any help with this.

Linuxser
5921
Linuxser  
goldenequity:
Here are 3 scripts:close all open trades;close all pendings; close both My question:
Is there an existing .mq4 script that allows/enables the trader to manuallyclose and reverse all open trades?
This would be needed for a manual scalping technique using 1 and 5 min charting. Thanks in advance for any help with this.

Hi, I just moved your post to the correspondent thread.

goldenequity
97
goldenequity  

Thanks

Linuxser:
Hi, I just moved your post to the correspondent thread.

Thanks Linuxer

Sergey Golubev
Moderator
111276
Sergey Golubev  
goldenequity:
Here are 3 scripts:close all open trades;close all pendings; close both My question:
  • Is there an existing .mq4 script that allows/enables the trader to manually Close and Reverse all Open Trades?A single script that offers the trader both option(s)..... to either:
  • Close all Open Trades, OR
  • Close and Reverse all Open Trades
is really what I'm seeking.

This is sorely needed to enhance the standard MT4 trading platform to accommodate manual scalping techniques using 1 and 5 min charting.

Thanks in advance for any help with this.

Yes. There is close and everse script. It was posted on this thread, or it is on Metaquotes codebase. It is old well-known script.

Just found it inside my computer ... may be difference as I did not check it.

Files:
reverse.mq4 2 kb
goldenequity
97
goldenequity  

Thanks

Thanks for the quick response NewDigital

Rambaldi
5
Rambaldi  

Hi,

i have a big problem, i try to code a script to "close a Part of a actuall Position", but my code skills are not so well, is there any chance to find this script?

Many Thanks, Ram

gcgipson
563
gcgipson  

EA to shutdown other EAs?

Is there an EA out there that will shutdown my EA when a certain amount of drawdown is hit? Thanks.

oilfxpro
442
oilfxpro  

Hi

I haver had chance to test this EA

https://www.mql5.com/en/forum/178206

oilfxpro

Michel
476
Michel  
Rambaldi:
Hi,

i have a big problem, i try to code a script to "close a Part of a actuall Position", but my code skills are not so well, is there any chance to find this script?

Many Thanks, Ram

Not a problem at all : just put the quantity of lots you want to close in the OrderClose() function.

To add comments, please log in or register