mirror of
https://github.com/wassname/catalyst.git
synced 2026-06-30 04:50:33 +08:00
40605e3c5d
Fix common error condition which was triggered whenever the session at the end of the prefetched history window was a session where the back contract was active. When the back contract was the active contract, the next contract for consideration was the front contract at the end of the window, which definitionally always has an autoclose after the end of the window. Instead, just start seeking backwards from the end of the window. Also prevent lookahead bias in volume rolls, which was caused by the using the volume for a session to determine whether that session had rolled. Information that would not have been available at the beginning of the session. This change makes the volume rolls overly conservative, and may be improved by looking at vectors of the preceding volume and making the roll off of momentum.