Phylix

Newbie
Jan 5, 2022
5
1
1
27
I just re-compiled the .mq4 file and it has 101 errors and 8 warnings. I don't know how to correct the code errors, do have a working code you can share with me?
 

Attachments

  • Capture.JPG
    Capture.JPG
    174 KB · Views: 3

Phylix

Newbie
Jan 5, 2022
5
1
1
27
I just re-compiled the .mq4 file and it has 101 errors and 8 warnings. I don't know how to correct the code errors, do have a working code you can share with me?
Never mind, stupid me didn't follow instructions. I only copied the .mq4 files when I'm supposed to copy the whole Account Protector folder into the Experts folder.

Thanks for helping :)
 
  • 👍
Reactions: Enivid

Enivid

Administrator
Staff member
Nov 30, 2008
18,533
1,355
144
Odesa
www.earnforex.com
My apologies for beeing stupid.
How do I install the advisor in MT5?
I downloaded the files from here or GITHUB: https://www.earnforex.com/metatrader-expert-advisors/Account-Protector/#Usage

and then I just pasted in the MT5 folder:
C:\Users\vps-user\AppData\Roaming\MetaQuotes\Terminal\xxxxxx\MQL5\Experts\Advisors
but MT5 does not recognize it as MQL5 program.

What am I doing wrong?
Try compiling the Account Protector.mq5 file with your MetaEditor. Does it produce any errors? If not, can you attach it now in MT5?
 

bilyng

Trader
Jan 13, 2022
3
2
9
44
Hi, I am testing this EA and it appears the emergency button is not working as it should.

When pressed, the only thing it does is to disable autotrading and close pending orders
It does not close any trades.

The expert tab says all positions closed, pending orders deleted, autotrading disabled.
but the trades stay open, but pending orders get deleted and autotrading is disabled.

Is there any setting i am missing?
 
  • 👍
Reactions: Enivid

Enivid

Administrator
Staff member
Nov 30, 2008
18,533
1,355
144
Odesa
www.earnforex.com
Hi, I am testing this EA and it appears the emergency button is not working as it should.

When pressed, the only thing it does is to disable autotrading and close pending orders
It does not close any trades.

The expert tab says all positions closed, pending orders deleted, autotrading disabled.
but the trades stay open, but pending orders get deleted and autotrading is disabled.

Is there any setting i am missing?
Looks like a bug. I'll fix it in the next release of the Account Protector.
 

SpockData01

Newbie
Jan 11, 2022
3
0
1
33
Hi,
I'm trying the MT4 version now. I copy the whole Account Protector folder into the "Experts" folder, but when I hit "compile" it says I have 100 errors.
What am I doing wrong?
Any advice would be very appreciated.

Thank you
SpockData
 

Attachments

  • Copy folder but getting erros when compiling account protector.jpg
    Copy folder but getting erros when compiling account protector.jpg
    331.1 KB · Views: 1

SpockData01

Newbie
Jan 11, 2022
3
0
1
33
I missed the mq4 file - now I get 12 errors :(
Would you help me, please?
 

Attachments

  • Copy folder but getting erros when compiling account protector.jpg
    Copy folder but getting erros when compiling account protector.jpg
    335.5 KB · Views: 1

Enivid

Administrator
Staff member
Nov 30, 2008
18,533
1,355
144
Odesa
www.earnforex.com
I missed the mq4 file - now I get 12 errors :(
Would you help me, please?
First, please make sure that you are compiling the right file - AccountProtector.mq4, NOT AccountProtector.mqh.
Second, I have no idea why, but your AccountProtector.mqh has some HTML in it. Perhaps, you opened the source of the viewer page on GitHub and copied it from there?
 

Enivid

Administrator
Staff member
Nov 30, 2008
18,533
1,355
144
Odesa
www.earnforex.com
Version 1.06 has been released to fix bugs and add new conditions and filters:
  1. Added two conditions for current chart's spread. (Suggested via email.)
  2. Added two conditions for account's margin level. (@Artattack)
  3. Added six conditions for daily profit/loss triggering. (@tennomen)
  4. Added a filter based on whether a trade is in profit or in loss. (Suggested via email.)
  5. Instrument filter now can accept a list of trading instruments to analyze or to ignore. (Suggested via email.)
  6. Fixed compatibility with other panel-based indicators and EAs.
  7. Improved performance when checking some particularly slow-to-check conditions.
  8. Optimized filtering by magic numbers.
  9. The Emergency Button will no correctly close open positions. In version 1.05, it only deleted pending orders. (@bilyng)
  10. The AP will now correctly check the respective checkbox when deciding whether to apply the "Breakeven extra profit value (points)". (Via GitHub issue.)
  11. "Pips" have been changed to "points" throughout the panel to avoid confusion. (Suggested via email.)
Please download and let me know how it works for you!
 

bilyng

Trader
Jan 13, 2022
3
2
9
44
Looks like a bug. I'll fix it in the next release of the Account Protector.
Thanks.. emergency button works perfectly now.

However, all equity related functions still not working.
or perhaps there is a setting i didn't enable.

for example, equity trailing stop (hidden) gives the correct equtiy SL to close but doesn't actually close any trades
Also, for the conditions, the equity related functions do not trigger
 
  • 👍
Reactions: Enivid

Enivid

Administrator
Staff member
Nov 30, 2008
18,533
1,355
144
Odesa
www.earnforex.com
Thanks.. emergency button works perfectly now.

However, all equity related functions still not working.
or perhaps there is a setting i didn't enable.

for example, equity trailing stop (hidden) gives the correct equtiy SL to close but doesn't actually close any trades
Also, for the conditions, the equity related functions do not trigger
The equity trailing stop should be fixed now in 1.07, which I have just released. As for the conditions, please check if you have any filters set or if you are setting up the conditions correctly. I've tested them and they seem to work fine.
 

stevetrade

Newbie
Mar 1, 2022
1
0
1
53
Hi, I'm trying to set this up with the following scenario.

I want to trade four different instruments.

Let's say I trade Eurusd, GbpUsd, UsdCad and UsdJpy.

I'd like to monitor my positions on each pair separately and if the positions on each pair and only that pair exceed a 1% drawdown on my equity I'd like to close that pair positions.

So for example EurUsd goes into 1% drawdown but the other three pairs are fine, EurUsd closes out but the other three remain.

Can I do this?
 

Sir Charlie

Newbie
Mar 2, 2022
1
0
1
34
Thank you for your suggestion, but there is already a Timer trigger for that.
Hey Enivid,
Many thanks for your good work..i already use your position size calculator and i love it.Just added your account protector and trying to figure out whether for example...if my floating loss rises to 100 and action disable auto trading is triggered..can i set a specific time to enable it again...lets say i want autotrading to be disabled for 12 hours and thereafter auto trading can be enabled again
 

Enivid

Administrator
Staff member
Nov 30, 2008
18,533
1,355
144
Odesa
www.earnforex.com
Hi, I'm trying to set this up with the following scenario.

I want to trade four different instruments.

Let's say I trade Eurusd, GbpUsd, UsdCad and UsdJpy.

I'd like to monitor my positions on each pair separately and if the positions on each pair and only that pair exceed a 1% drawdown on my equity I'd like to close that pair positions.

So for example EurUsd goes into 1% drawdown but the other three pairs are fine, EurUsd closes out but the other three remain.

Can I do this?
You need to launch four instances of Account Protector and use filter by symbol to limit each one to a single currency pair.
 
  • 👍
Reactions: stevetrade

Enivid

Administrator
Staff member
Nov 30, 2008
18,533
1,355
144
Odesa
www.earnforex.com
Hey Enivid,
Many thanks for your good work..i already use your position size calculator and i love it.Just added your account protector and trying to figure out whether for example...if my floating loss rises to 100 and action disable auto trading is triggered..can i set a specific time to enable it again...lets say i want autotrading to be disabled for 12 hours and thereafter auto trading can be enabled again
You can use a separate instance of Account Protector to enable autotrading at specific time, but you cannot use to enable autotrading after "specific period from another instance's triggering has passed".
 

Bandit

Newbie
Mar 3, 2022
8
0
1
60
Great Tool people.

Can I make a suggestion for an additional feature?

When closing a position could we have a option to close (or partially close) the position which is the further distance from the current price first, then move to the next distant and so on?
(currently from my testing it seems to average all positions - forgive me if this is not the case)
This option would assist many EA's in managing an account.

Many Thanks
 
Last edited:

Enivid

Administrator
Staff member
Nov 30, 2008
18,533
1,355
144
Odesa
www.earnforex.com
Great Tool people.

Can I make a suggestion for an additional feature?

When closing a position could we have a option to close (or partially close) the position which is the further distance from the current price first, then move to the next distant and so on?
(currently from my testing it seems to average all positions - forgive me if this is not the case)
This option would assist many EA's in managing an account.

Many Thanks
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.