This simple EA will help protect your account from a sudden huge drawdown from a position opened by another EA. It is used to complement another EA which does not come with a drawdown protection.
Many EAs sold in the Market do not allow you to control the drawdown or expect you to "believe" that their EA will not wipe out your account. All is too late, when your account hits margin call due to position opened by that EA that goes beyond the expected loss. Account Protection EA is designed to avoid such situation by covering your loss and closing all positions immediately after certain percentage drawdown or certain time (optional) set by you.
- PercentageToClose=80.0: Close all positions once equity reaches this account balance percentage. In this example, when you have a bad trade and your account is only left with 80% equity, all trades will be closed. Your maximum drawdown set will be 20%
- FiftyPercentAlarm=false: 50 percent before reaching your set drawdown (in this example drawdown reach 10%), alarm will be sent
- TewntyPercentAlarm=false: 20 percent before reaching your set drawdown (in this example drawdown reach 16%), alarm will be sent
- CloseTime=false: Set to True to close all trades at a certain time and False to turn it off. Configure the time at the "alarm" option
- alarm=145: If "CloseTime" is set to true, configure the time to close all trades here. The time is YOUR BROKER TIME. For example, to close all trades at a broker time 8:55 a.m., set 855. Another example: to close all trades at a broker time 8:55 p.m., set 2055
- XpanelDistance=1250: Location of your information panel. Increase value to move panel to the top right. Decrease the value to move panel to the top left.