quantopian/zipline — pull request #104 by jlowin (2013-03-07 22:41:12+00:00)
Title: New order methods

Some new ways to place orders, other than specifying a number of shares:

Adds to `AlgorithmSimulator`:
- `order_value()`, which wraps `order()` and allows a dollar value for the order to be provided instead of a number of shares.

Adds to `TradingAlgorithm`:
- `order_value()`, which is a call to the underlying `AlgorithmSimulator`'s `order_value()` method (just like `order()`).
- `order_percent()`, which allows an order to be specified as a [decimal] percent of the current portfolio value.
- `target()`, which places an order to adjust a position to the target number of shares
- `target_value()`, which places an order to adjust a position to the target value
- `target_percent()`, which places an order to adjust a position to the target percent of current portfolio value