We’re continuing to add features that support our live trading pilot. Today we’re introducing trading guards for your algorithm.
Everyone knows that code has bugs, and bugs that cause excessive trading are particularly problematic. We’re adding another layer of defense against a whole class of possible mistakes. You can now set limits to prevent runaway or excessive orders by your algorithm.
In the initialize() method you have the option to add:
- Maximum Order Count: Sets a limit on the number of orders that can be placed by this algorithm in a single day.
- Maximum Order Size: Sets a limit on the size of any single order placed by this algorithm. This limit can be set in terms of number of shares, dollar value, or both.
- Maximum Position Size: Sets a limit on the absolute magnitude of any position held by the algorithm for a given security. This limit can be set in terms of number of shares, dollar value, or both.
- Long Only: Prevent the algorithm from taking short positions.
These were customer-requested features and we’re happy to deliver them! Try these out in your backtests and live trading algorithms.