'Place an order to adjust a position to a target number of shares. If
the position doesn\'t already exist, this is equivalent to placing a new
order. If the position does exist, this is equivalent to placing an
order for the difference between the target number of shares and the
current number of shares.
Parameters
asset : Asset
The asset that this order is for.
target : int
The desired number of shares of ``asset``.
limit_price : float, optional
The limit price for the order.
stop_price : float, optional
The stop price for the order.
style : ExecutionStyle
The execution style for the order.
Returns
order_id : str
The unique identifier for this order.
Notes
``order_target`` does not take into account any open orders. For
example:
.. code-block:: python
order_target(sid(0), 10)
order_target(sid(0), 10)
This code will result in 20 shares of ``sid(0)`` because the first
call to ``order_target`` will not have been filled when the second
``order_target`` call is made.
See :func:`zipline.api.order` for more information about
``limit_price``, ``stop_price``, and ``style``
See Also
:class:`zipline.finance.execution.ExecutionStyle`
:func:`zipline.api.order`
:func:`zipline.api.order_target_percent`
:func:`zipline.api.order_target_value`'

@api_method
@disallowed_in_before_trading_start(OrderInBeforeTradingStart())
def order_target(self, asset, target, limit_price=None, stop_price=None, style=None):

    if (not self._can_order_asset(asset)):
        return None
    amount = self._calculate_order_target_amount(asset, target)
    return self.order(asset, amount, limit_price=limit_price, stop_price=stop_price, style=style)
