# Changing Trends in Trading Risk Management

Algorithmic trading risks can be categorized into the following:

• Access
• Consistency
• Quality
• Algorithm
• Technology
• Scalability

There are 2 places where Risk Management is handled –

Within the application – We need to ensure that wrong parameters are not set by the trader. It should not allow a trader to set grossly incorrect values nor any fat-finger errors.

Before generating an order in the Order Management System – Before the order flows out of the system we need to make sure it goes through some risk management system. This is where the most critical risk management check happens.

Below is an illustration of both the above mentioned places in the Algorithmic Trading System Architecture:

#### Data Access

You need to have proper checks in place to ensure that you are getting the correct data feed, based on which your algorithm will generate orders.

Say you have a trading strategy which trades in two different exchanges and the connectivity to one exchange is down. You might still keep quoting and generating orders on the other exchanges assuming that there is no error and you are not getting the data feed because there is no activity at the exchange. You need to distinguish between the cases when the connectivity is lost and when there is no data coming in due to no activity. Heat-beat messages allow you to make this distinction. When exchange receives this message it will respond and you would get a confirmation that you are actually connected to the exchange.

#### Consistency

You need to ensure that the data you are getting is not stale, that is, it is not old data. If you feed stale data as input to your strategy, the decision and output would garbage. In fact you pay a high premium to minimize delay in getting fresh data; hence, it is absolutely necessarily that you ensure your data is indeed consistent with time.

Some exchanges share snapshot data and others share more granular data in form of tick-by-tick data. In snapshot based data, the exchange shares the information about the top 5 or top 10 best buyers or sellers in the exchange. In case of tick-by-tick data, the exchange provides every tick that happens on the exchange.

Market data packets have time-stamp embedded in them. The advanced exchanges in the world are adopting concepts like time-syncs to atomic clocks. Your algorithmic trading system should be able to track these time-stamps to ensure the data you are getting is indeed fresh.

#### Quality

You need to ensure the quality of data is good. In case of the Nikkei and mini-Nikkei the input was not correct.

Deutsche Bank had a system where you could trade Nikkei on the basis of price of Nikkei ETF in Singapore. Since the underlying is the same, you could trade Nikkei, mini-Nikkei and Nikkei ETF Singapore. One day they had a change in their configuration, the very next day the system could not read the prices of Nikkei ETF in Singapore. Since the system couldn’t read the prices, it saw the prices as “zero”. This gave the system a wrong indication that the fair price of Nikkei ETF is zero. Due to this they tried to sell Nikkei at slightly above zero in Japan.

Orders were sent for 1.24 million Nikkei 225 Future and 4.82 million Nikkei 225 mini-futures in the first few minutes. This was more than 10 times the normal volume, which made the market drop 1% on orders. The error was recognized immediately and only 0.3% of the orders got executed.

As a result, Deutsche Bank had to close their algorithmic trading desk in Tokyo.

#### Algorithm

Many different types of checks need to be ensured at the algorithm level. A small coding error would reflect in terms of incorrect execution in the market. Risk limits might get exceeded because an acknowledgement check was not done before sending an order.

Incorrect parameters set: Suppose a trader is required to buy within a range of 20-25 lots but he incurs a value of 205 lots incorrectly. If an incorrect parameter is set he will end up doing a lot of trades. To avoid this, a methodology called “order throttle rate” is used within the order manager.

Incorrect parameters set: Suppose a trader is required to buy within a range of 20-25 lots but he incurs a value of 205 lots incorrectly. If an incorrect parameter is set he will end up doing a lot of trades. To avoid this, a methodology called “order throttle rate” is used within the order manager.

Risk-check: It is found that the best risk check would be the PnL based fluctuation check. The moment the PnL of a system drops more than “X” the trading system should automatically stop doing anything in the markets.

#### Technology

The case of Knight Capital was a “protocol mismatch” – where they had to install module A and B on all the 8 servers, while on one of the servers they only installed module A and module B was not installed which caused a protocol mismatch. It could also happen that you are installed a server/application which has a dependency on certain libraries it could also have indirect dependencies as well.

Such an error caused Knight Capital to trade 154 stocks at bizarre prices i.e. 4 million trades for 397 million shares in just 45 minutes.

It is absolutely crucial that hardware, networking and software checks are often carried out. Even basic issues such as hard disk full can cause systems to fail!

#### Scalability

This is where most people fail. What they do is they setup a system or strategy for one instrument and if it works, the strategy will be replicated for other instruments. But when we move from one instrument to many instruments, does it still work well? Let’s introduce something called as Order of Complexity of Computation from theory of Computation. While the strategy is testing for all scenarios using just one instrument, but when you increase the number of instruments, exchange and portfolio that you are trading may not be able to work.

### Audit Process & Requirements

India has one of the most stringent regulator environments. You will have to get all your strategies approved by the exchange. A half-yearly and an annual audit are also required by the regulator, exchange and independent auditors.

Once you have an automated trading strategy you need to execute it in a Mock Trading environment.

While submitting a strategy to the exchange for approval following are the risk management checks that one needs to show:

• Manual orders are disabled for auto-trading systems
• Order should be within x% of last price
• For each instrument an order size freeze limit is set
• Order should not breach the circuit limit (daily price range) of an instrument
• FIIs cannot trade in a select set of stocks (RBI directed)
• Cannot trade derivatives to increase Open Interest beyond a threshold
• Overnight long position that is available per share for selling
• Automated trading to be enabled for a select list of instruments only
• Cannot send buy orders if Index moves up beyond a point. Likewise for sell orders
• Maximum position that a client can have in a particular stock
• If a threshold of the available margin is reached, then the application should not send orders to increase the position further
• Net Position value per instrument
• Max Order Value

Simply knowing the building blocks is not enough; one should know what strategies others or your competitors are using. To give you this insight we have a section called “Financial Computing & Technology” in our Executive Programme in Algorithmic Trading. This will certainly inspire to design your own trading strategies; different concepts can be used to device your own strategies. Big Data analytical tools like R will be used for backtesting.

R is an opensource tool which is widely used for analysis and can be downloaded from here - https://cran.r-project.org/bin/windows/base/

• Market Risk
• Credit / Counter-party Risk
• Financial Risk
• Liquidity Risk
• Regulatory Risk

However, with the advent of automated trading this focus has shifted to the following:

• Operational Risk
• System Risk
• Greater Focus on Natural Disaster Risk
• Regulatory Risk (Automated Trading related)

Risk management is amongst the most overlooked yet very critical aspects of systematic trading.