Author Topic: How the ratio/ shares are determined?  (Read 6662 times)

vincent chan

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
How the ratio/ shares are determined?
« on: July 29, 2013, 12:33:45 pm »
I tried my best to go through your site but I cannot find the answer how the shares long/ short is determined.

For ex. NKE COH, buy 30 NKY and sell 26 COH, how 30 and 26 are from? Do you use just linear regression? But your ratio changes every trade. Also, do you use augumented Dickey Fuller test? How to know the half life and t-stat?


Date    Ticker    Operation    Open price    Z-Score    Commissions    Shares    Close price    P/L
2010-01-11    NYSE:NKE    Buy    32.46    -3.563    1    30    0.00    0.00
2010-01-11    NYSE:COH    Sell    38.32    -3.563    1    26    0.00    0.00

admin

  • Administrator
  • Sr. Member
  • *****
  • Posts: 338
  • Karma: +13/-0
    • Pair Trading Lab
Re: How the ratio/ shares are determined?
« Reply #1 on: July 29, 2013, 03:05:45 pm »
Hello Vincent,

about your questions:
1) number of shares comes from the dollar neutrality (the capital is split to halves, each for one leg and rounded down)...so if you have 2000 USD of capital:
NKE: 1000/32.46=30.8 ~ 30 shares
COH: 1000/38.32=26.09 ~ 26 shares

If you have margin account, you can take advantage of the 50% margin, so actually you would not divide it and you could have 2000/2000 allocation.

2) Do you use just linear regression?
Linear regression is used only in Residual model. In Ratio model it is not.
The Ration model is just based on calculating ratio of stock prices (P1/P2) and calculating some statistics on this series (moving average and standard deviation).

Actually the Ratio model is close to this: http://luminouslogic.com/a-pairs-trading-example.htm

Quote
Also, do you use augumented Dickey Fuller test? How to know the half life and t-stat?

Nope, we don't use cointegration at all (at this moment), we use backtests for screening directly. We also look to correlation.

Because more and more people keep asking about model details, we will prepare detailed description of both models used and put it to the Wiki soon.

vincent chan

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
Re: How the ratio/ shares are determined?
« Reply #2 on: July 29, 2013, 03:37:06 pm »
Hi, Admin,

Correlation is by no means cointegration, and two series are correlated actually could probably not cointegrated. Namely, even 2 series are correlative with high R square value, their price could be in parallel never diverse/ converse. Would it be one day you compile ADF test?

admin

  • Administrator
  • Sr. Member
  • *****
  • Posts: 338
  • Karma: +13/-0
    • Pair Trading Lab
Re: How the ratio/ shares are determined?
« Reply #3 on: July 29, 2013, 03:55:51 pm »
Hi, Admin,

Correlation is by no means cointegration, and two series are correlated actually could probably not cointegrated. Namely, even 2 series are correlative with high R square value, their price could be in parallel never diverse/ converse. Would it be one day you compile ADF test?

That is clear, that correlation is not cointegration  8) We do not use cointegration at this moment, because simply we did not need that yet for our own trading. For screening our pairs, we directly do dozens of full backtests for each pair to check the robustness across the parameter space and then take pairs having nice profit with log equity linear as possible. You can safely bet that these pairs _are_ cointegrated anyway, without need to perform ADF tests.

The long term correlation in range 0.4-0.85 is just a bonus for us - it helps to reduce open drawdown. It is not essentially needed for pairs to be profitable.

We would like to see cointegration metrics on our website too, but it is not trivial to apply these tests properly in a meaningful way, so it is quite a low priority for now - we have more important tasks to do first.

admin

  • Administrator
  • Sr. Member
  • *****
  • Posts: 338
  • Karma: +13/-0
    • Pair Trading Lab
Re: How the ratio/ shares are determined?
« Reply #4 on: July 29, 2013, 04:00:47 pm »
But if anyone thinks that he _really_ needs ADF test badly ASAP, feel free to help - send us a C++ class source code of ADF test and we may think about integrating that sooner than later.

We are still not convinced how results of ADF tests help to determine if the pair is profitable better than real backtests, that's all, especially in case you still need to perform those backtests anyway to verify the idea.