mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-04 17:21:10 +08:00
e47cb96479
Previously, we have assumed that the `amounts` and `last_sale_prices` lists have the same order as the `value_multipliers`. This is not correct, since to populate the `amounts` and `last_sale_prices` lists we iterate over a `dict` (self.positions). The order of this `dict` can change in arbitrary ways when it is updated, which occurs when we call `update_positions`. Our `value_multipliers` however are stored in an `OrderedDict`, meaning the order of existing key/value pairs is not changed when they are updated. To address this issue, we make sure that `self.positions` subclasses `OrderedDict`.