Forex
Google

Go Back   Forex Trading > Downloads > Tools and utilities
Forex Forum FAQ Members List Calendar Mark Forums Read


Register in Forex TSD!
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time).
Click here to register and get more information

 
 
LinkBack (6) Thread Tools
 
Old 12-12-2006, 11:42 AM
SloForeX SloForeX is offline
Senior Member
 
Join Date: Sep 2006
Location: Slovenia
Posts: 112
SloForeX is on a distinguished road
Your code is very similar than mine. The results are the same. I attached a picture, to make some things more clearly.
EA does close all trades for pair GBPUSD (picture). As you can see, after this another trade is opened. (1 means allowtrade is true, 0 allowtrade is false).
Attached Images
File Type: jpg Image3.jpg (358.2 KB, 969 views)

Last edited by SloForeX : 12-12-2006 at 01:53 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
 
Old 01-04-2007, 04:11 PM
newdigital newdigital is offline
Administrator
 
Join Date: Sep 2005
Posts: 15,364
newdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud of
CloseOnTime EA by KimIV
To close the orders exactly at the time.
At 23:55 for example.
All the ordes, or some of them (optional by simbols).
Attached Files
File Type: mq4 CloseOnTime.mq4 (2.0 KB, 171 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
 
Old 02-02-2007, 03:42 PM
ZTrader ZTrader is offline
Member
 
Join Date: Mar 2006
Posts: 91
ZTrader is on a distinguished road
Has anyone ever figured out how to make the "close all open orders" and "close all pending orders" scripts work? I keep trying and just keep getting Error: 0 for every order in every pair...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
 
Old 02-02-2007, 07:05 PM
codersguru's Avatar
codersguru codersguru is offline
Senior Member
 
Join Date: Oct 2005
Posts: 987
codersguru has a spectacular aura aboutcodersguru has a spectacular aura aboutcodersguru has a spectacular aura about
Wink CloseAll script

Quote:
Originally Posted by ZTrader
Has anyone ever figured out how to make the "close all open orders" and "close all pending orders" scripts work? I keep trying and just keep getting Error: 0 for every order in every pair...
Did you try this one:

http://xpworx.com/Close%20All.htm

.................................................. .............

These are the options:


0 Close all the orders (instant and pending orders) - this is the default option which mean if you run the script and didn't set any parameters all the orders (instant and pending) will be closed.
1 Close all instant orders; instant orders mean the orders that opened at the market price.
2 Close all pending orders.
3 Close by the magic number. You have to set the magic_number variable.
4 Close by comment. You have to set the comment_text variable.
5 Close orders (instant orders) in profit and leave the orders in loss.
6 Close orders (instant orders) in loss and leave the orders in profit.
7 Close not today orders and leave the orders that opened today.

The other two variables which you can set are:

magic_number: Set it if you'll use closing option 3 - closing by magic number.
comment_text : Set it if you'll use closing option 4 - closing by comment.
Enjoy yourself! and tell me your comment!
__________________
Hope it helps !
Coders' Guru
Senior MQL programmer:
www.xpworx.com/custom.htm
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
 
Old 02-13-2007, 02:49 AM
phorex_phreak phorex_phreak is offline
Senior Member
 
Join Date: Oct 2006
Posts: 175
phorex_phreak is on a distinguished road
what happens if you want to close all open and pending orders when the profit on the account hits 1000 dollars?? how do we do that??

http://phorex-phreak.blogspot.com/

Last edited by phorex_phreak : 02-20-2007 at 05:46 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
 
Old 03-14-2007, 09:43 AM
doragio doragio is offline
Member
 
Join Date: Dec 2005
Location: Shanghai
Posts: 36
doragio is on a distinguished road
Close All by Specific Currency

Thanks to everyone for posting their close all scripts. I've been trying to add a function whereby you can close all trades based upon a specific currency.

if (OrderSymbol() == "gbpusd")

Here's the additional string, which I am not sure if it's correct, a total beginner with mq4. but after successful compiling it, it says error 129?


any help or comments would be appreciated, thanks.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
 
Old 03-14-2007, 09:59 AM
newdigital newdigital is offline
Administrator
 
Join Date: Sep 2005
Posts: 15,364
newdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud of
You may take some example of coding fom this thread EA to close all open order of GBPJPY
(it is EA to close the orders on specify pairs only).
And it is the same (to close on specific pair) for pending orders this EA delete all pendind orders
(EA as well).
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
 
Old 03-14-2007, 10:05 AM
k3iroll k3iroll is offline
Member
 
Join Date: Nov 2006
Posts: 77
k3iroll is on a distinguished road
Hi doragio,

Can you kindly post the "Close all specific pair" pip once you managed to get it compiled properly. I think it would help a lot of ppl here. Thanks.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
 
Old 03-15-2007, 12:53 PM
amenlo9's Avatar
amenlo9 amenlo9 is offline
Senior Member
 
Join Date: Apr 2006
Location: Malaysia
Posts: 185
amenlo9 is on a distinguished road
i want to request script for modify open position,is there any?
__________________
~~Keep The Faith~~
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
 
Old 03-15-2007, 01:52 PM
newdigital newdigital is offline
Administrator
 
Join Date: Sep 2005
Posts: 15,364
newdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud of
We have a lot of it on our forum.
A lot.

- StepStopExpert_v1.1: EA to trail the orders.

- EMATrailing Stop EA: trailing stop based on an EMA. Original thread is here.

- Trailing stop EA with instruction in pdf file about how to use it is here.

- Tight Trailing Stops EA from Nicholishen is here.

- Kalenzo posted trailing stop code here which may be used in EAs (for programmers). Original thread is here.

- some trailing stop codes (mostly usefull for programmers) are here.

- Trailing Stop EA posted long time ago is here.

- E-ASEClose Expert from KIMIV is here.

- many trailing files are here. I tried it some time ago.

- The other thread about tailing stop with some codes was started here.

- The other EA for trailing stop is here.

- Trailing stop EAs/scripts: elite section thread with two EAs.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

LinkBacks (?)
LinkBack to this Thread: http://www.forex-tsd.com/tools-utilities/174-close-all-open-tools.html
Posted By For Type Date
Close all trades !!! This thread Refback 06-24-2008 03:13 AM
Close all trades !!! This thread Refback 06-19-2008 10:53 AM
Close all trades !!! This thread Refback 06-19-2008 09:33 AM
Antara EA yang telah diLIVE test oleh MyMEFx Grup - Page 50 - Nogold.com This thread Refback 12-05-2007 03:58 PM
skrypty close i modify This thread Refback 08-07-2007 04:11 AM
Ind close sume post with one click? - Nogold.com This thread Refback 06-30-2007 03:02 PM

Similar Threads
Thread Thread Starter Forum Replies Last Post
Open/close trade on same bar's close? WNW Expert Advisors - Metatrader 4 2 03-29-2007 05:37 AM
close all open trades ea G-Riper General Discussion 2 08-02-2006 09:41 PM
Close all open positions jonjonau Expert Advisors - Metatrader 4 6 07-12-2006 05:01 AM
Close All Open Positions? lonespruce Metatrader 4 9 06-22-2006 07:20 AM


All times are GMT. The time now is 08:33 AM.