Cover orders are complex orders that are meant to help to limit the loss within predefined values if trade becomes unfavorable. A cover order is essentially a combination of two regular orders together—an initial order and a stoploss order:
- Initial order: This order can be equivalent to a regular market order or regular limit order, depending on whether you are placing a cover market order or cover limit order. Once the order moves to the 'COMPLETE' state, the stoploss order is placed, which is described next.
- Stoploss order: This order is equivalent to a regular stoploss-market order (the Placing a regular stoploss-market order recipe in the previous chapter), with the specified trigger price value as its trigger price and a transaction type opposite to that of the initial order. For a buy initial order, the stoploss order is placed at a lower price than the initial order. This would be vice versa for a sell initial order. The quantity matches...