Enivid

Administrator
Staff member
Nov 30, 2008
19,241
1,507
144
Odesa
www.earnforex.com
- Does it perform the tasks in the action pannel in the order mentionned ?
Yes, it performs the actions in the same order as they are shown on the Actions tab.
When I use it, I ask to close all trades and close all charts once a give equity is reached.
However, almost every time, I see that all the trades are not closed, some trades are re-generated between the time when the trades are closed and the time when the charts are closed. No matter if I ask to keep autotrading or not.
Can you explain me why and what to do to fix it ?
You should first check why this happens - whether it's the failure to close the positions or it's that the positions are recreated by another EA. In the former case, you need to check what errors are generated when attempting to close the trades. In the latter case, there's little you can do if another EA is actively monitoring its trades and re-creates them as soon as they are closed. It'll always be a matter of race between the AP and that EA.

- To avoid beeing present each time a goal is reached, I asked the account protector to close all the trades, keep autotrading ON, to take a new snapshot of the goal and kept both the conditions and actions ON by not disabling it in the menu. However, I see that when I start again manually from scratch, the trading begins soflty with the other EA's managed by the Account Protector. But when done automatically (i.e. when the account protector closes the trades), the other EA's starts much more aggresivier, with more trades (and then triggering suddenly a bigger equity). Why does it perform like that ?
I don't think I understand what you are trying to say here... However, I wouldn't be able to tell why some other EA is doing what it's doing - it's best to ask its author.
 

Nico DFM

Newbie
Jul 31, 2024
4
0
1
70
Yes, it performs the actions in the same order as they are shown on the Actions tab.
Okey. So, could it be changed ? because if the charts are closed before stopping the trades, one whon't have the issue, even with a very active EA.
You should first check why this happens - whether it's the failure to close the positions or it's that the positions are recreated by another EA. In the former case, you need to check what errors are generated when attempting to close the trades. In the latter case, there's little you can do if another EA is actively monitoring its trades and re-creates them as soon as they are closed. It'll always be a matter of race between the AP and that EA.
That's exactly what's happening : the EA is faster than the AP. So I think that the only solution is the ask closing the charts first.
I don't think I understand what you are trying to say here... However, I wouldn't be able to tell why some other EA is doing what it's doing - it's best to ask its author.
I sent a message. Glad to hear it's nothing to do with the AP
 

Enivid

Administrator
Staff member
Nov 30, 2008
19,241
1,507
144
Odesa
www.earnforex.com
Okey. So, could it be changed ? because if the charts are closed before stopping the trades, one whon't have the issue, even with a very active EA.
I will definitely consider that for the next version of the AP.
That's exactly what's happening : the EA is faster than the AP. So I think that the only solution is the ask closing the charts first.
If you tell me which version you are using - MT4 or MT5 - I can tell you what to change in the source code (that's a rather simple change) to switch the order.
 

Nico DFM

Newbie
Jul 31, 2024
4
0
1
70
I will definitely consider that for the next version of the AP.

If you tell me which version you are using - MT4 or MT5 - I can tell you what to change in the source code (that's a rather simple change) to switch the order.
Super great ! Thanks for considering this and your help. I'm on the MT4 platform. Thank you !
 

Enivid

Administrator
Staff member
Nov 30, 2008
19,241
1,507
144
Odesa
www.earnforex.com
Super great ! Thanks for considering this and your help. I'm on the MT4 platform. Thank you !
In Account Protector.mqh, find these lines (should start at line 5150):
MQL4:
// Close all other charts.
    if (sets.CloseAllOtherCharts)
    {
        if (!DoNotDisableActions) sets.CloseAllOtherCharts = false;
        Logging("ACTION IS TAKEN: Close all other charts.");
        CloseAllOtherCharts();
        sets.Triggered = true;
        sets.TriggeredTime = TimeToString(TimeLocal(), TIME_DATE | TIME_MINUTES | TIME_SECONDS);
    }

And cut and paste them higher, at line 5064.
After that re-compile Account Protector.mq5.
 

Nico DFM

Newbie
Jul 31, 2024
4
0
1
70
In Account Protector.mqh, find these lines (should start at line 5150):
MQL4:
// Close all other charts.
    if (sets.CloseAllOtherCharts)
    {
        if (!DoNotDisableActions) sets.CloseAllOtherCharts = false;
        Logging("ACTION IS TAKEN: Close all other charts.");
        CloseAllOtherCharts();
        sets.Triggered = true;
        sets.TriggeredTime = TimeToString(TimeLocal(), TIME_DATE | TIME_MINUTES | TIME_SECONDS);
    }

And cut and paste them higher, at line 5064.
After that re-compile Account Protector.mq5.
I'll try ! Thank you !
 

Thomas110

Newbie
Aug 5, 2024
1
0
0
44
Discuss Account Protector expert advisor here. This EA lets you control your orders and positions with a chart panel. You can ask any questions about this MetaTrader tool here.

Installation and basic use tutorial:

Hello, I've just read the mql5 script and am wondering (sorry if this is trivial) where the ExtDialog.CheckAllConditions() function is defined in order to check all conditions based on the inputs, and where the related actions are (e.g. preventing to open a new position if DisableNumberOfPositionsGE is set to true)
 

Enivid

Administrator
Staff member
Nov 30, 2008
19,241
1,507
144
Odesa
www.earnforex.com
Hello, I've just read the mql5 script and am wondering (sorry if this is trivial) where the ExtDialog.CheckAllConditions() function is defined in order to check all conditions based on the inputs, and where the related actions are (e.g. preventing to open a new position if DisableNumberOfPositionsGE is set to true)
The CheckAllConditions() implementation is in the Account Protector.mqh file. You can use Ctrl+F to search for it or you can can set the pointer at the ExtDialog.CheckAllConditions() call and press Alt+G to go to the function automatically.

There is no code that prevents new positions from opening. There are two actions that can prevent other EAs from opening new trades - disable Algo Trading and close all other charts. All is done in the Trigger_Actions() function.
 

daxiong

Trader
Aug 8, 2024
2
0
6
31
I don't know. Maybe you ticked the 'Send e-mail' action on the Actions tab?
I want to be notified via email as soon as the set conditions are triggered. But when I ticked the 'Send e-mail' action on the Actions tab,It keeps sending emails but I only want to receive one email.
 

Enivid

Administrator
Staff member
Nov 30, 2008
19,241
1,507
144
Odesa
www.earnforex.com
I want to be notified via email as soon as the set conditions are triggered. But when I ticked the 'Send e-mail' action on the Actions tab,It keeps sending emails but I only want to receive one email.
Perhaps it keeps sending emails because the condition continues triggering. That happens when the DoNotDisableConditions and DoNotDisableActions input parameters are set to true.
 

Resems

Newbie
Jan 18, 2024
4
0
2
37
Hey, thank you for the EA ! It is amazing.

I do have a question, I use the EA for daily profit, take 10k, close everything, disable Auto trade, so no EA could trade anymore.
Is there a way to auto restart next day?

Right now I use basically two protectors, one to stop on daily profit, and one to restart every day, works but I was wondering if it could be that I am missing something.

Thank you.
 

Enivid

Administrator
Staff member
Nov 30, 2008
19,241
1,507
144
Odesa
www.earnforex.com
Hey, thank you for the EA ! It is amazing.

I do have a question, I use the EA for daily profit, take 10k, close everything, disable Auto trade, so no EA could trade anymore.
Is there a way to auto restart next day?

Right now I use basically two protectors, one to stop on daily profit, and one to restart every day, works but I was wondering if it could be that I am missing something.

Thank you.
No, you aren't missing anything. That should be done with two AP instances.
 
  • 👍
Reactions: Resems

EnrichWave

Master Trader
May 15, 2018
356
86
74
India
Enivid, Could you please add automatic snapshot equity on particular server time?. for example If it snapshot the equity at 23:59:59, That usage will be so much life saver.
Also, Kindly make Time format HH:MM:SS instead of HH:MM in Main Tab.

BR.
 

Enivid

Administrator
Staff member
Nov 30, 2008
19,241
1,507
144
Odesa
www.earnforex.com
Enivid, Could you please add automatic snapshot equity on particular server time?.
You can do that with the timer event.
for example If it snapshot the equity at 23:59:59, That usage will be so much life saver.
Also, Kindly make Time format HH:MM:SS instead of HH:MM in Main Tab.
What difference would that make compared to setting it to 00:00?
 
  • 🚀
Reactions: EnrichWave

Enivid

Administrator
Staff member
Nov 30, 2008
19,241
1,507
144
Odesa
www.earnforex.com
Wow, That's correct,,


How to snapshot the equity automatically at 00:00. Kindly let me know.
You set up two AP's with GlobalSnapshots set to true on both. You use one with the Timer + Update snapshots action. The second AP gets its snapshots updated from the first AP.
 
  • 🚀
Reactions: EnrichWave