Documentation
Documentation copied to clipboard
Document big picture issues
Providing an overall general picture of the system will help a lot to let people understand how best to code an algo. This would include:
- Is QC single threaded. I assume it is and a statement that it is then is great. If it is not you need a discussion of handling re-entrant calls, are the collections thread safe, use of semaphores, etc.
- Discuss the issue of race conditions and what needs to be done when writing code. Even if single threaded, because some calls are asynchronous, you can still have race conditions (example).
- Are blocking calls ok, or should we always use asynchronous calls? The intro videos show both approaches. And if blocking is ok, you need to say so for all of us coming from the world of writing web or desktop apps where you never ever make a blocking call (and only do polling if there is truly no alternative).
- In the Algorithm Framework, state where you should place your code to determine when to sell (the entire framework is designed to determine when to buy, and add a stop-loss. But nothing in it about making a determination of is it time to sell). And putting it in the risk model (as suggested) strikes me as sub optimal because it's an ongoing evaluation as to is it time to sell yet.
- Explain what happens if the VM running the code dies part way through processing a method such as OnData. And how someone should insure that an order they determine to place that day is placed exactly once.
- Explain if the Orders (pending) and Portfolio collections are read from the underlying broker, or if they are just a picture of what has been passed on. And if not read directly, stress that they may not be accurate as time goes on.
- Explain how to use a non supported broker (like E-Trade) in the Algorithm Framework.