Go through all trades in a for(open_trades) loop, and compare the TradeID variable.