Bandit

Newbie
Mar 3, 2022
8
0
1
60
When working with floating profit/loss conditions, it closes positions in an order based on profit/loss. For profit conditions, it will close the most profitable trades first. For loss conditions, it will close the most losing trades first.
Thankyou
I note that it averages out the open positions based on value (profit or loss)
How does the option UseTotalVolume affect this?

Kind Regards
 

Enivid

Administrator
Staff member
Nov 30, 2008
18,607
1,366
144
Odesa
www.earnforex.com
How does the option UseTotalVolume affect this?
UseTotalVolume comes into play (if set to true) when you set the AP to close only some share of all trades (e.g. 70%) and you are trading with multiple small orders (that cannot be partially closed by 70% of volume). Then it will close whole trades but will stop once 70% of total volume is out.
 

Bandit

Newbie
Mar 3, 2022
8
0
1
60
UseTotalVolume comes into play (if set to true) when you set the AP to close only some share of all trades (e.g. 70%) and you are trading with multiple small orders (that cannot be partially closed by 70% of volume). Then it will close whole trades but will stop once 70% of total volume is out.
So to clarify - if set to false - it does not close the position if it cannot reduce it, even if the 70% is not reached?

Sorry - after re reading I think I understand - this option uses volume rather than value to close the trades.

Is it possible to get a option to close most distant trade first instead of averaging added?
The reasoning behind this is if we are protecting the account by reducing drawdown when a certain level is reached, then if we were to reduce the most distant positions we leave the positions with the highest chance of coming back to profit (the closer positions to current price) if the trend of the trade reverses.

Kind Regards
 
Last edited:

Blurob29

Trader
Mar 5, 2022
7
0
7
62
Hi Guys,
Firstly I commend you work, fantastic tool.

New here so forgive me if my question is too basic. I have five charts open on my MT4 account. I have a smiley face on just one. Do I need to set up the EA on all charts. Do I need to list included instruments in Main Menu?

Or does the EA work across my account just loaded on one chart?

Thank you
 

Enivid

Administrator
Staff member
Nov 30, 2008
18,607
1,366
144
Odesa
www.earnforex.com
Hi Guys,
Firstly I commend you work, fantastic tool.

New here so forgive me if my question is too basic. I have five charts open on my MT4 account. I have a smiley face on just one. Do I need to set up the EA on all charts. Do I need to list included instruments in Main Menu?

Or does the EA work across my account just loaded on one chart?

Thank you
By default, it works on all trading symbols across your account. You can apply some filters to limit that if you want. Also, obviously, if you use conditions based on spread or current price, it will take the spread and current price from the current chart only.
 

Bandit

Newbie
Mar 3, 2022
8
0
1
60
Sorry you may have missed this question as I edited after posting.

Is it possible to get a option to close most distant trade first (from current price) on trigger added?

The reasoning behind this is if we are protecting the account by reducing drawdown when a certain level is reached, then if we were to reduce the most distant positions we leave the positions with the highest chance of coming back to profit (the closer positions to current price) if the trend of the trade reverses.

Kind Regards
 
Last edited:

Michelx

Trader
Mar 11, 2021
8
1
19
33
Hi, I'm trying to understand this EA (MT5), but I'm having a hard time, especially because it doesn't show trailing and breakeven lines, so I can only know what each function does when the orders are closed in demo account. If someone would be so kind to tell me if with this EA I can manage all orders together as a single group and allow me to use:

1- Breakeven: When I reach a global profit for example: 1000 profit points (between the sum of all buy and sell orders), place a breakeven point, so that in case the price returns, all buy and sell orders are closed without loss.
2- Then, in case I reach 1000 points of profit, and the price continues in my favor, use a dynamic TrailingStop, which allows me to track profits, so that every 10 points, the TrailingStop dynamic moves to drag the profits. I would like to know if this EA can do it? I have been searching and testing EAs for hours, and I can't believe it doesn't exist.
 
Last edited:

Enivid

Administrator
Staff member
Nov 30, 2008
18,607
1,366
144
Odesa
www.earnforex.com
1- Breakeven: When I reach a global profit for example: 1000 profit points (between the sum of all buy and sell orders), place a breakeven point, so that in case the price returns, all buy and sell orders are closed without loss.
I don't think a global Breakeven is doable if you want to place specific orders to BE. If you are tracking profit on all orders, some will be in profit and some in loss. You cannot put BE on losing trades. But if you only set BE on the profitable trades, that won't be a Breakeven in a global sense - if markets get sketchy, those profitable trades will close at 0, but those that were losing ones could go even further into negative.
2- Then, in case I reach 1000 points of profit, and the price continues in my favor, use a dynamic TrailingStop, which allows me to track profits, so that every 10 points, the TrailingStop dynamic moves to drag the profits. I would like to know if this EA can do it? I have been searching and testing EAs for hours, and I can't believe it doesn't exist.
The equity trailing stop of the Account Protector is somewhat like this, but it uses equity in currency units and will close all trades if hit.
 

Michelx

Trader
Mar 11, 2021
8
1
19
33
I don't think a global Breakeven is doable if you want to place specific orders to BE. If you are tracking profit on all orders, some will be in profit and some in loss. You cannot put BE on losing trades. But if you only set BE on the profitable trades, that won't be a Breakeven in a global sense - if markets get sketchy, those profitable trades will close at 0, but those that were losing ones could go even further into negative.

The equity trailing stop of the Account Protector is somewhat like this, but it uses equity in currency units and will close all trades if hit.
Thank you for your reply Enivid. For example. If your analysis is that the price is going up, and you have 1 SELL and 1 BUY at price 1.338 and another BUY at price 1.360, and the price is still in your favor (up), wouldn't there come a point where you would be taking profit, even though you have a SELL order? Since you have 2 BUYS and 1 SELL, there will come a time when the 2 BUY orders will cover the SELL order which is negative. Wouldn't you like to place a Breakeven to protect those 3 orders when you already have a profit? Or what is the same, a break-even point in case of price reversal?

Following the previous example. Let's suppose that the price reached 1.400, and just at that point, the sum of the 3 orders is "0" (zero). Then the price went up further to 1.430. At that point, a Breakeven at the 1.400 price would be the smart thing to do. And from 1.400, a Trailing Step or start a full closing dynamic StopLoss that moves every X points when the price is still in our favor.

Does this make sense to you?

On the other hand, I tried the option "Equity trailing stop (hidden), USD". But sometimes it closes my orders (buys and sells) in negative.
 

Enivid

Administrator
Staff member
Nov 30, 2008
18,607
1,366
144
Odesa
www.earnforex.com
Thank you for your reply Enivid. For example. If your analysis is that the price is going up, and you have 1 SELL and 1 BUY at price 1.338 and another BUY at price 1.360, and the price is still in your favor (up), wouldn't there come a point where you would be taking profit, even though you have a SELL order? Since you have 2 BUYS and 1 SELL, there will come a time when the 2 BUY orders will cover the SELL order which is negative. Wouldn't you like to place a Breakeven to protect those 3 orders when you already have a profit? Or what is the same, a break-even point in case of price reversal?

Following the previous example. Let's suppose that the price reached 1.400, and just at that point, the sum of the 3 orders is "0" (zero). Then the price went up further to 1.430. At that point, a Breakeven at the 1.400 price would be the smart thing to do. And from 1.400, a Trailing Step or start a full closing dynamic StopLoss that moves every X points when the price is still in our favor.

Does this make sense to you?
This makes perfect sense, but the problem is, it requires, first, that all buy and sell trades to be on the same currency pair and, second, the BE not be a true BE for each trade but a price that is BE for a combination of trades. I'm not sure I'd like to code something like this.
On the other hand, I tried the option "Equity trailing stop (hidden), USD". But sometimes it closes my orders (buys and sells) in negative.
Yes, it may close trades in negative. First, when the equity TS didn't yet go to profit. Second, when some trades are in negative and others are in positive.
 

Bandit

Newbie
Mar 3, 2022
8
0
1
60
No, I don't do paid coding. You can hire someone on Upwork (or even on this forum) to do the job for you if you need this feature as soon as possible.
Thankyou

Any coders on this forum interested to quote on this little project?
 

Vikk

Newbie
Dec 19, 2021
10
0
2
36
This could be not only due to the 200 ms lag, but also due the prices moving rather fast in the market. If the price changed so that the total loss moved immediately to 4.5 USD there is no chance to close the trades at the requested 1 USD loss even for a no-lag connection.

You can comment out the lines 10-12 in the AccountProtector.mqh and then comment out three lines that use GetAncestor() function in the same file. After that recompile AccountProtector.mq4. This should remove any DLL calls from the EA.


Hello Enivid.
I carried out the instructions above to remove the DLL call. However upon migrating to the mql5 vps together with my ea's it was unable to effect the command to close after floating loss reached. Please assist (See screenshots)
Post automatically merged:

This could be not only due to the 200 ms lag, but also due the prices moving rather fast in the market. If the price changed so that the total loss moved immediately to 4.5 USD there is no chance to close the trades at the requested 1 USD loss even for a no-lag connection.

You can comment out the lines 10-12 in the AccountProtector.mqh and then comment out three lines that use GetAncestor() function in the same file. After that recompile AccountProtector.mq4. This should remove any DLL calls from the EA.
Hello Enivid
I carried out the comment out of the said lines and re-compiled and it migrated successfully to the vps from mql5. However, the account protector could not effect the commands after the test floating loss was reached. How do I correct this? (see screenshots attached )
 

Attachments

  • Full screen capture compile.PNG
    Full screen capture compile.PNG
    77.7 KB · Views: 2
  • account Protector log.PNG
    account Protector log.PNG
    22.1 KB · Views: 2

Enivid

Administrator
Staff member
Nov 30, 2008
18,607
1,366
144
Odesa
www.earnforex.com
Hello Enivid.
I carried out the instructions above to remove the DLL call. However upon migrating to the mql5 vps together with my ea's it was unable to effect the command to close after floating loss reached. Please assist (See screenshots)
Post automatically merged:


Hello Enivid
I carried out the comment out of the said lines and re-compiled and it migrated successfully to the vps from mql5. However, the account protector could not effect the commands after the test floating loss was reached. How do I correct this? (see screenshots attached )
What do you mean? Did it fail to close your trades? Any output in the Journal tab about that?

You could also try downloading the latest version (1.07), removing the DLL import from it, and trying the new version - perhaps it is some 1.05-specific bug that is preventing it from closing the trades...
 

Vikk

Newbie
Dec 19, 2021
10
0
2
36
What do you mean? Did it fail to close your trades? Any output in the Journal tab about that?

You could also try downloading the latest version (1.07), removing the DLL import from it, and trying the new version - perhaps it is some 1.05-specific bug that is preventing it from closing the trades...


I had attached the log from the terminal. Please check. Where can I find the latest version 1.07?