Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- set.seed(1)
- time <- rep(seq(1,5), , each = 15)
- id <- sample(342:346,75,replace = TRUE)
- price <- sample(99:103,75,replace = TRUE)
- Desire.Price <- sample(97:105,75,replace = TRUE)
- quantity <- sample(1:4,75,replace = TRUE)
- data <- data.frame(time = time, id = id,price = price, Desire.Price = Desire.Price,quantity = quantity)
- data$buysell <- 0
- data$buysell <- ifelse( data$Desire.Price <= data$price, "BUY","SELL")
- Final.df <- data.frame(time=NA,id=NA,"97" = NA,"98"=NA ,"99"=NA,"100"=NA,"101"=NA,"102"=NA,"103"=NA
- ,"104"=NA,"105"=NA)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement