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.
tabadany19:
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
Master Exit Plan
- www.mql5.com
Master Exit Plan is collection of simple strategies that would help traders manage on how to exit open trades and pending orders. NOTE: This EA doesn't open a trade for you. It only manages your open trades and pending orders. Here are the list of exit strategies... Equity Target - this part of the program helps you protect your account equity...
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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