MarketBuy: Execute Market Buy Order

Description Usage Arguments Value Examples

Description

(Try) to buy a given instrument at given date and time, by market order.The function can at most penetrate 5 levels of ask prices. For large capital, the average executed price WILL be elevated.

Usage

1
2
MarketBuy(dir = dir, date, ticker, capital, orderTime, 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.

orderTime

Time of the day to place the market order.

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
## locate tick data directory ##
dir <- system.file("extdata", '', package = "TickExec")

## Execute order ##
dfLog = MarketBuy(dir = dir, date = 20141010, ticker = 000001, capital = 1e5,
                  orderTime = 94545, costIn = 0.001, market = 'SHSZ')
                  
## see result ##
dfLog

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

Related to MarketBuy in TickExec...