Monday, May 17, 2010

Super Quick Search

Binary search divides the search area into 2 partitions recursively and finds the value.

There is a better and faster way to search for a value.

When searching a value in an array of n numbers,

NB: Reals are rounded down to the nearest int and are ommited.

Divide it into n(1) = sqrt(n(0)) partitions of n(1) = sqrt(n(0))

Continue dividing each set of partitions of size n(i) into partitions n(i + 1) = sqrt(n(i)) of the approx. same size until narrowed to n(k) such that log2 (n(k)) <= sqrt(n(k)) + n(k) ^(1/4) + n(k) ^ (1/8) ... + 2 or 3 items recursively.

If subsiquant partitions where log2 (n(k)) > sqrt(n(k)) + ... are encountered select appropriate partition value fall into else repeat above other wise do a binary search. 

Thursday, January 15, 2009

No Arb (Free Lunch) Joke

In the joke that a student tells a prof. that there is a bill on the ground and the prof replies that it is not possible is it self a joke.
If the arb opportunities are not arbitraged away by agents then such opportunity would not cease to exist. This is because when some one sees money on the street they pick than but may be not coins of lower denomination. If this does not happen than there would be “free lunches” just lying around and not being utilised.
Suminda Sirinath Salpitikorala Dharmasena


Wednesday, January 07, 2009

Thoughts on Hedging Illiquid Assets (Hedging Under Liquidity Constraints)

An option price is the cost of hedging the contingent claim during its life. But when liquidity is scares, and buying stocks would influence the price, there would be cost in terms of the cost of slippage and miss hedges which would influence the price.
The cost of creating the replicating portfolio would be the price of the option. If the hedging is done using a particular strategy then the options should be the cost of hedging the option position using the particular strategy.
Suminda Sirinath Salpitikorala Dharmasena

Tuesday, December 09, 2008

Hedging under illiquidity

Hedging under illiquidity - Pl. comment

Wednesday, December 03, 2008

How to Identify Calendars Spreads Implied Volatility is High

If the price is held constant and the time to expiration is fudged than if the resulting difference between the implied option expirations at different expiration are closer they are actually, then they can be used for a Calendar spreads since if there is a large decline of implied volatility that would impact the option further from expiration, the one closer would also lose a large amount at least by expiration.
Suminda Sirinath Salpitikorala Dharmasena

Friday, November 21, 2008

The Paradox of Arbitrage

The no arbitrage principle makes sense but when the time dimension is considered on how two identical assets trading at different venues can reach no arbitrage pricing there seam to be a paradox given that there is no party at either venue who can fix price fixing, i.e., the arbitrage argument for two assets some times seams paradoxical when there are two trading venues and trading is competitive (no body can set the price) and the time to converge is considered.
Lets consider two trading venues with supplies of identical products. If there is a miss pricing, arbitragers would buy form one venue cheaper and trader on the other. The supplier with the higher price would see less demand and would lower his price decreasing until the prices converge. But still the supplier can maintain his price or have a different price at this trading venue depending on whether he want to fix the price or his output. Any new information on the asset would create fluctuation in demand and the output would fluctuate if price is kept constant. Alternatively the price can be varied to meet a target demand but it is practically not possible.
The equation would be:
dX = [α (X – Y) + μ] dt
dY = - [β (X – Y) + μ] dt
Now let’s assume that there are many market plays now hold stocks of the assets. If there is counterparty, a trade would happen in the market. On new information on the asset, the supply and demand forces would vary randomly.
The equations
dX = [α (X – Y) + μ] dt + σXdW1
dY = - [β (X – Y) + μ] dt + σYdW2
If information dissipation and analysis is imperfect correl(dW1, dW2) < 1
In this case at least intuitively, it seam very difficult to imagine that there be no arbitrage opportunities. If the distance widens the are pulled back, but the random movements would make them drift in different directions. In a time interval they will not be the same. In the case that there is transport cost, with a certain probability there would be a arbitrage opportunity.
I am trying to work it out or trying to figure out if I overlooked something.
Best regards, Suminda Sirinath Salpitikorala Dharmasena

Thursday, November 20, 2008

Random Thoughts on Market Making

A market maker might buy stock at the bid and sells at the ask and by doing so creates a market. At the time he gives his bid and ask quotes he does not know what the trader is going to do. The market maker increases liquidity since if a trader wants to trade he does not need to look for the counterparty who want to enter the opposite transaction. The markets maker buys low and sells high and make a profit, i.e., his profit or loss is depended on how low he bought the asset and how high he sold it.
The buying and selling may not happen in the same time therefore he has to maintain an inventory of assets to meet the trading requirements. Also we should be mindful that the market may not be trading on actual valuation. Also when a market maker buys a stock and liquidates his position the market price might have changed.
Therefore the factors affecting his profits are:
  • Bid and ask prices at which items were bought
  • How fast he can turn over his inventory
  • Exposure on his inventory
Out of these factors, what he can explicitly control in the spread again subjected to a maximum.
In order to achieve a high turnover and low inventories (thus reducing market exposures), a market making strategy should concentrate on balancing the liquidity supply and demand through setting the spreads.
If he is to manage his inventory he has to look at the number of sells and buys and put his spreads adjusting for buying and selling pressure in the market and against this inventory at the currently prevailing prices and the liquidity absorbed by other market makers and participants. When supply pressure in the market increases / decreases he should decrease / increase the bid and when demand pressure market increase / decrease he should increase / decrease the ask. Also he would have buy and selling pressure against this inventory based on large order he has to fill and the risk exposure on it.
The market pressures can be determined through the order book interaction with other MMs. The distribution of trades in the order book would help a MM to determine on how to setup his bid and ask. If a MM does not want to participate in either a buy or a sell, he can adjust the bid or ask accordingly so that there is a higher chance that another MM would be chosen undesirable transaction.
A market maker will have to fill various order. This would increase his buying and selling pressure. Also he has to asses the risk on the inventory in terms of price changes during his holding period and liquidity (determines the holding period and how fast he can turn around his inventory.)
To rap up, market makers are not in a position to trade on valuation. The profit he makes is based on how effectively a MM handles the supply and demand pressures through his spreads, not necessarily through setting it through a valuation basis like straddling the top and bottom of the market.
Suminda Sirinath Salpitikorala Dharmasena


Will VIX remain at this level for every?

No. Simply because if the market expectation of volatility is becomes lower than the option implied volatility, there will be a arbitrage opportunity by shorting the option and delta hedging the position. This would bring down the IM and the VIX also.

I don’t see this happening soon though