I need to create an easy Metatrader EA to close all trades based on win percentage.
This is what the EA will do:
- EA will be dragged on a pair and will be checking trades open and balance all the tim
- EA will close all trades open if WIn -5 or Win $ is reached. That is, if I set Win% to 10% (default), once my account is 10 up based on the account balance available from the 1st of each month, the EA will close all trades and send an email to the default email set up in Metatrader. Same applies to WIN$, I can specify if I want to close all trades if $1000 profit is reached.
- AUTO TRADING button will be disabled once the target and all trades have been closed, so the EA I use for trading won't be able to open any more trades unless I modify the target again
- Monthly_target_%: 10. Default 10% target. If this target is reached, EA will close all trades and send email
- Monthly_target_$: If this target is reached, EA will close all trades and send email. We need to have a way to choose one or the other
- Monthly_drawdown: 5. If -5% is reached, Auto Trading will be disabled so no more trades can be taken
- SendEMailTarget: true/false, will send email if target is reached
- SendEMailDrawdown: true/false, will send email if maximum drawdown is reached
- EA will display a text panel that can be toggled on/off (true, false), this panel will display this text:
* Balance: account balance
* Trades open: 4
* Risk taken: %4 (risk taken based on the account balance), need to know how much risk)
* Win %: winning percentage of open trades.
* Win $: same as win-% but it will display money earned
This panel will update information based on the balance available from the 1st day of the month.
Example 1: if I start month 1 with 10.000, and I made 10%, EA will close all trades and send email. Same if I specify WIN$ instead. I should be able to select which way I want to do the calculation, % or $
Example 2: then second month I start Day1 with 11.000, I set EA to close all trades at 10% based on the balance I started the month with... once EA reaches 10% of 11.000 the EA will close all the trades and send email.
I want this EA to be coded in such a way that its functions can be incorporated in the EA I use for my trading, it has to have that in mind, object oriented programming. I want it to work by itself but coded in such a way that it can be merged as functions in my EA.