• Home
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • User/Email: Password:
  • 12:46pm
Menu
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • 12:46pm
Sister Sites
  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

EA "Close all positions at profit target" closed all positions at loss ? 8 replies

Help with EA to close all the open positions in profit pips 0 replies

Mt4 Close Profit positions before Market closed on weekend? 1 reply

Looking for EA to close all Buy Or all Sell trades when in profit 0 replies

Close all pending orders and open orders once they reach profit target 3 replies

  • Platform Tech
  • /
  • Reply to Thread
  • Subscribe
  • 7
Attachments: EA fix: Close all positions at profit target X
Exit Attachments

EA fix: Close all positions at profit target X

  • Last Post
  •  
  • 1 Page 2 3
  • 1 Page 2 3
  •  
  • Post #21
  • Quote
  • Aug 6, 2015 6:06am Aug 6, 2015 6:06am
  •  Gumrai
  • Joined Oct 2012 | Status: Member | 1,959 Posts
Quoting holdocu82
Disliked
{quote} That's exactly what I have been looking for but close target should be the price, not money or pips. Just one price target. Is it possible?
Ignored
I don't know if useful or not
http://www.forexfactory.com/showthre...46#post8144746

http://www.forexfactory.com/showthre...92#post8235392
Please Do Not PM Me With Coding Enquiries
 
 
  • Post #22
  • Quote
  • Aug 6, 2015 10:38am Aug 6, 2015 10:38am
  •  holdocu82
  • | Joined Aug 2015 | Status: Member | 18 Posts
Quoting Gumrai
Disliked
{quote} I don't know if useful or not http://www.forexfactory.com/showthre...46#post8144746 http://www.forexfactory.com/showthre...92#post8235392
Ignored
Gumrai thank you for the help but these EAs has targets for the profit or pips. It doesnt work for me because I have sl and pl levels on my trades and they continuosly change the amount of profit that makes it impossible to calculate the exact profit target. I just need it to kill everything at a certain price even it hits the price from above or below.
 
 
  • Post #23
  • Quote
  • Nov 22, 2016 7:35pm Nov 22, 2016 7:35pm
  •  Hafizah
  • | Joined Nov 2016 | Status: Junior Member | 1 Post
Hello guys, I need 'Auto close profit target with currency pair target'
example :
RING 1
PAIR 1: AUDUSD
PAIR 2: EURUSD
PAIR 3: EURAUD
TOTAL PROFIT: USD30.00

RING 2
PAIR 1 : EURUSD
PAIR 2 : GBPUSD
PAIR 3 : EURGBP
TOTAL PROFIT : USD30



If you have any available source please give me a link.
 
 
  • Post #24
  • Quote
  • May 8, 2017 2:48am May 8, 2017 2:48am
  •  chinta
  • | Joined May 2017 | Status: Member | 6 Posts
this close all position in profit have zero divide error in line 88
Sarswati is Lakshmi
 
 
  • Post #25
  • Quote
  • May 29, 2017 4:49am May 29, 2017 4:49am
  •  fotios
  • | Commercial Member | Joined Nov 2014 | 11 Posts
hi theer guys i beleve i fount a ea is runing in profit some time is hard the take profit can any one add or change the code to add 3 simple option i need 3 thing take profit on dolar amount and normal tp + pip step and lot expoedent if any one can helo im wiling to share the mql file and teh wining seting by the way i fount th ea im not the creator
 
 
  • Post #26
  • Quote
  • Jun 7, 2017 10:51am Jun 7, 2017 10:51am
  •  Rmk90
  • | Joined Jan 2017 | Status: Member | 66 Posts
Quoting tradingviper
Disliked
Hi Hedgehog, The code you have should work to close everything unless there is an error - like the price is too close or slippage is too great. I made a quick change that is more aggressive. If certain positions have errors, it just keeps trying - forever. I believe they will close eventually. I am not at my computer with MT4, so I was unable to compile it, but I think it is OK. Give it a shot. Viper {file}
Ignored
This ea does not work any more, could some one fix it please?
 
 
  • Post #27
  • Quote
  • Oct 1, 2017 10:19am Oct 1, 2017 10:19am
  •  Kbunchar
  • | Joined Oct 2017 | Status: Junior Member | 1 Post
Hello Programming Expert,

I need help to fix my code. I have created attached EA (through EABuilder.com) using price action and want to close all order at profit X. But EABuilder has limited functionality and can't close all open positions (Buy&Sell) at the same time. Would you be able to help to fix the code for me and attach mq4 file please? I don't have background programming skill nor MQL4 knowledge.

Sorry I used existing forums as I can't create new post as I am new member.

Thanks you in advance.

Regards,
Ken
Attached File
File Type: mq4 4KB_Engulfing+CloseALL_Tst.mq4   11 KB | 531 downloads
 
 
  • Post #28
  • Quote
  • Nov 19, 2017 6:22am Nov 19, 2017 6:22am
  •  Paul9
  • | Joined Sep 2017 | Status: Member | 26 Posts
Hi all, perhaps this is the right place.....
I'm looking for an EA that every 30/50 minutes looks my open trades and close only those in profit of 20 pips.
Do you know a similar EA? thanks
 
 
  • Post #29
  • Quote
  • Nov 20, 2017 4:58pm Nov 20, 2017 4:58pm
  •  Paul9
  • | Joined Sep 2017 | Status: Member | 26 Posts
Quoting Paul9
Disliked
Hi all, perhaps this is the right place..... I'm looking for an EA that every 30/50 minutes looks my open trades and close only those in profit of 20 pips. Do you know a similar EA? thanks
Ignored

 
 
  • Post #30
  • Quote
  • Edited at 7:44am Feb 12, 2018 7:29am | Edited at 7:44am
  •  lorenzo9530
  • | Joined Dec 2015 | Status: Member | 19 Posts
Quoting fxdaytrader_
Disliked
pls. try attached, I extended the onscreen-comment also 2 new external vars added, should be self-explanatory ... {file}
Ignored
Hello everybody, this kind of EA is great, but I have a request ( if possible) to avoid that the EA close at profit 1 single open order ( I apply trailing profit / TP so is not necessary an EA) is it possible to add a kind of filter like that:


a) apply “Close everything” ONLY evaluating open orders (OP_BUY + OP_SELL)
b) MINIMUM number of open orders to apply “Close everything”( if Total Open Orders is < at this “value” no action will be performed)
ex. : 1 lot OP_BUY + 0.8 lot OP_SELL + 2.5 lot OP_BUY = 3 orders

Many thanks for your patience of reading :-), Lorenzo from Italy

P.S. maybe is the function altready present called " extern double ProftableTradeAmount = 1; // Only trades above this amount close out " Thanks again
Attached File
File Type: mq4 Close all positions at profit target v1.1.mq4   8 KB | 991 downloads
 
 
  • Post #31
  • Quote
  • Feb 12, 2018 11:52am Feb 12, 2018 11:52am
  •  Nicholishen
  • Joined Jul 2005 | Status: zzzzzzzzzzzzzzzzzzzzzzzzz zzzzzzzzzz | 1,289 Posts
Quoting lorenzo9530
Disliked
{quote} Hello everybody, this kind of EA is great, but I have a request ( if possible) to avoid that the EA close at profit 1 single open order ( I apply trailing profit / TP so is not necessary an EA) is it possible to add a kind of filter like that: a) apply “Close everything” ONLY evaluating open orders (OP_BUY + OP_SELL) b) MINIMUM number of open orders to apply “Close everything”( if Total Open Orders is < at this “value” no action will be performed) ex. : 1 lot OP_BUY + 0.8 lot OP_SELL + 2.5 lot OP_BUY = 3 orders Many thanks for your patience...
Ignored
I know this was dug up from a ancient thread, but I just wanted to add some comments since it's popping up again... Not only does the CloseAll function unnecessarily burn profits by incorrectly managing orders (literally pays unneccesary fees to the broker), but it also initiates a loop that can potentially lock the platform. Do not use this EA if you have real money on the line.
 
 
  • Post #32
  • Quote
  • Feb 12, 2018 1:46pm Feb 12, 2018 1:46pm
  •  lorenzo9530
  • | Joined Dec 2015 | Status: Member | 19 Posts
Hello Nicholishen, thank for your advice, I would have preferred have a EA coded with this options and could judge practically, because until now this EA has worked properly on my real money. Maybe I could ask in the section " Coding EA ". Many thanks, bye.
 
 
  • Post #33
  • Quote
  • Feb 12, 2018 2:15pm Feb 12, 2018 2:15pm
  •  Nicholishen
  • Joined Jul 2005 | Status: zzzzzzzzzzzzzzzzzzzzzzzzz zzzzzzzzzz | 1,289 Posts
Quoting lorenzo9530
Disliked
Hello Nicholishen, thank for your advice, I would have preferred have a EA coded with this options and could judge practically, because until now this EA has worked properly on my real money. Maybe I could ask in the section " Coding EA ". Many thanks, bye.
Ignored
Just know that you are leaving money on the table when you use this. Personally, I wouldn't burn profits just to close a position when there's a way to close positions to avoid paying extra (unnecessary) fees. If you are comfortable giving your broker your profits by paying fees you shouldn't be paying, then by all means keep using this.
 
 
  • Post #34
  • Quote
  • Feb 12, 2018 2:22pm Feb 12, 2018 2:22pm
  •  lorenzo9530
  • | Joined Dec 2015 | Status: Member | 19 Posts
Quoting Nicholishen
Disliked
{quote} Just know that you are leaving money on the table when you use this. Personally, I wouldn't burn profits just to close a position when there's a way to close positions to avoid paying extra (unnecessary) fees. If you are comfortable giving your broker your profits by paying fees you shouldn't be paying, then by all means keep using this.
Ignored
I suppose we are talking about different brokers and different kind of trade: I have chosen a broker with a little higher spread but no commissions on order closure, so for me closing hedging orders that are in profit is "commissions free", and I would select to do that when are more than 1 order ( for example 3 orders running together) and the total profit is... 50 euro... so close everything... and I am ok to restart with a new trade. But my question is.... are you able to code that? Or anyone here is able to?
 
 
  • Post #35
  • Quote
  • Aug 31, 2018 3:36am Aug 31, 2018 3:36am
  •  andy60rm
  • | Joined Aug 2012 | Status: Member | 42 Posts
Quoting tradingviper
Disliked
Hi Hedgehog, The code you have should work to close everything unless there is an error - like the price is too close or slippage is too great. I made a quick change that is more aggressive. If certain positions have errors, it just keeps trying - forever. I believe they will close eventually. I am not at my computer with MT4, so I was unable to compile it, but I think it is OK. Give it a shot. Viper {file}
Ignored
great ea
 
 
  • Post #36
  • Quote
  • Aug 31, 2018 9:13am Aug 31, 2018 9:13am
  •  Sc11
  • Joined Feb 2012 | Status: chomping on ortolan | 50 Posts
can this be done with line drawn on screen that can be moved to adjust take profit?
ZTJQL Return This Year: 17.2%
 
 
  • Post #37
  • Quote
  • Jun 1, 2019 3:55am Jun 1, 2019 3:55am
  •  carbonmimeti
  • Joined Jun 2012 | Status: Member | 384 Posts
Quoting taru
Disliked
{quote} I've been looking for an EA to close a basket of trades at profit in pips. This EA is great but it considers ALL the trades on the account to calculate the profit. Can anyone modify the code so that the EA will close trades only on one pair.
Ignored
me too...this ea would close trades only on one pair
thanks in advance
 
 
  • Post #38
  • Quote
  • Jun 24, 2019 6:01am Jun 24, 2019 6:01am
  •  fxkem
  • | Joined Jun 2019 | Status: Junior Member | 1 Post
hello all, TradingViper has modified a "Close All Trades" EA at an instant when a Target X is hit. Under the Inputs "Profit Target", does this express as % Profit? Which means when the Trading Account reaches a X% Profit compounded, the EA will close out all Existing Trades at an instant? The existing trades may composite winning or losing trades.

A check if anyone can modify this EA to execute Close All Trades should the account "that hold all losing trades" reaches Y%? This scenario happens if just happen all my trades are terribly losing. So a "CUT OFF" Y% is there to salvage the losing account.

Attached Image (click to enlarge)
Click to Enlarge

Name: Screenshot2.png
Size: 57 KB
 
 
  • Post #39
  • Quote
  • Edited at 9:12pm Sep 10, 2019 8:35pm | Edited at 9:12pm
  •  ecryptom
  • | Joined Jun 2019 | Status: Member | 140 Posts
hi
is an Ea that close profit only (not all, not loss, not stop orders)
automatically every 1 min
or
when the profit is positive (auto detect is somehow)
also with an trailing stops
?
Everything flows. Learn to Earn.
 
 
  • Post #40
  • Quote
  • Oct 28, 2021 7:04pm Oct 28, 2021 7:04pm
  •  mring16
  • | Joined Aug 2016 | Status: Member | 134 Posts
Quoting tradingviper
Disliked
Hi Hedgehog, The code you have should work to close everything unless there is an error - like the price is too close or slippage is too great. I made a quick change that is more aggressive. If certain positions have errors, it just keeps trying - forever. I believe they will close eventually. I am not at my computer with MT4, so I was unable to compile it, but I think it is OK. Give it a shot. Viper {file}
Ignored
Hi I tried this ea and seems to work wellThere are 2 inputs
One is profit target
And the other is
Profitable trade amount
Can you tell me what the second input is?
Thanks
 
 
  • Platform Tech
  • /
  • EA fix: Close all positions at profit target X
  • Reply to Thread
    • 1 Page 2 3
    • 1 Page 2 3
0 traders viewing now
  • More
Top of Page
  • Facebook
  • Twitter
About FF
  • Mission
  • Products
  • User Guide
  • Media Kit
  • Blog
  • Contact
FF Products
  • Forums
  • Trades
  • Calendar
  • News
  • Market
  • Brokers
  • Trade Explorer
FF Website
  • Homepage
  • Search
  • Members
  • Report a Bug
Follow FF
  • Facebook
  • Twitter

FF Sister Sites:

  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Forex Factory® is a brand of Fair Economy, Inc.

Terms of Service / ©2022