I parse the file several time because I use it as a container of all the phantom trades during test and trade and than parse it in order to retrieve only the proper Asset/algo Combination.
High level code structure is:
-once delete the old file
-every bar store the closed phantom trades in the file
-every bar check if signal and then parse the file for proper Algo/Asset combination and read the numbers to decide if trade or not. Here is the parse call.
Do you think that this is not the best way to do it?