trading-controls: Trading controls

Description Usage Arguments Details Zipline Documentation

Description

These controls ensure that your algorithm is performing as expected. The controls act as guards against certain actions such as ordering black listed stocks, shorting, or exceeding a maximum leverage threshold.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
fly_control_set_do_not_order_list(restricted_list, on_error = "fail")

fly_control_set_long_only(on_error = "fail")

fly_control_set_max_leverage(max_leverage)

fly_control_set_max_order_count(max_count, on_error = "fail")

fly_control_set_max_order_size(asset = NULL, max_shares = NULL,
  max_notional = NULL, on_error = "fail")

fly_control_set_max_position_size(asset = NULL, max_shares = NULL,
  max_notional = NULL, on_error = "fail")

Arguments

restricted_list

A list of assets that cannot be ordered.

on_error

How to proceed on a control error. The default is to stop the backtest. Another option is "log" to log the error and continue.

max_count

An integer. The maximum number of orders that can be placed on a single day.

asset

An asset. If provided, guard only on positions in the given asset.

max_shares

An integer. The maximum number of shares that can be ordered at any one time.

max_notional

The maximum value that can be ordered at any one time.

Details

Zipline Documentation


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