LimitBuy: Execute Limit Buy Order

Description Usage Arguments Value Examples

Description

(Try) to buy a given instrument at given date and time slot, by limit order. If limit price was not given, then use the last trading price as limit price. If both 'orderTo' and 'orderLast' was given, then the smaller one will be adopted.

Usage

1
2
3
LimitBuy(dir = dir, date, ticker, capital, limitPrice = NA, orderFrom, 
         orderTo = 150000, orderLast = 7 * 3600, costIn = 0.001,
         market = 'SHSZ')

Arguments

dir

The directory containing the Tick data.

date

the date for placing the order.

ticker

ticker for traget instrument, characters or numbers are both acceptable.

capital

amount of money wanted to fully invested on the instrument.

limitPrice

the limit price to sell.

orderFrom

time of the order being placed.

orderTo

time of the order being withdrawed.

orderLast

duration of the order, in seconds.

costIn

transaction cost for buying.

market

specifying the sub-function to call depending on the market.

Value

A dataframe, with corresponding summary statistics.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## locate tick data directory ##
dir <- system.file("extdata", '', package = "TickExec")

## Execute order, given duration ##
dfLog1 = LimitBuy(dir = dir, date = 20141013, ticker = 000001, capital = 1e6, 
                 limitPrice = NA, orderFrom = 94545, orderLast = 600, 
                 costIn = 0.001, market = 'SHSZ')
                 
## Execute order, given ending time ##
dfLog2 = LimitBuy(dir = dir, date = 20141013, ticker = 000001, capital = 1e6, 
                 limitPrice = NA, orderFrom = 94545, orderTo = 100001, 
                 costIn = 0.001, market = 'SHSZ')
                  
## see result ##
dfLog1
dfLog2

TickExec documentation built on May 2, 2019, 9:58 a.m.

Related to LimitBuy in TickExec...