Thanks GumRai, I didn't konw about GlobalVariables. Just what I needed!
- Don't need GVs Just do your orderSelect loop and create your sum, return from start on your limit.
-
But if you insist: Remove an EA through MQL4 code - MQL4 forum
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
I've been struggling with this problem for a little while. I want the close all positions and stop my EA when total profit reaches a certain value.
Where :
Across all positions:
If the same EA is used on multiple charts, how can I close all positions and stop all EAs at the same time?
1. I've tried using a script to check for the total profit target and then close the positions, but there's no way to stop EAs from script.
2. I've tried unsuccessfully to get the EAs to stop themselves. Some of them reopen their positions because I guess they don't all see profit target being hit.
Does anyone have any suggestions?