|
Daniel
2021-08-27 09:33:27
|
|
I have a trading algorithm that I use in Python and have been testing over the course of the summer. For the most part, the algorithm runs very well but it ran into an issue this week where it purchased an excessive amount of shares in a very short amount of time (over the course of 4 milliseconds). So, I'm trying to implement safety mechanisms that would check each order before sending it to the broker to ensure a sort of buying spree doesn't occur (kind of like trying to avoid what happened to Knight Capital in 2012).
I know the parameters I want to keep track of for each order (excessive size, high frequency, etc.) but I'm trying to determine the best way to integrate the checks at a software-level to minimize latency. Right now, I'm debating between including the checks in the code for my trading strategy directly via software libraries or developing a separate system/service which would check all the trades before relaying them to my broker.
Does anyone have any suggestions (either from research of first-hand experience) as to which method is more efficient for implementing safety guards in a trading algorithm? Alternatively, does anyone have any resources they might suggest that may give me inspiration for my project?
Any and all help is welcome and greatly appreciated. Thanks in advance.
|
|