I tried to apply the index arbitrage code to Turkish market XU030 index and its components. I had a few unresolved points. Here is the case:
I ran the cadf(y,x) function with y=XU030 and x=XU030_components. I picked the 3 best cointegrated components which seemed to be ARCLK, TCELL, THYAO for our timeline.
Then comes the hedge_ratio(y,x) function. which yields the ratios: 2690 THYAO - 3570 TCELL - 2175 ARCLK
price info(last day) and index level (last day) are: 14.16 THYAO - 14.89 TCELL - 20.04 ARCLK and our index closes @ 128.800 points
then we form a basket called basket_MV. Now here comes my curiosity: we form a potfolio with in the form of " basket_XLE_MV= basket_MV - xle.XLE " please explain this to me in detail.
After the portfolio formation the spread graph comes. Very nice cointegration going up and down. Current spread state is positive and above average. Now according to our “ basket_XLE_MV= basket_MV - xle.XLE " should we go short on our picked stocks and long on the index XU030???
Here comes another point of interest:
— Each stock lot is formed of 100 stock units. If you go long 1 unit THYAO then it means you invest 1416 TL money in one lot.
— If you try to trade the index then you should trade the future contract which is leveraged at 1/10. which means current price is 13000 TL
considering these numbers, what should be our stock lot units and futures contract unit? Also which one should be long and which one should be short??
Hi Aybars,
Can you please share the code and the csv data file related to this query. Thank you
Hi Aybars,
Thank you for sharing the code and data. Just to summarize the points of our discussion so far, I have collated all the data here below.
In the code you have shared, the Index Arb component was generated using the following code:
basket_XU030_MV= basket_MV - XU030.XU030
Here basket_MV was the top 3 cointegrated stocks that you chose and their hedge ratios were
THYAO 2689.303929
TCELL 3567.518501
ARCLK 2175.535582
The last closing price of the index and the stocks are:
XU030 128785.77
THYAO 14.16
TCELL 14.89
ARCLK 20.04
Since the current spread state is positive and above average, we would need to sell the spread.
This means that you need to sell the component stocks as per their weights as shown below:
THYAO 14.162689.303929 TL = 38100TL
TCELL 14.893567.518501 TL = 53100TL
ARCLK 20.04*2175.535582 TL = 43600TL
The total amount in component stocks = 134800
Since the index futures are leveraged 1/10, and as per the last closing price, you would need approximately 13000 TL.
You need to adjust the components for this leverage by dividing them by 10. So the final amount to be shorted is:
THYAO = 3810TL
TCELL = 5310TL
ARCLK = 4360TL
The total amount in component stocks = 13480TL
We can further covert this into future lot sizes by dividing it by 100 and approximating it closer to the index value:
THYAO 38 Lots
TCELL 53 Lots
ARCLK 43 Lots
Once you have shorted these lots, you need to buy 1 Lot of the index future worth 13000 TL.
Hope this clears your doubt.