Repository navigation
trade_aggregation: support 14, nanosecond timestamps and size units, … - #25
Merged
Merged
Conversation
…0.139.0 trade_aggregation 14 takes the timestamp resolution and the currency of the trade size from the trade type. The old impl left the resolution at its default of milliseconds although the timestamps are in nanoseconds, so the parts of trade_aggregation that read it from the trade (Adaptive, MinDuration, MaxDuration, TimeVelocity) were off by a factor of 10^6. Trade now implements Timestamped with TimestampResolution::Nanosecond, and TakerTrade with SIZE_UNIT from the currency of its quantity, so By::Base and By::Quote sum base volumes and notionals for linear and inverse contracts. For that, Currency gets a KIND constant (CurrencyKind::Base or ::Quote), which generic code can also use elsewhere. The From<Trade> for trade_aggregation::Trade conversion is removed: that type now has millisecond timestamps and quote sizes, so the conversion would lose precision, and a Trade can be aggregated directly. Breaking (new required Currency constant, removed conversion), so the version is 0.139.0.
SummaryPR bumps Issues
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…0.139.0
trade_aggregation 14 takes the timestamp resolution and the currency of the trade size from the trade type. The old impl left the resolution at its default of milliseconds although the timestamps are in nanoseconds, so the parts of trade_aggregation that read it from the trade (Adaptive, MinDuration, MaxDuration, TimeVelocity) were off by a factor of 10^6.
Trade now implements Timestamped with TimestampResolution::Nanosecond, and TakerTrade with SIZE_UNIT from the currency of its quantity, so By::Base and By::Quote sum base volumes and notionals for linear and inverse contracts. For that, Currency gets a KIND constant (CurrencyKind::Base or ::Quote), which generic code can also use elsewhere.
The From for trade_aggregation::Trade conversion is removed: that type now has millisecond timestamps and quote sizes, so the conversion would lose precision, and a Trade can be aggregated directly.
Breaking (new required Currency constant, removed conversion), so the version is 0.139.0.