create_snapshot: Prepare data for computing impact cost.

Description Usage Arguments Value Examples

View source: R/ic.R

Description

Extract the list of best prices and quantities for a given mbp.

Usage

1

Arguments

mbp

A 'data.frame' containing market by price data. Rownames of the data frame should contain the timestamp corresponding to the given row.

type

a character scalar: 'bsp' for sell side price, 'bbp' for buy side price, 'bbq' for buy side quantity and 'bsq' for sell side quantity.

Value

A 'matrix' containing prices/quantities for the buy side/sell side with timestamps as rownames. Example: For type = 'bsp', the fields 'bsp1' and 'bsp2' contain the list of 1st and 2nd best sell prices from the LOB at every timestamp.

@author Chirag Anand

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Demonstration of IC functions using the market by
## price data of CINEMAX from the ic_CINEMAX dataset.

try(data( package = "ifrogs", "ic_CINEMAX")) 
mbp <- cbind(as.data.frame(CINEMAX[1]), 
             as.data.frame(CINEMAX[2]), 
             as.data.frame(CINEMAX[3]), 
             as.data.frame(CINEMAX[4]))
str(mbp)

## create_snapshot for the best buy quantity.
bbqSnap <- create_snapshot( mbp, type = "bbq")
head(bbqSnap)

## create_snapshot for best sell price
bspSnap <- create_snapshot( mbp, type = "bsp")
head(bspSnap)

igidrfrg/ifrogs documentation built on July 20, 2020, 2:02 p.m.