pairs trading

jim leahy

Active member
does anyone in these forums trade pairs? i'm interested in doing this to remove the market risk.
i'm curious as to what criteria and what method people use to find pairs. i know the obvious and
maybe most common criteria is over/under performance, but you can also use the yield curve
to trade interest rate products, or the gold/silver price ratio. any others?

i created a tool on one of my web sites to help analyze and track pairs. it mainly analyzes relative
performance but it doesn't do any scans so you have to have a pair in mind to analyze. i'd like
to hear what other are using to find pairs.

the tool can be found at https://sites.google.com/site/traderzstudio/pairs. i have a few paper trades
i've been looking at but haven't done any real trades yet. one trade i'm following is eem/spy (long 6 eem,
short 1 spy). if you want to see this trade, copy the attached file to a folder on your computer. go to
the above web site and near the bottom of the page, click on "browse" and point to the saved file in
the file menu that pops up. this will load the file and plot the price graphs and equity curve. the file is
simply a text file describing the trade.


regards,
jim
 

Attachments

  • eem_spy.txt
    98 bytes · Views: 17
based on the underwhelming response, i guess no one here is trading pairs. or at least doesn't
want to contribute. i've been doing some informal searching for information and stumbled on
a site called quantopian.com. they have a lot of education on pairs trading and you can run simulations on
their site. the lesson i found useful is at https://www.quantopian.com/posts/how-to-build-a-pairs-trading-strategy-on-quantopian. it outlines a strategy for finding pairs using python. i'm not a python programmer but i'm
cobbling their code into a script, filling in some missing pieces, at the same time learning enough python
to get through it. when i have something working i'll post it, or try to incorporate their approach into my
web site. anyway, i found their site interesting.
 
Hi Jim. Theotrade has offered a workshop on pairs trading in the past, and it may still be available. I have tried it in the past. The concept is solid, but I did not make any money on the few that I tried. Don't know if my selections were bad or if I did not manage them correctly.
 
I think your first observation is correct There are not many or none at all that do pair trading here It;s hard enough to do options with different strategies than to abandon everything we learned and start something new like pair trading
Perhaps if there was a round table that shows an easy way to make money with pair trading than it may generate some small interest

I looked at the link you provided for traderzstudio and I entered some random stocks and ofcourse the p/l showed 0 You have to research and find the right pair before you even begin to pair trade so it's a whole new chapter in learning a new way to trade that may or may not be any better than what we are already doing now
 
thanks dan, i'll check out theotrade.

status1, my pairs page on traderzstudio isn't a back test. it won't show any p/l until you
reload a saved pair the following day. it will keep track of daily p/l over time.

yes. researching for the right pairs is the key to pairs trading. the script i wrote follows the method
outlined on the quantopian site. i realize this won't be of much use folks here. it's not an
application, it's only a simple script to analyze cointegration and correlation for the stocks
you put in a list. it downloads historical data from yahoo, does some statistical analysis,
and plots out a few graphs. the graphs look something like below.

1841

for any brave souls wanting to try it, you have to have python installed on your computer.
it's easy to install, just search for 'install python on <your operating system of choice>' on the web.
to run the script just edit the file for the symbols you want, save it and enter 'python get_pairs.py'.
i've only run it on linux but i don't see why it won't be the same on other operating systems.


edit... it looks like i can't attach the py file. i renamed it txt and still can't attach it. i'll have to
try another solution.

ok, it looks like i can attach a .doc. just open the file in word or your favorite doc reader and export as text.
 

Attachments

  • get_pairs.doc
    29 KB · Views: 16
Last edited:
I am very interested in pairs trading...

There are two pairs I have on now: QQQ/IWM & VXX-UPRO.

The QQQ/IWM I am in because TheoTrade (free announcement) said they were out of whack by 2+std. devs, see
) and the VXX-UPRO I am in because Contango is < 5.45%. For the latter, check out this awesome article by Dane: https://seekingalpha.com/article/3958001-modified-volatility-pair-trading-strategy

The QQQ/IWM did spike up, but I wasn't paying attention, and it slipped back to only having minor profit now; I'll wait. These appear to be relatively low-risk trades.

I may also sign-up for this site: https://pairtradefinder.com/ , though not sure if there are better (& cost effective) sites out there.

Regards,

Marc
 
vxx - upro is an interesting and complex trade. vxx can drop without upro changing much because if the market
settles down, volatility will fall. also vxx has a built-in drag due to the vix rolls. i'd want to study that trade a lot
before i traded it. i never considered a volatility pair before now. i'll paper trade a few. my pairs web page is
broken thanks to msn stopping access to their quotes api. just another reason to hate microsoft. it'll take
some time to switch to another provider.

andrew, i supposed you could consider a calendar a volaltility pairs trade, but unlike a "traditional" pairs trade,
it doesn't help hedge systemic risk.
 
I don't see how a pairs trade, as I understand it, can be any type of hedge outside of the trade itself. It is in essence an arbitrage between two correlated vehicles that are expected to move, ideally converse to each other or at least at much different velocities.
 
correct, the pairs trade won't hedge anything besides the trade itself. i didn't mean to imply it
would hedge a portfolio or anything else. sorry for the confusion.
 
vxx - upro is an interesting and complex trade. vxx can drop without upro changing much because if the market
settles down, volatility will fall. also vxx has a built-in drag due to the vix rolls.


Yes, I know. But, that's why Dane has the Contango < 5.45% condition for this trade and UPRO as the hedge, of course. In our current market condition, it's usually a short-lived trade.
 
i trade spreads using tradingview / i go long stock and long 80 delta (or more) put leaps for the short side

i don't look for past correlation

i choose stocks from the same sector based on fundamental prediction

i do a some financial work on the financials of each company - i like to short heavy debt companies with low or negative income

i like to go long growth companies with a lot of cash and low debt

sometimes i go long stock short index

i usually calculate the beta proportion (i take data from finviz) to decide how much to go long vs short

for example long aapl short tesla on 25.1.2019 at 0.55 closing at 0.86 june 17
 
for example long aapl short tesla on 25.1.2019 at 0.55 closing at 0.86 june 17

So it took 6 months to make 0.31 cents ? Or am I missing something ?
I thought these pair trades are are more like day trading or maybe a few days but certainly not 6 months
If this is pair trading it hardly seems worth doing It probably would have been easier to just go long apple and maybe add a put or put spread around earnings for protection in case it goes down and than take it off a few days later
I am guessing Tesla did not go down much until recently so maybe that's why the trade did not make too much
 
1565280401162.png

you sure do miss in your calculations - if spread value is up from 0.55 to 0.86 positions value is up 0.31/0.55=56% in 6 month

equals to 112% in a year

if you put 10 K $ in this position you made 5600$ in 6 month...

but you must have a stop since you could loss a lot of money if the short stock is up and the long stock is down

i use 10% stop max and expect to achieve twice the loss as profit = enter 0.55 stop 0.5 target 0.65
 
Thanks for clarifying although I am not sure how you get to $5600 in 6 months unless you just multiplied the percentage
The P/L should be $3100 by my calculation for a 10K lot
 
i will make it super simple - forget beta calculation

let's assume you do same price long and short on the stocks directly at market price (no use in puts - i have 2 reason to short stocks using puts the main reason is of course limited loss in the amount of money i use to buy the puts , the second reason is that usually if stock is down hard the volatility goes up and the long puts gain more time premium)

so you open position on 25/1/2019

long aapl = 157.5 $ per share

short tsla = 297 $ per share

you buy 10 K $ shares of aapl (long 64 shares)

you short 10 K $ shares of tsla (short 34 shares)

you close position on 25/6/2019

sell aapl = 194 $ per share X 64 shares = 12.4 K $ you made 2,400 $ long aapl

buy to close tsla = 220 $ per share X 34 shares = 7.48 K $ you made 2520 $ short tsla

profit on both positions : 2400 + 2520 = 4920 $
 
Tom, Dan,
Perhaps consider a Pairs Trade tab?

A place to throw out some pairs to consider, analysis folks are doing, learnings...

Marc
 
In response to the original question (not sure if it was answered), ShadowTrader has a pairs trading concept led by Tom Cook. He has some interesting charts and metrics on ToS.
 
Top
Contact Us