Change der "reverse" script

 
I need help please. I have a script that closes the opened positions and opens a new position in the opposite direction. But this script applies this function only to opened positions, from the current active chart. I would now like to rewrite the script so that all open trades are rotated no matter which chart is open. Since I only trade on two indices, the script could also be provided with the query, which symbol it is. 
Files:
Reverse.mq4  4 kb
 
Trader221262: I need help please. I have a script that closes the opened positions and opens a new position in the opposite direction. But this script applies this function only to opened positions, from the current active chart. I would now like to rewrite the script so that all open trades are rotated no matter which chart is open. Since I only trade on two indices, the script could also be provided with the query, which symbol it is. 

If you are requesting for coding to be done for you, then please understand that the forum is not a Free Coding Service.

Please consider placing a job request in the Freelance section instead.

Trading applications for MetaTrader 5 to order
Trading applications for MetaTrader 5 to order
  • 2022.12.01
  • www.mql5.com
The largest freelance service with MQL5 application developers
 
Trader221262 I would now like to rewrite the script so …

You haven't stated a problem, you stated a want. Show us your attempt (using the CODE button) and state the nature of your difficulty.
          No free help (2017)

Or pay someone. Top of every page is the link Freelance.
          Hiring to write script - General - MQL5 programming forum (2018)

We're not going to code it for you (although it could happen if you are lucky or the problem is interesting).
          No free help (2017)

Reason: