Skip to content
Prev 13324 / 15274 Next

Monthly Midpoint return

Hi Brian and everybody else, 
its downloaded stock prices I want to transform to middle of month stock price.
endpoints give end of month doesn't it?if Im using endpoints I get a really strange result with a lot of NA:s My Data starts with the 15:th som my idea it transforming the data to.monthly somehow
My function is ("provided" by Ulrich): 
monthly = function(x){  sym <- sub("\\..*$", "", names(x)[1])  Ad(to.monthly(x, indexAt = 'lastof', drop.time = TRUE, name = sym))}

best regards,Phillip