Dump open trades to a file

 

Does anyone have any code to write out the currently open trades to a text file?

Or anything similar that I could modify?

thanks