Enivid

Administrator
Staff member
Nov 30, 2008
14,191
635
144
Odessa
www.earnforex.com
Do you have the new file for MT5? I just tried to compile it and it failed.

Thanks

Lewis
That file is for MT4 only. Why would you want it for MT5? Besides, it looks like condition checked correctly by AP and the problem is in its inability to close the trades. Did you read this post of mine?
 

hounddog

Trader
Jul 23, 2020
14
0
6
29
I am using MT5 on my live account with the AP as well.

In MT4 with it left on displaying floating loss and limit will it incur hyperactivity due to so many messages?

Do you have any idea as to how to fix it from not being able to close trades?

Thanks

lewis
 

Enivid

Administrator
Staff member
Nov 30, 2008
14,191
635
144
Odessa
www.earnforex.com
Hi,
Please see this new log.

Thanks

Lewis
Thank you! The attached log shows the problem with the market being closed. Please check the trading hours for the symbols you are working with.

Additionally, here are two modified Account Protector.mqh files (for MT4 and for MT5) that will log messages in the following events when attempting to close trades:
1. AutoTrading disabled globally in the platform or by the broker.
2. No connection.
3. AutoTrading disabled for the expert advisor (Allow live trading checkbox is unchecked).

They will not log the "market closed" event separately but this is already covered by logging the OrderSend() response code (Error #132 means that the market for the trading symbol is closed).
 

Attachments

  • MQL4.zip
    29.9 KB · Views: 4
  • MQL5.zip
    31.1 KB · Views: 2

rasasu

Trader
Jul 11, 2020
4
0
6
30
Hi there . I have read the message posted by my colleague here @hounddog . You did mentioned earlier about MT5 hedging mode And netting mode. Does it make any difference with the AP as mine is hedging mode ? @Enivid
 

Enivid

Administrator
Staff member
Nov 30, 2008
14,191
635
144
Odessa
www.earnforex.com
Hi there . I have read the message posted by my colleague here @hounddog . You did mentioned earlier about MT5 hedging mode And netting mode. Does it make any difference with the AP as mine is hedging mode ? @Enivid
I've asked to know where to test to reproduce the problem. AP should work fine in any mode - hedging or netting.
 

ayylmao23

Newbie
Jul 22, 2020
9
0
1
51
@Enivid have you had any luck diagnosing the issue after reviewing the logs I sent you? I assume the conditions are silently resetting after being triggered for the first time. I can see others here are experiencing the same issue
 

Enivid

Administrator
Staff member
Nov 30, 2008
14,191
635
144
Odessa
www.earnforex.com
@Enivid have you had any luck diagnosing the issue after reviewing the logs I sent you? I assume the conditions are silently resetting after being triggered for the first time. I can see others here are experiencing the same issue
That log doesn't show any problem. Please try running AP recompiled with Account Protector.mqh either from this post (it will help to see if AP detects the condition) or from this (in case the problem is the same as in case of @hounddog, this will show a detailed reason why AP cannot close trades when it detects the condition).
 

rasasu

Trader
Jul 11, 2020
4
0
6
30
Hi @Enivid , I was exploring further the account protector, the value of slippage was 2. Is there any reason why the value was set to 2 and not any other number. What does value number 2 stands for if you don't mind explaining it to me?

Thanks.

Rasasu
 

Enivid

Administrator
Staff member
Nov 30, 2008
14,191
635
144
Odessa
www.earnforex.com
Hi @Enivid , I was exploring further the account protector, the value of slippage was 2. Is there any reason why the value was set to 2 and not any other number. What does value number 2 stands for if you don't mind explaining it to me?

No particular reason. It means that if the slippage is greater than 2 pips, it will issue an off quotes or requote error.
 

ayylmao23

Newbie
Jul 22, 2020
9
0
1
51
That log doesn't show any problem. Please try running AP recompiled with Account Protector.mqh either from this post (it will help to see if AP detects the condition) or from this (in case the problem is the same as in case of @hounddog, this will show a detailed reason why AP cannot close trades when it detects the condition).


Part 1 is an example of the bug we've been experiencing. The floating profit = value stays at 0.00 right after the action was taken. I was able to work around this issue by closing the chart, restarting the server and then reattaching to the chart. The floating profit = stayed at 0.00 for hours. Until I noticed it and started to turn things on and off until it started working again..

Is this a known bug? Whats going on?
 

Attachments

  • part1.txt
    7.2 KB · Views: 3
  • part2.txt
    6 KB · Views: 3

Enivid

Administrator
Staff member
Nov 30, 2008
14,191
635
144
Odessa
www.earnforex.com
Part 1 is an example of the bug we've been experiencing. The floating profit = value stays at 0.00 right after the action was taken. I was able to work around this issue by closing the chart, restarting the server and then reattaching to the chart. The floating profit = stayed at 0.00 for hours. Until I noticed it and started to turn things on and off until it started working again..

Is this a known bug? Whats going on?

Sorry, but I couldn't reproduce it. It is on MT4, right? Considering what the log shows (part2) the floating profit might really have been zero as the next printout following the reattachment shows only 0.02 profit, which is about one tick away from 0.

If you recompile with the attached .mqh file, it will also log profit on per-order basis - maybe it's skipping orders for some reason?
 

Attachments

  • Account Protector.mqh
    328.1 KB · Views: 2

ayylmao23

Newbie
Jul 22, 2020
9
0
1
51
Sorry, but I couldn't reproduce it. It is on MT4, right? Considering what the log shows (part2) the floating profit might really have been zero as the next printout following the reattachment shows only 0.02 profit, which is about one tick away from 0.

If you recompile with the attached .mqh file, it will also log profit on per-order basis - maybe it's skipping orders for some reason?

Yes, this is on Mt4.
I appreciate that but it really wasnt 0.00. It was stuck on 0.00 from 15:50 to 17:07 ..
 

BrotherBear

Trader
Aug 6, 2020
2
0
6
38
Hi there. I just discovered this awesome tool! I have one or two questions though. I would like to run multiple EA's on one account with daily gain goals and a set risk percentage. Then use the AP to close all trades and turn off autotrading for the day when either one or the other is triggered. My question is whether it is possible for AP to restart autotrading automatically at user defined time (say the next day)? If not, would it be possible to add that functionality? And when it starts up Autotrading again it would be great if it automatically took new snapshots.

Thank you for this incredible tool. It is going to help a lot.
 
Last edited:

Enivid

Administrator
Staff member
Nov 30, 2008
14,191
635
144
Odessa
www.earnforex.com
Hi there. I just discovered this awesome tool! I have one or two questions though. I would like to run multiple EA's on one account with daily gain goals and a set risk percentage. Then use the AP to close all trades and turn off autotrading for the day when either one or the other is triggered. My question is whether it is possible for AP to restart autotrading automatically at user defined time (say the next day)? If not, would it be possible to add that functionality? And when it starts up Autotrading again it would be great if it automatically took new snapshots.

Thank you for this incredible tool. It is going to help a lot.

After it triggers and disables Autotrading, you would have to set a timer and set actions to enable Autotrading and recapture snapshots. This has to be done manually any time between its disable Autotrading trigger and hwen you'd like to to re-enable it.
 

BrotherBear

Trader
Aug 6, 2020
2
0
6
38
I just tested it using the AP on two different charts in the same account. The one has the conditions for closing trades, pending orders, and disabling Autotrader, and then take a snapshot. The second one only enables autotrading based on the timer. The timer however resets and the tick box gets uncheck (reset). Is there a way that this can stay checked and not reset after it has completed it's action? And do you think it will be ok to run this on two seperate charts in 1 account like this? It looked like it is working like I wanted it to at the moment, but I haven't tested it with equity levels being the trigger.
 

Enivid

Administrator
Staff member
Nov 30, 2008
14,191
635
144
Odessa
www.earnforex.com
I just tested it using the AP on two different charts in the same account. The one has the conditions for closing trades, pending orders, and disabling Autotrader, and then take a snapshot. The second one only enables autotrading based on the timer. The timer however resets and the tick box gets uncheck (reset). Is there a way that this can stay checked and not reset after it has completed it's action? And do you think it will be ok to run this on two seperate charts in 1 account like this? It looked like it is working like I wanted it to at the moment, but I haven't tested it with equity levels being the trigger.

It should work like that fine (with two AP's running on two different charts). Unfortunately, the timer has to be reset manually.