We propose a new method to define trading algorithms in market design environments. Dropping the traditional idea of clearing cycles in generated graphs, we use parameterized linear equations to define trading algorithms. Our method has two advantages. First, our method avoids discussing the details of who trades with whom and how, which can be a difficult question in complex environments. Second, by controlling parameter values in our equations, our method is flexible and transparent to satisfy various fairness criteria. We apply our method to several models and obtain new trading algorithms that are efficient and fair.