Try searching for the algorithms in game forums such as "The Patrician 2" or "Port Royal 1&2". These are games, that almost exclusively handle trade.