Stress Test – External Events

Stress testing is a mechanism to test performance of a trading algorithm. During stress testing various unfavourable scenarios are designed and the trading algorithm is run over these scenarios and the Key Performance Indicators (KPIs) are measured.

The scenarios consist of internal events and external events, both have impact on algo’s KPIs. Internal events are events which occur within the system, it can include cases like delay in signal between trader and broker or even loss of connection between both parties. External events on other hand are cases which are not within the system like market related events, it includes cases like strong market movements or frequent price fluctuations.

Creating Scenarios

The stress testing scenarios are extreme cases which doesn’t occur in normal market conditions. Thus, in order to perform successful stress test, certain extreme market conditions need to be simulated. These simulations are created by varying values of different variables. The variables for internal events like delayed or loss of signal are built into the system and thus are incorporated directly during the testing process. Variables for external events like market movements and price fluctuations are needs to be designed externally and then are fed into the system during testing. We will describe the process of designing the data for these external events in detail.

Data Preparation for External Events

The variables external to the system are:

  1. Market Movement
  2. Market Volatility
  3. Options Price Fluctuations

To design various scenarios values of these variables are used.

Market Movement

  1. Upward movement – Market gains by 30% in one hour.
  2. Downward movement – Market slips by 30% in one hour
  3. Sideways movement (flat movement) – There is no net movement by the end of hour.

Market Volatility

Based on historical data Nifty has experienced intraday volatility of 19.6% (annualized). The variations in volatility variable are:

  1. Low – Annualized volatility of 8%
  2. Average – Annualized Volatility of 19.6%
  3. High – Annualized Volatility of 50%

Options Price Fluctuations

Options prices are influenced by following parameters:

  1. Price of underlying – Price of Nifty in case of Nifty Options. This is already considered this case in market movement.
  2. Implied Volatility – Implied Volatility (IV) is perceived volatility of underlying by the market. This is generally close to actual volatility in the prices but may inflate or deflate in extreme market conditions.

Thus, to vary option prices variable IV is scaled as following:

  1. Normal – No scaling to IV, i.e. IV is multiplied by 1.
  2. Inflate – IV is inflated by a factor of 3. Thus, applicable IV would be Normal IV * 3.
  3. Deflate – IV is reduced by factor of .33. Applicable IV = IV * .33

Using the variation in above variables, different scenarios are created. For each scenario price of Nifty and its options are calculated for each second for a period of one hour. This dataset can be fed into stress testing system to calculate algo’s KPIs.