order-placement: Order placement

Description Usage Arguments Details Zipline Documentation

Description

Place various types of orders according to amounts, percentages, and targets. Orders can be specified as market, limit, stop, or stop-limit.

Usage

 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)

Arguments

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 MarketOrder. See ?MarketOrder for other execution styles.

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 asset. This is specified as a decimal, for example: 0.50 means 50 percent.

target

The new amount, value, or percent to adjust to depending on the order target function called.

Details

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.

Zipline Documentation


DavisVaughan/flyingfox documentation built on May 5, 2019, 12:28 a.m.