Skip to content
This repository has been archived by the owner on Feb 15, 2022. It is now read-only.

Restore onTrade() bail-out in a way that works #2345

Merged
merged 1 commit into from
Aug 27, 2020
Merged

Restore onTrade() bail-out in a way that works #2345

merged 1 commit into from
Aug 27, 2020

Conversation

jorisw
Copy link
Contributor

@jorisw jorisw commented Aug 22, 2020

This fix undoes #2334 and fixes the problem it tried to fix, the right way, by restoring bailing out of onTrade when an old trade comes in, but this time with the call to the callback function which went missing in the changes in 17e9758#diff-a41b519e7979a713e894ef8d1b3fe568R347-R349 .

Because of the missing call on the callback function, the async event queue loop would break when an old trade came in. This PR restores resuming operations when a trade comes in that belongs to a previous period.

The bug, and these changes, affect only those running paper or live trading in very short timeframes such as 1s or 5s.

This fix undoes #2334 and fixes the problem it tried to fix, the right way, by restoring bailing out of onTrade when an old trade comes in, but this time with the callback that went missing in the changes in 17e9758#diff-a41b519e7979a713e894ef8d1b3fe568R347-R349 .

Because of the missing call on the callback function, the async queue chain would break when an old trade came in. This PR restores resuming operations when a trade comes in that belongs to a previous period.

The bug, and these changes, affected only those running paper trades in very short timeframes such as 1s or 5s.
@DeviaVir DeviaVir merged commit 3be1c33 into DeviaVir:unstable Aug 27, 2020
@jorisw jorisw deleted the patch-1 branch August 27, 2020 12:15
@grooveuser
Copy link

I've been banging my head on the code for weeks looking for this bug! Thank you thank you thank you!

How did you find it?

@jorisw
Copy link
Contributor Author

jorisw commented Aug 28, 2020

Reverse engineering 😳

And @DeviaVir 's comment in #2334 sure helped too.

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

Successfully merging this pull request may close these issues.

3 participants