This is the code in R for Trade Matcher