Pair Trading Strategy Journal

Quote from waltbx:


The CAPTCHAs are really hard to read. Is it necessary as frequently as it now requires -- for each click on each point on the scatter graph a new CAPTCHA must be decoded. It's a bit of a pain. Why not have a login requiring a CAPTCHA just once?

Walt B

Good news here...we decided that captcha will no longer be required to be filled everytime, instead, it will be required once a few backtests..this update will probably come in next 2 weeks
 
Quote from sals3r0:

OK Let me explain:
There are few approaches how to trade pairs. The most popular one (also the one we use at pairtradinglab) works with ratio between two stock prices together with two technical indicators applied on the ratio time series - moving average and standard deviation (you could also look at it as on the one indicator - bollinger bands, which is the same anyway). For these indicators you need parameters - period (how many days to look back).

So for pair trading strategy, you have at least two parameters:
1) moving average period (in days) - lets call it MP now
2) standard deviation period (in days) - lets call it SP now

In the end you have even more parameters (thresholds, ...) but I won't comment on them now, although everything said below applies on them too.

Then, in order to trade pairs successfully we have to make decisions:
1) which pairs to trade, how to judge pairs
2) what MP/SP combination to use a parameters to the strategy

Looks simple but actually this is a big magic.
About how to judge pair - we can do backtest and see if result is good enough - but then we still have problem: we need to select MP/SP also for this backtest! how to do it? we have quite a risk here - the whole pair may be crap, but just by luck, the backtest can be good for particular MP/SP tried...but if we were trading this pair in future, it would most likely turned to be a loser...because we built our assumption on something what was not really robust enough

How we can help ourselves with this?
We will not evaluate a pair just by a single backtest. Instead, we will perform backtests for large number of MP/SP combinations and observe, how results behave for those. We can then probably expect, that if the stock pair behaves well for ALL the parameter combinations instead of just one, we should have much more chance the pair will hold up in future trading, right?

So thats what basically study in pairtradinglab does.
It will perform backtests for all MPs in range 10..50 and SPs in range 10..50. So in total it will perform 1681 backtests, one for each period combination.

Then it will display for each result the CAGR and Max Drawdown of the backtest in the scatter plot, color determined by the period.

So in the scatter plot you can instantly see, how the stock pair behaves for ALL period parameters! You can instantly tell, if the pair is crap (it haves a lot of points in CAGR range below zero), or good - haves all points above zero in CAGR and good dd for all points.

So finally, the study feature helps solve both problems:
1) check if the stock pair is good/robust - good and robust pairs will indicate >=99% points above zero in CAGR and indicate good drawdown for them too
2) choose optimization parameters MP,SP - for instance, I would advise to take some big cluster of points having good CAGR and low DD and take the middle point of the cluster

I hope it is more clear now.

so what about cointegration ? seems you are using an alternate path....
 
Quote from amitkumar_ny:

so what about cointegration ? seems you are using an alternate path....

Yes, cointegration is powerful indicator saying the pair might be good, but even for pair showing decent cointegration, for my own trading I would still want to see backtests as well.
So to me, cointegration is a powerful tool, another indicator, a filter possibly - but not something I would rely on as only indicator to choose a pair to trade.

Also, cointegration will not answer the second question of my post - what parameters to use in the strategy. You still have to decide that (unless you are using different strategy of course, like linear regression, etc...)

I would like to add cointegration indicator to pairtradinglab too, but that's a lot of work so I cannot promise when it is there. I focus on other project now, i.e. implementing full auto pair trading system.

Personally, I don't use cointegration at all at the moment - imho if a stock pair exhibits really good backtests for all possible parameter combination, especially for short periods, it is probably cointegrated anyway :)
 
Came across BWLD:CMA in my non-related pairs list. Nice converging pattern since October. Will see if it can bounce off of the lower 20 day bb one more time.
 
sals3r0,

Other than US stocks, are any other country stocks available to run in the study in your website?

Tried India stocks, (NSE:tatasteel, NSE:KFA)and it did not work.

BTW, where do you get your data from?

thanks,
Sachin
 
Quote from sachin1980:

sals3r0,

Other than US stocks, are any other country stocks available to run in the study in your website?

Tried India stocks, (NSE:tatasteel, NSE:KFA)and it did not work.

BTW, where do you get your data from?

thanks,
Sachin

I get data from Google Finance currently. You can use any symbols from Google Finance, for which Google provides historical data to download (it must offer the link " Download to spreadsheet").
 
Quote from sals3r0:

I get data from Google Finance currently. You can use any symbols from Google Finance, for which Google provides historical data to download (it must offer the link " Download to spreadsheet").

Now I know!! there is no download to spreadsheet link for indian stocks. Thanks.
 
Am having difficulty with the symbol for DJI witin PT, keeps showing an error when using ^DJI

Any thoughts as to why, have no problems at all with any other symbol, got me stumped

TIA
 
Quote from nip:

Am having difficulty with the symbol for DJI witin PT, keeps showing an error when using ^DJI

Any thoughts as to why, have no problems at all with any other symbol, got me stumped

TIA

What is the full symbol on Google Finance? I am unable to find such a symbol (^DJI) - the closest what I can see there is "INDEXDJX:.DJI", which does not have data download link anyway.
 
Back
Top