Fixed a bug where trades were being closed on multiple pairs. Filtered by magic number.
Also noticed I somehow reverted to an older version where the back tests were not as good. This has been corrected on the live account.