Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #calculo dos retornos
- #pegar o valor de fechamento / fechamento anterior
- ASSET$Close_Shift <- ASSET$CLOSE #cria variavel asset.closeshifit e copia os dados de asset$close para ela
- ASSET['Close_Shift'] <- c(NA, head(ASSET['Close_Shift'], dim(ASSET[1] -1)[1])) #nao entendi como e feito o deslocamento nao entendi #essa linha inteira
- ASSET$Retornos <- (ASSET$CLOSE / ASSET$Close_Shift-1)*100 # Pega o valor do fechamento/fechamento anterior para ter variacao %
- ASSET[is.na(ASSET)] <- 0 # Se ASSET é NA então coloca 0 ???
- head(ASSET)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement