Description Usage Arguments Details Zipline Documentation
Place various types of orders according to amounts, percentages, and targets. Orders can be specified as market, limit, stop, or stop-limit.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | fly_order(asset, amount, limit_price = NULL, stop_price = NULL,
style = NULL)
fly_order_value(asset, value, limit_price = NULL, stop_price = NULL,
style = NULL)
fly_order_percent(asset, percent, limit_price = NULL, stop_price = NULL,
style = NULL)
fly_order_target(asset, target, limit_price = NULL, stop_price = NULL,
style = NULL)
fly_order_target_value(asset, target, limit_price = NULL, stop_price = NULL,
style = NULL)
fly_order_target_percent(asset, target, limit_price = NULL,
stop_price = NULL, style = NULL)
|
asset |
The asset that this order is for. |
amount |
An integer. The amount of shares to order. If amount is positive, this is the number of shares to buy or cover. If amount is negative, this is the number of shares to sell or short. |
limit_price |
Optional. The limit price for the order. |
stop_price |
Optional. The stop price for the order. |
style |
The execution style for the order. The default is |
value |
If the requested asset exists, the requested value is divided by its price to imply the number of shares to transact. If the Asset being ordered is a Future, the <e2><80><98>value<e2><80><99> calculated is actually the exposure, as Futures have no <e2><80><98>value<e2><80><99>. If positive, buy/cover. If negative, sell/short. |
percent |
The percentage of the portfolio value to allocate to |
target |
The new |
The limit_price and stop_price arguments provide shorthands for passing
common execution styles. Passing limit_price=N
is equivalent to
style=LimitOrder(N)
. Similarly, passing stop_price=M
is equivalent to
style=StopOrder(M)
, and passing limit_price=N
and stop_price=M
is equivalent to style=StopLimitOrder(N, M)
.
It is an error to pass both a style and limit_price or stop_price.
fly_order()
- Place an order.
fly_order_value()
- Place an order by desired value rather than desired
number of shares.
fly_order_percent()
- Place an order in the specified asset corresponding
to the given percent of the current portfolio value.
fly_order_target()
, fly_order_target_value()
, fly_order_target_percent()
- Place an order to adjust a position to a target
number of shares, value, or percent. If the position doesn<e2><80><99>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, value, or percent
and the current number of shares, value, or percent.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.