Skip to content
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

Refactor perTradeStats and error handle scenario where timespan is length 1 (buy and sell txn on same timestamp) #110

Open
jaymon0703 opened this issue Oct 13, 2020 · 1 comment
Assignees

Comments

@jaymon0703
Copy link
Collaborator

It is possible there is a round turn trade with buy and sell transactions occurring on the same whole second timestamp. Not sure about microseconds...should be rare if possible.

This feature request is about handling the error by giving the user an appropriate message if the condition is triggered.

@jaymon0703 jaymon0703 self-assigned this Oct 13, 2020
@braverock
Copy link
Owner

I think the fix might be better done in addTxns than in perTradeStats.

make.index.unique in xts was created in part for this exact problem, to ensure strict time ordering of transactions even when timestamp frequency isn't high enough to keep things separated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants