Quote from stefan_777:the machine legging out the long first INCREASED the risk to IB by causing a naked put
The auto-liquidation process makes one fundamental assumption that requires re-examination: that liquidation is
always a risk-reducing activity. It is clearly not:
- after hours (and before hours), when portfolio is evaluated on the basis of prices quoted by active market-makers (i.e. susceptible to gaming),
- for portfolios containing offsetting positions, including: static hedges such as option debit spreads, and hedges established by the customer in temporarily closed markets or in temporarily halted securities,
- under exceptional market conditions, when the risk of mistrades is very high,
So here are some solutions that may deal with the above problems:
1) collecting a database of typical bid/ask spreads for most underlyings and their typical combinations (e.g. those 'buliding blocks' that can be entered using TWS tools such as Spread Trader) and preventing the auto-trading bot from making any trades when the current market
spread is 'excessive' (e.g. exceeds a pre-defined multiple of the typical spread, volatility-adjusted via multiplication by the current volatility level over its median level),
2) when the current bid/ask spread is wider than the typical one,
using limit orders initially pegged to the opposite-side price and gradually moved towards midpoint, or even better - towards 'fair value' price (which a market-making firm should be easily able to compute, not only for options); note that this requires starting the auto-liquidation process earlier than at the last moment,
3) starting the liquidation process with the
most capital-intensive instrument first, using the 'Check Margin' functionality code to assess the post-liquidation margin requirements (in a special case when no liquidation can release liquidity, i.e. when the portfolio is optimally hedged, liquidating it in its entirety or better - leaving intact),
4) preserving the information about combination orders initiated via TWS tools such as Option Trader, Spread Trader etc. and their API equivalents, to subsequently treat such combos during the liquidation process
in their entirety, evaluating their combined margin impact and liquidating with offsetting spread orders rather than legging out of them (which can create a 'margin cascade'),
5) when excessively wide spreads preclude liquidation, IB can use
'liquidation substitutes' such as:
-
dynamic hedging of the short option position (using the most liquid underlying available, and using IB's proprietary capital to offset the delta risk of the customer's position, of course at customer's expense, as an elective service, with commissions and hedging losses charged to his account afterwards; note that 'deficit' liquidations could be more risky for proprietary capital than such 'pro-active' hedging service), or
- in case of liquid instruments,
'shorting against the box' i.e. opening a hedge in the same (or substantially the same) contract as the losing one (e.g. when the customer's hedging instrument is quoted on a temporarily closed exchange or has just been halted or cannot be shorted when used by customer for delta-heding, etc.),
6) customers usually open positions with adequate funds, and critical margin deficits are typically created by sustained periods of losses, so it is important for the auto-liquidation to become
'pro-active' , i.e. starting earlier than the last moment, i.e. when a rapid downward trend in available funds becomes apparent (e.g. when an average daily return over a 10-day moving window gets below -5% per day and yet the customer refuses to close the losing position),
7) please post
other ideas than may improve IB's auto-liquidation process (just brainstorming, i.e. without evaluation).