diff --git a/tradecalc.py b/tradecalc.py index 66fe58c2..975b0936 100644 --- a/tradecalc.py +++ b/tradecalc.py @@ -47,7 +47,7 @@ def detail(self, verbose=False): hop = self.hops[i] str += " >-> " if i == 0 else " -+- " str += "%-20s Buy" % route[i] - for item in hop[0]: + for item in sorted(hop[0], key=lambda item: item[1] * item[0].gainCr, reverse=True): str += " %d*%s," % (item[1], item[0]) str += "\n" if verbose: