Learn R Programming

TickExec (version 1.1)

MarketBuy: Execute Market Buy Order

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

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

Run this code
## 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

Run the code above in your browser using DataLab