MQL4 - automated forex trading   /  

Code Base

Read Financial Magazines in MetaTrader 4 and MetaTrader 5!

Code Base  Scripts  Close Orders To post a new code, please log in or register

Download MetaTrader 5 and visit Code Base
and Trade on the Go!
and Trade on the Go!
Couldn't find the right code? Order it in the Jobs section

This script is for
MetaTrader 4
Download MT 4 - 455 Kb

and Trade on the Go!

and Trade on the Go!

Close Orders [ ru ]
Author: sxTed (2007.11.21 05:35)
Downloaded: 10582
 _CloseOrders.mq4 (7.1 Kb) View




    Close all multi currency open orders and cancel pending orders according to various scenarios. Slippage for open orders is calculated for each currency.
    Choose only one scenario per visit, the script processes the first menu item selected.

    22 comments: 1 2 3   To post a new comment, please log in or register
    can we close orders open only on the window we drop the script on ? Thank you.
    02.05.2011 18:45 memem
    he74 wrote:
    thanks, but i don't understand how system works. qeuity was 6900 i set up 5000 (level after close orders). system closed orders but queity was 3900. when i type 3000 (level of lost), every order is automaticly close. it doesn't matter quantity 100k, 50k, 10k. what should i put that system works good?

    hey, the problem that you are experiencing is so simple that you are overlooking the solution, this EA is essentially an "Oh Crap i need to get out" button. When loaded as an EA on any one chart it will close orders opened from any other source regardless of chart. it is meant to be loaded onto a chart with EAs disabled and than when the trader expects the market to change detrimentally to the traders profits or the trader for some reason desires to close all his or her positions in total or of a particular type at once rather than individually and manually which takes time, the trader only has to enable EAs via the button nect to the open order button and all the orders will be closed according to the settings of the EA. Now if the EA button is left in the enabled position any order that is open will be immediately closed additionally this EA doesn't play well with other EA's loaded onto other charts because it is global in its nature and chart irrespective. There is your answer.

    Good Luck


    04.12.2008 01:37 Jedimedic77
    bnbb2004, thank you for the compliment.
    21.09.2008 14:38 sxTed
    chris phs, sorry for the delay I only check mail at the week end, if open orders are EURUSD and USDJPY and current chart where the script is launched from is GBPUSD then orders for EURUSD and USDJPY will be closed.
    21.09.2008 14:36 sxTed
    Does this script close just the orders from the currently viewd pair/chart, or does it close all open orders in the terminal regardless of how many pairs are being traded?
    16.09.2008 03:09 chris_phs
    Works great!  Thx!!  :-)
    25.07.2008 23:06 bnbb2004
    thank you for interest.
    19.03.2008 15:29 he74
    he74, If you are trading on a live account - then close all orders and stop. Ask your question on the main forum - as I do not understand, sorry.
    19.03.2008 14:46 sxTed
    i don't know why but system made more lost than digit in system (inside). at the present i can't open any orders. everyone is close directly after opening. is there any minimum capital i need on the acoount or other parameters?
    19.03.2008 13:41 he74
    he74, I do not understand your problem, sorry.
    19.03.2008 12:56 sxTed