Tâche terminée
Spécifications
Hello, I need someone to help solve a shortfall in my code using (Array). It should be simple and I'll be happy if you can get it done in a few hrs.
THE ISSUE:
I have coded a Partial Closure function that is expected to close (x% lots) off every trade running on the account having a specified Magic No. only when the net profit of these trades hit a stated max DD of Account Balance. (Symbol of trades doesn't matter).
I have observed that the function sometimes closes a ticket by the (x% lots) and the before loop finishes, it again closes (x% lots) off the resultant position from the initial one probably because it sees this new resultant ticket just as one of the old trades. This makes everything random and I want a solution....
My solution:
Developer should create an Array so that when maxDD is hit, this Array is populated with all existing tickets. If the partial closure function starts, the loop should then handle only the tickets found in the Array. This way, I believe the problem could be solved.
I'll share my code with the selected dev. and am also open to any other ideas or solutions....thanks!