library(quantmod)
getSymbols("LLOY.L",
from = datefrom,
to = dateto,
auto.assign = TRUE)
LLOY.L$MovingAverages <- 0
e <- movavg(LLOY.L$LLOY.L.Close, 5, type = c("e"))
LLOY.L[, 7] <- e
Is there a way to create a new column of this dataset that means if column 4 is greater than column 7 it prints "Buy Stock" in each row, else print "Sell Stock", I have tried using loops with no success