Previously the class SerializeableZiplineObject was used to
house basic __setstate__ and __getstate__ methods. It wasn't
really doing much that was helpful, so it is now gone.
For printability in the repr when debugging algo config and state,
change the repr of TradingAlgorithm and the objects it contains
so that the more closely adhere to the repr interface of being
able to recreate an object instance.
The cost value should always be a float.
The per share calculation shouldn't be changed dramatically by being
a float, (except for potential rounding errors), but change to so
that PerShare and PerTrade are aligned.
# Please enter the commit message for your changes. Lines starting
When the cost basis was set to an integer the division in the
calculation would floor down to the nearest integer.
Ensuring that the number is a float during PerTrade's init
will ensure that the calculation doesn't use integer division.
Do the conversion to float in init rather than calculate, so that
calling the builtin `float` is not added to any inner loops.
Mostly whitespace, line width and other spacing changes.
Also, removes use of deprecated has_key in favor of `in`
Going forward new patches should pass running `flake8` before
submission.