Script to close the oldest open order

 
Hi, I been using hotkeys to buy/sell X amount of lots with scripts and using a "Close All" script to close an entire position of multiple orders. But what if I want to close only 1 order at a time? 
I found this topic to close the oldest 5 orders but it seems incomplete and part of the codes used might be out of date and dont compile.
Can anyone help me with this script I'm not much of a coder.
https://www.mql5.com/en/forum/142093
Script : close oldest 5 buy orders
Script : close oldest 5 buy orders
  • 2012.11.11
  • www.mql5.com
Hi all, the following script closes all buy orders, can someone help by modifying it to close .. the "oldest 5" only, instead of all orders. thanks...
Reason: