Forex Factory
  • Login

  • Username: Password:
  • 12:09am

  • Search
  • Home

  • Forums

  • Trades

  • Calendar

  • News

  • Market

  • Brokers

Options

Search

Subscribe to Thread

Bookmark Thread

First Page First Unread Last Page Last Post

Printable Version

Similar Threads

Grid level with "50īs" and "00īs" without price label? 1 reply

Broker Challenge "NDD/STP" vs. True "ECN" and "Mkt Mkr" broker talk 45 replies

"Equity Stop" feature...which brokers have this? 3 replies

Help with Pivots "Monday Fix" 1 reply

  • Platform Tech
  • /
  • Reply to Thread
  • 3

Simple EA fix - "close all at equity level X"

  • Post# 1
  • Quote
  • First Post: Feb 7, 2010 6:28pm
  • Hedginghog
    Joined Nov 2009 | 194 Posts | Status: Member
Hi folks - can someone please lend a hand with a minor "repair" to this EA.

I use this "close all positions at equity level X" EA to sometimes close hedge trades with positions on different instruments and different currencies.

The problem I have is that it starts to close "all positions" when the equity target is hit, but then (I think) what happens is it stops closing positions if that equity level drops during the closing process and/or if the loosing trade side of a hedge trade is closed first. What I really need it to do is just close ALL positions as soon as the equity target is reached, and not stop closing positions at market level regardless of any changes to that equity level during the closing process.

Can someone help?

Thanks a million (well not quite a $million but you know what I mean)
Attached Files
File Type: mq4 CloseAllAtEquityLevel.mq4   5 KB | 439 downloads
File Type: ex4 CloseAllAtEquityLevel.ex4   5 KB | 236 downloads
  • Post# 2
  • Quote
  • Jul 12, 2010 11:53pm
  • semamak
    Joined Jan 2010 | 34 Posts | Status: pips.............
thanks mate.. it really helps
sharpshooter.......
  • Post# 3
  • Quote
  • Sep 3, 2011 6:17am
  • Breza
    Joined Apr 2011 | 26 Posts | Status: Member
Thanks, I'm supposed to.
But I have one question, whether the EA can code so when equity reach the target profit and close all positions, automatically raise the equity target for a given number of x, because the second EA continues to open new positions ?

thank you very much
  • Post# 4
  • Quote
  • Sep 4, 2011 10:20am | Edited Sep 5, 2011 5:39am – Changed previous attached file because of wrong declaration type.
  • tigpips
    Joined May 2011 | 92 Posts | Status: Member
Hmm.. see if this works for you.

UseEquityRaiseAfterClose
When this is set to true, it will utilize this "Equity Raise After Close" function.

EquityRaisedByXAfterClose
This indicates how much equity that will be raised after the it closes all positions.

Calculation for this is:
New Equity Target = Original Equity Target + EquityRaisedByXAfterClose.

RunEquityRaiseContinuously
When this is set to true, it will run this new "Equity Raise" continuously after each "Close All Positions" function is performed. When this is set to false, it will run this new "Equity Raise" just once after a "Close All Positions" is performed.
Attached File
File Type: mq4 CloseAllAtEquityLevel v1.2.mq4   5 KB | 411 downloads
  • Post# 5
  • Quote
  • Sep 4, 2011 7:38pm | Edited at 8:38pm
  • Breza
    Joined Apr 2011 | 26 Posts | Status: Member
Thanks, but unfortunately I am not sufficiently explained.
Other EA on the grid and is continually adding to equity a couple of dollars. To the goal he may miss just a few cents when it reaches the EA closes all positions.
Means that "EquityRaisedByXAfterClose" just a profit at the time of the closing of all positions (not accounted for the constant gains of the grid EA).

If it is possible to "EquityRaisedByXAfterClose" should be a numeric value.
For example, after each closing of all positions to increase the target for $ 10
"New Equity Target = Original Equity Target + X$"
if at all feasible


thanks again
  • Post# 6
  • Quote
  • Sep 5, 2011 5:40am
  • tigpips
    Joined May 2011 | 92 Posts | Status: Member
Quoting Breza
Thanks, but unfortunately I am not sufficiently explained.
Other EA on the grid and is continually adding to equity a couple of dollars. To the goal he may miss just a few cents when it reaches the EA closes all positions.
Means that "EquityRaisedByXAfterClose" just a profit at the time of the closing of all positions (not accounted for the constant gains of the grid EA).

If it is possible to "EquityRaisedByXAfterClose" should be a numeric value.
For example, after each closing of all positions to increase the target for $ 10
"New Equity...
Hi Breza,

I'm sorry, it was my bad. I have accidentally set the "EquityRaisedByXAfterClose" as a bool not an int lol. bool means it will be either "true" or "false". int means it will be an interger type or in english terms, a number value.

I have edited the original file to include this amendment. Please redownload the newer version, "CloseAllAtEquityLevel v1.2.mq4".
  • Post# 7
  • Quote
  • Sep 11, 2011 8:04am
  • Breza
    Joined Apr 2011 | 26 Posts | Status: Member
That's it !
Excellent job
  • Post# 8
  • Quote
  • Feb 25, 2012 9:22am
  • fmfx1
    Joined Sep 2011 | 49 Posts | Status: Member
Quoting tigpips
Hmm.. see if this works for you.

UseEquityRaiseAfterClose
When this is set to true, it will utilize this "Equity Raise After Close" function.

EquityRaisedByXAfterClose
This indicates how much equity that will be raised after the it closes all positions.

Calculation for this is:
New Equity Target = Original Equity Target + EquityRaisedByXAfterClose.

RunEquityRaiseContinuously
When this is set to true, it will run this new "Equity Raise" continuously after each "Close All Positions" function is performed....
Thanks for sharing man, pls tell me what is the work of this function "Profitable Trade Amount"? The default is set to 1.

Thanks
No Risk No Reward
  • Post# 9
  • Quote
  • Nov 27, 2012 1:38am
  • wrm
    Joined Jul 2008 | 19 Posts | Status: Member
This Simple EA looks great. A very useful tool in Forex trading.

I want to share this Free MT4 EA with you since you need to close all the trades at the certain equity level.
Hope Equity Sentry will be useful for you.

http://www.ea-coder.com/forex-softwa...y-free-mt4-ea/

Regards
  • Post# 10
  • Quote
  • Mar 13, 2013 3:43pm
  • apscalp
    Joined May 2010 | 1 Post | Status: Junior Member
Hello, I would REALLY-TRULY appreciate if there is an e-mail alert (a message sent to a specified e-mail address) in addition to "UseAlerts". Thank you for consideration.
  • Post# 11
  • Quote
  • Last Post: Apr 16, 2013 3:48am
  • vina
    Joined May 2012 | 5 Posts | Status: Member
Quoting Breza
Thanks, but unfortunately I am not sufficiently explained. Other EA on the grid and is continually adding to equity a couple of dollars. To the goal he may miss just a few cents when it reaches the EA closes all positions. Means that "EquityRaisedByXAfterClose" just a profit at the time of the closing of all positions (not accounted for the constant gains of the grid EA). If it is possible to "EquityRaisedByXAfterClose" should be a numeric value. For example, after each closing of all positions to increase the target for $ 10 "New Equity Target...
Thanks!
Please tell me, how can i add this code of this EA on other EA.
Thread Tools Search this Thread
Show Printable Version Show Printable Version
Email This Thread Email This Thread
Search this Thread:

Advanced Search

  • Platform Tech
  • /
  • Simple EA fix - "close all at equity level X"
  • Reply to Thread
0 traders viewing now

©2013 Forex Factory, Inc. / Terms of Use / Privacy Policy

Forex Factory® is a registered trademark.

Connect

  • Facebook
  • Twitter
  • RSS

Company

  • About FF
  • FF Blog
  • Careers at FF
  • Advertising
  • Contact FF

Products

  • Forums
  • Trades
  • Calendar
  • News
  • Market
  • Brokers
  • Trade Explorer

Website

  • Homepage
  • Search
  • User Guide
  • Member List
  • Online Now
  • Report a Bug