money protection
Please edit your post and
use the code button (Alt+S) when pasting code
topics concerning MT4 and MQL4 have their own section.
In future please post in the correct section.
I will move your topic to the MQL4 and Metatrader 4 section.
Hello all!
I need help for my mq4 code, I want that the ea close all trade when total trade running+closed trade reach 5%(different pairs running)
I have got a code for that but the ea close trade when closed trade reach 5%, however all running trade are in loss,so it's nothing
This is the part of the code(I put it in my ea code)
Thanks in advance for your help
Try this...
int Start{ //Target Profit static double ProfitTargets=(AccountBalance()*ProfitTarget/100)+AccountBalance(); ProfitRunning=AccountEquity(); if(ProfitRunning >= ProfitTargets) { CloseAll(); ProfitTargets=(AccountBalance()*ProfitTarget/100)+AccountBalance(); } Comment("Capital: ",AccountBalance(),"\n Marge disponible: ",AccountEquity(),"\n Profits en cours: ",ProfitRunning); }
Or use the script in codebase... https://www.mql5.com/en/code/31812
- www.mql5.com
Hello all!
I need help for my mq4 code, I want that the ea close all trade when total trade running+closed trade reach 5%(different pairs running)
I have got a code for that but the ea close trade when closed trade reach 5%, however all running trade are in loss,so it's nothing
This is the part of the code(I put it in my ea code)
Thanks in advance for your help