describe_trades: Describe trades

Description Usage Arguments Value Examples

View source: R/describe_trades.R

Description

Generate a trade list based on a previous and a new schedule. The function will analyse the differences between the schedules and infer the time and volume of the trades that occurred.

Usage

1
describe_trades(old_schedule, new_schedule, prices)

Arguments

old_schedule

a numerical vector

new_schedule

a numerical vector, must be same length as current_schedule.

prices

a numerical vector, must be same length as current_schedule.

Value

a data frame with columns describing the time at which a trade occurred (as index of old_schedule), volume and buy/sell price

Examples

1
2
3
4
schedule1 <- c(4, 0, 0, 3)
schedule2 <- c(0, 3, 0, 4)
new_prices <- c(70, 65, 80, 60)
describe_trades(schedule1, schedule2, new_prices)

henobe/flexoptr documentation built on March 11, 2021, 6:04 p.m.