-
Notifications
You must be signed in to change notification settings - Fork 855
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
Stack handler error #1474
Comments
I'm not sure the system has done anything wrong here. Why did you close the position manually? Why not set the roll state to Close? |
Probably a niche scenario.
It wouldn't have happened had I waited to check what DO was going to do before changing roll status (would've left it alone in this case). |
What you have described so far is not clear at all. Manual close order, or set roll state to CLOSE? Reading between the lines, it looks like what you are suggesting is:
Is that about right? |
Yes sorry I meant that I used interactive_update_roll_status to set it to CLOSE. |
I'm still confused. In normal operation, order generation happens after the stack handler has shut down. So, even if you changed the roll status AND ran "Create force roll contract orders" immediately, AND for some reason the close order didn't execute, there would not be any orders on the stack by the time order generation ran. The order generator already takes roll state into account, obviously. Was there another previous stack handler crash? That would account for orders still on the stack at order time. Or have you setup some non standard process timing? Please describe the exact scenario in detail |
Sorry this is confusing. Let me try to be more detailed.
|
First step I would take is to look in the logs, and establish exactly what happened |
|
I think you misunderstand. If this was a problem that I had, on my setup, the first step I would take is to work out what happened, exactly. I would do that by analysing the logs of the strategy order generator and the stack handler. I am not offering to do that work for you |
Understood. I'll work on this and if I come up with anything more specific or actionable I can open another issue. Thanks. |
Great. If it happens again, here are the steps to make it less painful:
|
I had a -1 position in HANGENT_mini that was about to expire, so I put a close order in using interactive_order_stack. At the same time, the dynamic system decided to close the position so I ended up with this in interactive_order_stack (this was run after the crash)
What actually happened was the system placed an order for 1 to close the position then crashed as below.
Since the stack handler crashed the other orders did not take place. Trying to run the end of day stack deletion failed with the same error. I also ended up with a strategy position in HANGENT_mini of +1, which had to be fixed to correct the positions "break". It would be ideal if the stack handler could handle the niche scenario where a position is closed (or rolled?) the same time as the system decides to change position. I usually wait until after the strategy order generator runs before closing positions to avoid this sort of situation.
Thanks!
The text was updated successfully, but these errors were encountered: