-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Aggregation to Data by Period #19
Comments
hi oldandlostnow, Yes, it was intended. The code uses the price at the first day available at that month (see ref.date = min(ref.date)). I do agree however, that one could prefer using the last price (as u did in your code). I'll keep this issue open and fix it by adding an option to the function. Thanks. |
Hi @msperlin, If you run Also the column values for price.high are not correct. you are using When I have some more time I will dive into this a bit more and compare this on how xts is doing this. example:
|
Hi pverspeelt and oldandlostnow, I fixed the first issue by adding input "how.to.aggregate", which can be "first" or "last". As for the weekday problem, I also fixed it, making sure all first dates are monday. Give it a try using the github version. Best, |
Hi @msperlin, Just tested the github version and the weekly aggregates work as expected. Only quible I have is that I would expect the closing price to be the last by default, not first. Maybe an example in a vignette or documentation to fully explain the difference between first and last for But I appreciate the quick fix 👍 . Best |
Great. Glad it worked out. best, |
To improve the description, added an example at manual. |
BatchGetSymbols is very useful code. Thank you for writing it.
I have only looked at monthly data produced by BatchGetSymbols. It appears that the closing price and adjusted closing price are computed from the data for the first day of the period. Is that intended?
I believe the current code snippet is
Should this code be (changing the formulas for price.close and price.adjusted)
I would appreciate your thoughts. Thank you in advance for your help.
The text was updated successfully, but these errors were encountered: