-
Notifications
You must be signed in to change notification settings - Fork 25
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
fix: trigger aligned timerule when diff is equal to period #17
fix: trigger aligned timerule when diff is equal to period #17
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall. Some slight test modifications and we can get this merged.
Trade { | ||
timestamp: 1712656815000, | ||
price: 101.0, | ||
size: -10.0, | ||
}, | ||
Trade { | ||
timestamp: 1712656860000, | ||
price: 101.0, | ||
size: -10.0, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trade { | |
timestamp: 1712656815000, | |
price: 101.0, | |
size: -10.0, | |
}, | |
Trade { | |
timestamp: 1712656860000, | |
price: 101.0, | |
size: -10.0, | |
}, | |
Trade { | |
timestamp: 1712656815000, | |
price: 100.5, | |
size: 10.0, | |
}, | |
Trade { | |
timestamp: 1712656860000, | |
price: 101.0, | |
size: -10.0, | |
}, |
Would be good for both prices to be unique.
assert_eq!(candles[0].open(), 100.00); | ||
assert_eq!(candles[1].open(), 101.00); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assert_eq!(candles[0].open(), 100.00); | |
assert_eq!(candles[1].open(), 101.00); | |
assert_eq!(candles[0].open(), 100.0); | |
assert_eq!(candles[0].close(), 100.5); | |
assert_eq!(candles[1].open(), 101.0); | |
assert_eq!(candles[1].close(), 101.0); |
An assertion for the close price would be good as well.
I think those values are correct, but unfortunate that both open and close prices are 101, so maybe it makes sense to add another trade to be included in the second candle
da08f98
to
d52a61f
Compare
d52a61f
to
f4e5f12
Compare
@MathisWellmann updated this one as well |
Aligned time rule is not triggered on timestamps like
15:00:00
with one minute rule