Help needed: how fast can be closed 100 open orders

What is the best method to close 100 open orders as fast as posible? And I mean maximum 10 seconds.

Are they hedged orders, or one way orders?

All kind, sells and buys, not necessarilly hedged

I am sure no one has tried this, so no one would know. All I can say is that sometimes it takes me more than 10 seconds to close a single order depending on the broker’s response.

I am sure there must be Some Expert Advisor that can help you manage open positions, and give you a tool to let you close all floaters at the click of a button.

Yup, there are literally dozens of scripts available for this sort of thing. Try a search over at forex factory.

No, there are not, everyone searches for order management tools, like swiss army or so, but I am only concerned with just closing quickly a large number of orders. I asked this question in this section because I thought there must have been some programmers concerned with that too.

You are right, but in normal conditions, when trading context is not busy and normaly closing one order takes less then a second, could be posible to close 100 orders in seconds ? I am thinking about having multiple mt4 instances opened and giving background workers to each of them.Or maybe someone has found a better solution. It’s just a programmatic issue, I need an algorithm.

I’m using FXCM’s TS platform with several seperate accounts I can just select the trades I want Closed and click “close all positions”? can this not be done on MT4 also?

MT4 is not multithreaded in that manner, at least as I understand. I believe that it has one thread to handle trading. That thread can be used to open, close or modify trades. Once it starts a trade operation, the trade context is flagged as being busy and nothing else can happen until the trade context is set to not busy. So if a transaction completes in 1/100 second, you can start the next one with a small delay. If it takes 10 seconds (sometimes, but not usually), you wait 10 seconds. You have to appreciate that the transaction time is dependent on several things - your client computer response, the internet connection and the broker’s server response.

I have an EA that will do this for you quicker than you can. I got it free on the internet so you can have a copy.
Cant seem to upload with that extension here, pm me.

you could rename it and change the extention to .txt then anyone who downloads it would simply rename it back to what it should be

Hi

It’s better a script than an ea because ea execution depends on ticks, on the other hand, a script with a loop will execute until all orders have been closed and don’t need to wait for ticks.
Obviously, as stated by codemeister, time depends on many factors that you can’t control. The only thing you can do is use a good computer and a fast internet connection.

Gabriel

you still doing the statistics cloud I see

Good news

I discovered that if you have 10 instances of mt4 opened on the same account, they act independently , which means that you can close 10 orders simultaneously (or however you spell that) any time (tick not needed) . Or 20, it goes well up to 30 -40 instances , only memory or/and processor limits that. Or you can use more than one computer with many instances opened on each.

I tried with scripts, but they still need confirmation of previous operation completion, so they will close 100 orders one after another. I found something like parallel processing.

Well, I know you can do that, but I think you will get many errors for not finding a position already closed by other instance and may be that will introduce unwanted delay. You need to divide the job, let’s say instance #1 will close positions from 1 to 10, instance #2 from pos 11 to 20 and so on. And to be efficient it would be necessary that one instance be a master that would signal the other slave instances to start the job so with one click you’re done.

Gabriel

Exactly, this is precisely what I have done. It’s not very difficult. Dividing jobs is the answer, and yes, from a central driving point.

BreakOut Pips System | Trade2Win Forums

Go to 7th post, there is a script file, load into scrips under expert, then modify hot key, or you can drag and drop the file from naviagtion to the chart, and it will close every single trade with one click, pretty fast to, clears 10 trades in 1-2 seconds

if you PM me I will look out an EA which closes all orders pretty quickly that you can try