[R-SIG-Finance] Sum volume by day and plot in xts
Peter Neumaier
peter.neumaier at gmail.com
Sat Mar 12 10:26:14 CET 2016
Hi all,
I am looking at half hourly OHLC in xts:
NGFH6.Open NGFH6.High NGFH6.Low NGFH6.Close NGFH6.Volume
2016-01-06 07:30:00 0.3395 0.3395 0.3375 0.3380 45
2016-01-06 08:00:00 0.3400 0.3400 0.3387 0.3395 140
2016-01-06 08:30:00 0.3395 0.3395 0.3379 0.3379 70
I'd like to plot my closing price for the day and sum up the volume (for
that day).
My current work around is
cbind(NGF[,"NGFH6.Close"],NGF[,"NGFH6.Volume"])
Summing up the daily volume and then plot (in manual steps).
Is there a more elegant way than above work around, i.e. select columns to
plot (without cbind), sum up volume by day and the plot closing price and
the daily sum (probably in one statement)?
I am thankful for any directions on that.
Peter
[[alternative HTML version deleted]]
More information about the R-SIG-Finance
mailing list