Latest versions of the three usual suspects are in post 1.
I decided to do something for our FIFO-blighted US cousins. Ok, so the closure code as was would eventually close out all the trades but it needed calling as many times as there were trades.
Load Bugger All Included into the editor and follow the bookmarks to see what I have done.
I assumed that lower ticket numbers would be older trades, so I declared an array to hold the ticket numbers of all the trades, then sort them in descending order so that the furthest back in time would be at the top of the array, and so on down.
Originally, all this code was within a user input IfLunaticFifoRulesApply and the code was redirected to a dedicated FIFO trade closure function. I realised later that we do not need a separate function because iterating through the array of ticket numbers is going to be more efficient that iterating through all the trades on the platform.
Usage will throw up anything that I have broken during this process.

Read the effing manual, ok?
Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.
I still suffer from OCCD. Good thing, really.
Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.
To see The Weekly Roundup of stuff you guys might have missed
Click here
My special thanks to Thomas (tomele) for all the incredible work he does here.