Serving the Quantitative Finance Community

 
User avatar
milano
Topic Author
Posts: 0
Joined: August 6th, 2014, 11:50 am

Pairs trading threshold

October 12th, 2014, 1:45 am

Good morning everyoneI'm implementing, step by step, a pairs trading strategy in matlab and I'm using a fixed threshold (constant + 1 and -1), but I think it?s not the best solution.I'd like to know if there is any other threshold that I can use with this strategy.Thanks for your cooperation
 
User avatar
tags
Posts: 3603
Joined: February 21st, 2010, 12:58 pm

Pairs trading threshold

October 12th, 2014, 7:57 am

QuoteOriginally posted by: milanoI'm using a fixed threshold (constant + 1 and -1), but I think it?s not the best solution.What is the rationale behind -1, +1 (sd?)?
Last edited by tags on October 11th, 2014, 10:00 pm, edited 1 time in total.
 
User avatar
milano
Topic Author
Posts: 0
Joined: August 6th, 2014, 11:50 am

Pairs trading threshold

October 12th, 2014, 12:52 pm

hello in the matlab code that I found on a webinar they used this type of fixed threshold +1 and -1. no logic. that's why I wanted to get some advice on other types of threshold. thanks regards
 
User avatar
tags
Posts: 3603
Joined: February 21st, 2010, 12:58 pm

Pairs trading threshold

October 12th, 2014, 1:36 pm

What are the considerations behind tresholds? What is the ultimate goal of your pair trading strategy?
 
User avatar
milano
Topic Author
Posts: 0
Joined: August 6th, 2014, 11:50 am

Pairs trading threshold

October 13th, 2014, 7:07 pm

helloIn the webinar I saw the usage of constant threshold to determine when a stock will be sold or bought. I'd like to implement this strategy, for an university research and it is a complex topic. The ultimate goal is to obtain a reasonable gain by using appropriate thresholds.For this I would like to know how I can determine these thresholds.thanks again for your cooperation.
 
User avatar
acastaldo
Posts: 14
Joined: October 11th, 2002, 11:24 pm

Pairs trading threshold

October 14th, 2014, 4:07 pm

to learn more google "ornstein uhlenbeck pairs trading" for example. [added October 15]:an alternative, in discrete time, is to model the spread as an AR(1) process
Last edited by acastaldo on October 14th, 2014, 10:00 pm, edited 1 time in total.
 
User avatar
milano
Topic Author
Posts: 0
Joined: August 6th, 2014, 11:50 am

Pairs trading threshold

October 16th, 2014, 2:15 pm

Good morning everyonethank you very much for your help.I'm documenting the subject Ornstein Uhlenbeck pairs trading.I ask you another little help.I can not understand how they are calculated returns in this part of the code.s (i: i + N-1, 1) = -reg1.coeff (2). * s (i: i + N-1, 2); return = sum ([0 0; s (1: end-1, : ). * diff (series2) - abs (diff (s)) * cost / 2], 2);the prices of the series that I have to examine must be standardized ?thank you so much for your time and cooperationregards
Last edited by milano on October 15th, 2014, 10:00 pm, edited 1 time in total.
 
User avatar
acastaldo
Posts: 14
Joined: October 11th, 2002, 11:24 pm

Pairs trading threshold

October 17th, 2014, 1:06 am

Quotereturn = sum ([0 0; s (1: end-1, : ). * diff (series2) - abs (diff (s)) * cost / 2], 2);This is some rather clever MATLAB code for computing the profits from the pair trading.The total profit is the sum of "daily m2m profits" minus "daily trading costs" summed over all days The daily m2m profits are the share holdings s times price change diff(series2)The trading costs are the absolute value of the shares bought or sold diff(s) multiplied by cost/2 (a constant)diff() takes the first differences of a vector. As you already know s() are the positions (number of shares) and series() are the prices.You can write this out as an old fashioned summation with subscripted variables, it will be perhaps clearer to you than this clever vectorized stuff.Or you can run this expression interactively at the MATLAB prompt step by step and see how it works. BTW I am not even 100% sure that it is free of bugs.
 
User avatar
milano
Topic Author
Posts: 0
Joined: August 6th, 2014, 11:50 am

Pairs trading threshold

October 18th, 2014, 2:20 am

thanks so much for your explanation, now everything is clearer
 
User avatar
milano
Topic Author
Posts: 0
Joined: August 6th, 2014, 11:50 am

Pairs trading threshold

November 15th, 2014, 4:42 am

Good morning everyoneI would ask you another little help.I would like to know what types of transaction costs should I consider for pairs trading strategy and what their percentages are.I also could not understand how the final return is Calculated in this part of the code. r4 is the total return vector'series' Represents the prices of companies.Specifically I'd like to learn the reason of the division of the sum (r4) to the mean of a series of prices.What is this indicator?(', num2str (sum (r4) / mean (Series2 (1,) * 100,3),'%) '])